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_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"
126 #include "switch_module_interfaces.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_json.h"
142 #include "switch_limit.h"
143 #include "switch_core_media.h"
144 #include "switch_core_video.h"
145 #include "switch_jitterbuffer.h"
146 #include "switch_estimators.h"
147 #include "switch_vad.h"
148 #include <libteletone.h>
149 
150 
151 /** \mainpage FreeSWITCH
152  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
153 
154  * \section intro Introduction
155  *
156  * \section supports Supported Platforms
157  * Freeswitch has been built on the following platforms:
158  *
159  *  - Linux (x86 & x86_64)
160  *  - Windows (MSVC 2012/2013 & VC++ EE 2012/2013)
161  *  - Mac OS X 10.7/10.8/10.9 (x86_64 Intel)
162  *  - FreeBSD 8/9/10
163  *  - NetBSD 6.x
164  *  - OpenBSD 5.x
165  *
166  * \section depends Dependencies
167  *  Freeswitch makes heavy use of external libraries.
168  *
169  *  libFreeSWITCH:
170  *		- APR (http://apr.apache.org)
171  *		- APR-Util (http://apr.apache.org)
172  *		- SQLite (http://www.sqlite.org)
173  *		- Pcre (http://www.pcre.org/)
174  *		- SRTP (http://srtp.sourceforge.net/srtp.html)
175  *
176  *	Additionally, the various external modules make use of several external modules:
177  *
178  *
179  *  ASR/TTS
180  *	mod_cepstral
181  *		- Cepstral (commercial) (http://www.cepstral.com/)
182  *
183  *	mod_flite
184  *		- Flite (http://www.speech.cs.cmu.edu/flite/)
185  *
186  *	mod_pocketsphinx
187  *		- PocketSphinx (http://www.speech.cs.cmu.edu/pocketsphinx/)
188  *
189  *	mod_unimrcp
190  *		- MRCP (http://www.unimrcp.org/)
191  *
192  *
193  *  Codecs
194  *  mod_amr
195  *      - Passthru codec for amr narrowband (8kHz)
196  *
197  *  mod_amrwb
198  *      - Passthru codec for amr wideband (16kHz)
199  *
200  *  mod_b64
201  *      - Base64 codec tranfers data base64 encoded (http://www.b64codec.org)
202  *
203  *  mod_bv
204  *      - BroadVoice16 (8kHz) and BroadVoice32 (16kHz) (https://www.broadcom.com/support/broadvoice)
205  *
206  *  mod_codec2
207  *      - Codec2 is an open source low bit rate speech at 2400 bit/s and below. (http://www.rowetel.com/blog/?page_id=452)
208  *
209  *	mod_speex
210  *		- libspeex (http://www.speex.org/)
211  *
212  *	mod_siren
213  *		- libg722_1 (http://www.polycom.com/company/about_us/technology/siren22/index.html)
214  *
215  * Digital Signal Processing
216  *	mod_spandsp
217  *		- codec, fax and modem (http://www.soft-switch.org/)
218  *
219  *  Directories
220  *	mod_ldap
221  *		- openldap (*nix only http://www.openldap.org/)
222  *
223  *  Endpoints
224  *	mod_portaudio
225  *		- portaudio (http://www.portaudio.com/)
226  *
227  *	mod_dingaling
228  *		- libdingaling (internal library distributed with freeswitch which depends on)
229  *		- APR (http://apr.apache.org)
230  *		- iksemel (http://iksemel.jabberstudio.org/)
231  *
232  *	mod_sofia
233  *		- sofia-sip (http://opensource.nokia.com/projects/sofia-sip/)
234  *
235  *	mod_opal
236  *		- libopal (http://www.opalvoip.org)
237  *
238  *	mod_freetdm
239  *		- freetdm (http://wiki.freeswitch.org/wiki/FreeTDM)
240  *
241  *  Event Hanlders
242  *	mod_xmpp_event
243  *		- iksemel (http://iksemel.jabberstudio.org/)
244  *
245  *  Formats
246  *	mod_sndfile
247  *		- libsndfile (http://www.mega-nerd.com/libsndfile/)
248  *
249  *  Languages
250  *	mod_perl
251  *		- perl (http://www.perl.org/)
252  *
253  *	mod_lua
254  *		- lua (http://www.lua.org)
255  *
256  *  XML interfaces
257  *	mod_xml_rpc
258  *		- xmlrpc-c (http://xmlrpc-c.sourceforge.net/)
259  *
260  *	mod_xml_curl
261  *		- libcurl (http://curl.haxx.se/)
262  *
263  *  Network services
264  *	mod_http
265  *		- Abyss (http://www.aprelium.com/)
266  *
267  *	mod_enum
268  *		- udns (http://www.corpit.ru/mjt/udns.html)
269  *
270  *
271  * \section license Licensing
272  *
273  * Freeswitch is licensed under the terms of the MPL 1.1
274  *
275  */
276 #endif
277 
278 /* For Emacs:
279  * Local Variables:
280  * mode:c
281  * indent-tabs-mode:t
282  * tab-width:4
283  * c-basic-offset:4
284  * End:
285  * For VIM:
286  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
287  */
288