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 enum {
262 
263 
264 /*!
265  \enum switch_dtmf_source_t
266  \brief DTMF sources
267 <pre>
268  SWITCH_DTMF_UNKNOWN - Unknown source
269  SWITCH_DTMF_INBAND_AUDIO - From audio
270  SWITCH_DTMF_RTP - From RTP as a telephone event
271  SWITCH_DTMF_ENDPOINT - From endpoint signaling
272  SWITCH_DTMF_APP - From application
273 </pre>
274  */
275 typedef enum {
282 
283 typedef enum {
288 
289 
290 
291 typedef enum {
294 } dtmf_flag_t;
295 
296 typedef struct {
297  char digit;
298  uint32_t duration;
299  int32_t flags;
301 } switch_dtmf_t;
302 
303 typedef enum {
307 
308 typedef enum {
309  SBF_DIAL_ALEG = (1 << 0),
310  SBF_EXEC_ALEG = (1 << 1),
311  SBF_DIAL_BLEG = (1 << 2),
312  SBF_EXEC_BLEG = (1 << 3),
313  SBF_EXEC_OPPOSITE = (1 << 4),
314  SBF_EXEC_SAME = (1 << 5),
315  SBF_ONCE = (1 << 6),
316  SBF_EXEC_INLINE = (1 << 7)
318 typedef uint32_t switch_bind_flag_t;
319 
320 typedef enum {
324 
325 typedef enum {
326  SOF_NONE = 0,
327  SOF_NOBLOCK = (1 << 0),
328  SOF_FORKED_DIAL = (1 << 1),
333  SOF_NO_LIMITS = (1 << 6)
335 typedef uint32_t switch_originate_flag_t;
336 
337 typedef enum {
338  SPF_NONE = 0,
339  SPF_ODD = (1 << 0),
340  SPF_EVEN = (1 << 1),
341  SPF_ROBUST_TCP = (1 << 2),
342  SPF_ROBUST_UDP = (1 << 3)
344 typedef uint32_t switch_port_flag_t;
345 
346 typedef enum {
347  ED_NONE = 0,
348  ED_MUX_READ = (1 << 0),
349  ED_MUX_WRITE = (1 << 1),
350  ED_DTMF = (1 << 2),
351  ED_COPY_DISPLAY = (1 << 3),
352  ED_BRIDGE_READ = (1 << 4),
353  ED_BRIDGE_WRITE = (1 << 5),
354  ED_TAP_READ = (1 << 6),
355  ED_TAP_WRITE = (1 << 7),
356  ED_STEREO = (1 << 8)
358 typedef uint32_t switch_eavesdrop_flag_t;
359 
360 typedef enum {
361  SCF_NONE = 0,
362  SCF_USE_SQL = (1 << 0),
366  SCF_SHUTTING_DOWN = (1 << 3),
367  SCF_VG = (1 << 4),
368  SCF_RESTART = (1 << 5),
370  SCF_USE_AUTO_NAT = (1 << 7),
371  SCF_EARLY_HANGUP = (1 << 8),
373  SCF_USE_HEAVY_TIMING = (1 << 10),
374  SCF_USE_CLOCK_RT = (1 << 11),
375  SCF_VERBOSE_EVENTS = (1 << 12),
377  SCF_AUTO_SCHEMAS = (1 << 14),
378  SCF_MINIMAL = (1 << 15),
379  SCF_USE_NAT_MAPPING = (1 << 16),
380  SCF_CLEAR_SQL = (1 << 17),
384  SCF_DEBUG_SQL = (1 << 21),
385  SCF_API_EXPANSION = (1 << 22),
388  SCF_CPF_SOFT_PREFIX = (1 << 25),
389  SCF_CPF_SOFT_LOOKUP = (1 << 26),
393  SCF_LOG_DISABLE = (1 << 30)
395 typedef uint32_t switch_core_flag_t;
396 
397 typedef enum {
416 
417 /*!
418  \enum switch_database_flag_t
419  \brief Database flags
420 <pre>
421 SWITCH_DATABASE_FLAG_ROW_SIZE_LIMIT = (1 << 0) - Indicates that database has got row-size limit for the combined sizes of all columns.
422 </pre>
423  */
424 typedef enum {
427 typedef uint32_t switch_database_flag_t;
428 
429 typedef enum {
430  SUF_NONE = 0,
431  SUF_THREAD_RUNNING = (1 << 0),
432  SUF_READY = (1 << 1),
433  SUF_NATIVE = (1 << 2)
435 typedef uint32_t switch_unicast_flag_t;
436 
437 typedef enum {
440 } switch_bool_t;
441 
442 /* WARNING, Do not forget to update *SAY_METHOD_NAMES[] in src/switch_ivr_play_say.c */
443 typedef enum {
450 
451 /* WARNING, Do not forget to update *SAY_TYPE_NAMES[] in src/switch_ivr_say.c */
452 typedef enum {
473 
474 typedef enum {
480 
481 typedef enum {
486 
487 typedef enum {
489  SSHF_OWN_THREAD = (1 << 0),
490  SSHF_FREE_ARG = (1 << 1),
491  SSHF_NO_DEL = (1 << 2)
493 typedef uint32_t switch_scheduler_flag_t;
494 
495 typedef enum {
496  SMF_NONE = 0,
497  SMF_REBRIDGE = (1 << 0),
498  SMF_ECHO_ALEG = (1 << 1),
499  SMF_ECHO_BLEG = (1 << 2),
500  SMF_FORCE = (1 << 3),
501  SMF_LOOP = (1 << 4),
502  SMF_HOLD_BLEG = (1 << 5),
503  SMF_IMMEDIATE = (1 << 6),
504  SMF_EXEC_INLINE = (1 << 7),
505  SMF_PRIORITY = (1 << 8),
506  SMF_REPLYONLY_A = (1 << 9),
507  SMF_REPLYONLY_B = (1 << 10)
509 typedef uint32_t switch_media_flag_t;
510 
511 typedef enum {
515 
516 typedef enum {
532 
533 typedef struct {
535  uint32_t buflen;
537  uint32_t bytes;
538  uint32_t bits_tot;
546  switch_bitpack_mode_t mode;
548 
549 
551  char *base_dir;
552  char *mod_dir;
553  char *conf_dir;
554  char *log_dir;
555  char *run_dir;
556  char *db_dir;
557  char *script_dir;
558  char *temp_dir;
559  char *htdocs_dir;
560  char *grammar_dir;
561  char *storage_dir;
562  char *cache_dir;
564  char *sounds_dir;
565  char *lib_dir;
566  char *certs_dir;
567  char *fonts_dir;
568  char *images_dir;
569  char *data_dir;
571 };
572 
575 
577  char *conf_name;
578 };
579 
582 
583 #define SWITCH_MAX_STACKS 32
584 #define SWITCH_THREAD_STACKSIZE 240 * 1024
585 #define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
586 #define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
587 #define SWITCH_INTERVAL_PAD 10 /* A little extra buffer space to be safe */
588 #define SWITCH_MAX_SAMPLE_LEN 48
589 #define SWITCH_BYTES_PER_SAMPLE 2 /* slin is 2 bytes per sample */
590 #define SWITCH_RECOMMENDED_BUFFER_SIZE 8192
591 #define SWITCH_MAX_CODECS 50
592 #define SWITCH_MAX_STATE_HANDLERS 30
593 #define SWITCH_CORE_QUEUE_LEN 100000
594 #define SWITCH_MAX_MANAGEMENT_BUFFER_LEN 1024 * 8
595 
596 #define SWITCH_ACCEPTABLE_INTERVAL(_i) (_i && _i <= SWITCH_MAX_INTERVAL && (_i % 10) == 0)
597 
598 typedef enum {
601 } switch_rw_t;
602 
603 typedef enum {
605  SWITCH_CPF_SCREEN = (1 << 0),
612 
613 typedef enum {
614  // flags matching libsndfile
625 
626  // custom flags
631 
632 typedef enum {
640  /* Nothing after this line */
643 typedef uint32_t switch_xml_section_t;
644 
645 /*!
646  \enum switch_vad_flag_t
647  \brief RTP Related Flags
648 <pre>
649  SWITCH_VAD_FLAG_TALKING - Currently Talking
650  SWITCH_VAD_FLAG_EVENTS_TALK - Fire events when talking is detected
651  SWITCH_VAD_FLAG_EVENTS_NOTALK - Fire events when not talking is detected
652  SWITCH_VAD_FLAG_CNG - Send CNG
653 </pre>
654  */
655 typedef enum {
661 typedef uint32_t switch_vad_flag_t;
662 
663 typedef enum {
670 typedef struct switch_vad_s switch_vad_t;
671 
672 typedef struct error_period {
673  int64_t start;
674  int64_t stop;
675  uint32_t flaws;
679 
680 
681 typedef struct {
693  /* Jitter */
694  int64_t last_proc_time;
695  int64_t jitter_n;
696  int64_t jitter_add;
697  int64_t jitter_addsq;
698 
699  double variance;
700  double min_variance;
701  double max_variance;
703 
704  /* Burst and Packet Loss */
705  double lossrate;
706  double burstrate;
710  int recved;
714  double R;
715  double mos;
718 
719 typedef struct {
720  uint32_t packet_count; /* sent packet count */
721  uint32_t octet_count;
722  uint32_t peer_ssrc;
723  uint32_t last_rpt_ts; /* RTP timestamp at which the last report was generated and sent */
724  uint32_t ssrc; /* identifier of the source */
725  uint32_t csrc; /* contributing source 0-15 32bit each */
726  uint32_t last_pkt_tsdiff; /* Jitter calculation, timestamp difference between the two last received packet */
727  double inter_jitter; /* Jitter calculation, Interarrival jitter */
728  uint32_t last_rpt_ext_seq; /* Packet loss calculation, extended sequence number at the begining of this RTCP report interval */
729  uint16_t last_rpt_cycle; /* Packet loss calculation, sequence number cycle at the begining of the current RTCP report interval */
730  uint16_t period_pkt_count; /* Packet loss calculation, packet count received during this RTCP report interval */
731  uint16_t pkt_count; /* Packet loss calculation, packet count received during this session */
732  uint16_t sent_pkt_count;
733  uint32_t rtcp_rtp_count; /* RTCP report generated count */
734  uint32_t high_ext_seq_recv; /* Packet loss calculation, highest extended sequence number received and processed for stats */
735  uint16_t cycle; /* Packet loss calculation, sequence number cycle of the current RTCP report interval */
736  uint32_t bad_seq; /* Bad SEQ found, used to detect reset on the other side */
737  uint16_t base_seq; /* Packet loss calculation, first sequence number received */
738  uint32_t cum_lost; /* Packet loss calculation, cumulative number of packet lost */
739  uint32_t last_recv_lsr_local; /* RTT calculation, When receiving an SR we save our local timestamp in fraction of 65536 seconds */
740  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 */
741  uint32_t init;
743 
744 typedef struct {
745  uint16_t nack_count;
746  uint16_t fir_count;
747  uint16_t pli_count;
748  uint16_t sr_count;
749  uint16_t rr_count;
751 
752 typedef struct {
753  /* counters and stats for the incoming video stream and outgoing RTCP*/
755  /* counters and stats for the outgoing video stream and incoming RTCP*/
758 
759 typedef struct {
763  uint32_t read_count;
765 
766 typedef enum {
771 
772 #define SWITCH_RTP_CNG_PAYLOAD 13
773 
774 /*!
775  \enum switch_rtp_flag_t
776  \brief RTP Related Flags
777 <pre>
778  SWITCH_RTP_FLAG_NOBLOCK - Do not block
779  SWITCH_RTP_FLAG_IO - IO is ready
780  SWITCH_RTP_FLAG_USE_TIMER - Timeout Reads and replace with a CNG Frame
781  SWITCH_RTP_FLAG_SECURE - Secure RTP
782  SWITCH_RTP_FLAG_AUTOADJ - Auto-Adjust the dest based on the source
783  SWITCH_RTP_FLAG_RAW_WRITE - Try to forward packets unscathed
784  SWITCH_RTP_FLAG_GOOGLEHACK - Convert payload from 102 to 97
785  SWITCH_RTP_FLAG_VAD - Enable VAD
786  SWITCH_RTP_FLAG_BREAK - Stop what you are doing and return SWITCH_STATUS_BREAK
787  SWITCH_RTP_FLAG_DATAWAIT - Do not return from reads unless there is data even when non blocking
788  SWITCH_RTP_FLAG_BUGGY_2833 - Emulate the bug in cisco equipment to allow interop
789  SWITCH_RTP_FLAG_PASS_RFC2833 - Pass 2833 (ignore it)
790  SWITCH_RTP_FLAG_AUTO_CNG - Generate outbound CNG frames when idle
791 </pre>
792  */
793 typedef enum {
846 
847 
848 typedef enum {
849  RTP_BUG_NONE = 0, /* won't be using this one much ;) */
850 
852  /* Some Cisco devices get mad when you send the mark bit on new 2833 because it makes
853  them flush their jitterbuffer and the dtmf along with it.
854 
855  This flag will disable the sending of the mark bit on the first DTMF packet.
856  */
857 
858 
860  /*
861  Sonus wrongly expects that, when sending a multi-packet 2833 DTMF event, The sender
862  should increment the RTP timestamp in each packet when, in reality, the sender should
863  send the same exact timestamp and increment the duration field in the 2833 payload.
864  This allows a reconstruction of the duration if any of the packets are lost.
865 
866  final_duration - initial_timestamp = total_samples
867 
868  However, if the duration value exceeds the space allocated (16 bits), The sender should increment
869  the timestamp one unit and reset the duration to 0.
870 
871  Always sending a duration of 0 with a new timestamp should be tolerated but is rarely intentional
872  and is mistakenly done by many devices.
873  The issue is that the Sonus expects everyone to do it this way instead of tolerating either way.
874  Sonus will actually ignore every packet with the same timestamp before concluding if it's DTMF.
875 
876  This flag will cause each packet to have a new timestamp.
877  */
878 
879 
881 
882  /*
883  A Huawei SBC has been discovered that sends the mark bit on every single RTP packet.
884  Since this causes the RTP stack to flush it's buffers, it horribly messes up the timing on the channel.
885 
886  This flag will do nothing when an inbound packet contains the mark bit.
887 
888  */
889 
890 
892 
893  /*
894  Our friends at Sonus get real mad when the timestamps are not in perfect sequence even during periods of silence.
895  With this flag, we will only increment the timestamp when write packets even if they are eons apart.
896 
897  */
898 
900 
901  /*
902  Our friends at Sonus also get real mad if the sequence number does not start at 0.
903  Typically, we set this to a random starting value for your saftey.
904  This is a security risk you take upon yourself when you enable this flag.
905  */
906 
907 
909 
910  /*
911  Our friends at Sonus are on a roll, They also get easily dumbfounded by marker bits.
912  This flag will never send any. Sheesh....
913  */
914 
916 
917  /*
918  Guess Who? ... Yep, Sonus (and who know's who else) likes to interweave DTMF with the audio stream making it take
919  2X as long as it should and sending an incorrect duration making the DTMF very delayed.
920  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.
921  */
922 
923 
925 
926  /*
927  Oracle's Contact Center Anywhere (CCA) likes to use a single RTP socket to send all its outbound audio.
928  This messes up our ability to auto adjust to NATTED RTP and causes us to ignore its audio packets.
929  This flag will allow compatibility with this dying product.
930  */
931 
932 
934 
935  /*
936  Some RTP endpoints (and by some we mean *cough* _SONUS_!) do not like it when the timestamps jump forward or backwards in time.
937  So say you are generating a file that says "please wait for me to complete your call, or generating ringback"
938  Now you place and outbound call and you are bridging. Well, while you were playing the file, you were generating your own RTP timestamps.
939  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......
940  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.
941 
942  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
943  actual timestamps in the frames.
944 
945  */
946 
948 
949  /*
950  By default FS will change the SSRC when the marker is set and it detects a timestamp reset.
951  If this setting is enabled it will NOT do this (old behaviour).
952  */
953 
955 
956  /* FLUSH JITTERBUFFER When getting RFC2833 to reduce bleed through */
957 
959 
960  /*
961  Make FS accept any payload type instead of dropping and returning CNG frame. Workaround while FS only supports a single payload per rtp session.
962  This can be used by endpoint modules to detect payload changes and act appropriately (ex: sofia could send a reINVITE with single codec).
963  This should probably be a flag, but flag enum is already full!
964  */
965 
966 
968 
969  /*
970  Leave the auto-adjust behavior enableed permenantly rather than only at appropriate times. (IMPLICITLY sets RTP_BUG_ACCEPT_ANY_PACKETS)
971 
972  */
973 
975 
976 #ifdef _MSC_VER
977 #pragma pack(push, r1, 1)
978 #endif
979 
980 #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
981 typedef struct {
982  unsigned version:2; /* protocol version */
983  unsigned p:1; /* padding flag */
984  unsigned x:1; /* header extension flag */
985  unsigned cc:4; /* CSRC count */
986  unsigned m:1; /* marker bit */
987  unsigned pt:7; /* payload type */
988  unsigned seq:16; /* sequence number */
989  unsigned ts:32; /* timestamp */
990  unsigned ssrc:32; /* synchronization source */
992 
993 typedef struct {
994  unsigned length:16; /* length */
995  unsigned profile:16; /* defined by profile */
997 
998 #else /* BIG_ENDIAN */
999 
1000 typedef struct {
1001  unsigned cc:4; /* CSRC count */
1002  unsigned x:1; /* header extension flag */
1003  unsigned p:1; /* padding flag */
1004  unsigned version:2; /* protocol version */
1005  unsigned pt:7; /* payload type */
1006  unsigned m:1; /* marker bit */
1007  unsigned seq:16; /* sequence number */
1008  unsigned ts:32; /* timestamp */
1009  unsigned ssrc:32; /* synchronization source */
1011 
1012 typedef struct {
1013  unsigned profile:16; /* defined by profile */
1014  unsigned length:16; /* length */
1016 
1017 #endif
1018 
1019 #ifdef _MSC_VER
1020 #pragma pack(pop, r1)
1021 #endif
1022 
1023 #ifdef _MSC_VER
1024 #pragma pack(push, r1, 1)
1025 #endif
1026 
1027 #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
1028 typedef struct switch_rtcp_hdr_s {
1029  unsigned version:2; /* protocol version */
1030  unsigned p:1; /* padding flag */
1031  unsigned count:5; /* number of reception report blocks */
1032  unsigned type:8; /* packet type */
1033  unsigned length:16; /* length in 32-bit words - 1 */
1035 
1036 #else /* BIG_ENDIAN */
1037 
1038 typedef struct switch_rtcp_hdr_s {
1039  unsigned count:5; /* number of reception report blocks */
1040  unsigned p:1; /* padding flag */
1041  unsigned version:2; /* protocol version */
1042  unsigned type:8; /* packet type */
1043  unsigned length:16; /* length in 32-bit words - 1 */
1045 
1046 #endif
1047 
1048 #ifdef _MSC_VER
1049 #pragma pack(pop, r1)
1050 #endif
1051 
1052 typedef struct audio_buffer_header_s {
1053  uint32_t ts;
1054  uint32_t len;
1056 
1057 
1058 /*!
1059  \enum switch_priority_t
1060  \brief Priority Indication
1061 <pre>
1062  SWITCH_PRIORITY_NORMAL - Normal Priority
1063  SWITCH_PRIORITY_LOW - Low Priority
1064  SWITCH_PRIORITY_HIGH - High Priority
1065 </pre>
1066  */
1067 typedef enum {
1072 
1073 /*!
1074  \enum switch_ivr_option_t
1075  \brief Possible options related to ivr functions
1076 <pre>
1077  SWITCH_IVR_OPTION_NONE - nothing whatsoever
1078  SWITCH_IVR_OPTION_ASYNC - Asynchronous (do things in the background when applicable)
1079  SWITCH_IVR_OPTION_FILE - string argument implies a filename
1080 </pre>
1081  */
1082 typedef enum {
1087 typedef uint32_t switch_ivr_option_t;
1088 
1089 /*!
1090  \enum switch_core_session_message_types_t
1091  \brief Possible types of messages for inter-session communication
1092 <pre>
1093  SWITCH_MESSAGE_REDIRECT_AUDIO - Indication to redirect audio to another location if possible
1094  SWITCH_MESSAGE_TRANSMIT_TEXT - A text message
1095  SWITCH_MESSAGE_INDICATE_ANSWER - indicate answer
1096  SWITCH_MESSAGE_INDICATE_PROGRESS - indicate progress
1097  SWITCH_MESSAGE_INDICATE_BRIDGE - indicate a bridge starting
1098  SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
1099  SWITCH_MESSAGE_INDICATE_TRANSFER - indicate a transfer is taking place
1100  SWITCH_MESSAGE_INDICATE_MEDIA - indicate media is required
1101  SWITCH_MESSAGE_INDICATE_NOMEDIA - indicate no-media is required
1102  SWITCH_MESSAGE_INDICATE_HOLD - indicate hold
1103  SWITCH_MESSAGE_INDICATE_UNHOLD - indicate unhold
1104  SWITCH_MESSAGE_INDICATE_REDIRECT - indicate redirect
1105  SWITCH_MESSAGE_INDICATE_RESPOND - indicate reject
1106  SWITCH_MESSAGE_INDICATE_BROADCAST - indicate media broadcast
1107  SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT - indicate media broadcast
1108  SWITCH_MESSAGE_INDICATE_DEFLECT - indicate deflect
1109  SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ - indicate video refresh request
1110 </pre>
1111  */
1112 typedef enum {
1176 
1177 typedef struct {
1178  uint16_t T38FaxVersion;
1179  uint32_t T38MaxBitRate;
1186  const char *T38FaxUdpEC;
1187  const char *T38VendorInfo;
1188  const char *remote_ip;
1189  uint16_t remote_port;
1190  const char *local_ip;
1191  uint16_t local_port;
1192  const char *sdp_o_line;
1194 
1195 /*!
1196  \enum switch_stack_t
1197  \brief Expression of how to stack a list
1198 <pre>
1199 SWITCH_STACK_BOTTOM - Stack on the bottom
1200 SWITCH_STACK_TOP - Stack on the top
1201 </pre>
1202  */
1203 typedef enum {
1205  SWITCH_STACK_TOP = (1 << 1),
1208 } switch_stack_t;
1209 
1210 /*!
1211  \enum switch_status_t
1212  \brief Common return values
1213 <pre>
1214  SWITCH_STATUS_SUCCESS - General Success (common return value for most functions)
1215  SWITCH_STATUS_FALSE - General Falsehood
1216  SWITCH_STATUS_TIMEOUT - A Timeout has occured
1217  SWITCH_STATUS_RESTART - An indication to restart the previous operation
1218  SWITCH_STATUS_TERM - An indication to terminate
1219  SWITCH_STATUS_NOTIMPL - An indication that requested resource is not impelemented
1220  SWITCH_STATUS_MEMERR - General memory error
1221  SWITCH_STATUS_NOOP - NOTHING
1222  SWITCH_STATUS_RESAMPLE - An indication that a resample has occured
1223  SWITCH_STATUS_GENERR - A general Error
1224  SWITCH_STATUS_INUSE - An indication that requested resource is in use
1225  SWITCH_STATUS_BREAK - A non-fatal break of an operation
1226  SWITCH_STATUS_SOCKERR - A socket error
1227  SWITCH_STATUS_MORE_DATA - Need More Data
1228  SWITCH_STATUS_NOTFOUND - Not Found
1229  SWITCH_STATUS_UNLOAD - Unload
1230  SWITCH_STATUS_NOUNLOAD - Never Unload
1231 </pre>
1232  */
1233 typedef enum {
1260 } switch_status_t;
1261 
1262 
1263 
1264 /*!
1265 \enum switch_log_level_t
1266 \brief Log Level Enumeration
1267 <pre>
1268  SWITCH_LOG_DEBUG - Debug
1269  SWITCH_LOG_INFO - Info
1270  SWITCH_LOG_NOTICE - Notice
1271  SWITCH_LOG_WARNING - Warning
1272  SWITCH_LOG_ERROR - Error
1273  SWITCH_LOG_CRIT - Critical
1274  SWITCH_LOG_ALERT - Alert
1275  SWITCH_LOG_CONSOLE - Console
1276 </pre>
1277  */
1278 typedef enum {
1301 
1302 
1303 /*!
1304 \enum switch_text_channel_t
1305 \brief A target to write log/debug info to
1306 <pre>
1307 SWITCH_CHANNEL_ID_LOG - Write to the currently defined log
1308 SWITCH_CHANNEL_ID_LOG_CLEAN - Write to the currently defined log with no extra file/line/date information
1309 SWITCH_CHANNEL_ID_EVENT - Write to the event engine as a LOG event
1310 </pre>
1311  */
1312 typedef enum {
1318 
1319 typedef enum {
1320  SCSMF_DYNAMIC = (1 << 0),
1325 
1328 static inline const char *switch_const_char_type_check(const char *str) { return str; }
1329 
1330 #define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
1331 #define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
1332 #define SWITCH_CHANNEL_SESSION_LOG_CLEAN(x) SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, switch_core_session_get_uuid((x))
1333 #define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
1334 #define SWITCH_CHANNEL_SESSION_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)switch_core_session_type_check(x)
1335 #define SWITCH_CHANNEL_CHANNEL_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)switch_channel_get_session(x)
1336 #define SWITCH_CHANNEL_UUID_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, switch_const_char_type_check(x)
1337 
1338 typedef enum {
1349 
1350 typedef enum {
1359 
1360 
1361 /*!
1362  \enum switch_channel_state_t
1363  \brief Channel States (these are the defaults, CS_SOFT_EXECUTE, CS_EXCHANGE_MEDIA, and CS_CONSUME_MEDIA are often overridden by specific apps)
1364 <pre>
1365 CS_NEW - Channel is newly created.
1366 CS_INIT - Channel has been initialized.
1367 CS_ROUTING - Channel is looking for an extension to execute.
1368 CS_SOFT_EXECUTE - Channel is ready to execute from 3rd party control.
1369 CS_EXECUTE - Channel is executing it's dialplan.
1370 CS_EXCHANGE_MEDIA - Channel is exchanging media with another channel.
1371 CS_PARK - Channel is accepting media awaiting commands.
1372 CS_CONSUME_MEDIA - Channel is consuming all media and dropping it.
1373 CS_HIBERNATE - Channel is in a sleep state.
1374 CS_RESET - Channel is in a reset state.
1375 CS_HANGUP - Channel is flagged for hangup and ready to end.
1376 CS_REPORTING - Channel is ready to collect call detail.
1377 CS_DESTROY - Channel is ready to be destroyed and out of the state machine.
1378 </pre>
1379  */
1380 typedef enum {
1396 
1397 typedef enum {
1402 
1403 
1404 /*!
1405  \enum switch_channel_flag_t
1406  \brief Channel Flags
1407 
1408 <pre>
1409 CF_ANSWERED - Channel is answered
1410 CF_OUTBOUND - Channel is an outbound channel
1411 CF_EARLY_MEDIA - Channel is ready for audio before answer
1412 CF_ORIGINATOR - Channel is an originator
1413 CF_TRANSFER - Channel is being transfered
1414 CF_ACCEPT_CNG - Channel will accept CNG frames
1415 CF_REDIRECT - Channel is being redirected
1416 CF_BRIDGED - Channel in a bridge
1417 CF_HOLD - Channel is on hold
1418 CF_HOLD_BLEG - B leg is on hold
1419 CF_SERVICE - Channel has a service thread
1420 CF_TAGGED - Channel is tagged
1421 CF_WINNER - Channel is the winner
1422 CF_REUSE_CALLER_PROFILE - Channel reuse caller profile
1423 CF_CONTROLLED - Channel is under control
1424 CF_PROXY_MODE - Channel has no media
1425 CF_SUSPEND - Suspend i/o
1426 CF_EVENT_PARSE - Suspend control events
1427 CF_GEN_RINGBACK - Channel is generating it's own ringback
1428 CF_RING_READY - Channel is ready to send ringback
1429 CF_BREAK - Channel should stop what it's doing
1430 CF_BROADCAST - Channel is broadcasting
1431 CF_UNICAST - Channel has a unicast connection
1432 CF_VIDEO - Channel has video
1433 CF_EVENT_LOCK - Don't parse events
1434 CF_RESET - Tell extension parser to reset
1435 CF_ORIGINATING - Channel is originating
1436 CF_STOP_BROADCAST - Signal to stop broadcast
1437 
1438 CF_AUDIO_PAUSE - Audio is not ready to read/write
1439 CF_VIDEO_PAUSE - Video is not ready to read/write
1440 
1441 CF_MEDIA_SET - Session has read codec assigned
1442 
1443 </pre>
1444  */
1445 
1446 typedef enum {
1457  /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
1460 
1461 typedef enum {
1559  CF_PROTO_HOLD, //TFLAG_SIP_HOLD
1561  CF_VIDEO_POSSIBLE,//TFLAG_VIDEO
1634  /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
1635  /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
1638 
1639 typedef struct switch_vid_params_s {
1640  uint32_t width;
1641  uint32_t height;
1642  uint32_t fps;
1643  uint32_t d_width;
1644  uint32_t d_height;
1646 
1647 typedef struct switch_fps_s {
1648  float fps;
1649  int ms;
1650  int samples;
1651 } switch_fps_t;
1652 
1653 
1654 typedef enum {
1655  CF_APP_TAGGED = (1 << 0),
1656  CF_APP_T38 = (1 << 1),
1657  CF_APP_T38_REQ = (1 << 2),
1658  CF_APP_T38_FAIL = (1 << 3),
1662 
1663 
1664 /*!
1665  \enum switch_frame_flag_t
1666  \brief Frame Flags
1667 
1668 <pre>
1669 SFF_CNG = (1 << 0) - Frame represents comfort noise
1670 SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible
1671 SFF_RTP_HEADER = (1 << 2) - Get the rtp header from the frame header
1672 SFF_PLC = (1 << 3) - Frame has generated PLC data
1673 SFF_RFC2833 = (1 << 4) - Frame has rfc2833 dtmf data
1674 SFF_DYNAMIC = (1 << 5) - Frame is dynamic and should be freed
1675 SFF_MARKER = (1 << 11) - Frame flag has Marker set, only set by encoder
1676 SFF_WAIT_KEY_FRAME = (1 << 12) - Need a key from before could decode, or force generate a key frame on encode
1677 </pre>
1678  */
1679 typedef enum {
1681  SFF_CNG = (1 << 0),
1682  SFF_RAW_RTP = (1 << 1),
1683  SFF_RTP_HEADER = (1 << 2),
1684  SFF_PLC = (1 << 3),
1685  SFF_RFC2833 = (1 << 4),
1686  SFF_PROXY_PACKET = (1 << 5),
1687  SFF_DYNAMIC = (1 << 6),
1688  SFF_UDPTL_PACKET = (1 << 7),
1689  SFF_NOT_AUDIO = (1 << 8),
1690  SFF_RTCP = (1 << 9),
1691  SFF_MARKER = (1 << 10),
1692  SFF_WAIT_KEY_FRAME = (1 << 11),
1694  SFF_PICTURE_RESET = (1 << 13),
1695  SFF_SAME_IMAGE = (1 << 14),
1697  SFF_ENCODED = (1 << 16),
1698  SFF_TEXT_LINE_BREAK = (1 << 17),
1699  SFF_IS_KEYFRAME = (1 << 18),
1700  SFF_EXTERNAL = (1 << 19)
1702 typedef uint32_t switch_frame_flag_t;
1703 
1704 
1705 typedef enum {
1708  SAF_ROUTING_EXEC = (1 << 1),
1709  SAF_MEDIA_TAP = (1 << 2),
1710  SAF_ZOMBIE_EXEC = (1 << 3),
1711  SAF_NO_LOOPBACK = (1 << 4),
1714 typedef uint32_t switch_application_flag_t;
1715 
1716 typedef enum {
1720 
1721 
1722 /*!
1723  \enum switch_signal_t
1724  \brief Signals to send to channels
1725 <pre>
1726 SWITCH_SIG_KILL - Kill the channel
1727 SWITCH_SIG_XFER - Stop the current io but leave it viable
1728 </pre>
1729  */
1730 
1731 typedef enum {
1736 } switch_signal_t;
1737 
1738 /*!
1739  \enum switch_codec_flag_t
1740  \brief Codec related flags
1741 <pre>
1742 SWITCH_CODEC_FLAG_ENCODE = (1 << 0) - Codec can encode
1743 SWITCH_CODEC_FLAG_DECODE = (1 << 1) - Codec can decode
1744 SWITCH_CODEC_FLAG_SILENCE_START = (1 << 2) - Start period of silence
1745 SWITCH_CODEC_FLAG_SILENCE_STOP = (1 << 3) - End period of silence
1746 SWITCH_CODEC_FLAG_SILENCE = (1 << 4) - Silence
1747 SWITCH_CODEC_FLAG_FREE_POOL = (1 << 5) - Free codec's pool on destruction
1748 SWITCH_CODEC_FLAG_AAL2 = (1 << 6) - USE AAL2 Bitpacking
1749 SWITCH_CODEC_FLAG_PASSTHROUGH = (1 << 7) - Passthrough only
1750 </pre>
1751 */
1752 typedef enum {
1766 typedef uint32_t switch_codec_flag_t;
1767 
1768 
1769 /*!
1770  \enum switch_speech_flag_t
1771  \brief Speech related flags
1772 <pre>
1773 SWITCH_SPEECH_FLAG_HASTEXT = (1 << 0) - Interface is has text to read.
1774 SWITCH_SPEECH_FLAG_PEEK = (1 << 1) - Read data but do not erase it.
1775 SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 2) - Free interface's pool on destruction.
1776 SWITCH_SPEECH_FLAG_BLOCKING = (1 << 3) - Indicate that a blocking call is desired
1777 SWITCH_SPEECH_FLAG_PAUSE = (1 << 4) - Pause toggle for playback
1778 </pre>
1779 */
1780 typedef enum {
1790 typedef uint32_t switch_speech_flag_t;
1791 
1792 /*!
1793  \enum switch_asr_flag_t
1794  \brief Asr related flags
1795 <pre>
1796 SWITCH_ASR_FLAG_DATA = (1 << 0) - Interface has data
1797 SWITCH_ASR_FLAG_FREE_POOL = (1 << 1) - Pool needs to be freed
1798 SWITCH_ASR_FLAG_CLOSED = (1 << 2) - Interface has been closed
1799 SWITCH_ASR_FLAG_FIRE_EVENTS = (1 << 3) - Fire all speech events
1800 SWITCH_ASR_FLAG_AUTO_RESUME = (1 << 4) - Auto Resume
1801 </pre>
1802 */
1803 typedef enum {
1810 
1812 typedef uint32_t switch_asr_flag_t;
1813 
1814 /*!
1815  \enum switch_directory_flag_t
1816  \brief Directory Handle related flags
1817 <pre>
1818 SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0) - Free interface's pool on destruction.
1819 </pre>
1820 */
1821 typedef enum {
1823 
1825 typedef uint32_t switch_directory_flag_t;
1826 
1827 /*!
1828  \enum switch_codec_type_t
1829  \brief Codec types
1830 <pre>
1831 SWITCH_CODEC_TYPE_AUDIO - Audio Codec
1832 SWITCH_CODEC_TYPE_VIDEO - Video Codec
1833 SWITCH_CODEC_TYPE_T38 - T38 Codec
1834 SWITCH_CODEC_TYPE_APP - Application Codec
1835 </pre>
1836  */
1837 typedef enum {
1843 
1844 typedef enum {
1849 #define SWITCH_MEDIA_TYPE_TOTAL 3
1850 
1851 
1852 /*!
1853  \enum switch_timer_flag_t
1854  \brief Timer related flags
1855 <pre>
1856 SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0) - Free timer's pool on destruction
1857 </pre>
1858 */
1859 typedef enum {
1862 typedef uint32_t switch_timer_flag_t;
1863 
1864 
1865 /*!
1866  \enum switch_timer_flag_t
1867  \brief Timer related flags
1868 <pre>
1869 SMBF_READ_STREAM - Include the Read Stream
1870 SMBF_WRITE_STREAM - Include the Write Stream
1871 SMBF_WRITE_REPLACE - Replace the Write Stream
1872 SMBF_READ_REPLACE - Replace the Read Stream
1873 SMBF_STEREO - Record in stereo
1874 SMBF_ANSWER_REQ - Don't record until the channel is answered
1875 SMBF_BRIDGE_REQ - Don't record until the channel is bridged
1876 SMBF_THREAD_LOCK - Only let the same thread who created the bug remove it.
1877 SMBF_PRUNE -
1878 SMBF_NO_PAUSE -
1879 SMBF_STEREO_SWAP - Record in stereo: Write Stream - left channel, Read Stream - right channel
1880 </pre>
1881 */
1882 typedef enum {
1884  SMBF_READ_STREAM = (1 << 0),
1885  SMBF_WRITE_STREAM = (1 << 1),
1887  SMBF_READ_REPLACE = (1 << 3),
1888  SMBF_READ_PING = (1 << 4),
1889  SMBF_STEREO = (1 << 5),
1890  SMBF_ANSWER_REQ = (1 << 6),
1891  SMBF_BRIDGE_REQ = (1 << 7),
1892  SMBF_THREAD_LOCK = (1 << 8),
1893  SMBF_PRUNE = (1 << 9),
1894  SMBF_NO_PAUSE = (1 << 10),
1895  SMBF_STEREO_SWAP = (1 << 11),
1896  SMBF_LOCK = (1 << 12),
1899  SMBF_ONE_ONLY = (1 << 15),
1900  SMBF_MASK = (1 << 16),
1905  SMBF_VIDEO_PATCH = (1 << 21),
1910  SMBF_FIRST = (1 << 26),
1911  SMBF_PAUSE = (1 << 27)
1913 typedef uint32_t switch_media_bug_flag_t;
1914 
1915 /*!
1916  \enum switch_file_flag_t
1917  \brief File flags
1918 <pre>
1919 SWITCH_FILE_FLAG_READ = (1 << 0) - Open for read
1920 SWITCH_FILE_FLAG_WRITE = (1 << 1) - Open for write
1921 SWITCH_FILE_FLAG_FREE_POOL = (1 << 2) - Free file handle's pool on destruction
1922 SWITCH_FILE_DATA_SHORT = (1 << 3) - Read data in shorts
1923 SWITCH_FILE_DATA_INT = (1 << 4) - Read data in ints
1924 SWITCH_FILE_DATA_FLOAT = (1 << 5) - Read data in floats
1925 SWITCH_FILE_DATA_DOUBLE = (1 << 6) - Read data in doubles
1926 SWITCH_FILE_DATA_RAW = (1 << 7) - Read data as is
1927 SWITCH_FILE_PAUSE = (1 << 8) - Pause
1928 SWITCH_FILE_NATIVE = (1 << 9) - File is in native format (no transcoding)
1929 SWITCH_FILE_SEEK = (1 << 10) - File has done a seek
1930 SWITCH_FILE_OPEN = (1 << 11) - File is open
1931 </pre>
1932  */
1933 typedef enum {
1942  SWITCH_FILE_PAUSE = (1 << 8),
1944  SWITCH_FILE_SEEK = (1 << 10),
1945  SWITCH_FILE_OPEN = (1 << 11),
1947  SWITCH_FILE_DONE = (1 << 13),
1951  SWITCH_FILE_NOMUX = (1 << 17),
1957 typedef uint32_t switch_file_flag_t;
1958 
1959 typedef enum {
1966 typedef uint32_t switch_io_flag_t;
1967 
1968 /* make sure this is synced with the EVENT_NAMES array in switch_event.c
1969  also never put any new ones before EVENT_ALL
1970 */
1971 /*!
1972  \enum switch_event_types_t
1973  \brief Built-in Events
1974 
1975 <pre>
1976  SWITCH_EVENT_CUSTOM - A custom event
1977  SWITCH_EVENT_CLONE - A cloned event
1978  SWITCH_EVENT_CHANNEL_CREATE - A channel has been created
1979  SWITCH_EVENT_CHANNEL_DESTROY - A channel has been destroyed
1980  SWITCH_EVENT_CHANNEL_STATE - A channel has changed state
1981  SWITCH_EVENT_CHANNEL_CALLSTATE - A channel has changed call state
1982  SWITCH_EVENT_CHANNEL_ANSWER - A channel has been answered
1983  SWITCH_EVENT_CHANNEL_HANGUP - A channel has been hungup
1984  SWITCH_EVENT_CHANNEL_HANGUP_COMPLETE - A channel has completed the hangup
1985  SWITCH_EVENT_CHANNEL_EXECUTE - A channel has executed a module's application
1986  SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE - A channel has finshed executing a module's application
1987  SWITCH_EVENT_CHANNEL_HOLD - A channel has been put on hold
1988  SWITCH_EVENT_CHANNEL_UNHOLD - A channel has been unheld
1989  SWITCH_EVENT_CHANNEL_BRIDGE - A channel has bridged to another channel
1990  SWITCH_EVENT_CHANNEL_UNBRIDGE - A channel has unbridged from another channel
1991  SWITCH_EVENT_CHANNEL_PROGRESS - A channel has started ringing
1992  SWITCH_EVENT_CHANNEL_PROGRESS_MEDIA - A channel has started early media
1993  SWITCH_EVENT_CHANNEL_OUTGOING - A channel has been unparked
1994  SWITCH_EVENT_CHANNEL_PARK - A channel has been parked
1995  SWITCH_EVENT_CHANNEL_UNPARK - A channel has been unparked
1996  SWITCH_EVENT_CHANNEL_APPLICATION- A channel has called and event from an application
1997  SWITCH_EVENT_CHANNEL_ORIGINATE - A channel has been originated
1998  SWITCH_EVENT_CHANNEL_UUID - A channel has changed uuid
1999  SWITCH_EVENT_API - An API call has been executed
2000  SWITCH_EVENT_LOG - A LOG event has been triggered
2001  SWITCH_EVENT_INBOUND_CHAN - A new inbound channel has been created
2002  SWITCH_EVENT_OUTBOUND_CHAN - A new outbound channel has been created
2003  SWITCH_EVENT_STARTUP - The system has been started
2004  SWITCH_EVENT_SHUTDOWN - The system has been shutdown
2005  SWITCH_EVENT_PUBLISH - Publish
2006  SWITCH_EVENT_UNPUBLISH - UnPublish
2007  SWITCH_EVENT_TALK - Talking Detected
2008  SWITCH_EVENT_NOTALK - Not Talking Detected
2009  SWITCH_EVENT_SESSION_CRASH - Session Crashed
2010  SWITCH_EVENT_MODULE_LOAD - Module was loaded
2011  SWITCH_EVENT_MODULE_UNLOAD - Module was unloaded
2012  SWITCH_EVENT_DTMF - DTMF was sent
2013  SWITCH_EVENT_MESSAGE - A Basic Message
2014  SWITCH_EVENT_PRESENCE_IN - Presence in
2015  SWITCH_EVENT_NOTIFY_IN - Received incoming NOTIFY from gateway subscription
2016  SWITCH_EVENT_PRESENCE_OUT - Presence out
2017  SWITCH_EVENT_PRESENCE_PROBE - Presence probe
2018  SWITCH_EVENT_MESSAGE_WAITING - A message is waiting
2019  SWITCH_EVENT_MESSAGE_QUERY - A query for MESSAGE_WAITING events
2020  SWITCH_EVENT_ROSTER - ?
2021  SWITCH_EVENT_CODEC - Codec Change
2022  SWITCH_EVENT_BACKGROUND_JOB - Background Job
2023  SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
2024  SWITCH_EVENT_DETECTED_TONE - Detected Tone
2025  SWITCH_EVENT_PRIVATE_COMMAND - A private command event
2026  SWITCH_EVENT_HEARTBEAT - Machine is alive
2027  SWITCH_EVENT_TRAP - Error Trap
2028  SWITCH_EVENT_ADD_SCHEDULE - Something has been scheduled
2029  SWITCH_EVENT_DEL_SCHEDULE - Something has been unscheduled
2030  SWITCH_EVENT_EXE_SCHEDULE - Something scheduled has been executed
2031  SWITCH_EVENT_RE_SCHEDULE - Something scheduled has been rescheduled
2032  SWITCH_EVENT_RELOADXML - XML registry has been reloaded
2033  SWITCH_EVENT_NOTIFY - Notification
2034  SWITCH_EVENT_PHONE_FEATURE - Notification (DND/CFWD/etc)
2035  SWITCH_EVENT_PHONE_FEATURE_SUBSCRIBE - Phone feature subscription
2036  SWITCH_EVENT_SEND_MESSAGE - Message
2037  SWITCH_EVENT_RECV_MESSAGE - Message
2038  SWITCH_EVENT_REQUEST_PARAMS
2039  SWITCH_EVENT_CHANNEL_DATA
2040  SWITCH_EVENT_GENERAL
2041  SWITCH_EVENT_COMMAND
2042  SWITCH_EVENT_SESSION_HEARTBEAT
2043  SWITCH_EVENT_CLIENT_DISCONNECTED
2044  SWITCH_EVENT_SERVER_DISCONNECTED
2045  SWITCH_EVENT_SEND_INFO
2046  SWITCH_EVENT_RECV_INFO
2047  SWITCH_EVENT_RECV_RTCP_MESSAGE
2048  SWITCH_EVENT_SEND_RTCP_MESSAGE
2049  SWITCH_EVENT_CALL_SECURE
2050  SWITCH_EVENT_NAT - NAT Management (new/del/status)
2051  SWITCH_EVENT_RECORD_START
2052  SWITCH_EVENT_RECORD_STOP
2053  SWITCH_EVENT_PLAYBACK_START
2054  SWITCH_EVENT_PLAYBACK_STOP
2055  SWITCH_EVENT_CALL_UPDATE
2056  SWITCH_EVENT_FAILURE - A failure occurred which might impact the normal functioning of the switch
2057  SWITCH_EVENT_SOCKET_DATA
2058  SWITCH_EVENT_MEDIA_BUG_START
2059  SWITCH_EVENT_MEDIA_BUG_STOP
2060  SWITCH_EVENT_CONFERENCE_DATA_QUERY
2061  SWITCH_EVENT_CONFERENCE_DATA
2062  SWITCH_EVENT_CALL_SETUP_REQ
2063  SWITCH_EVENT_CALL_SETUP_RESULT
2064  SWITCH_EVENT_CALL_DETAIL
2065  SWITCH_EVENT_DEVICE_STATE
2066  SWITCH_EVENT_SHUTDOWN_REQUESTED - Shutdown of the system has been requested
2067  SWITCH_EVENT_ALL - All events at once
2068 </pre>
2069 
2070  */
2071 typedef enum {
2166 
2167 typedef enum {
2171 
2172 typedef enum {
2256 
2257 typedef enum {
2304 
2305 typedef enum {
2306  SSH_FLAG_STICKY = (1 << 0),
2309 
2310 #ifdef WIN32
2311 typedef SOCKET switch_os_socket_t;
2312 #define SWITCH_SOCK_INVALID INVALID_SOCKET
2313 #else
2315 #define SWITCH_SOCK_INVALID -1
2316 #endif
2317 
2318 typedef struct fspr_pool_t switch_memory_pool_t;
2319 typedef void* switch_plc_state_t;
2320 typedef uint16_t switch_port_t;
2321 typedef uint8_t switch_payload_t;
2323 typedef struct switch_rtp switch_rtp_t;
2324 typedef struct switch_rtcp switch_rtcp_t;
2348 typedef struct switch_odbc_handle switch_odbc_handle_t;
2350 
2374 
2375 typedef void (*hashtable_destructor_t)(void *ptr);
2376 
2378  char *val;
2380 };
2382 
2386  int count;
2387  int dynamic;
2388 };
2390 
2391 typedef void (*switch_media_bug_exec_cb_t)(switch_media_bug_t *bug, void *user_data);
2392 
2395 typedef void (*switch_cap_callback_t) (const char *var, const char *val, void *user_data);
2398 typedef switch_bool_t (*switch_tone_detect_callback_t) (switch_core_session_t *, const char *, const char *);
2400 
2401 typedef void (*switch_engine_function_t) (switch_core_session_t *session, void *user_data);
2402 
2403 
2405  switch_codec_t *other_codec,
2406  void *decoded_data,
2407  uint32_t decoded_data_len,
2408  uint32_t decoded_rate,
2409  void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag);
2410 
2411 
2413  switch_codec_t *other_codec,
2414  void *encoded_data,
2415  uint32_t encoded_data_len,
2416  uint32_t encoded_rate,
2417  void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag);
2418 
2420 
2422 
2423 typedef enum {
2433 
2434 typedef enum {
2439 
2440 typedef enum {
2444 
2446  switch_codec_control_command_t cmd,
2447  switch_codec_control_type_t ctype,
2448  void *cmd_data,
2449  switch_codec_control_type_t atype,
2450  void *cmd_arg,
2451  switch_codec_control_type_t *rtype,
2452  void **ret_data);
2453 
2454 
2458 
2459 
2461 #define SWITCH_STANDARD_CHAT_APP(name) static switch_status_t name (switch_event_t *message, const char *data)
2462 
2463 typedef void (*switch_application_function_t) (switch_core_session_t *, const char *);
2464 #define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, const char *data)
2465 
2466 typedef int (*switch_core_recover_callback_t)(switch_core_session_t *session);
2467 typedef void (*switch_event_callback_t) (switch_event_t *);
2468 typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);
2469 #define SWITCH_STANDARD_DIALPLAN(name) static switch_caller_extension_t *name (switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
2470 
2471 typedef switch_bool_t (*switch_hash_delete_callback_t) (_In_ const void *key, _In_ const void *val, _In_opt_ void *pData);
2472 #define SWITCH_HASH_DELETE_FUNC(name) static switch_bool_t name (const void *key, const void *val, void *pData)
2473 
2475 
2477 
2478 #define SWITCH_STANDARD_SCHED_FUNC(name) static void name (switch_scheduler_task_t *task)
2479 
2480 typedef switch_status_t (*switch_state_handler_t) (switch_core_session_t *);
2482 typedef uint8_t * (*switch_stream_handle_read_function_t) (switch_stream_handle_t *handle, int *len);
2485 
2486 typedef switch_status_t (*switch_api_function_t) (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session,
2487  _In_ switch_stream_handle_t *stream);
2488 
2489 
2490 #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)
2491 
2492 
2493 typedef switch_status_t (*switch_json_api_function_t) (const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply);
2494 
2495 
2496 #define SWITCH_STANDARD_JSON_API(name) static switch_status_t name (const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
2497 
2498 typedef switch_status_t (*switch_input_callback_function_t) (switch_core_session_t *session, void *input,
2499  switch_input_type_t input_type, void *buf, unsigned int buflen);
2500 typedef switch_status_t (*switch_read_frame_callback_function_t) (switch_core_session_t *session, switch_frame_t *frame, void *user_data);
2502 
2503 #define DMACHINE_MAX_DIGIT_LEN 512
2504 
2505 typedef enum {
2508 } dm_match_type_t;
2509 
2510 struct switch_ivr_dmachine;
2512 
2515  const char *match_digits;
2516  int32_t match_key;
2517  dm_match_type_t type;
2518  void *user_data;
2519 };
2520 
2523 
2524 #define MAX_ARG_RECURSION 25
2525 
2526 #define arg_recursion_check_start(_args) if (_args) { \
2527  if (_args->loops >= MAX_ARG_RECURSION) { \
2528  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, \
2529  "RECURSION ERROR! It's not the best idea to call things that collect input recursively from an input callback.\n"); \
2530  return SWITCH_STATUS_GENERR; \
2531  } else {_args->loops++;} \
2532  }
2533 
2534 
2535 #define arg_recursion_check_stop(_args) if (_args) _args->loops--
2536 
2537 typedef struct {
2539  void *buf;
2540  uint32_t buflen;
2542  void *user_data;
2544  int loops;
2546 
2547 
2548 typedef struct {
2549  switch_say_type_t type;
2550  switch_say_method_t method;
2551  switch_say_gender_t gender;
2552  const char *ext;
2554 
2555 
2556 typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session,
2557  char *tosay,
2558  switch_say_args_t *say_args,
2559  switch_input_args_t *args);
2560 
2561 typedef switch_status_t (*switch_say_string_callback_t) (switch_core_session_t *session,
2562  char *tosay,
2563  switch_say_args_t *say_args, char **rstr);
2564 
2565 struct switch_say_file_handle;
2567 
2569  char *tosay,
2570  switch_say_args_t *say_args);
2571 
2572 
2573 typedef struct switch_xml *switch_xml_t;
2575 typedef switch_xml_t(*switch_xml_open_root_function_t) (uint8_t reload, const char **err, void *user_data);
2576 typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
2577  const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
2578  void *user_data);
2579 
2580 struct switch_hashtable;
2585 
2586 struct switch_network_list;
2588 
2589 
2590 #define SWITCH_API_VERSION 5
2591 #define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
2592 #define SWITCH_MODULE_RUNTIME_ARGS (void)
2593 #define SWITCH_MODULE_SHUTDOWN_ARGS (void)
2594 typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS;
2595 typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS;
2596 typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS;
2597 #define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS
2598 #define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS
2599 #define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS
2600 
2601 typedef enum {
2607 
2608 typedef enum {
2612 typedef uint32_t switch_module_flag_t;
2613 
2616  switch_module_load_t load;
2617  switch_module_shutdown_t shutdown;
2618  switch_module_runtime_t runtime;
2619  switch_module_flag_t flags;
2621 
2622 typedef int (*switch_modulename_callback_func_t) (void *user_data, const char *module_name);
2623 
2625 
2626 #define SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, flags) \
2627 static const char modname[] = #name ; \
2628 SWITCH_MOD_DECLARE_DATA switch_loadable_module_function_table_t name##_module_interface = { \
2629  SWITCH_API_VERSION, \
2630  load, \
2631  shutdown, \
2632  runtime, \
2633  flags \
2634 }
2635 
2636 #define SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime) \
2637  SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, SMODF_NONE)
2638 
2639 /* things we don't deserve to know about */
2640 /*! \brief A channel */
2641 struct switch_channel;
2642 /*! \brief A core session representing a call and all of it's resources */
2643 struct switch_core_session;
2644 /*! \brief An audio bug */
2645 struct switch_media_bug;
2646 /*! \brief A digit stream parser object */
2648 struct sql_queue_manager;
2649 
2650 struct switch_media_handle_s;
2652 
2653 typedef uint32_t switch_event_channel_id_t;
2654 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);
2655 
2656 struct switch_live_array_s;
2658 
2659 typedef enum {
2663 
2664 
2665 typedef enum {
2679 
2680 /* Keep in sync with CRYPTO_KEY_PARAM_METHOD table. */
2681 typedef enum {
2682  CRYPTO_KEY_PARAM_METHOD_INLINE, /* identified by "inline" chars in SRTP key parameter */
2685 
2686 typedef struct payload_map_s {
2687  switch_media_type_t type;
2688  switch_sdp_type_t sdp_type;
2689  uint32_t ptime;
2690  uint32_t rate;
2691  uint8_t allocated;
2692  uint8_t negotiated;
2693  uint8_t current;
2694  unsigned long hash;
2695 
2697  char *iananame;
2698  char *modname;
2699  switch_payload_t pt;
2700  unsigned long rm_rate;
2701  unsigned long adv_rm_rate;
2702  uint32_t codec_ms;
2703  uint32_t bitrate;
2704 
2705  char *rm_fmtp;
2706 
2707  switch_payload_t recv_pt;
2708 
2709  char *fmtp_out;
2710 
2712  switch_port_t remote_sdp_port;
2713 
2716 
2718 
2719 } payload_map_t;
2720 
2721 typedef enum {
2728 
2729 typedef enum {
2730  ICE_GOOGLE_JINGLE = (1 << 0),
2731  ICE_VANILLA = (1 << 1),
2732  ICE_CONTROLLED = (1 << 2),
2733  ICE_LITE = (1 << 3)
2735 
2736 typedef enum {
2737  SWITCH_POLL_READ = (1 << 0),
2738  SWITCH_POLL_WRITE = (1 << 1),
2739  SWITCH_POLL_ERROR = (1 << 2),
2740  SWITCH_POLL_HUP = (1 << 3),
2743  SWITCH_POLL_PRI = (1 << 6),
2745 } switch_poll_t;
2746 
2747 typedef struct switch_waitlist_s {
2748  switch_os_socket_t sock;
2749  uint32_t events;
2750  uint32_t revents;
2752 
2753 struct switch_jb_s;
2754 typedef struct switch_jb_s switch_jb_t;
2755 
2756 //struct kalman_estimator_s;
2757 //typedef struct kalman_estimator_s kalman_estimator_t;
2758 
2759 //struct cusum_kalman_detector_s;
2760 //typedef struct cusum_kalman_detector_s cusum_kalman_detector_t;
2761 
2764 
2765 struct switch_frame_buffer_s;
2767 
2768 typedef enum {
2769  SVR_BLOCK = (1 << 0),
2770  SVR_FLUSH = (1 << 1),
2771  SVR_CHECK = (1 << 2)
2773 
2774 typedef enum {
2779 
2780 typedef enum {
2786 
2787 
2791 
2792 struct switch_chromakey_s;
2794 
2795 typedef enum {
2801 
2802 typedef enum {
2807 
2808 typedef struct switch_mm_s {
2811  int keyint;
2812  int ab;
2813  int vb;
2814  int vw;
2815  int vh;
2816  int cbr;
2817  float fps;
2818  float source_fps;
2820  int vbuf;
2821  switch_video_profile_t vprofile;
2822  switch_video_encode_speed_t vencspd;
2824  int scale_w;
2825  int scale_h;
2829 } switch_mm_t;
2830 
2831 #define SWITCH_RTP_MAX_CRYPTO_LEN 64
2832 
2833 /* If MKI is used, then one or more key-materials are present in the <key-params> section of the crypto attribute.
2834  * This struct describes the single MKI entry (key-material) within <key-params> section of crypto attribute.
2835  * Key-material follows the format:
2836  * "inline:" <key||salt> ["|" lifetime] ["|" MKI ":" length]
2837  * which translates to
2838  * "inline: KEYSALT|MKI_ID:MKI_SZ" or "inline: KEYSALT|LIFETIME|MKI_ID:MKI_SZ" */
2840  switch_rtp_crypto_key_param_method_type_t method;
2841  unsigned char raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; /* Key-salt. Master key appended with salt. Sizes determined by crypto suite. */
2842  char *crypto_key; /* Complete key material string ("method:keysalt[|lifetime]|mki"). */
2843  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. */
2844  unsigned int mki_id; /* OPTIONAL. */
2845  unsigned int mki_size; /* OPTIONAL. Byte length of the master key field in the RTP packet. */
2846  struct switch_crypto_key_material_s *next; /* NULL if this is the last master key in crypto attribute set. */
2848 
2849 typedef struct secure_settings_s {
2851  unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN];
2852  unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN];
2853  switch_rtp_crypto_key_type_t crypto_type;
2856 
2857  /*
2858  * MKI support (as per rfc4568).
2859  * Normally single crypto attribute contains one key-material in a <key-params> section, e.g. "inline: KEYSALT" or "inline: KEYSALT|2^LIFETIME_BITS".
2860  * 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:
2861  *
2862  * "inline:" <key||salt> ["|" lifetime] ["|" MKI ":" length]
2863  *
2864  * "inline: KEYSALT|MKI_ID:MKI_SZ"
2865  * or
2866  * "inline: KEYSALT|2^LIFETIME_BITS|MKI_ID:MKI_SZ"
2867  *
2868  * 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.
2869  */
2870  struct switch_crypto_key_material_s *local_key_material_next; /* NULL if MKI not used for crypto set on outbound SRTP. */
2871  unsigned long local_key_material_n; /* number of key_materials in the linked list for outbound SRTP */
2872  struct switch_crypto_key_material_s *remote_key_material_next; /* NULL if MKI not used for crypto set on inbound SRTP. */
2873  unsigned long remote_key_material_n; /* number of key_materials in the linked list for inbound SRTP */
2875 
2876 /* Default MKI index used for packets send from FS. We always use first key if multiple master keys are present in the crypto attribute. */
2877 #define SWITCH_CRYPTO_MKI_INDEX 0
2878 
2879 /* max number of MKI in a single crypto line supported */
2880 #define SWITCH_CRYPTO_MKI_MAX 20
2881 
2882 struct switch_dial_handle_s;
2884 
2885 struct switch_dial_leg_s;
2887 
2888 struct switch_dial_leg_list_s;
2890 
2893 
2895 #endif
2896 /* For Emacs:
2897  * Local Variables:
2898  * mode:c
2899  * indent-tabs-mode:t
2900  * tab-width:4
2901  * c-basic-offset:4
2902  * End:
2903  * For VIM:
2904  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
2905  */
uint32_t switch_bind_flag_t
Definition: switch_types.h:318
switch_size_t flaws
Definition: switch_types.h:712
A module interface to implement an application.
switch_caller_profile_flag_enum_t
Definition: switch_types.h:603
struct switch_waitlist_s switch_waitlist_t
uint8_t allocated
switch_size_t period_packet_count
Definition: switch_types.h:685
switch_bind_flag_enum_t
Definition: switch_types.h:308
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:429
switch_rtp_numbers_t inbound
Definition: switch_types.h:760
switch_abc_type_t
Definition: switch_types.h:516
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:766
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:303
switch_byte_t frame_bits
Definition: switch_types.h:541
uint32_t switch_speech_flag_t
unsigned long adv_rm_rate
switch_pvt_class_t
Definition: switch_types.h:258
switch_bool_t
Definition: switch_types.h:437
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:613
switch_ivr_dmachine_t * dmachine
switch_size_t largest_jb_size
Definition: switch_types.h:692
struct error_period * next
Definition: switch_types.h:677
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:546
switch_digit_action_target_t
Definition: switch_types.h:283
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:511
switch_channel_cap_t
Abstract interface to a chat module.
switch_core_flag_enum_t
Definition: switch_types.h:360
struct switch_console_callback_match_node * head
switch_size_t last_flaw
Definition: switch_types.h:713
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:493
A representation of an XML tree.
Definition: switch_xml.h:79
switch_eavesdrop_flag_enum_t
Definition: switch_types.h:346
switch_xml_section_enum_t
Definition: switch_types.h:632
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:335
switch_bool_t T38FaxTranscodingJBIG
A table of functions that a timer module implements.
switch_size_t media_bytes
Definition: switch_types.h:683
uint32_t duration
Definition: switch_types.h:298
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:689
switch_video_profile_t vprofile
char * auth_password
uint32_t switch_core_flag_t
Definition: switch_types.h:395
switch_vad_flag_enum_t
Definition: switch_types.h:655
struct switch_crypto_key_material_s * next
dtmf_flag_t
Definition: switch_types.h:291
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:675
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:661
switch_rw_t
Definition: switch_types.h:598
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:762
switch_byte_t switch_byte_t * buf
int64_t stop
Definition: switch_types.h:674
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:539
switch_chat_application_flag_enum_t
dm_match_type_t
switch_size_t raw_bytes
Definition: switch_types.h:682
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:427
switch_rtp_bug_flag_t
Definition: switch_types.h:848
unsigned long local_key_material_n
Abstract interface to a management module.
switch_byte_t * buf
Definition: switch_types.h:534
switch_status_t(* switch_state_handler_t)(switch_core_session_t *)
switch_session_ctl_t
switch_byte_t this_byte
Definition: switch_types.h:543
uint32_t switch_xml_section_t
Definition: switch_types.h:643
#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:663
switch_say_gender_t
Definition: switch_types.h:474
switch_rtp_numbers_t outbound
Definition: switch_types.h:761
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:397
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:275
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:544
switch_video_profile_t
uint32_t switch_eavesdrop_flag_t
Definition: switch_types.h:358
uint32_t consecutive_flaws
Definition: switch_types.h:676
switch_speech_flag_enum_t
int64_t start
Definition: switch_types.h:673
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:684
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:320
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:688
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:687
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:756
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:337
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:716
switch_byte_t shiftby
Definition: switch_types.h:542
switch_frame_flag_enum_t
switch_rtcp_video_counters_t video_in
Definition: switch_types.h:754
switch_file_command_t
switch_originate_flag_enum_t
Definition: switch_types.h:325
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:739
An abstraction of a rtcp frame.
const char * remote_ip
switch_rtp_flag_t
RTP Related Flags.
Definition: switch_types.h:793
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:691
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:686
uint32_t switch_port_flag_t
Definition: switch_types.h:344
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:452
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:443
uint32_t switch_media_flag_t
Definition: switch_types.h:509
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:536
switch_dtmf_source_t source
Definition: switch_types.h:300
switch_payload_t recv_pt
switch_byte_t over
Definition: switch_types.h:545
A table of settings and callbacks that define a paticular implementation of a codec.
switch_byte_t bits_rem
Definition: switch_types.h:540
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:435
#define _In_opt_z_
uint32_t switch_caller_profile_flag_t
Definition: switch_types.h:611
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:487
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:424
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:495
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:481
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:690
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 *)