FreeSWITCH API Documentation  1.7.0
switch.h
Go to the documentation of this file.
1 /*
2  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3  * Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
4  *
5  * Version: MPL 1.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
18  *
19  * The Initial Developer of the Original Code is
20  * Anthony Minessale II <anthm@freeswitch.org>
21  * Portions created by the Initial Developer are Copyright (C)
22  * the Initial Developer. All Rights Reserved.
23  *
24  * Contributor(s):
25  *
26  * Anthony Minessale II <anthm@freeswitch.org>
27  *
28  * switch.h -- Main Library Header
29  *
30  */
31 /*! \file switch.h
32  \brief Main Library Header
33 */
34 
35 #ifndef SWITCH_H
36 #define SWITCH_H
37 
38 #ifdef __cplusplus
39 #define SWITCH_BEGIN_EXTERN_C extern "C" {
40 #define SWITCH_END_EXTERN_C }
41 #else
42 #define SWITCH_BEGIN_EXTERN_C
43 #define SWITCH_END_EXTERN_C
44 #endif
45 
46 #define SWITCH_VIDEO_IN_THREADS
47 
48 #ifndef WIN32
49 #include <switch_am_config.h>
50 #endif
51 
52 #define FREESWITCH_PEN "27880"
53 #define FREESWITCH_OID_PREFIX ".1.3.6.1.4.1." FREESWITCH_PEN
54 #define FREESWITCH_ITAD "543"
55 #define __EXTENSIONS__ 1
56 #ifndef MACOSX
57 #if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__)
58 #ifndef __cplusplus
59 #define _XOPEN_SOURCE 600
60 #endif
61 #endif
62 #ifdef __linux__
63 #ifndef _BSD_SOURCE
64 #define _BSD_SOURCE
65 #endif
66 #ifndef _DEFAULT_SOURCE
67 #define _DEFAULT_SOURCE
68 #endif
69 #endif
70 #ifndef __BSD_VISIBLE
71 #define __BSD_VISIBLE 1
72 #endif
73 #ifdef __linux__
74 #ifndef _GNU_SOURCE
75 #define _GNU_SOURCE
76 #endif
77 #endif
78 #endif
79 #include <stdlib.h>
80 #include <stdio.h>
81 #include <stdarg.h>
82 #include <stddef.h>
83 #include <assert.h>
84 #include <setjmp.h>
85 #include <ctype.h>
86 #include <fcntl.h>
87 #include <string.h>
88 #ifdef _MSC_VER
89 #include <Winsock2.h>
90 #if _MSC_VER < 1500
91 /* work around bug in msvc 2005 code analysis http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99397 */
92 #pragma warning(push)
93 #pragma warning(disable:6011)
94 #include <Ws2tcpip.h>
95 #pragma warning(pop)
96 #else
97 /* work around for warnings in vs 2010 */
98 #pragma warning (disable:6386)
99 #include <Ws2tcpip.h>
100 #pragma warning (default:6386)
101 #endif
102 #else
103 #include <strings.h>
104 #endif
105 #include <sys/stat.h>
106 #include <limits.h>
107 #include <sys/types.h>
108 #include <time.h>
109 #include <signal.h>
110 #include <errno.h>
111 
112 #include "switch_platform.h"
113 #include "switch_types.h"
114 #include "switch_apr.h"
115 #include "switch_mprintf.h"
116 #include "switch_core_db.h"
117 #include "switch_dso.h"
118 #include "switch_regex.h"
119 #include "switch_core.h"
120 #include "switch_loadable_module.h"
121 #include "switch_console.h"
122 #include "switch_utils.h"
123 #include "switch_caller.h"
124 #include "switch_frame.h"
125 #include "switch_rtcp_frame.h"
127 #include "switch_channel.h"
128 #include "switch_buffer.h"
129 #include "switch_event.h"
130 #include "switch_resample.h"
131 #include "switch_ivr.h"
132 #include "switch_rtp.h"
133 #include "switch_log.h"
134 #include "switch_xml.h"
135 #include "switch_xml_config.h"
136 #include "switch_core_event_hook.h"
137 #include "switch_scheduler.h"
138 #include "switch_config.h"
139 #include "switch_nat.h"
140 #include "switch_odbc.h"
141 #include "switch_pgsql.h"
142 #include "switch_json.h"
143 #include "switch_limit.h"
144 #include "switch_core_media.h"
145 #include "switch_core_video.h"
146 #include "switch_jitterbuffer.h"
147 #include <libteletone.h>
148 
149 
150 /** \mainpage FreeSWITCH
151  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
152 
153  * \section intro Introduction
154  *
155  * \section supports Supported Platforms
156  * Freeswitch has been built on the following platforms:
157  *
158  * - Linux (x86 & x86_64)
159  * - Windows (MSVC 2012/2013 & VC++ EE 2012/2013)
160  * - Mac OS X 10.7/10.8/10.9 (x86_64 Intel)
161  * - FreeBSD 8/9/10
162  * - NetBSD 6.x
163  * - OpenBSD 5.x
164  *
165  * \section depends Dependencies
166  * Freeswitch makes heavy use of external libraries.
167  *
168  * libFreeSWITCH:
169  * - APR (http://apr.apache.org)
170  * - APR-Util (http://apr.apache.org)
171  * - SQLite (http://www.sqlite.org)
172  * - Pcre (http://www.pcre.org/)
173  * - SRTP (http://srtp.sourceforge.net/srtp.html)
174  *
175  * Additionally, the various external modules make use of several external modules:
176  *
177  *
178  * ASR/TTS
179  * mod_cepstral
180  * - Cepstral (commercial) (http://www.cepstral.com/)
181  *
182  * mod_flite
183  * - Flite (http://www.speech.cs.cmu.edu/flite/)
184  *
185  * mod_pocketsphinx
186  * - PocketSphinx (http://www.speech.cs.cmu.edu/pocketsphinx/)
187  *
188  * mod_unimrcp
189  * - MRCP (http://www.unimrcp.org/)
190  *
191  *
192  * Codecs
193  * mod_amr
194  * - Passthru codec for amr narrowband (8kHz)
195  *
196  * mod_amrwb
197  * - Passthru codec for amr wideband (16kHz)
198  *
199  * mod_b64
200  * - Base64 codec tranfers data base64 encoded (http://www.b64codec.org)
201  *
202  * mod_bv
203  * - BroadVoice16 (8kHz) and BroadVoice32 (16kHz) (https://www.broadcom.com/support/broadvoice)
204  *
205  * mod_codec2
206  * - Codec2 is an open source low bit rate speech at 2400 bit/s and below. (http://www.rowetel.com/blog/?page_id=452)
207  *
208  * mod_speex
209  * - libspeex (http://www.speex.org/)
210  *
211  * mod_siren
212  * - libg722_1 (http://www.polycom.com/company/about_us/technology/siren22/index.html)
213  *
214  * Digital Signal Processing
215  * mod_spandsp
216  * - codec, fax and modem (http://www.soft-switch.org/)
217  *
218  * Directories
219  * mod_ldap
220  * - openldap (*nix only http://www.openldap.org/)
221  *
222  * Endpoints
223  * mod_portaudio
224  * - portaudio (http://www.portaudio.com/)
225  *
226  * mod_dingaling
227  * - libdingaling (internal library distributed with freeswitch which depends on)
228  * - APR (http://apr.apache.org)
229  * - iksemel (http://iksemel.jabberstudio.org/)
230  *
231  * mod_sofia
232  * - sofia-sip (http://opensource.nokia.com/projects/sofia-sip/)
233  *
234  * mod_opal
235  * - libopal (http://www.opalvoip.org)
236  *
237  * mod_freetdm
238  * - freetdm (http://wiki.freeswitch.org/wiki/FreeTDM)
239  *
240  * Event Hanlders
241  * mod_xmpp_event
242  * - iksemel (http://iksemel.jabberstudio.org/)
243  *
244  * Formats
245  * mod_sndfile
246  * - libsndfile (http://www.mega-nerd.com/libsndfile/)
247  *
248  * Languages
249  * mod_perl
250  * - perl (http://www.perl.org/)
251  *
252  * mod_lua
253  * - lua (http://www.lua.org)
254  *
255  * XML interfaces
256  * mod_xml_rpc
257  * - xmlrpc-c (http://xmlrpc-c.sourceforge.net/)
258  *
259  * mod_xml_curl
260  * - libcurl (http://curl.haxx.se/)
261  *
262  * Network services
263  * mod_http
264  * - Abyss (http://www.aprelium.com/)
265  *
266  * mod_enum
267  * - udns (http://www.corpit.ru/mjt/udns.html)
268  *
269  *
270  * \section license Licensing
271  *
272  * Freeswitch is licensed under the terms of the MPL 1.1
273  *
274  */
275 #endif
276 
277 /* For Emacs:
278  * Local Variables:
279  * mode:c
280  * indent-tabs-mode:t
281  * tab-width:4
282  * c-basic-offset:4
283  * End:
284  * For VIM:
285  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
286  */
video includes header
Compatability and Helper Code.
APR includes header.
Media Channel Interface.
Data Types.
Simple Console.
Caller Identification.
IVR Library.
Loadable Module Routines.
Core DB Header.
Data Buffering Code.
Top level include file.
Regex Header.
Event System.
Module Interface Definitions.
Platform Specific Header.
Simple Log.
Basic Configuration File Parser.
RTCP Frame Structure.
Audio Resample Code.
Media Frame Structure.
Core Library.