RTS API Documentation  1.10.11
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 700
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_spandsp.h"
116 #include "switch_mprintf.h"
117 #include "switch_core_db.h"
118 #include "switch_dso.h"
119 #include "switch_regex.h"
120 #include "switch_core.h"
121 #include "switch_loadable_module.h"
122 #include "switch_console.h"
123 #include "switch_utils.h"
124 #include "switch_caller.h"
125 #include "switch_frame.h"
126 #include "switch_rtcp_frame.h"
128 #include "switch_channel.h"
129 #include "switch_buffer.h"
130 #include "switch_event.h"
131 #include "switch_resample.h"
132 #include "switch_ivr.h"
133 #include "switch_rtp.h"
134 #include "switch_log.h"
135 #include "switch_xml.h"
136 #include "switch_xml_config.h"
137 #include "switch_core_event_hook.h"
138 #include "switch_scheduler.h"
139 #include "switch_config.h"
140 #include "switch_packetizer.h"
141 #include "switch_nat.h"
142 #include "switch_odbc.h"
143 #include "switch_json.h"
144 #include "switch_limit.h"
145 #include "switch_core_media.h"
146 #include "switch_core_video.h"
147 #include "switch_jitterbuffer.h"
148 #include "switch_estimators.h"
149 #include "switch_vad.h"
150 #include <libteletone.h>
151 
152 
153 /** \mainpage FreeSWITCH
154  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
155 
156  * \section intro Introduction
157  *
158  * \section supports Supported Platforms
159  * Freeswitch has been built on the following platforms:
160  *
161  * - Linux (x86 & x86_64)
162  * - Windows (MSVC 2012/2013 & VC++ EE 2012/2013)
163  * - Mac OS X 10.7/10.8/10.9 (x86_64 Intel)
164  * - FreeBSD 8/9/10
165  * - NetBSD 6.x
166  * - OpenBSD 5.x
167  *
168  * \section depends Dependencies
169  * Freeswitch makes heavy use of external libraries.
170  *
171  * libFreeSWITCH:
172  * - APR (http://apr.apache.org)
173  * - APR-Util (http://apr.apache.org)
174  * - SQLite (http://www.sqlite.org)
175  * - Pcre (http://www.pcre.org/)
176  * - SRTP (http://srtp.sourceforge.net/srtp.html)
177  *
178  * Additionally, the various external modules make use of several external modules:
179  *
180  *
181  * ASR/TTS
182  * mod_cepstral
183  * - Cepstral (commercial) (http://www.cepstral.com/)
184  *
185  * mod_flite
186  * - Flite (http://www.speech.cs.cmu.edu/flite/)
187  *
188  * mod_pocketsphinx
189  * - PocketSphinx (http://www.speech.cs.cmu.edu/pocketsphinx/)
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_sofia
227  * - sofia-sip (http://opensource.nokia.com/projects/sofia-sip/)
228  *
229  * mod_opal
230  * - libopal (http://www.opalvoip.org)
231  *
232  * mod_freetdm
233  * - freetdm (http://wiki.freeswitch.org/wiki/FreeTDM)
234  *
235  * Event Hanlders
236  * mod_xmpp_event
237  * - iksemel (http://iksemel.jabberstudio.org/)
238  *
239  * Formats
240  * mod_sndfile
241  * - libsndfile (http://www.mega-nerd.com/libsndfile/)
242  *
243  * Languages
244  * mod_perl
245  * - perl (http://www.perl.org/)
246  *
247  * mod_lua
248  * - lua (http://www.lua.org)
249  *
250  * XML interfaces
251  * mod_xml_rpc
252  * - xmlrpc-c (http://xmlrpc-c.sourceforge.net/)
253  *
254  * mod_xml_curl
255  * - libcurl (http://curl.haxx.se/)
256  *
257  * Network services
258  * mod_http
259  * - Abyss (http://www.aprelium.com/)
260  *
261  * mod_enum
262  * - udns (http://www.corpit.ru/mjt/udns.html)
263  *
264  *
265  * \section license Licensing
266  *
267  * Freeswitch is licensed under the terms of the MPL 1.1
268  *
269  */
270 #endif
271 
272 /* For Emacs:
273  * Local Variables:
274  * mode:c
275  * indent-tabs-mode:t
276  * tab-width:4
277  * c-basic-offset:4
278  * End:
279  * For VIM:
280  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
281  */
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.