RTS API Documentation  1.10.11
switch_types.h
Go to the documentation of this file.
1 /*
2  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3  * Copyright (C) 2005-2021, 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  * Bret McDanel <trixter AT 0xdecafbad dot com>
28  * Joseph Sullivan <jossulli@amazon.com>
29  * Raymond Chandler <intralanman@freeswitch.org>
30  * Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
31  * Andrey Volk <andywolk@gmail.com>
32  *
33  * switch_types.h -- Data Types
34  *
35  */
36 /*! \file switch_types.h
37  \brief Data Types
38 */
39 #ifndef SWITCH_TYPES_H
40 #define SWITCH_TYPES_H
41 
42 #include <switch.h>
43 #include <switch_json.h>
44 #include <switch_vpx.h>
45 
47 #define SWITCH_ENT_ORIGINATE_DELIM ":_:"
48 #define SWITCH_BLANK_STRING ""
49 #define SWITCH_TON_UNDEF 255
50 #define SWITCH_NUMPLAN_UNDEF 255
51 #ifdef WIN32
52 #define SWITCH_SEQ_FWHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
53 #define SWITCH_SEQ_FRED FOREGROUND_RED | FOREGROUND_INTENSITY
54 #define SWITCH_SEQ_FMAGEN FOREGROUND_BLUE | FOREGROUND_RED
55 #define SWITCH_SEQ_FCYAN FOREGROUND_GREEN | FOREGROUND_BLUE
56 #define SWITCH_SEQ_FGREEN FOREGROUND_GREEN
57 #define SWITCH_SEQ_FYELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
58 #define SWITCH_SEQ_DEFAULT_COLOR SWITCH_SEQ_FWHITE
59 #else
60 #define SWITCH_SEQ_ESC "\033["
61 /* Ansi Control character suffixes */
62 #define SWITCH_SEQ_HOME_CHAR 'H'
63 #define SWITCH_SEQ_HOME_CHAR_STR "H"
64 #define SWITCH_SEQ_CLEARLINE_CHAR '1'
65 #define SWITCH_SEQ_CLEARLINE_CHAR_STR "1"
66 #define SWITCH_SEQ_CLEARLINEEND_CHAR "K"
67 #define SWITCH_SEQ_CLEARSCR_CHAR0 '2'
68 #define SWITCH_SEQ_CLEARSCR_CHAR1 'J'
69 #define SWITCH_SEQ_CLEARSCR_CHAR "2J"
70 #define SWITCH_SEQ_DEFAULT_COLOR SWITCH_SEQ_ESC SWITCH_SEQ_END_COLOR /* Reset to Default fg/bg color */
71 #define SWITCH_SEQ_AND_COLOR ";" /* To add multiple color definitions */
72 #define SWITCH_SEQ_END_COLOR "m" /* To end color definitions */
73 /* Foreground colors values */
74 #define SWITCH_SEQ_F_BLACK "30"
75 #define SWITCH_SEQ_F_RED "31"
76 #define SWITCH_SEQ_F_GREEN "32"
77 #define SWITCH_SEQ_F_YELLOW "33"
78 #define SWITCH_SEQ_F_BLUE "34"
79 #define SWITCH_SEQ_F_MAGEN "35"
80 #define SWITCH_SEQ_F_CYAN "36"
81 #define SWITCH_SEQ_F_WHITE "37"
82 /* Background colors values */
83 #define SWITCH_SEQ_B_BLACK "40"
84 #define SWITCH_SEQ_B_RED "41"
85 #define SWITCH_SEQ_B_GREEN "42"
86 #define SWITCH_SEQ_B_YELLOW "43"
87 #define SWITCH_SEQ_B_BLUE "44"
88 #define SWITCH_SEQ_B_MAGEN "45"
89 #define SWITCH_SEQ_B_CYAN "46"
90 #define SWITCH_SEQ_B_WHITE "47"
91 /* Preset escape sequences - Change foreground colors only */
92 #define SWITCH_SEQ_FBLACK SWITCH_SEQ_ESC SWITCH_SEQ_F_BLACK SWITCH_SEQ_END_COLOR
93 #define SWITCH_SEQ_FRED SWITCH_SEQ_ESC SWITCH_SEQ_F_RED SWITCH_SEQ_END_COLOR
94 #define SWITCH_SEQ_FGREEN SWITCH_SEQ_ESC SWITCH_SEQ_F_GREEN SWITCH_SEQ_END_COLOR
95 #define SWITCH_SEQ_FYELLOW SWITCH_SEQ_ESC SWITCH_SEQ_F_YELLOW SWITCH_SEQ_END_COLOR
96 #define SWITCH_SEQ_FBLUE SWITCH_SEQ_ESC SWITCH_SEQ_F_BLUE SWITCH_SEQ_END_COLOR
97 #define SWITCH_SEQ_FMAGEN SWITCH_SEQ_ESC SWITCH_SEQ_F_MAGEN SWITCH_SEQ_END_COLOR
98 #define SWITCH_SEQ_FCYAN SWITCH_SEQ_ESC SWITCH_SEQ_F_CYAN SWITCH_SEQ_END_COLOR
99 #define SWITCH_SEQ_FWHITE SWITCH_SEQ_ESC SWITCH_SEQ_F_WHITE SWITCH_SEQ_END_COLOR
100 #define SWITCH_SEQ_BBLACK SWITCH_SEQ_ESC SWITCH_SEQ_B_BLACK SWITCH_SEQ_END_COLOR
101 #define SWITCH_SEQ_BRED SWITCH_SEQ_ESC SWITCH_SEQ_B_RED SWITCH_SEQ_END_COLOR
102 #define SWITCH_SEQ_BGREEN SWITCH_SEQ_ESC SWITCH_SEQ_B_GREEN SWITCH_SEQ_END_COLOR
103 #define SWITCH_SEQ_BYELLOW SWITCH_SEQ_ESC SWITCH_SEQ_B_YELLOW SWITCH_SEQ_END_COLOR
104 #define SWITCH_SEQ_BBLUE SWITCH_SEQ_ESC SWITCH_SEQ_B_BLUE SWITCH_SEQ_END_COLOR
105 #define SWITCH_SEQ_BMAGEN SWITCH_SEQ_ESC SWITCH_SEQ_B_MAGEN SWITCH_SEQ_END_COLOR
106 #define SWITCH_SEQ_BCYAN SWITCH_SEQ_ESC SWITCH_SEQ_B_CYAN SWITCH_SEQ_END_COLOR
107 #define SWITCH_SEQ_BWHITE SWITCH_SEQ_ESC SWITCH_SEQ_B_WHITE SWITCH_SEQ_END_COLOR
108 /* Preset escape sequences */
109 #define SWITCH_SEQ_HOME SWITCH_SEQ_ESC SWITCH_SEQ_HOME_CHAR_STR
110 #define SWITCH_SEQ_CLEARLINE SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINE_CHAR_STR
111 #define SWITCH_SEQ_CLEARLINEEND SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINEEND_CHAR
112 #define SWITCH_SEQ_CLEARSCR SWITCH_SEQ_ESC SWITCH_SEQ_CLEARSCR_CHAR SWITCH_SEQ_HOME
113 #endif
114 #define SWITCH_DEFAULT_CLID_NAME ""
115 #define SWITCH_DEFAULT_CLID_NUMBER "0000000000"
116 #define SWITCH_DEFAULT_DTMF_DURATION 2000
117 #define SWITCH_DEFAULT_TIMEOUT 60
118 #define SWITCH_MIN_DTMF_DURATION 400
119 #define SWITCH_MAX_DTMF_DURATION 192000
120 #define SWITCH_DEFAULT_DIR_PERMS SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE
121 #ifdef WIN32
122 #define SWITCH_PATH_SEPARATOR "/"
123 #else
124 #define SWITCH_PATH_SEPARATOR "/"
125 #endif
126 #define SWITCH_URL_SEPARATOR "://"
127 #define SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE "ignore_display_updates"
128 #define SWITCH_AUDIO_SPOOL_PATH_VARIABLE "audio_spool_path"
129 #define SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE "bridge_hangup_cause"
130 #define SWITCH_READ_TERMINATOR_USED_VARIABLE "read_terminator_used"
131 #define SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE "send_silence_when_idle"
132 #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
133 #define SWITCH_CURRENT_APPLICATION_DATA_VARIABLE "current_application_data"
134 #define SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE "current_application_response"
135 #define SWITCH_PASSTHRU_PTIME_MISMATCH_VARIABLE "passthru_ptime_mismatch"
136 #define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE "enable_heartbeat_events"
137 #define SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE "bypass_media_after_bridge"
138 #define SWITCH_READ_RESULT_VARIABLE "read_result"
139 #define SWITCH_ATT_XFER_RESULT_VARIABLE "att_xfer_result"
140 #define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
141 #define SWITCH_COPY_JSON_CDR_VARIABLE "copy_json_cdr"
142 #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
143 #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
144 #define SWITCH_TRANSFER_HISTORY_VARIABLE "transfer_history"
145 #define SWITCH_TRANSFER_SOURCE_VARIABLE "transfer_source"
146 #define SWITCH_SENSITIVE_DTMF_VARIABLE "sensitive_dtmf"
147 #define SWITCH_RECORD_POST_PROCESS_EXEC_APP_VARIABLE "record_post_process_exec_app"
148 #define SWITCH_RECORD_POST_PROCESS_EXEC_API_VARIABLE "record_post_process_exec_api"
149 
150 #define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE "execute_on_answer"
151 #define SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE "execute_on_pre_answer"
152 #define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
153 #define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
154 #define SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE "execute_on_tone_detect"
155 #define SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE "execute_on_originate"
156 #define SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE "execute_on_post_originate"
157 #define SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE "execute_on_pre_originate"
158 
159 #define SWITCH_CHANNEL_EXECUTE_ON_PRE_BRIDGE_VARIABLE "execute_on_pre_bridge"
160 #define SWITCH_CHANNEL_EXECUTE_ON_POST_BRIDGE_VARIABLE "execute_on_post_bridge"
161 
162 #define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
163 #define SWITCH_CHANNEL_API_ON_PRE_ANSWER_VARIABLE "api_on_pre_answer"
164 #define SWITCH_CHANNEL_API_ON_MEDIA_VARIABLE "api_on_media"
165 #define SWITCH_CHANNEL_API_ON_RING_VARIABLE "api_on_ring"
166 #define SWITCH_CHANNEL_API_ON_TONE_DETECT_VARIABLE "api_on_tone_detect"
167 #define SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE "api_on_originate"
168 #define SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE "api_on_post_originate"
169 #define SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE "api_on_pre_originate"
170 
171 #define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
172 #define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
173 #define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
174 #define SWITCH_API_BRIDGE_END_VARIABLE "api_after_bridge"
175 #define SWITCH_API_BRIDGE_START_VARIABLE "api_before_bridge"
176 #define SWITCH_API_HANGUP_HOOK_VARIABLE "api_hangup_hook"
177 #define SWITCH_API_REPORTING_HOOK_VARIABLE "api_reporting_hook"
178 #define SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE "session_in_hangup_hook"
179 #define SWITCH_PROCESS_CDR_VARIABLE "process_cdr"
180 #define SWITCH_SKIP_CDR_CAUSES_VARIABLE "skip_cdr_causes"
181 #define SWITCH_FORCE_PROCESS_CDR_VARIABLE "force_process_cdr"
182 #define SWITCH_BRIDGE_CHANNEL_VARIABLE "bridge_channel"
183 #define SWITCH_CHANNEL_NAME_VARIABLE "channel_name"
184 #define SWITCH_BRIDGE_UUID_VARIABLE "bridge_uuid"
185 #define SWITCH_CONTINUE_ON_FAILURE_VARIABLE "continue_on_fail"
186 #define SWITCH_PLAYBACK_TERMINATORS_VARIABLE "playback_terminators"
187 #define SWITCH_PLAYBACK_TERMINATOR_USED "playback_terminator_used"
188 #define SWITCH_CACHE_SPEECH_HANDLES_VARIABLE "cache_speech_handles"
189 #define SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME "__cache_speech_handles_obj__"
190 #define SWITCH_BYPASS_MEDIA_VARIABLE "bypass_media"
191 #define SWITCH_PROXY_MEDIA_VARIABLE "proxy_media"
192 #define SWITCH_ENDPOINT_DISPOSITION_VARIABLE "endpoint_disposition"
193 #define SWITCH_HOLD_MUSIC_VARIABLE "hold_music"
194 #define SWITCH_TEMP_HOLD_MUSIC_VARIABLE "temp_hold_music"
195 #define SWITCH_EXPORT_VARS_VARIABLE "export_vars"
196 #define SWITCH_BRIDGE_EXPORT_VARS_VARIABLE "bridge_export_vars"
197 #define SWITCH_R_SDP_VARIABLE "switch_r_sdp"
198 #define SWITCH_L_SDP_VARIABLE "switch_l_sdp"
199 #define SWITCH_B_SDP_VARIABLE "switch_m_sdp"
200 #define SWITCH_BRIDGE_VARIABLE "bridge_to"
201 #define SWITCH_LAST_BRIDGE_VARIABLE "last_bridge_to"
202 #define SWITCH_SIGNAL_BRIDGE_VARIABLE "signal_bridge_to"
203 #define SWITCH_SIGNAL_BOND_VARIABLE "signal_bond"
204 #define SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE "originate_signal_bond"
205 #define SWITCH_ORIGINATOR_VARIABLE "originator"
206 #define SWITCH_ORIGINATOR_CODEC_VARIABLE "originator_codec"
207 #define SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE "originator_video_codec"
208 #define SWITCH_LOCAL_MEDIA_IP_VARIABLE "local_media_ip"
209 #define SWITCH_LOCAL_MEDIA_PORT_VARIABLE "local_media_port"
210 #define SWITCH_ADVERTISED_MEDIA_IP_VARIABLE "advertised_media_ip"
211 #define SWITCH_REMOTE_MEDIA_IP_VARIABLE "remote_media_ip"
212 #define SWITCH_REMOTE_MEDIA_PORT_VARIABLE "remote_media_port"
213 #define SWITCH_REMOTE_VIDEO_IP_VARIABLE "remote_video_ip"
214 #define SWITCH_REMOTE_VIDEO_PORT_VARIABLE "remote_video_port"
215 #define SWITCH_LOCAL_VIDEO_IP_VARIABLE "local_video_ip"
216 #define SWITCH_LOCAL_VIDEO_PORT_VARIABLE "local_video_port"
217 #define SWITCH_LOCAL_TEXT_IP_VARIABLE "local_text_ip"
218 #define SWITCH_LOCAL_TEXT_PORT_VARIABLE "local_text_port"
219 #define SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE "hangup_after_bridge"
220 #define SWITCH_PARK_AFTER_BRIDGE_VARIABLE "park_after_bridge"
221 #define SWITCH_PARK_AFTER_EARLY_BRIDGE_VARIABLE "park_after_early_bridge"
222 #define SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE "transfer_after_bridge"
223 #define SWITCH_TRANSFER_AFTER_EARLY_BRIDGE_VARIABLE "transfer_after_early_bridge"
224 #define SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE "exec_after_bridge_app"
225 #define SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE "exec_after_bridge_arg"
226 #define SWITCH_MAX_FORWARDS_VARIABLE "max_forwards"
227 #define SWITCH_RFC7989_SESSION_ID_VARIABLE "session_uuid"
228 #define SWITCH_RFC7989_REMOTE_SESSION_ID_VARIABLE "remote_session_uuid"
229 #define SWITCH_RFC7989_APP_SESSION_ID_VARIABLE "app_session_uuid"
230 #define SWITCH_RFC7989_GENERIC_PARAM_VARIABLE "generic_param_session_uuid"
231 #define SWITCH_MAX_SESSION_TRANSFERS_VARIABLE "max_session_transfers"
232 #define SWITCH_DISABLE_APP_LOG_VARIABLE "disable_app_log"
233 #define SWITCH_SPEECH_KEY "speech"
234 #define SWITCH_UUID_BRIDGE "uuid_bridge"
235 #define SWITCH_BITS_PER_BYTE 8
236 #define SWITCH_DEFAULT_FILE_BUFFER_LEN 65536
237 #define SWITCH_DTMF_LOG_LEN 1000
238 #define SWITCH_MAX_TRANS 2000
239 #define SWITCH_CORE_SESSION_MAX_PRIVATES 2
240 #define SWITCH_DEFAULT_VIDEO_SIZE 1200
241 #define SWITCH_RTCP_AUDIO_INTERVAL_MSEC "1000"
242 #define SWITCH_RTCP_VIDEO_INTERVAL_MSEC "1000"
243 
244 #define TEXT_UNICODE_LINEFEED {0xe2, 0x80, 0xa8}
245 #define MAX_FMTP_LEN 256
246 
247 /* Jitter */
248 #define JITTER_VARIANCE_THRESHOLD 400.0
249 /* IPDV */
250 #define IPDV_THRESHOLD 1.0
251 /* Burst and Lost Rate */
252 #define LOST_BURST_ANALYZE 500
253 /* Burst */
254 #define LOST_BURST_CAPTURE 1024
255 
256 typedef uint8_t switch_byte_t;
257 
258 typedef struct {
259  unsigned int value : 31;
261 
262 typedef enum {
266 
267 
268 /*!
269  \enum switch_dtmf_source_t
270  \brief DTMF sources
271 <pre>
272  SWITCH_DTMF_UNKNOWN - Unknown source
273  SWITCH_DTMF_INBAND_AUDIO - From audio
274  SWITCH_DTMF_RTP - From RTP as a telephone event
275  SWITCH_DTMF_ENDPOINT - From endpoint signaling
276  SWITCH_DTMF_APP - From application
277 </pre>
278  */
279 typedef enum {
286 
287 typedef enum {
292 
293 
294 
295 typedef enum {
298 } dtmf_flag_t;
299 
300 typedef struct {
301  char digit;
302  uint32_t duration;
303  int32_t flags;
305 } switch_dtmf_t;
306 
307 typedef enum {
311 
312 typedef enum {
313  SBF_DIAL_ALEG = (1 << 0),
314  SBF_EXEC_ALEG = (1 << 1),
315  SBF_DIAL_BLEG = (1 << 2),
316  SBF_EXEC_BLEG = (1 << 3),
317  SBF_EXEC_OPPOSITE = (1 << 4),
318  SBF_EXEC_SAME = (1 << 5),
319  SBF_ONCE = (1 << 6),
320  SBF_EXEC_INLINE = (1 << 7)
322 typedef uint32_t switch_bind_flag_t;
323 
324 typedef enum {
328 
329 typedef enum {
330  SOF_NONE = 0,
331  SOF_NOBLOCK = (1 << 0),
332  SOF_FORKED_DIAL = (1 << 1),
337  SOF_NO_LIMITS = (1 << 6)
339 typedef uint32_t switch_originate_flag_t;
340 
341 typedef enum {
342  SPF_NONE = 0,
343  SPF_ODD = (1 << 0),
344  SPF_EVEN = (1 << 1),
345  SPF_ROBUST_TCP = (1 << 2),
346  SPF_ROBUST_UDP = (1 << 3)
348 typedef uint32_t switch_port_flag_t;
349 
350 typedef enum {
351  ED_NONE = 0,
352  ED_MUX_READ = (1 << 0),
353  ED_MUX_WRITE = (1 << 1),
354  ED_DTMF = (1 << 2),
355  ED_COPY_DISPLAY = (1 << 3),
356  ED_BRIDGE_READ = (1 << 4),
357  ED_BRIDGE_WRITE = (1 << 5),
358  ED_TAP_READ = (1 << 6),
359  ED_TAP_WRITE = (1 << 7),
360  ED_STEREO = (1 << 8)
362 typedef uint32_t switch_eavesdrop_flag_t;
363 
364 typedef enum {
365  SCF_NONE = 0,
366  SCF_USE_SQL = (1 << 0),
370  SCF_SHUTTING_DOWN = (1 << 3),
371  SCF_VG = (1 << 4),
372  SCF_RESTART = (1 << 5),
374  SCF_USE_AUTO_NAT = (1 << 7),
375  SCF_EARLY_HANGUP = (1 << 8),
377  SCF_USE_HEAVY_TIMING = (1 << 10),
378  SCF_USE_CLOCK_RT = (1 << 11),
379  SCF_VERBOSE_EVENTS = (1 << 12),
381  SCF_AUTO_SCHEMAS = (1 << 14),
382  SCF_MINIMAL = (1 << 15),
383  SCF_USE_NAT_MAPPING = (1 << 16),
384  SCF_CLEAR_SQL = (1 << 17),
388  SCF_DEBUG_SQL = (1 << 21),
389  SCF_API_EXPANSION = (1 << 22),
392  SCF_CPF_SOFT_PREFIX = (1 << 25),
393  SCF_CPF_SOFT_LOOKUP = (1 << 26),
397  SCF_LOG_DISABLE = (1 << 30)
399 typedef uint32_t switch_core_flag_t;
400 
401 typedef enum {
420 
421 /*!
422  \enum switch_database_flag_t
423  \brief Database flags
424 <pre>
425 SWITCH_DATABASE_FLAG_ROW_SIZE_LIMIT = (1 << 0) - Indicates that database has got row-size limit for the combined sizes of all columns.
426 </pre>
427  */
428 typedef enum {
431 typedef uint32_t switch_database_flag_t;
432 
433 typedef enum {
434  SUF_NONE = 0,
435  SUF_THREAD_RUNNING = (1 << 0),
436  SUF_READY = (1 << 1),
437  SUF_NATIVE = (1 << 2)
439 typedef uint32_t switch_unicast_flag_t;
440 
441 typedef enum {
444 } switch_bool_t;
445 
446 /* WARNING, Do not forget to update *SAY_METHOD_NAMES[] in src/switch_ivr_play_say.c */
447 typedef enum {
454 
455 /* WARNING, Do not forget to update *SAY_TYPE_NAMES[] in src/switch_ivr_say.c */
456 typedef enum {
477 
478 typedef enum {
484 
485 typedef enum {
490 
491 typedef enum {
493  SSHF_OWN_THREAD = (1 << 0),
494  SSHF_FREE_ARG = (1 << 1),
495  SSHF_NO_DEL = (1 << 2)
497 typedef uint32_t switch_scheduler_flag_t;
498 
499 typedef enum {
500  SMF_NONE = 0,
501  SMF_REBRIDGE = (1 << 0),
502  SMF_ECHO_ALEG = (1 << 1),
503  SMF_ECHO_BLEG = (1 << 2),
504  SMF_FORCE = (1 << 3),
505  SMF_LOOP = (1 << 4),
506  SMF_HOLD_BLEG = (1 << 5),
507  SMF_IMMEDIATE = (1 << 6),
508  SMF_EXEC_INLINE = (1 << 7),
509  SMF_PRIORITY = (1 << 8),
510  SMF_REPLYONLY_A = (1 << 9),
511  SMF_REPLYONLY_B = (1 << 10)
513 typedef uint32_t switch_media_flag_t;
514 
515 typedef enum {
519 
520 typedef enum {
536 
537 typedef struct {
539  uint32_t buflen;
541  uint32_t bytes;
542  uint32_t bits_tot;
550  switch_bitpack_mode_t mode;
552 
553 
555  char *base_dir;
556  char *mod_dir;
557  char *conf_dir;
558  char *log_dir;
559  char *run_dir;
560  char *db_dir;
561  char *script_dir;
562  char *temp_dir;
563  char *htdocs_dir;
564  char *grammar_dir;
565  char *storage_dir;
566  char *cache_dir;
568  char *sounds_dir;
569  char *lib_dir;
570  char *certs_dir;
571  char *fonts_dir;
572  char *images_dir;
573  char *data_dir;
575 };
576 
579 
581  char *conf_name;
582 };
583 
586 
587 #define SWITCH_MAX_STACKS 32
588 #define SWITCH_THREAD_STACKSIZE 240 * 1024
589 #define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
590 #define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
591 #define SWITCH_INTERVAL_PAD 10 /* A little extra buffer space to be safe */
592 #define SWITCH_MAX_SAMPLE_LEN 48
593 #define SWITCH_BYTES_PER_SAMPLE 2 /* slin is 2 bytes per sample */
594 #define SWITCH_RECOMMENDED_BUFFER_SIZE 8192
595 #define SWITCH_MAX_CODECS 50
596 #define SWITCH_MAX_STATE_HANDLERS 30
597 #define SWITCH_CORE_QUEUE_LEN 100000
598 #define SWITCH_MAX_MANAGEMENT_BUFFER_LEN 1024 * 8
599 
600 #define SWITCH_ACCEPTABLE_INTERVAL(_i) (_i && _i <= SWITCH_MAX_INTERVAL && (_i % 10) == 0)
601 
602 /* Check if RAND_MAX is a power of 2 minus 1 or in other words all bits set */
603 #if ((RAND_MAX) & ((RAND_MAX) + 1)) == 0 && (RAND_MAX) != 0
604 #define SWITCH_RAND_MAX RAND_MAX
605 #else
606 #define SWITCH_RAND_MAX 0x7fff
607 #endif
608 
609 typedef enum {
612 } switch_rw_t;
613 
614 typedef enum {
616  SWITCH_CPF_SCREEN = (1 << 0),
623 
624 typedef enum {
625  // flags matching libsndfile
636 
637  // custom flags
642 
643 typedef enum {
651  /* Nothing after this line */
654 typedef uint32_t switch_xml_section_t;
655 
656 /*!
657  \enum switch_vad_flag_t
658  \brief RTP Related Flags
659 <pre>
660  SWITCH_VAD_FLAG_TALKING - Currently Talking
661  SWITCH_VAD_FLAG_EVENTS_TALK - Fire events when talking is detected
662  SWITCH_VAD_FLAG_EVENTS_NOTALK - Fire events when not talking is detected
663  SWITCH_VAD_FLAG_CNG - Send CNG
664 </pre>
665  */
666 typedef enum {
672 typedef uint32_t switch_vad_flag_t;
673 
674 typedef enum {
681 typedef struct switch_vad_s switch_vad_t;
682 
683 typedef struct error_period {
684  int64_t start;
685  int64_t stop;
686  uint32_t flaws;
690 
691 
692 typedef struct {
704  /* Jitter */
705  int64_t last_proc_time;
706  int64_t jitter_n;
707  int64_t jitter_add;
708  int64_t jitter_addsq;
709 
710  double variance;
711  double min_variance;
712  double max_variance;
714 
715  /* Burst and Packet Loss */
716  double lossrate;
717  double burstrate;
721  int recved;
725  double R;
726  double mos;
729 
730 typedef struct {
731  uint32_t packet_count; /* sent packet count */
732  uint32_t octet_count;
733  uint32_t peer_ssrc;
734  uint32_t last_rpt_ts; /* RTP timestamp at which the last report was generated and sent */
735  uint32_t ssrc; /* identifier of the source */
736  uint32_t csrc; /* contributing source 0-15 32bit each */
737  uint32_t last_pkt_tsdiff; /* Jitter calculation, timestamp difference between the two last received packet */
738  double inter_jitter; /* Jitter calculation, Interarrival jitter */
739  uint32_t last_rpt_ext_seq; /* Packet loss calculation, extended sequence number at the begining of this RTCP report interval */
740  uint16_t last_rpt_cycle; /* Packet loss calculation, sequence number cycle at the begining of the current RTCP report interval */
741  uint16_t period_pkt_count; /* Packet loss calculation, packet count received during this RTCP report interval */
742  uint16_t pkt_count; /* Packet loss calculation, packet count received during this session */
743  uint16_t sent_pkt_count;
744  uint32_t rtcp_rtp_count; /* RTCP report generated count */
745  uint32_t high_ext_seq_recv; /* Packet loss calculation, highest extended sequence number received and processed for stats */
746  uint16_t cycle; /* Packet loss calculation, sequence number cycle of the current RTCP report interval */
747  uint32_t bad_seq; /* Bad SEQ found, used to detect reset on the other side */
748  uint16_t base_seq; /* Packet loss calculation, first sequence number received */
749  uint32_t cum_lost; /* Packet loss calculation, cumulative number of packet lost */
750  uint32_t last_recv_lsr_local; /* RTT calculation, When receiving an SR we save our local timestamp in fraction of 65536 seconds */
751  uint32_t last_recv_lsr_peer; /* RTT calculation, When receiving an SR we extract the middle 32bits of the remote NTP timestamp to include it in the next SR LSR */
752  uint32_t init;
754 
755 typedef struct {
756  uint16_t nack_count;
757  uint16_t fir_count;
758  uint16_t pli_count;
759  uint16_t sr_count;
760  uint16_t rr_count;
762 
763 typedef struct {
764  /* counters and stats for the incoming video stream and outgoing RTCP*/
766  /* counters and stats for the outgoing video stream and incoming RTCP*/
769 
770 typedef struct {
774  uint32_t read_count;
776 
777 typedef enum {
782 
783 #define SWITCH_RTP_CNG_PAYLOAD 13
784 
785 /*!
786  \enum switch_rtp_flag_t
787  \brief RTP Related Flags
788 <pre>
789  SWITCH_RTP_FLAG_NOBLOCK - Do not block
790  SWITCH_RTP_FLAG_IO - IO is ready
791  SWITCH_RTP_FLAG_USE_TIMER - Timeout Reads and replace with a CNG Frame
792  SWITCH_RTP_FLAG_SECURE - Secure RTP
793  SWITCH_RTP_FLAG_AUTOADJ - Auto-Adjust the dest based on the source
794  SWITCH_RTP_FLAG_RAW_WRITE - Try to forward packets unscathed
795  SWITCH_RTP_FLAG_GOOGLEHACK - Convert payload from 102 to 97
796  SWITCH_RTP_FLAG_VAD - Enable VAD
797  SWITCH_RTP_FLAG_BREAK - Stop what you are doing and return SWITCH_STATUS_BREAK
798  SWITCH_RTP_FLAG_DATAWAIT - Do not return from reads unless there is data even when non blocking
799  SWITCH_RTP_FLAG_BUGGY_2833 - Emulate the bug in cisco equipment to allow interop
800  SWITCH_RTP_FLAG_PASS_RFC2833 - Pass 2833 (ignore it)
801  SWITCH_RTP_FLAG_AUTO_CNG - Generate outbound CNG frames when idle
802 </pre>
803  */
804 typedef enum {
857 
858 
859 typedef enum {
860  RTP_BUG_NONE = 0, /* won't be using this one much ;) */
861 
863  /* Some Cisco devices get mad when you send the mark bit on new 2833 because it makes
864  them flush their jitterbuffer and the dtmf along with it.
865 
866  This flag will disable the sending of the mark bit on the first DTMF packet.
867  */
868 
869 
871  /*
872  Sonus wrongly expects that, when sending a multi-packet 2833 DTMF event, The sender
873  should increment the RTP timestamp in each packet when, in reality, the sender should
874  send the same exact timestamp and increment the duration field in the 2833 payload.
875  This allows a reconstruction of the duration if any of the packets are lost.
876 
877  final_duration - initial_timestamp = total_samples
878 
879  However, if the duration value exceeds the space allocated (16 bits), The sender should increment
880  the timestamp one unit and reset the duration to 0.
881 
882  Always sending a duration of 0 with a new timestamp should be tolerated but is rarely intentional
883  and is mistakenly done by many devices.
884  The issue is that the Sonus expects everyone to do it this way instead of tolerating either way.
885  Sonus will actually ignore every packet with the same timestamp before concluding if it's DTMF.
886 
887  This flag will cause each packet to have a new timestamp.
888  */
889 
890 
892 
893  /*
894  A Huawei SBC has been discovered that sends the mark bit on every single RTP packet.
895  Since this causes the RTP stack to flush it's buffers, it horribly messes up the timing on the channel.
896 
897  This flag will do nothing when an inbound packet contains the mark bit.
898 
899  */
900 
901 
903 
904  /*
905  Our friends at Sonus get real mad when the timestamps are not in perfect sequence even during periods of silence.
906  With this flag, we will only increment the timestamp when write packets even if they are eons apart.
907 
908  */
909 
911 
912  /*
913  Our friends at Sonus also get real mad if the sequence number does not start at 0.
914  Typically, we set this to a random starting value for your saftey.
915  This is a security risk you take upon yourself when you enable this flag.
916  */
917 
918 
920 
921  /*
922  Our friends at Sonus are on a roll, They also get easily dumbfounded by marker bits.
923  This flag will never send any. Sheesh....
924  */
925 
927 
928  /*
929  Guess Who? ... Yep, Sonus (and who know's who else) likes to interweave DTMF with the audio stream making it take
930  2X as long as it should and sending an incorrect duration making the DTMF very delayed.
931  This flag will treat every dtmf as if it were 50ms and queue it on recipt of the leading packet rather than at the end.
932  */
933 
934 
936 
937  /*
938  Oracle's Contact Center Anywhere (CCA) likes to use a single RTP socket to send all its outbound audio.
939  This messes up our ability to auto adjust to NATTED RTP and causes us to ignore its audio packets.
940  This flag will allow compatibility with this dying product.
941  */
942 
943 
945 
946  /*
947  Some RTP endpoints (and by some we mean *cough* _SONUS_!) do not like it when the timestamps jump forward or backwards in time.
948  So say you are generating a file that says "please wait for me to complete your call, or generating ringback"
949  Now you place and outbound call and you are bridging. Well, while you were playing the file, you were generating your own RTP timestamps.
950  But, now that you have a remote RTP stream, you'd rather send those timestamps as-is in case they will be fed to a remote jitter buffer......
951  Ok, so this causes the audio to completely fade out despite the fact that we send the mark bit which should give them heads up its happening.
952 
953  Sigh, This flag will tell FreeSWITCH that if it ever generates even one RTP packet itself, to continue to generate all of them and ignore the
954  actual timestamps in the frames.
955 
956  */
957 
959 
960  /*
961  By default FS will change the SSRC when the marker is set and it detects a timestamp reset.
962  If this setting is enabled it will NOT do this (old behaviour).
963  */
964 
966 
967  /* FLUSH JITTERBUFFER When getting RFC2833 to reduce bleed through */
968 
970 
971  /*
972  Make FS accept any payload type instead of dropping and returning CNG frame. Workaround while FS only supports a single payload per rtp session.
973  This can be used by endpoint modules to detect payload changes and act appropriately (ex: sofia could send a reINVITE with single codec).
974  This should probably be a flag, but flag enum is already full!
975  */
976 
977 
979 
980  /*
981  Leave the auto-adjust behavior enableed permenantly rather than only at appropriate times. (IMPLICITLY sets RTP_BUG_ACCEPT_ANY_PACKETS)
982 
983  */
984 
986 
987 #ifdef _MSC_VER
988 #pragma pack(push, r1, 1)
989 #endif
990 
991 #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
992 typedef struct {
993  unsigned version:2; /* protocol version */
994  unsigned p:1; /* padding flag */
995  unsigned x:1; /* header extension flag */
996  unsigned cc:4; /* CSRC count */
997  unsigned m:1; /* marker bit */
998  unsigned pt:7; /* payload type */
999  unsigned seq:16; /* sequence number */
1000  unsigned ts:32; /* timestamp */
1001  unsigned ssrc:32; /* synchronization source */
1003 
1004 typedef struct {
1005  unsigned length:16; /* length */
1006  unsigned profile:16; /* defined by profile */
1008 
1009 #else /* BIG_ENDIAN */
1010 
1011 typedef struct {
1012  unsigned cc:4; /* CSRC count */
1013  unsigned x:1; /* header extension flag */
1014  unsigned p:1; /* padding flag */
1015  unsigned version:2; /* protocol version */
1016  unsigned pt:7; /* payload type */
1017  unsigned m:1; /* marker bit */
1018  unsigned seq:16; /* sequence number */
1019  unsigned ts:32; /* timestamp */
1020  unsigned ssrc:32; /* synchronization source */
1022 
1023 typedef struct {
1024  unsigned profile:16; /* defined by profile */
1025  unsigned length:16; /* length */
1027 
1028 #endif
1029 
1030 #ifdef _MSC_VER
1031 #pragma pack(pop, r1)
1032 #endif
1033 
1034 #ifdef _MSC_VER
1035 #pragma pack(push, r1, 1)
1036 #endif
1037 
1038 #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
1039 typedef struct switch_rtcp_hdr_s {
1040  unsigned version:2; /* protocol version */
1041  unsigned p:1; /* padding flag */
1042  unsigned count:5; /* number of reception report blocks */
1043  unsigned type:8; /* packet type */
1044  unsigned length:16; /* length in 32-bit words - 1 */
1046 
1047 #else /* BIG_ENDIAN */
1048 
1049 typedef struct switch_rtcp_hdr_s {
1050  unsigned count:5; /* number of reception report blocks */
1051  unsigned p:1; /* padding flag */
1052  unsigned version:2; /* protocol version */
1053  unsigned type:8; /* packet type */
1054  unsigned length:16; /* length in 32-bit words - 1 */
1056 
1057 #endif
1058 
1059 #ifdef _MSC_VER
1060 #pragma pack(pop, r1)
1061 #endif
1062 
1063 typedef struct audio_buffer_header_s {
1064  uint32_t ts;
1065  uint32_t len;
1067 
1068 
1069 /*!
1070  \enum switch_priority_t
1071  \brief Priority Indication
1072 <pre>
1073  SWITCH_PRIORITY_NORMAL - Normal Priority
1074  SWITCH_PRIORITY_LOW - Low Priority
1075  SWITCH_PRIORITY_HIGH - High Priority
1076 </pre>
1077  */
1078 typedef enum {
1083 
1084 /*!
1085  \enum switch_ivr_option_t
1086  \brief Possible options related to ivr functions
1087 <pre>
1088  SWITCH_IVR_OPTION_NONE - nothing whatsoever
1089  SWITCH_IVR_OPTION_ASYNC - Asynchronous (do things in the background when applicable)
1090  SWITCH_IVR_OPTION_FILE - string argument implies a filename
1091 </pre>
1092  */
1093 typedef enum {
1098 typedef uint32_t switch_ivr_option_t;
1099 
1100 /*!
1101  \enum switch_core_session_message_types_t
1102  \brief Possible types of messages for inter-session communication
1103 <pre>
1104  SWITCH_MESSAGE_REDIRECT_AUDIO - Indication to redirect audio to another location if possible
1105  SWITCH_MESSAGE_TRANSMIT_TEXT - A text message
1106  SWITCH_MESSAGE_INDICATE_ANSWER - indicate answer
1107  SWITCH_MESSAGE_INDICATE_PROGRESS - indicate progress
1108  SWITCH_MESSAGE_INDICATE_BRIDGE - indicate a bridge starting
1109  SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
1110  SWITCH_MESSAGE_INDICATE_TRANSFER - indicate a transfer is taking place
1111  SWITCH_MESSAGE_INDICATE_MEDIA - indicate media is required
1112  SWITCH_MESSAGE_INDICATE_NOMEDIA - indicate no-media is required
1113  SWITCH_MESSAGE_INDICATE_HOLD - indicate hold
1114  SWITCH_MESSAGE_INDICATE_UNHOLD - indicate unhold
1115  SWITCH_MESSAGE_INDICATE_REDIRECT - indicate redirect
1116  SWITCH_MESSAGE_INDICATE_RESPOND - indicate reject
1117  SWITCH_MESSAGE_INDICATE_BROADCAST - indicate media broadcast
1118  SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT - indicate media broadcast
1119  SWITCH_MESSAGE_INDICATE_DEFLECT - indicate deflect
1120  SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ - indicate video refresh request
1121 </pre>
1122  */
1123 typedef enum {
1187 
1188 typedef struct {
1189  uint16_t T38FaxVersion;
1190  uint32_t T38MaxBitRate;
1197  const char *T38FaxUdpEC;
1198  const char *T38VendorInfo;
1199  const char *remote_ip;
1200  uint16_t remote_port;
1201  const char *local_ip;
1202  uint16_t local_port;
1203  const char *sdp_o_line;
1205 
1206 /*!
1207  \enum switch_stack_t
1208  \brief Expression of how to stack a list
1209 <pre>
1210 SWITCH_STACK_BOTTOM - Stack on the bottom
1211 SWITCH_STACK_TOP - Stack on the top
1212 </pre>
1213  */
1214 typedef enum {
1216  SWITCH_STACK_TOP = (1 << 1),
1219 } switch_stack_t;
1220 
1221 /*!
1222  \enum switch_status_t
1223  \brief Common return values
1224 <pre>
1225  SWITCH_STATUS_SUCCESS - General Success (common return value for most functions)
1226  SWITCH_STATUS_FALSE - General Falsehood
1227  SWITCH_STATUS_TIMEOUT - A Timeout has occured
1228  SWITCH_STATUS_RESTART - An indication to restart the previous operation
1229  SWITCH_STATUS_TERM - An indication to terminate
1230  SWITCH_STATUS_NOTIMPL - An indication that requested resource is not impelemented
1231  SWITCH_STATUS_MEMERR - General memory error
1232  SWITCH_STATUS_NOOP - NOTHING
1233  SWITCH_STATUS_RESAMPLE - An indication that a resample has occured
1234  SWITCH_STATUS_GENERR - A general Error
1235  SWITCH_STATUS_INUSE - An indication that requested resource is in use
1236  SWITCH_STATUS_BREAK - A non-fatal break of an operation
1237  SWITCH_STATUS_SOCKERR - A socket error
1238  SWITCH_STATUS_MORE_DATA - Need More Data
1239  SWITCH_STATUS_NOTFOUND - Not Found
1240  SWITCH_STATUS_UNLOAD - Unload
1241  SWITCH_STATUS_NOUNLOAD - Never Unload
1242 </pre>
1243  */
1244 typedef enum {
1271 } switch_status_t;
1272 
1273 
1274 
1275 /*!
1276 \enum switch_log_level_t
1277 \brief Log Level Enumeration
1278 <pre>
1279  SWITCH_LOG_DEBUG - Debug
1280  SWITCH_LOG_INFO - Info
1281  SWITCH_LOG_NOTICE - Notice
1282  SWITCH_LOG_WARNING - Warning
1283  SWITCH_LOG_ERROR - Error
1284  SWITCH_LOG_CRIT - Critical
1285  SWITCH_LOG_ALERT - Alert
1286  SWITCH_LOG_CONSOLE - Console
1287 </pre>
1288  */
1289 typedef enum {
1312 
1313 
1314 /*!
1315 \enum switch_text_channel_t
1316 \brief A target to write log/debug info to
1317 <pre>
1318 SWITCH_CHANNEL_ID_LOG - Write to the currently defined log
1319 SWITCH_CHANNEL_ID_LOG_CLEAN - Write to the currently defined log with no extra file/line/date information
1320 SWITCH_CHANNEL_ID_EVENT - Write to the event engine as a LOG event
1321 </pre>
1322  */
1323 typedef enum {
1329 
1330 typedef enum {
1331  SCSMF_DYNAMIC = (1 << 0),
1336 
1339 static inline const char *switch_const_char_type_check(const char *str) { return str; }
1340 
1341 #define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
1342 #define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
1343 #define SWITCH_CHANNEL_SESSION_LOG_CLEAN(x) SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, switch_core_session_get_uuid((x))
1344 #define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
1345 #define SWITCH_CHANNEL_SESSION_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)switch_core_session_type_check(x)
1346 #define SWITCH_CHANNEL_CHANNEL_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)switch_channel_get_session(x)
1347 #define SWITCH_CHANNEL_UUID_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, switch_const_char_type_check(x)
1348 
1349 typedef enum {
1360 
1361 typedef enum {
1370 
1371 
1372 /*!
1373  \enum switch_channel_state_t
1374  \brief Channel States (these are the defaults, CS_SOFT_EXECUTE, CS_EXCHANGE_MEDIA, and CS_CONSUME_MEDIA are often overridden by specific apps)
1375 <pre>
1376 CS_NEW - Channel is newly created.
1377 CS_INIT - Channel has been initialized.
1378 CS_ROUTING - Channel is looking for an extension to execute.
1379 CS_SOFT_EXECUTE - Channel is ready to execute from 3rd party control.
1380 CS_EXECUTE - Channel is executing it's dialplan.
1381 CS_EXCHANGE_MEDIA - Channel is exchanging media with another channel.
1382 CS_PARK - Channel is accepting media awaiting commands.
1383 CS_CONSUME_MEDIA - Channel is consuming all media and dropping it.
1384 CS_HIBERNATE - Channel is in a sleep state.
1385 CS_RESET - Channel is in a reset state.
1386 CS_HANGUP - Channel is flagged for hangup and ready to end.
1387 CS_REPORTING - Channel is ready to collect call detail.
1388 CS_DESTROY - Channel is ready to be destroyed and out of the state machine.
1389 </pre>
1390  */
1391 typedef enum {
1407 
1408 typedef enum {
1413 
1414 
1415 /*!
1416  \enum switch_channel_flag_t
1417  \brief Channel Flags
1418 
1419 <pre>
1420 CF_ANSWERED - Channel is answered
1421 CF_OUTBOUND - Channel is an outbound channel
1422 CF_EARLY_MEDIA - Channel is ready for audio before answer
1423 CF_ORIGINATOR - Channel is an originator
1424 CF_TRANSFER - Channel is being transfered
1425 CF_ACCEPT_CNG - Channel will accept CNG frames
1426 CF_REDIRECT - Channel is being redirected
1427 CF_BRIDGED - Channel in a bridge
1428 CF_HOLD - Channel is on hold
1429 CF_HOLD_BLEG - B leg is on hold
1430 CF_SERVICE - Channel has a service thread
1431 CF_TAGGED - Channel is tagged
1432 CF_WINNER - Channel is the winner
1433 CF_REUSE_CALLER_PROFILE - Channel reuse caller profile
1434 CF_CONTROLLED - Channel is under control
1435 CF_PROXY_MODE - Channel has no media
1436 CF_SUSPEND - Suspend i/o
1437 CF_EVENT_PARSE - Suspend control events
1438 CF_GEN_RINGBACK - Channel is generating it's own ringback
1439 CF_RING_READY - Channel is ready to send ringback
1440 CF_BREAK - Channel should stop what it's doing
1441 CF_BROADCAST - Channel is broadcasting
1442 CF_UNICAST - Channel has a unicast connection
1443 CF_VIDEO - Channel has video
1444 CF_EVENT_LOCK - Don't parse events
1445 CF_RESET - Tell extension parser to reset
1446 CF_ORIGINATING - Channel is originating
1447 CF_STOP_BROADCAST - Signal to stop broadcast
1448 
1449 CF_AUDIO_PAUSE - Audio is not ready to read/write
1450 CF_VIDEO_PAUSE - Video is not ready to read/write
1451 
1452 CF_MEDIA_SET - Session has read codec assigned
1453 
1454 </pre>
1455  */
1456 
1457 typedef enum {
1468  /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
1471 
1472 typedef enum {
1570  CF_PROTO_HOLD, //TFLAG_SIP_HOLD
1572  CF_VIDEO_POSSIBLE,//TFLAG_VIDEO
1645  /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
1646  /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
1649 
1650 typedef struct switch_vid_params_s {
1651  uint32_t width;
1652  uint32_t height;
1653  uint32_t fps;
1654  uint32_t d_width;
1655  uint32_t d_height;
1657 
1658 typedef struct switch_fps_s {
1659  float fps;
1660  int ms;
1661  int samples;
1662 } switch_fps_t;
1663 
1664 
1665 typedef enum {
1666  CF_APP_TAGGED = (1 << 0),
1667  CF_APP_T38 = (1 << 1),
1668  CF_APP_T38_REQ = (1 << 2),
1669  CF_APP_T38_FAIL = (1 << 3),
1673 
1674 
1675 /*!
1676  \enum switch_frame_flag_t
1677  \brief Frame Flags
1678 
1679 <pre>
1680 SFF_CNG = (1 << 0) - Frame represents comfort noise
1681 SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible
1682 SFF_RTP_HEADER = (1 << 2) - Get the rtp header from the frame header
1683 SFF_PLC = (1 << 3) - Frame has generated PLC data
1684 SFF_RFC2833 = (1 << 4) - Frame has rfc2833 dtmf data
1685 SFF_DYNAMIC = (1 << 5) - Frame is dynamic and should be freed
1686 SFF_MARKER = (1 << 11) - Frame flag has Marker set, only set by encoder
1687 SFF_WAIT_KEY_FRAME = (1 << 12) - Need a key from before could decode, or force generate a key frame on encode
1688 </pre>
1689  */
1690 typedef enum {
1692  SFF_CNG = (1 << 0),
1693  SFF_RAW_RTP = (1 << 1),
1694  SFF_RTP_HEADER = (1 << 2),
1695  SFF_PLC = (1 << 3),
1696  SFF_RFC2833 = (1 << 4),
1697  SFF_PROXY_PACKET = (1 << 5),
1698  SFF_DYNAMIC = (1 << 6),
1699  SFF_UDPTL_PACKET = (1 << 7),
1700  SFF_NOT_AUDIO = (1 << 8),
1701  SFF_RTCP = (1 << 9),
1702  SFF_MARKER = (1 << 10),
1703  SFF_WAIT_KEY_FRAME = (1 << 11),
1705  SFF_PICTURE_RESET = (1 << 13),
1706  SFF_SAME_IMAGE = (1 << 14),
1708  SFF_ENCODED = (1 << 16),
1709  SFF_TEXT_LINE_BREAK = (1 << 17),
1710  SFF_IS_KEYFRAME = (1 << 18),
1711  SFF_EXTERNAL = (1 << 19)
1713 typedef uint32_t switch_frame_flag_t;
1714 
1715 
1716 typedef enum {
1719  SAF_ROUTING_EXEC = (1 << 1),
1720  SAF_MEDIA_TAP = (1 << 2),
1721  SAF_ZOMBIE_EXEC = (1 << 3),
1722  SAF_NO_LOOPBACK = (1 << 4),
1725 typedef uint32_t switch_application_flag_t;
1726 
1727 typedef enum {
1731 
1732 
1733 /*!
1734  \enum switch_signal_t
1735  \brief Signals to send to channels
1736 <pre>
1737 SWITCH_SIG_KILL - Kill the channel
1738 SWITCH_SIG_XFER - Stop the current io but leave it viable
1739 </pre>
1740  */
1741 
1742 typedef enum {
1747 } switch_signal_t;
1748 
1749 /*!
1750  \enum switch_codec_flag_t
1751  \brief Codec related flags
1752 <pre>
1753 SWITCH_CODEC_FLAG_ENCODE = (1 << 0) - Codec can encode
1754 SWITCH_CODEC_FLAG_DECODE = (1 << 1) - Codec can decode
1755 SWITCH_CODEC_FLAG_SILENCE_START = (1 << 2) - Start period of silence
1756 SWITCH_CODEC_FLAG_SILENCE_STOP = (1 << 3) - End period of silence
1757 SWITCH_CODEC_FLAG_SILENCE = (1 << 4) - Silence
1758 SWITCH_CODEC_FLAG_FREE_POOL = (1 << 5) - Free codec's pool on destruction
1759 SWITCH_CODEC_FLAG_AAL2 = (1 << 6) - USE AAL2 Bitpacking
1760 SWITCH_CODEC_FLAG_PASSTHROUGH = (1 << 7) - Passthrough only
1761 </pre>
1762 */
1763 typedef enum {
1777 typedef uint32_t switch_codec_flag_t;
1778 
1779 
1780 /*!
1781  \enum switch_speech_flag_t
1782  \brief Speech related flags
1783 <pre>
1784 SWITCH_SPEECH_FLAG_HASTEXT = (1 << 0) - Interface is has text to read.
1785 SWITCH_SPEECH_FLAG_PEEK = (1 << 1) - Read data but do not erase it.
1786 SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 2) - Free interface's pool on destruction.
1787 SWITCH_SPEECH_FLAG_BLOCKING = (1 << 3) - Indicate that a blocking call is desired
1788 SWITCH_SPEECH_FLAG_PAUSE = (1 << 4) - Pause toggle for playback
1789 </pre>
1790 */
1791 typedef enum {
1801 typedef uint32_t switch_speech_flag_t;
1802 
1803 /*!
1804  \enum switch_asr_flag_t
1805  \brief Asr related flags
1806 <pre>
1807 SWITCH_ASR_FLAG_DATA = (1 << 0) - Interface has data
1808 SWITCH_ASR_FLAG_FREE_POOL = (1 << 1) - Pool needs to be freed
1809 SWITCH_ASR_FLAG_CLOSED = (1 << 2) - Interface has been closed
1810 SWITCH_ASR_FLAG_FIRE_EVENTS = (1 << 3) - Fire all speech events
1811 SWITCH_ASR_FLAG_AUTO_RESUME = (1 << 4) - Auto Resume
1812 </pre>
1813 */
1814 typedef enum {
1821 
1823 typedef uint32_t switch_asr_flag_t;
1824 
1825 /*!
1826  \enum switch_directory_flag_t
1827  \brief Directory Handle related flags
1828 <pre>
1829 SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0) - Free interface's pool on destruction.
1830 </pre>
1831 */
1832 typedef enum {
1834 
1836 typedef uint32_t switch_directory_flag_t;
1837 
1838 /*!
1839  \enum switch_codec_type_t
1840  \brief Codec types
1841 <pre>
1842 SWITCH_CODEC_TYPE_AUDIO - Audio Codec
1843 SWITCH_CODEC_TYPE_VIDEO - Video Codec
1844 SWITCH_CODEC_TYPE_T38 - T38 Codec
1845 SWITCH_CODEC_TYPE_APP - Application Codec
1846 </pre>
1847  */
1848 typedef enum {
1854 
1855 typedef enum {
1860 #define SWITCH_MEDIA_TYPE_TOTAL 3
1861 
1862 
1863 /*!
1864  \enum switch_timer_flag_t
1865  \brief Timer related flags
1866 <pre>
1867 SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0) - Free timer's pool on destruction
1868 </pre>
1869 */
1870 typedef enum {
1873 typedef uint32_t switch_timer_flag_t;
1874 
1875 
1876 /*!
1877  \enum switch_timer_flag_t
1878  \brief Timer related flags
1879 <pre>
1880 SMBF_READ_STREAM - Include the Read Stream
1881 SMBF_WRITE_STREAM - Include the Write Stream
1882 SMBF_WRITE_REPLACE - Replace the Write Stream
1883 SMBF_READ_REPLACE - Replace the Read Stream
1884 SMBF_STEREO - Record in stereo
1885 SMBF_ANSWER_REQ - Don't record until the channel is answered
1886 SMBF_BRIDGE_REQ - Don't record until the channel is bridged
1887 SMBF_THREAD_LOCK - Only let the same thread who created the bug remove it.
1888 SMBF_PRUNE -
1889 SMBF_NO_PAUSE -
1890 SMBF_STEREO_SWAP - Record in stereo: Write Stream - left channel, Read Stream - right channel
1891 </pre>
1892 */
1893 typedef enum {
1895  SMBF_READ_STREAM = (1 << 0),
1896  SMBF_WRITE_STREAM = (1 << 1),
1898  SMBF_READ_REPLACE = (1 << 3),
1899  SMBF_READ_PING = (1 << 4),
1900  SMBF_STEREO = (1 << 5),
1901  SMBF_ANSWER_REQ = (1 << 6),
1902  SMBF_BRIDGE_REQ = (1 << 7),
1903  SMBF_THREAD_LOCK = (1 << 8),
1904  SMBF_PRUNE = (1 << 9),
1905  SMBF_NO_PAUSE = (1 << 10),
1906  SMBF_STEREO_SWAP = (1 << 11),
1907  SMBF_LOCK = (1 << 12),
1910  SMBF_ONE_ONLY = (1 << 15),
1911  SMBF_MASK = (1 << 16),
1916  SMBF_VIDEO_PATCH = (1 << 21),
1921  SMBF_FIRST = (1 << 26),
1922  SMBF_PAUSE = (1 << 27)
1924 typedef uint32_t switch_media_bug_flag_t;
1925 
1926 /*!
1927  \enum switch_file_flag_t
1928  \brief File flags
1929 <pre>
1930 SWITCH_FILE_FLAG_READ = (1 << 0) - Open for read
1931 SWITCH_FILE_FLAG_WRITE = (1 << 1) - Open for write
1932 SWITCH_FILE_FLAG_FREE_POOL = (1 << 2) - Free file handle's pool on destruction
1933 SWITCH_FILE_DATA_SHORT = (1 << 3) - Read data in shorts
1934 SWITCH_FILE_DATA_INT = (1 << 4) - Read data in ints
1935 SWITCH_FILE_DATA_FLOAT = (1 << 5) - Read data in floats
1936 SWITCH_FILE_DATA_DOUBLE = (1 << 6) - Read data in doubles
1937 SWITCH_FILE_DATA_RAW = (1 << 7) - Read data as is
1938 SWITCH_FILE_PAUSE = (1 << 8) - Pause
1939 SWITCH_FILE_NATIVE = (1 << 9) - File is in native format (no transcoding)
1940 SWITCH_FILE_SEEK = (1 << 10) - File has done a seek
1941 SWITCH_FILE_OPEN = (1 << 11) - File is open
1942 </pre>
1943  */
1944 typedef enum {
1953  SWITCH_FILE_PAUSE = (1 << 8),
1955  SWITCH_FILE_SEEK = (1 << 10),
1956  SWITCH_FILE_OPEN = (1 << 11),
1958  SWITCH_FILE_DONE = (1 << 13),
1962  SWITCH_FILE_NOMUX = (1 << 17),
1968 typedef uint32_t switch_file_flag_t;
1969 
1970 typedef enum {
1977 typedef uint32_t switch_io_flag_t;
1978 
1979 /* make sure this is synced with the EVENT_NAMES array in switch_event.c
1980  also never put any new ones before EVENT_ALL
1981 */
1982 /*!
1983  \enum switch_event_types_t
1984  \brief Built-in Events
1985 
1986 <pre>
1987  SWITCH_EVENT_CUSTOM - A custom event
1988  SWITCH_EVENT_CLONE - A cloned event
1989  SWITCH_EVENT_CHANNEL_CREATE - A channel has been created
1990  SWITCH_EVENT_CHANNEL_DESTROY - A channel has been destroyed
1991  SWITCH_EVENT_CHANNEL_STATE - A channel has changed state
1992  SWITCH_EVENT_CHANNEL_CALLSTATE - A channel has changed call state
1993  SWITCH_EVENT_CHANNEL_ANSWER - A channel has been answered
1994  SWITCH_EVENT_CHANNEL_HANGUP - A channel has been hungup
1995  SWITCH_EVENT_CHANNEL_HANGUP_COMPLETE - A channel has completed the hangup
1996  SWITCH_EVENT_CHANNEL_EXECUTE - A channel has executed a module's application
1997  SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE - A channel has finshed executing a module's application
1998  SWITCH_EVENT_CHANNEL_HOLD - A channel has been put on hold
1999  SWITCH_EVENT_CHANNEL_UNHOLD - A channel has been unheld
2000  SWITCH_EVENT_CHANNEL_BRIDGE - A channel has bridged to another channel
2001  SWITCH_EVENT_CHANNEL_UNBRIDGE - A channel has unbridged from another channel
2002  SWITCH_EVENT_CHANNEL_PROGRESS - A channel has started ringing
2003  SWITCH_EVENT_CHANNEL_PROGRESS_MEDIA - A channel has started early media
2004  SWITCH_EVENT_CHANNEL_OUTGOING - A channel has been unparked
2005  SWITCH_EVENT_CHANNEL_PARK - A channel has been parked
2006  SWITCH_EVENT_CHANNEL_UNPARK - A channel has been unparked
2007  SWITCH_EVENT_CHANNEL_APPLICATION- A channel has called and event from an application
2008  SWITCH_EVENT_CHANNEL_ORIGINATE - A channel has been originated
2009  SWITCH_EVENT_CHANNEL_UUID - A channel has changed uuid
2010  SWITCH_EVENT_API - An API call has been executed
2011  SWITCH_EVENT_LOG - A LOG event has been triggered
2012  SWITCH_EVENT_INBOUND_CHAN - A new inbound channel has been created
2013  SWITCH_EVENT_OUTBOUND_CHAN - A new outbound channel has been created
2014  SWITCH_EVENT_STARTUP - The system has been started
2015  SWITCH_EVENT_SHUTDOWN - The system has been shutdown
2016  SWITCH_EVENT_PUBLISH - Publish
2017  SWITCH_EVENT_UNPUBLISH - UnPublish
2018  SWITCH_EVENT_TALK - Talking Detected
2019  SWITCH_EVENT_NOTALK - Not Talking Detected
2020  SWITCH_EVENT_SESSION_CRASH - Session Crashed
2021  SWITCH_EVENT_MODULE_LOAD - Module was loaded
2022  SWITCH_EVENT_MODULE_UNLOAD - Module was unloaded
2023  SWITCH_EVENT_DTMF - DTMF was sent
2024  SWITCH_EVENT_MESSAGE - A Basic Message
2025  SWITCH_EVENT_PRESENCE_IN - Presence in
2026  SWITCH_EVENT_NOTIFY_IN - Received incoming NOTIFY from gateway subscription
2027  SWITCH_EVENT_PRESENCE_OUT - Presence out
2028  SWITCH_EVENT_PRESENCE_PROBE - Presence probe
2029  SWITCH_EVENT_MESSAGE_WAITING - A message is waiting
2030  SWITCH_EVENT_MESSAGE_QUERY - A query for MESSAGE_WAITING events
2031  SWITCH_EVENT_ROSTER - ?
2032  SWITCH_EVENT_CODEC - Codec Change
2033  SWITCH_EVENT_BACKGROUND_JOB - Background Job
2034  SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
2035  SWITCH_EVENT_DETECTED_TONE - Detected Tone
2036  SWITCH_EVENT_PRIVATE_COMMAND - A private command event
2037  SWITCH_EVENT_HEARTBEAT - Machine is alive
2038  SWITCH_EVENT_TRAP - Error Trap
2039  SWITCH_EVENT_ADD_SCHEDULE - Something has been scheduled
2040  SWITCH_EVENT_DEL_SCHEDULE - Something has been unscheduled
2041  SWITCH_EVENT_EXE_SCHEDULE - Something scheduled has been executed
2042  SWITCH_EVENT_RE_SCHEDULE - Something scheduled has been rescheduled
2043  SWITCH_EVENT_RELOADXML - XML registry has been reloaded
2044  SWITCH_EVENT_NOTIFY - Notification
2045  SWITCH_EVENT_PHONE_FEATURE - Notification (DND/CFWD/etc)
2046  SWITCH_EVENT_PHONE_FEATURE_SUBSCRIBE - Phone feature subscription
2047  SWITCH_EVENT_SEND_MESSAGE - Message
2048  SWITCH_EVENT_RECV_MESSAGE - Message
2049  SWITCH_EVENT_REQUEST_PARAMS
2050  SWITCH_EVENT_CHANNEL_DATA
2051  SWITCH_EVENT_GENERAL
2052  SWITCH_EVENT_COMMAND
2053  SWITCH_EVENT_SESSION_HEARTBEAT
2054  SWITCH_EVENT_CLIENT_DISCONNECTED
2055  SWITCH_EVENT_SERVER_DISCONNECTED
2056  SWITCH_EVENT_SEND_INFO
2057  SWITCH_EVENT_RECV_INFO
2058  SWITCH_EVENT_RECV_RTCP_MESSAGE
2059  SWITCH_EVENT_SEND_RTCP_MESSAGE
2060  SWITCH_EVENT_CALL_SECURE
2061  SWITCH_EVENT_NAT - NAT Management (new/del/status)
2062  SWITCH_EVENT_RECORD_START
2063  SWITCH_EVENT_RECORD_STOP
2064  SWITCH_EVENT_PLAYBACK_START
2065  SWITCH_EVENT_PLAYBACK_STOP
2066  SWITCH_EVENT_CALL_UPDATE
2067  SWITCH_EVENT_FAILURE - A failure occurred which might impact the normal functioning of the switch
2068  SWITCH_EVENT_SOCKET_DATA
2069  SWITCH_EVENT_MEDIA_BUG_START
2070  SWITCH_EVENT_MEDIA_BUG_STOP
2071  SWITCH_EVENT_CONFERENCE_DATA_QUERY
2072  SWITCH_EVENT_CONFERENCE_DATA
2073  SWITCH_EVENT_CALL_SETUP_REQ
2074  SWITCH_EVENT_CALL_SETUP_RESULT
2075  SWITCH_EVENT_CALL_DETAIL
2076  SWITCH_EVENT_DEVICE_STATE
2077  SWITCH_EVENT_SHUTDOWN_REQUESTED - Shutdown of the system has been requested
2078  SWITCH_EVENT_ALL - All events at once
2079 </pre>
2080 
2081  */
2082 typedef enum {
2177 
2178 typedef enum {
2182 
2183 typedef enum {
2267 
2268 typedef enum {
2315 
2316 typedef enum {
2317  SSH_FLAG_STICKY = (1 << 0),
2320 
2321 #ifdef WIN32
2322 typedef SOCKET switch_os_socket_t;
2323 #define SWITCH_SOCK_INVALID INVALID_SOCKET
2324 #else
2326 #define SWITCH_SOCK_INVALID -1
2327 #endif
2328 
2329 typedef struct fspr_pool_t switch_memory_pool_t;
2330 typedef void* switch_plc_state_t;
2331 typedef uint16_t switch_port_t;
2332 typedef uint8_t switch_payload_t;
2334 typedef struct switch_rtp switch_rtp_t;
2335 typedef struct switch_rtcp switch_rtcp_t;
2359 typedef struct switch_odbc_handle switch_odbc_handle_t;
2361 
2385 
2386 typedef void (*hashtable_destructor_t)(void *ptr);
2387 
2389  char *val;
2391 };
2393 
2397  int count;
2398  int dynamic;
2399 };
2401 
2402 typedef void (*switch_media_bug_exec_cb_t)(switch_media_bug_t *bug, void *user_data);
2403 
2406 typedef void (*switch_cap_callback_t) (const char *var, const char *val, void *user_data);
2409 typedef switch_bool_t (*switch_tone_detect_callback_t) (switch_core_session_t *, const char *, const char *);
2411 
2412 typedef void (*switch_engine_function_t) (switch_core_session_t *session, void *user_data);
2413 
2414 
2416  switch_codec_t *other_codec,
2417  void *decoded_data,
2418  uint32_t decoded_data_len,
2419  uint32_t decoded_rate,
2420  void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag);
2421 
2422 
2424  switch_codec_t *other_codec,
2425  void *encoded_data,
2426  uint32_t encoded_data_len,
2427  uint32_t encoded_rate,
2428  void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag);
2429 
2431 
2433 
2434 typedef enum {
2444 
2445 typedef enum {
2450 
2451 typedef enum {
2455 
2457  switch_codec_control_command_t cmd,
2458  switch_codec_control_type_t ctype,
2459  void *cmd_data,
2460  switch_codec_control_type_t atype,
2461  void *cmd_arg,
2462  switch_codec_control_type_t *rtype,
2463  void **ret_data);
2464 
2465 
2469 
2470 
2472 #define SWITCH_STANDARD_CHAT_APP(name) static switch_status_t name (switch_event_t *message, const char *data)
2473 
2474 typedef void (*switch_application_function_t) (switch_core_session_t *, const char *);
2475 #define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, const char *data)
2476 
2477 typedef int (*switch_core_recover_callback_t)(switch_core_session_t *session);
2478 typedef void (*switch_event_callback_t) (switch_event_t *);
2479 typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);
2480 #define SWITCH_STANDARD_DIALPLAN(name) static switch_caller_extension_t *name (switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
2481 
2482 typedef switch_bool_t (*switch_hash_delete_callback_t) (_In_ const void *key, _In_ const void *val, _In_opt_ void *pData);
2483 #define SWITCH_HASH_DELETE_FUNC(name) static switch_bool_t name (const void *key, const void *val, void *pData)
2484 
2486 
2488 
2489 #define SWITCH_STANDARD_SCHED_FUNC(name) static void name (switch_scheduler_task_t *task)
2490 
2491 typedef switch_status_t (*switch_state_handler_t) (switch_core_session_t *);
2493 typedef uint8_t * (*switch_stream_handle_read_function_t) (switch_stream_handle_t *handle, int *len);
2496 
2497 typedef switch_status_t (*switch_api_function_t) (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session,
2498  _In_ switch_stream_handle_t *stream);
2499 
2500 
2501 #define SWITCH_STANDARD_API(name) static switch_status_t name (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
2502 
2503 
2504 typedef switch_status_t (*switch_json_api_function_t) (const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply);
2505 
2506 
2507 #define SWITCH_STANDARD_JSON_API(name) static switch_status_t name (const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
2508 
2509 typedef switch_status_t (*switch_input_callback_function_t) (switch_core_session_t *session, void *input,
2510  switch_input_type_t input_type, void *buf, unsigned int buflen);
2511 typedef switch_status_t (*switch_read_frame_callback_function_t) (switch_core_session_t *session, switch_frame_t *frame, void *user_data);
2513 
2514 #define DMACHINE_MAX_DIGIT_LEN 512
2515 
2516 typedef enum {
2519 } dm_match_type_t;
2520 
2521 struct switch_ivr_dmachine;
2523 
2526  const char *match_digits;
2527  int32_t match_key;
2528  dm_match_type_t type;
2529  void *user_data;
2530 };
2531 
2534 
2535 #define MAX_ARG_RECURSION 25
2536 
2537 #define arg_recursion_check_start(_args) if (_args) { \
2538  if (_args->loops >= MAX_ARG_RECURSION) { \
2539  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, \
2540  "RECURSION ERROR! It's not the best idea to call things that collect input recursively from an input callback.\n"); \
2541  return SWITCH_STATUS_GENERR; \
2542  } else {_args->loops++;} \
2543  }
2544 
2545 
2546 #define arg_recursion_check_stop(_args) if (_args) _args->loops--
2547 
2548 typedef struct {
2550  void *buf;
2551  uint32_t buflen;
2553  void *user_data;
2555  int loops;
2557 
2558 
2559 typedef struct {
2560  switch_say_type_t type;
2561  switch_say_method_t method;
2562  switch_say_gender_t gender;
2563  const char *ext;
2565 
2566 
2567 typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session,
2568  char *tosay,
2569  switch_say_args_t *say_args,
2570  switch_input_args_t *args);
2571 
2572 typedef switch_status_t (*switch_say_string_callback_t) (switch_core_session_t *session,
2573  char *tosay,
2574  switch_say_args_t *say_args, char **rstr);
2575 
2576 struct switch_say_file_handle;
2578 
2580  char *tosay,
2581  switch_say_args_t *say_args);
2582 
2583 
2584 typedef struct switch_xml *switch_xml_t;
2586 typedef switch_xml_t(*switch_xml_open_root_function_t) (uint8_t reload, const char **err, void *user_data);
2587 typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
2588  const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
2589  void *user_data);
2590 
2591 struct switch_hashtable;
2596 
2597 struct switch_network_list;
2599 
2600 
2601 #define SWITCH_API_VERSION 5
2602 #define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
2603 #define SWITCH_MODULE_RUNTIME_ARGS (void)
2604 #define SWITCH_MODULE_SHUTDOWN_ARGS (void)
2605 typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS;
2606 typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS;
2607 typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS;
2608 #define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS
2609 #define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS
2610 #define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS
2611 
2612 typedef enum {
2618 
2619 typedef enum {
2623 typedef uint32_t switch_module_flag_t;
2624 
2627  switch_module_load_t load;
2628  switch_module_shutdown_t shutdown;
2629  switch_module_runtime_t runtime;
2630  switch_module_flag_t flags;
2632 
2633 typedef int (*switch_modulename_callback_func_t) (void *user_data, const char *module_name);
2634 
2636 
2637 #define SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, flags) \
2638 static const char modname[] = #name ; \
2639 SWITCH_MOD_DECLARE_DATA switch_loadable_module_function_table_t name##_module_interface = { \
2640  SWITCH_API_VERSION, \
2641  load, \
2642  shutdown, \
2643  runtime, \
2644  flags \
2645 }
2646 
2647 #define SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime) \
2648  SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, SMODF_NONE)
2649 
2650 /* things we don't deserve to know about */
2651 /*! \brief A channel */
2652 struct switch_channel;
2653 /*! \brief A core session representing a call and all of it's resources */
2654 struct switch_core_session;
2655 /*! \brief An audio bug */
2656 struct switch_media_bug;
2657 /*! \brief A digit stream parser object */
2659 struct sql_queue_manager;
2660 
2661 struct switch_media_handle_s;
2663 
2664 typedef uint32_t switch_event_channel_id_t;
2665 typedef void (*switch_event_channel_func_t)(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data);
2666 
2667 struct switch_live_array_s;
2669 
2670 typedef enum {
2674 
2675 #define SDP_TYPE_REQUEST SDP_OFFER
2676 #define SDP_TYPE_RESPONSE SDP_ANSWER
2677 
2678 typedef enum {
2692 
2693 /* Keep in sync with CRYPTO_KEY_PARAM_METHOD table. */
2694 typedef enum {
2695  CRYPTO_KEY_PARAM_METHOD_INLINE, /* identified by "inline" chars in SRTP key parameter */
2698 
2699 typedef struct payload_map_s {
2700  switch_media_type_t type;
2701  switch_sdp_type_t sdp_type;
2702  uint32_t ptime;
2703  uint32_t rate;
2704  uint8_t allocated;
2705  uint8_t negotiated;
2706  uint8_t current;
2707  unsigned long hash;
2708 
2710  char *iananame;
2711  char *modname;
2712  switch_payload_t pt;
2713  unsigned long rm_rate;
2714  unsigned long adv_rm_rate;
2715  uint32_t codec_ms;
2716  uint32_t bitrate;
2717 
2718  char *rm_fmtp;
2719 
2720  switch_payload_t recv_pt;
2721 
2722  char *fmtp_out;
2723 
2725  switch_port_t remote_sdp_port;
2726 
2729 
2731 
2732 } payload_map_t;
2733 
2734 typedef enum {
2741 
2742 typedef enum {
2743  ICE_GOOGLE_JINGLE = (1 << 0),
2744  ICE_VANILLA = (1 << 1),
2745  ICE_CONTROLLED = (1 << 2),
2746  ICE_LITE = (1 << 3)
2748 
2749 typedef enum {
2750  SWITCH_POLL_READ = (1 << 0),
2751  SWITCH_POLL_WRITE = (1 << 1),
2752  SWITCH_POLL_ERROR = (1 << 2),
2753  SWITCH_POLL_HUP = (1 << 3),
2756  SWITCH_POLL_PRI = (1 << 6),
2758 } switch_poll_t;
2759 
2760 typedef struct switch_waitlist_s {
2761  switch_os_socket_t sock;
2762  uint32_t events;
2763  uint32_t revents;
2765 
2766 struct switch_jb_s;
2767 typedef struct switch_jb_s switch_jb_t;
2768 
2769 //struct kalman_estimator_s;
2770 //typedef struct kalman_estimator_s kalman_estimator_t;
2771 
2772 //struct cusum_kalman_detector_s;
2773 //typedef struct cusum_kalman_detector_s cusum_kalman_detector_t;
2774 
2777 
2778 struct switch_frame_buffer_s;
2780 
2781 typedef enum {
2782  SVR_BLOCK = (1 << 0),
2783  SVR_FLUSH = (1 << 1),
2784  SVR_CHECK = (1 << 2)
2786 
2787 typedef enum {
2792 
2793 typedef enum {
2799 
2800 
2804 
2805 struct switch_chromakey_s;
2807 
2808 typedef enum {
2814 
2815 typedef enum {
2820 
2821 typedef struct switch_mm_s {
2824  int keyint;
2825  int ab;
2826  int vb;
2827  int vw;
2828  int vh;
2829  int cbr;
2830  float fps;
2831  float source_fps;
2833  int vbuf;
2834  switch_video_profile_t vprofile;
2835  switch_video_encode_speed_t vencspd;
2837  int scale_w;
2838  int scale_h;
2842 } switch_mm_t;
2843 
2844 #define SWITCH_RTP_MAX_CRYPTO_LEN 64
2845 
2846 /* If MKI is used, then one or more key-materials are present in the <key-params> section of the crypto attribute.
2847  * This struct describes the single MKI entry (key-material) within <key-params> section of crypto attribute.
2848  * Key-material follows the format:
2849  * "inline:" <key||salt> ["|" lifetime] ["|" MKI ":" length]
2850  * which translates to
2851  * "inline: KEYSALT|MKI_ID:MKI_SZ" or "inline: KEYSALT|LIFETIME|MKI_ID:MKI_SZ" */
2853  switch_rtp_crypto_key_param_method_type_t method;
2854  unsigned char raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; /* Key-salt. Master key appended with salt. Sizes determined by crypto suite. */
2855  char *crypto_key; /* Complete key material string ("method:keysalt[|lifetime]|mki"). */
2856  uint64_t lifetime; /* OPTIONAL. The lifetime value MAY be written as a non-zero, positive decimal integer or as a power of 2. Must be less than max lifetime of RTP and RTCP packets in given crypto suite. */
2857  unsigned int mki_id; /* OPTIONAL. */
2858  unsigned int mki_size; /* OPTIONAL. Byte length of the master key field in the RTP packet. */
2859  struct switch_crypto_key_material_s *next; /* NULL if this is the last master key in crypto attribute set. */
2861 
2862 typedef struct secure_settings_s {
2864  unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN];
2865  unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN];
2866  switch_rtp_crypto_key_type_t crypto_type;
2869 
2870  /*
2871  * MKI support (as per rfc4568).
2872  * Normally single crypto attribute contains one key-material in a <key-params> section, e.g. "inline: KEYSALT" or "inline: KEYSALT|2^LIFETIME_BITS".
2873  * But if MKI is used, then one or more key-materials are present in the <key-params> section of the crypto attribute. Each key-material follows the format:
2874  *
2875  * "inline:" <key||salt> ["|" lifetime] ["|" MKI ":" length]
2876  *
2877  * "inline: KEYSALT|MKI_ID:MKI_SZ"
2878  * or
2879  * "inline: KEYSALT|2^LIFETIME_BITS|MKI_ID:MKI_SZ"
2880  *
2881  * This points to singly linked list of key-material descriptions if there is more than one key-material present in this crypto attribute (this key is inserted as the head of the list in that case), or to NULL otherwise.
2882  */
2883  struct switch_crypto_key_material_s *local_key_material_next; /* NULL if MKI not used for crypto set on outbound SRTP. */
2884  unsigned long local_key_material_n; /* number of key_materials in the linked list for outbound SRTP */
2885  struct switch_crypto_key_material_s *remote_key_material_next; /* NULL if MKI not used for crypto set on inbound SRTP. */
2886  unsigned long remote_key_material_n; /* number of key_materials in the linked list for inbound SRTP */
2888 
2889 /* Default MKI index used for packets send from FS. We always use first key if multiple master keys are present in the crypto attribute. */
2890 #define SWITCH_CRYPTO_MKI_INDEX 0
2891 
2892 /* max number of MKI in a single crypto line supported */
2893 #define SWITCH_CRYPTO_MKI_MAX 20
2894 
2895 struct switch_dial_handle_s;
2897 
2898 struct switch_dial_leg_s;
2900 
2901 struct switch_dial_leg_list_s;
2903 
2906 
2908 #endif
2909 /* For Emacs:
2910  * Local Variables:
2911  * mode:c
2912  * indent-tabs-mode:t
2913  * tab-width:4
2914  * c-basic-offset:4
2915  * End:
2916  * For VIM:
2917  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
2918  */
uint32_t switch_bind_flag_t
Definition: switch_types.h:322
switch_size_t flaws
Definition: switch_types.h:723
A module interface to implement an application.
switch_caller_profile_flag_enum_t
Definition: switch_types.h:614
struct switch_waitlist_s switch_waitlist_t
uint8_t allocated
switch_size_t period_packet_count
Definition: switch_types.h:696
switch_bind_flag_enum_t
Definition: switch_types.h:312
An Abstract Representation of a dialplan extension.
uint32_t switch_ivr_option_t
switch_say_type_t type
switch_thread_priority_t
Call Specific Data.
Definition: switch_caller.h:73
switch_unicast_flag_enum_t
Definition: switch_types.h:433
switch_rtp_numbers_t inbound
Definition: switch_types.h:771
switch_abc_type_t
Definition: switch_types.h:520
Abstract interface to a limit module.
switch_text_channel_t
A target to write log/debug info to.
switch_codec_type_t
Codec types.
switch_img_fmt_t fmt
#define SWITCH_MODULE_LOAD_ARGS
switch_rtp_crypto_key_type_t
struct payload_map_s payload_map_t
uint32_t switch_event_channel_id_t
struct switch_odbc_handle switch_odbc_handle_t
switch_rtp_flush_t
Definition: switch_types.h:777
switch_os_socket_t sock
Abstraction of an module endpoint interface This is the glue between the abstract idea of a "channel"...
switch_bool_t(* switch_hash_delete_callback_t)(_In_ const void *key, _In_ const void *val, _In_opt_ void *pData)
switch_xml_t(* switch_xml_search_function_t)(const char *section, const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params, void *user_data)
uint32_t switch_chat_application_flag_t
struct switch_loadable_module_function_table switch_loadable_module_function_table_t
uint32_t switch_io_flag_t
struct switch_fps_s switch_fps_t
uint32_t switch_application_flag_t
#define SWITCH_END_EXTERN_C
Definition: switch.h:43
unsigned long rm_rate
switch_ring_ready_t
switch_event_types_t
Built-in Events.
switch_io_flag_enum_t
switch_call_direction_t
Definition: switch_types.h:307
switch_byte_t frame_bits
Definition: switch_types.h:545
uint32_t switch_speech_flag_t
unsigned long adv_rm_rate
switch_pvt_class_t
Definition: switch_types.h:262
switch_bool_t
Definition: switch_types.h:441
switch_bool_t(* switch_media_bug_callback_t)(switch_media_bug_t *, void *, switch_abc_type_t)
switch_audio_col_t
Definition: switch_types.h:624
switch_ivr_dmachine_t * dmachine
switch_size_t largest_jb_size
Definition: switch_types.h:703
struct error_period * next
Definition: switch_types.h:688
char * remote_sdp_ip
switch_priority_t
Priority Indication.
struct switch_xml * switch_xml_t
unsigned long hash
switch_channel_flag_t
Channel Flags.
switch_say_method_t method
void(* hashtable_destructor_t)(void *ptr)
switch_timer_flag_enum_t
Representation of an event.
Definition: switch_event.h:80
A module interface to implement a chat application.
const char * cc
Definition: cc.h:2
An event Header.
Definition: switch_event.h:65
An Abstract Representation of a dialplan Application.
switch_core_session_message_flag_enum_t
switch_core_session_message_types_t
Possible types of messages for inter-session communication.
uint8_t try_hardware_encoder
switch_bitpack_mode_t mode
Definition: switch_types.h:550
switch_digit_action_target_t
Definition: switch_types.h:287
switch_status_t(* switch_stream_handle_raw_write_function_t)(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen)
switch_bool_t T38FaxTranscodingMMR
switch_rtp_crypto_key_param_method_type_t
const char * T38FaxRateManagement
switch_status_t(* switch_core_codec_fmtp_parse_func_t)(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
switch_bitpack_mode_t
Definition: switch_types.h:515
switch_channel_cap_t
Abstract interface to a chat module.
switch_core_flag_enum_t
Definition: switch_types.h:364
struct switch_console_callback_match_node * head
switch_size_t last_flaw
Definition: switch_types.h:724
switch_status_t(* switch_console_complete_callback_t)(const char *, const char *, switch_console_callback_match_t **matches)
#define SWITCH_DECLARE_DATA
uint32_t switch_scheduler_flag_t
Definition: switch_types.h:497
A representation of an XML tree.
Definition: switch_xml.h:79
switch_eavesdrop_flag_enum_t
Definition: switch_types.h:350
switch_xml_section_enum_t
Definition: switch_types.h:643
Abstract interface to a dialplan module.
switch_status_t(* switch_core_codec_init_func_t)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings)
switch_video_encode_speed_t
uint32_t switch_originate_flag_t
Definition: switch_types.h:339
switch_bool_t T38FaxTranscodingJBIG
A table of functions that a timer module implements.
switch_size_t media_bytes
Definition: switch_types.h:694
uint32_t duration
Definition: switch_types.h:302
A node to store binded events.
Definition: switch_event.c:48
#define SWITCH_MODULE_SHUTDOWN_ARGS
struct switch_crypto_key_material_s * local_key_material_next
A table of i/o routines that an endpoint interface can implement.
struct switch_console_callback_match_node * end
Abstract handler to a timer module.
switch_size_t dtmf_packet_count
Definition: switch_types.h:700
switch_video_profile_t vprofile
char * auth_password
uint32_t switch_core_flag_t
Definition: switch_types.h:399
switch_vad_flag_enum_t
Definition: switch_types.h:666
struct switch_crypto_key_material_s * next
dtmf_flag_t
Definition: switch_types.h:295
switch_input_type_t
uint32_t switch_module_flag_t
Abstract interface to an asr module.
switch_status_t(* switch_json_api_function_t)(const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
uint32_t flaws
Definition: switch_types.h:686
A message object designed to allow unlike technologies to exchange data.
Definition: switch_core.h:179
uint32_t switch_core_session_message_flag_t
uint8_t switch_byte_t
Definition: switch_types.h:256
float source_fps
Abstract interface to a file format module.
struct payload_map_s * next
int cJSON_bool fmt
Definition: switch_cJSON.h:150
uint32_t switch_codec_flag_t
switch_status_t(* switch_chat_application_function_t)(switch_event_t *, const char *)
switch_video_read_flag_t
void(* switch_application_function_t)(switch_core_session_t *, const char *)
#define LOST_BURST_CAPTURE
Definition: switch_types.h:254
switch_codec_control_command_t
static switch_core_session_t * switch_core_session_type_check(switch_core_session_t *session)
switch_status_t(* switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, const char *fmt,...)
uint32_t switch_vad_flag_t
Definition: switch_types.h:672
switch_rw_t
Definition: switch_types.h:609
switch_codec_control_type_t
void(* switch_engine_function_t)(switch_core_session_t *session, void *user_data)
Abstract interface to a speech module.
switch_rtcp_numbers_t rtcp
Definition: switch_types.h:773
switch_byte_t switch_byte_t * buf
int64_t stop
Definition: switch_types.h:685
switch_status_t(* switch_read_frame_callback_function_t)(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
switch_byte_t bits_cur
Definition: switch_types.h:543
switch_chat_application_flag_enum_t
dm_match_type_t
switch_size_t raw_bytes
Definition: switch_types.h:693
A module interface to implement an api function.
switch_asr_flag_enum_t
char * auth_username
uint32_t switch_file_flag_t
#define SWITCH_MODULE_RUNTIME_ARGS
switch_status_t(* switch_core_codec_video_decode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
Abstract interface to a say module.
uint32_t switch_database_flag_t
Definition: switch_types.h:431
switch_rtp_bug_flag_t
Definition: switch_types.h:859
unsigned long local_key_material_n
Abstract interface to a management module.
switch_byte_t * buf
Definition: switch_types.h:538
switch_status_t(* switch_state_handler_t)(switch_core_session_t *)
switch_session_ctl_t
switch_byte_t this_byte
Definition: switch_types.h:547
uint32_t switch_xml_section_t
Definition: switch_types.h:654
#define SWITCH_RTP_MAX_CRYPTO_LEN
switch_status_t(* switch_say_string_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, char **rstr)
switch_vad_state_t
Definition: switch_types.h:674
switch_say_gender_t
Definition: switch_types.h:478
switch_rtp_numbers_t outbound
Definition: switch_types.h:772
uint32_t switch_timer_flag_t
switch_directory_flag_enum_t
switch_input_callback_function_t input_callback
switch_status_t(* switch_input_callback_function_t)(switch_core_session_t *session, void *input, switch_input_type_t input_type, void *buf, unsigned int buflen)
int switch_os_socket_t
Top level module interface to implement a series of codec implementations.
switch_file_flag_enum_t
switch_application_flag_enum_t
#define _In_opt_
void(* switch_event_channel_func_t)(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id, void *user_data)
switch_sdp_type_t sdp_type
char const int length
Definition: switch_cJSON.h:153
switch_module_interface_name_t
Definition: switch_types.h:401
switch_state_handler_flag_t
An abstraction of a data frame.
Definition: switch_frame.h:54
uintptr_t switch_size_t
struct switch_rtcp switch_rtcp_t
uint8_t negotiated
struct switch_rtcp_hdr_s switch_rtcp_hdr_t
switch_dtmf_source_t
DTMF sources.
Definition: switch_types.h:279
switch_sdp_type_t
switch_payload_t pt
uint16_t switch_port_t
switch_status_t(* switch_new_say_callback_t)(switch_say_file_handle_t *sh, char *tosay, switch_say_args_t *say_args)
uint32_t switch_asr_flag_t
const char * T38VendorInfo
uint32_t ptime
switch_status_t(* switch_say_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
switch_filenames SWITCH_GLOBAL_filenames
Definition: switch_core.c:83
switch_byte_t switch_byte_t uint32_t buflen
switch_byte_t under
Definition: switch_types.h:548
switch_video_profile_t
uint32_t switch_eavesdrop_flag_t
Definition: switch_types.h:362
uint32_t consecutive_flaws
Definition: switch_types.h:687
switch_speech_flag_enum_t
int64_t start
Definition: switch_types.h:684
int(* switch_modulename_callback_func_t)(void *user_data, const char *module_name)
switch_channel_callstate_t
switch_say_gender_t gender
switch_size_t packet_count
Definition: switch_types.h:695
switch_xml_t(* switch_xml_open_root_function_t)(uint8_t reload, const char **err, void *user_data)
vpx_img_fmt_t switch_img_fmt_t
Definition: switch_vpx.h:91
const char * T38FaxUdpEC
uint32_t bitrate
switch_call_cause_t
switch_dtmf_direction_t
Definition: switch_types.h:324
uint32_t switch_frame_flag_t
unsigned long remote_key_material_n
switch_device_state_t
switch_media_type_t type
switch_directories SWITCH_GLOBAL_dirs
Definition: switch_core.c:82
switch_size_t jb_packet_count
Definition: switch_types.h:699
switch_read_frame_callback_function_t read_frame_callback
switch_media_bug_flag_enum_t
switch_size_t skip_packet_count
Definition: switch_types.h:698
switch_video_encode_speed_t vencspd
switch_status_t(* switch_api_function_t)(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
switch_rtcp_video_counters_t video_out
Definition: switch_types.h:767
switch_status_t(* switch_core_codec_video_encode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
struct switch_vid_params_s switch_vid_params_t
switch_channel_state_t
Channel States (these are the defaults, CS_SOFT_EXECUTE, CS_EXCHANGE_MEDIA, and CS_CONSUME_MEDIA are ...
void * switch_plc_state_t
switch_port_flag_enum_t
Definition: switch_types.h:341
switch_ivr_option_enum_t
switch_status_t
Common return values.
switch_status_t(* switch_ivr_dmachine_callback_t)(switch_ivr_dmachine_match_t *match)
switch_bool_t(* switch_tone_detect_callback_t)(switch_core_session_t *, const char *, const char *)
struct error_period * error_log
Definition: switch_types.h:727
switch_byte_t shiftby
Definition: switch_types.h:546
switch_frame_flag_enum_t
switch_rtcp_video_counters_t video_in
Definition: switch_types.h:765
switch_file_command_t
switch_originate_flag_enum_t
Definition: switch_types.h:329
switch_codec_flag_enum_t
void(* switch_scheduler_func_t)(switch_scheduler_task_t *task)
switch_vid_spy_fmt_t
uint32_t last_recv_lsr_local
Definition: switch_types.h:750
An abstraction of a rtcp frame.
unsigned int value
Definition: switch_types.h:259
const char * remote_ip
switch_rtp_flag_t
RTP Related Flags.
Definition: switch_types.h:804
Main Library Header.
switch_status_t(* switch_core_codec_control_func_t)(switch_codec_t *codec, switch_codec_control_command_t cmd, switch_codec_control_type_t ctype, void *cmd_data, switch_codec_control_type_t atype, void *cmd_arg, switch_codec_control_type_t *rtype, void **ret_data)
void(* switch_cap_callback_t)(const char *var, const char *val, void *user_data)
int(* switch_core_recover_callback_t)(switch_core_session_t *session)
switch_size_t flush_packet_count
Definition: switch_types.h:702
A registered custom event subclass.
Definition: switch_event.c:63
struct secure_settings_s switch_secure_settings_t
switch_status_t(* switch_core_video_thread_callback_func_t)(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
switch_signal_t
Signals to send to channels.
switch_status_t(* switch_core_codec_decode_func_t)(switch_codec_t *codec, switch_codec_t *other_codec, void *encoded_data, uint32_t encoded_data_len, uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag)
switch_size_t media_packet_count
Definition: switch_types.h:697
uint32_t switch_port_flag_t
Definition: switch_types.h:348
struct error_period switch_error_period_t
switch_status_t(* switch_core_text_thread_callback_func_t)(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
switch_say_type_t
Definition: switch_types.h:456
char * key
Definition: switch_msrp.c:64
switch_media_flow_t
A generic object to pass as a thread&#39;s session object to allow mutiple arguements and a pool...
Definition: switch_core.h:216
switch_say_method_t
Definition: switch_types.h:447
uint32_t switch_media_flag_t
Definition: switch_types.h:513
switch_stack_t
Expression of how to stack a list.
void(* switch_media_bug_exec_cb_t)(switch_media_bug_t *bug, void *user_data)
switch_module_shutdown_t shutdown
void(* switch_event_callback_t)(switch_event_t *)
switch_byte_t * cur
Definition: switch_types.h:540
switch_dtmf_source_t source
Definition: switch_types.h:304
switch_payload_t recv_pt
switch_byte_t over
Definition: switch_types.h:549
A table of settings and callbacks that define a paticular implementation of a codec.
switch_byte_t bits_rem
Definition: switch_types.h:544
A module interface to implement a json api function.
switch_bool_t T38FaxFillBitRemoval
switch_port_t remote_sdp_port
uint32_t switch_unicast_flag_t
Definition: switch_types.h:439
#define _In_opt_z_
uint32_t switch_caller_profile_flag_t
Definition: switch_types.h:622
uint32_t switch_media_bug_flag_t
int count
Definition: switch_cJSON.h:204
struct fspr_pool_t switch_memory_pool_t
switch_scheduler_flag_enum_t
Definition: switch_types.h:491
switch_io_type_t
struct switch_mm_s switch_mm_t
switch_rtp_crypto_key_param_method_type_t method
switch_poll_t
vpx resources
switch_core_media_ice_type_t
switch_database_flag_enum_t
Definition: switch_types.h:428
uint32_t switch_directory_flag_t
const char * sdp_o_line
switch_status_t(* switch_core_codec_encode_func_t)(switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data, uint32_t decoded_data_len, uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag)
switch_media_flag_enum_t
Definition: switch_types.h:499
switch_channel_app_flag_t
switch_rtp_crypto_key_type_t crypto_type
Abstract interface to a database module.
static const char * switch_const_char_type_check(const char *str)
const char * ext
uint32_t codec_ms
struct switch_console_callback_match_node * next
switch_log_level_t
Log Level Enumeration.
switch_management_action_t
Definition: switch_types.h:485
The abstraction of a loadable module.
switch_ivr_dmachine_t * dmachine
uint8_t switch_payload_t
struct switch_crypto_key_material_s switch_crypto_key_material_t
const char * local_ip
switch_module_flag_enum_t
#define _In_
switch_size_t cng_packet_count
Definition: switch_types.h:701
Abstract interface to a directory module.
#define SWITCH_BEGIN_EXTERN_C
Definition: switch.h:42
char * rm_encoding
switch_media_type_t
struct audio_buffer_header_s audio_buffer_header_t
struct switch_crypto_key_material_s * remote_key_material_next
switch_status_t(* switch_core_codec_destroy_func_t)(switch_codec_t *)