2005-11-19 20:07:43 +00:00
/*
* FreeSWITCH Modular Media Switching Software Library / Soft - Switch Application
2014-02-05 21:02:28 +00:00
* Copyright ( C ) 2005 - 2014 , Anthony Minessale II < anthm @ freeswitch . org >
2005-11-19 20:07:43 +00:00
*
* Version : MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 ( the " License " ) ; you may not use this file except in compliance with
* the License . You may obtain a copy of the License at
* http : //www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an " AS IS " basis ,
* WITHOUT WARRANTY OF ANY KIND , either express or implied . See the License
* for the specific language governing rights and limitations under the
* License .
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft - Switch Application
*
* The Initial Developer of the Original Code is
2009-02-04 21:20:54 +00:00
* Anthony Minessale II < anthm @ freeswitch . org >
2005-11-19 20:07:43 +00:00
* Portions created by the Initial Developer are Copyright ( C )
* the Initial Developer . All Rights Reserved .
*
* Contributor ( s ) :
*
2009-02-04 21:20:54 +00:00
* Anthony Minessale II < anthm @ freeswitch . org >
2007-06-04 22:10:42 +00:00
* Bret McDanel < trixter AT 0xdecafbad dot com >
2011-12-14 19:23:54 +00:00
* Joseph Sullivan < jossulli @ amazon . com >
2012-08-31 20:35:13 +00:00
* Raymond Chandler < intralanman @ freeswitch . org >
2013-10-24 19:29:29 +00:00
* Emmanuel Schmidbauer < e . schmidbauer @ gmail . com >
2005-11-19 20:07:43 +00:00
*
* switch_types . h - - Data Types
*
*/
2006-01-02 05:00:28 +00:00
/*! \file switch_types.h
\ brief Data Types
2006-01-01 15:23:12 +00:00
*/
2005-11-19 20:07:43 +00:00
# ifndef SWITCH_TYPES_H
# define SWITCH_TYPES_H
# include <switch.h>
2013-10-15 21:24:32 +00:00
# include <switch_json.h>
2011-03-30 00:55:28 +00:00
2006-09-07 14:23:31 +00:00
SWITCH_BEGIN_EXTERN_C
2009-11-18 20:25:49 +00:00
# define SWITCH_ENT_ORIGINATE_DELIM ":_:"
2007-09-29 01:06:08 +00:00
# define SWITCH_BLANK_STRING ""
2010-02-26 16:33:02 +00:00
# define SWITCH_TON_UNDEF 255
# define SWITCH_NUMPLAN_UNDEF 255
2008-07-14 17:09:47 +00:00
# ifdef WIN32
# define SWITCH_SEQ_FWHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
# define SWITCH_SEQ_FRED FOREGROUND_RED | FOREGROUND_INTENSITY
# define SWITCH_SEQ_FMAGEN FOREGROUND_BLUE | FOREGROUND_RED
# define SWITCH_SEQ_FCYAN FOREGROUND_GREEN | FOREGROUND_BLUE
# define SWITCH_SEQ_FGREEN FOREGROUND_GREEN
# define SWITCH_SEQ_FYELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
2008-07-22 16:43:00 +00:00
# define SWITCH_SEQ_DEFAULT_COLOR SWITCH_SEQ_FWHITE
2008-07-14 17:09:47 +00:00
# else
2007-02-28 18:28:07 +00:00
# define SWITCH_SEQ_ESC "\033["
/* Ansi Control character suffixes */
# define SWITCH_SEQ_HOME_CHAR 'H'
# define SWITCH_SEQ_HOME_CHAR_STR "H"
# define SWITCH_SEQ_CLEARLINE_CHAR '1'
# define SWITCH_SEQ_CLEARLINE_CHAR_STR "1"
# define SWITCH_SEQ_CLEARLINEEND_CHAR "K"
# define SWITCH_SEQ_CLEARSCR_CHAR0 '2'
# define SWITCH_SEQ_CLEARSCR_CHAR1 'J'
# define SWITCH_SEQ_CLEARSCR_CHAR "2J"
2007-03-29 22:31:56 +00:00
# define SWITCH_SEQ_DEFAULT_COLOR SWITCH_SEQ_ESC SWITCH_SEQ_END_COLOR /* Reset to Default fg/bg color */
# define SWITCH_SEQ_AND_COLOR ";" /* To add multiple color definitions */
# define SWITCH_SEQ_END_COLOR "m" /* To end color definitions */
2007-02-28 18:28:07 +00:00
/* Foreground colors values */
# define SWITCH_SEQ_F_BLACK "30"
# define SWITCH_SEQ_F_RED "31"
# define SWITCH_SEQ_F_GREEN "32"
# define SWITCH_SEQ_F_YELLOW "33"
# define SWITCH_SEQ_F_BLUE "34"
# define SWITCH_SEQ_F_MAGEN "35"
# define SWITCH_SEQ_F_CYAN "36"
# define SWITCH_SEQ_F_WHITE "37"
/* Background colors values */
# define SWITCH_SEQ_B_BLACK "40"
# define SWITCH_SEQ_B_RED "41"
# define SWITCH_SEQ_B_GREEN "42"
# define SWITCH_SEQ_B_YELLOW "43"
# define SWITCH_SEQ_B_BLUE "44"
# define SWITCH_SEQ_B_MAGEN "45"
# define SWITCH_SEQ_B_CYAN "46"
# define SWITCH_SEQ_B_WHITE "47"
/* Preset escape sequences - Change foreground colors only */
# define SWITCH_SEQ_FBLACK SWITCH_SEQ_ESC SWITCH_SEQ_F_BLACK SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FRED SWITCH_SEQ_ESC SWITCH_SEQ_F_RED SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FGREEN SWITCH_SEQ_ESC SWITCH_SEQ_F_GREEN SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FYELLOW SWITCH_SEQ_ESC SWITCH_SEQ_F_YELLOW SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FBLUE SWITCH_SEQ_ESC SWITCH_SEQ_F_BLUE SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FMAGEN SWITCH_SEQ_ESC SWITCH_SEQ_F_MAGEN SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FCYAN SWITCH_SEQ_ESC SWITCH_SEQ_F_CYAN SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_FWHITE SWITCH_SEQ_ESC SWITCH_SEQ_F_WHITE SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BBLACK SWITCH_SEQ_ESC SWITCH_SEQ_B_BLACK SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BRED SWITCH_SEQ_ESC SWITCH_SEQ_B_RED SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BGREEN SWITCH_SEQ_ESC SWITCH_SEQ_B_GREEN SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BYELLOW SWITCH_SEQ_ESC SWITCH_SEQ_B_YELLOW SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BBLUE SWITCH_SEQ_ESC SWITCH_SEQ_B_BLUE SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BMAGEN SWITCH_SEQ_ESC SWITCH_SEQ_B_MAGEN SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BCYAN SWITCH_SEQ_ESC SWITCH_SEQ_B_CYAN SWITCH_SEQ_END_COLOR
# define SWITCH_SEQ_BWHITE SWITCH_SEQ_ESC SWITCH_SEQ_B_WHITE SWITCH_SEQ_END_COLOR
/* Preset escape sequences */
# define SWITCH_SEQ_HOME SWITCH_SEQ_ESC SWITCH_SEQ_HOME_CHAR_STR
# define SWITCH_SEQ_CLEARLINE SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINE_CHAR_STR
# define SWITCH_SEQ_CLEARLINEEND SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINEEND_CHAR
# define SWITCH_SEQ_CLEARSCR SWITCH_SEQ_ESC SWITCH_SEQ_CLEARSCR_CHAR SWITCH_SEQ_HOME
2008-07-14 17:09:47 +00:00
# endif
2010-01-23 20:35:40 +00:00
# define SWITCH_DEFAULT_CLID_NAME ""
2012-09-17 19:26:00 +00:00
# define SWITCH_DEFAULT_CLID_NUMBER "0000000000"
2008-01-11 04:23:09 +00:00
# define SWITCH_DEFAULT_DTMF_DURATION 2000
2009-09-16 21:24:22 +00:00
# define SWITCH_MIN_DTMF_DURATION 400
2008-02-21 21:38:49 +00:00
# define SWITCH_MAX_DTMF_DURATION 192000
2007-12-06 19:51:55 +00:00
# define SWITCH_DEFAULT_DIR_PERMS SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE
2006-02-28 23:00:34 +00:00
# ifdef WIN32
2012-09-16 19:15:49 +00:00
# define SWITCH_PATH_SEPARATOR " / "
2006-02-28 23:00:34 +00:00
# else
2006-03-01 17:06:10 +00:00
# define SWITCH_PATH_SEPARATOR " / "
2006-02-28 23:00:34 +00:00
# endif
2007-03-10 02:36:55 +00:00
# define SWITCH_URL_SEPARATOR ": //"
2009-10-23 22:04:34 +00:00
# define SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE "ignore_display_updates"
2009-09-16 20:09:27 +00:00
# define SWITCH_AUDIO_SPOOL_PATH_VARIABLE "audio_spool_path"
2009-04-16 22:13:55 +00:00
# define SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE "bridge_hangup_cause"
2009-03-30 16:48:44 +00:00
# define SWITCH_READ_TERMINATOR_USED_VARIABLE "read_terminator_used"
2008-12-09 00:32:51 +00:00
# define SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE "send_silence_when_idle"
2008-12-08 15:42:37 +00:00
# define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
# define SWITCH_CURRENT_APPLICATION_DATA_VARIABLE "current_application_data"
# define SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE "current_application_response"
2010-10-05 14:59:13 +00:00
# define SWITCH_PASSTHRU_PTIME_MISMATCH_VARIABLE "passthru_ptime_mismatch"
2008-10-07 21:03:37 +00:00
# define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE "enable_heartbeat_events"
2008-09-18 21:50:18 +00:00
# define SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE "bypass_media_after_bridge"
2008-08-05 21:50:48 +00:00
# define SWITCH_READ_RESULT_VARIABLE "read_result"
2012-05-07 16:41:47 +00:00
# define SWITCH_ATT_XFER_RESULT_VARIABLE "att_xfer_result"
2008-07-09 16:03:03 +00:00
# define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
2012-05-08 12:43:01 +00:00
# define SWITCH_COPY_JSON_CDR_VARIABLE "copy_json_cdr"
2008-07-01 23:41:09 +00:00
# define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
2008-05-01 18:35:45 +00:00
# define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
2011-10-11 20:13:23 +00:00
# define SWITCH_TRANSFER_HISTORY_VARIABLE "transfer_history"
2011-12-08 23:33:31 +00:00
# define SWITCH_TRANSFER_SOURCE_VARIABLE "transfer_source"
2013-02-26 17:49:17 +00:00
# define SWITCH_SENSITIVE_DTMF_VARIABLE "sensitive_dtmf"
2013-04-08 17:09:44 +00:00
# define SWITCH_RECORD_POST_PROCESS_EXEC_APP_VARIABLE "record_post_process_exec_app"
# define SWITCH_RECORD_POST_PROCESS_EXEC_API_VARIABLE "record_post_process_exec_api"
2011-08-18 14:11:45 +00:00
2008-04-02 15:11:07 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE "execute_on_answer"
2009-10-29 05:47:17 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE "execute_on_pre_answer"
# define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
2008-06-05 20:45:03 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
2011-04-04 23:50:46 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE "execute_on_tone_detect"
2011-08-18 14:11:45 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE "execute_on_originate"
2012-07-05 17:34:09 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE "execute_on_post_originate"
2012-10-30 16:06:33 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE "execute_on_pre_originate"
2011-08-18 14:11:45 +00:00
2013-03-26 21:33:13 +00:00
# define SWITCH_CHANNEL_EXECUTE_ON_PRE_BRIDGE_VARIABLE "execute_on_pre_bridge"
# define SWITCH_CHANNEL_EXECUTE_ON_POST_BRIDGE_VARIABLE "execute_on_post_bridge"
2011-08-18 14:11:45 +00:00
# define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
# define SWITCH_CHANNEL_API_ON_PRE_ANSWER_VARIABLE "api_on_pre_answer"
# define SWITCH_CHANNEL_API_ON_MEDIA_VARIABLE "api_on_media"
# define SWITCH_CHANNEL_API_ON_RING_VARIABLE "api_on_ring"
# define SWITCH_CHANNEL_API_ON_TONE_DETECT_VARIABLE "api_on_tone_detect"
# define SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE "api_on_originate"
2012-07-05 17:34:09 +00:00
# define SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE "api_on_post_originate"
2012-10-30 16:06:33 +00:00
# define SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE "api_on_pre_originate"
2011-08-18 14:11:45 +00:00
2008-03-13 01:08:42 +00:00
# define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
# define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
2009-10-07 04:30:19 +00:00
# define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
2008-03-13 01:08:42 +00:00
# define SWITCH_API_BRIDGE_END_VARIABLE "api_after_bridge"
2013-03-26 21:33:13 +00:00
# define SWITCH_API_BRIDGE_START_VARIABLE "api_before_bridge"
2008-03-12 07:48:38 +00:00
# define SWITCH_API_HANGUP_HOOK_VARIABLE "api_hangup_hook"
2010-07-21 19:48:08 +00:00
# define SWITCH_API_REPORTING_HOOK_VARIABLE "api_reporting_hook"
2008-11-19 22:24:17 +00:00
# define SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE "session_in_hangup_hook"
2008-01-14 15:26:46 +00:00
# define SWITCH_PROCESS_CDR_VARIABLE "process_cdr"
2012-09-19 15:49:50 +00:00
# define SWITCH_SKIP_CDR_CAUSES_VARIABLE "skip_cdr_causes"
2010-04-24 21:48:59 +00:00
# define SWITCH_FORCE_PROCESS_CDR_VARIABLE "force_process_cdr"
2007-12-06 15:46:54 +00:00
# define SWITCH_BRIDGE_CHANNEL_VARIABLE "bridge_channel"
2007-12-06 19:51:55 +00:00
# define SWITCH_CHANNEL_NAME_VARIABLE "channel_name"
2007-12-06 15:46:54 +00:00
# define SWITCH_BRIDGE_UUID_VARIABLE "bridge_uuid"
2008-09-15 16:48:45 +00:00
# define SWITCH_CONTINUE_ON_FAILURE_VARIABLE "continue_on_fail"
2007-10-16 14:36:39 +00:00
# define SWITCH_PLAYBACK_TERMINATORS_VARIABLE "playback_terminators"
2008-09-26 16:04:16 +00:00
# define SWITCH_PLAYBACK_TERMINATOR_USED "playback_terminator_used"
2007-10-15 16:25:08 +00:00
# define SWITCH_CACHE_SPEECH_HANDLES_VARIABLE "cache_speech_handles"
# define SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME "__cache_speech_handles_obj__"
2007-05-09 19:44:15 +00:00
# define SWITCH_BYPASS_MEDIA_VARIABLE "bypass_media"
2008-02-21 17:48:41 +00:00
# define SWITCH_PROXY_MEDIA_VARIABLE "proxy_media"
add enhanced zrtp passthrough (zrtp passthru) mode
ZRTP passthrough mode allows two ZRTP-capable clients to negotiate an
end-to-end security association through FreeSWITCH. The clients are
therefore able to be certain that the FreeSWITCH instance mediating
the call cannot eavesdrop on their conversation.
Importantly, this capability is maintained across multiple FreeSWITCH
hops. If widely deployed, this enables a global network architecture
where two people can speak securely with strong cryptographically
protected authentication and confidentiality.
With this commit we implement a zrtp-passthru mode that handles all
the details of the negotiation intelligently. This mode can be
selected by setting the boolean parameter inbound-zrtp-passthru in the
sofia profile. This will also force late-negotiation as it is
essential for correctly negotiating an end-to-end ZRTP security
association.
When an incoming call with a zrtp-hash is received and this mode is
enabled, we find the first audio and the first video zrtp-hash in the
SDP and store them as remote values on this channel. Once a b-leg is
available, we set the local zrtp-hash values on that channel to the
remote zrtp-hash values collected from the a-leg.
Because zrtp-passthru absolutely requires that the channels negotiate
the same codec, we offer to the b-leg only codecs that the a-leg can
speak. Once the b-leg accepts a codec, we will force that choice onto
the a-leg.
If the b-leg sends us zrtp-hash values in the signaling, we store
those as remote values on the b-leg and copy them to the local values
on the a-leg.
At this point, each leg has the zrtp-hash values from the other, and
we know we can do ZRTP passthrough mode on the call. We send the
b-leg's zrtp-hash back to the a-leg in the 200 OK.
We then enable UDPTL mode on the rtp streams for both the audio and
the video so that we don't interfere in the ZRTP negotiation.
If the b-leg fails to return a zrtp-hash in the signaling, we set up a
ZRTP security association with the a-leg ourselves, if we are so
equipped. Likewise, if the a-leg fails to send a zrtp-hash in the
signaling, we attempt to set up a ZRTP security association ourselves
with the b-leg.
The zrtp-passthru mode can also be enabled in the dialplan by setting
the boolean channel variable zrtp_passthru. If enabled in this
manner, we can't force late-negotiation, so the user would need to be
sure this is configured.
If ZRTP passthrough mode is not enabled in either manner, this change
should have no effect.
Channel variables for each of the various zrtp-hash values are set,
though it is anticipated that there is no good reason to use them, so
they may be removed without warning. For checking whether zrtp
passthrough mode was successful, we provide the channel variable
zrtp_passthru_active which is set on both legs.
Though not implemented by this commit, the changes here should make it
more straightforward to add correct zrtp-hash values to the signaling
and verify that correct hello hash values are received when FreeSWITCH
is acting as a terminating leg of the ZRTP security association.
A historical note...
This commit replaces the recently-added sdp_zrtp_hash_string method,
commit 2ab1605a8887adc62be1b75f6ef67af87ff080de.
This prior method sets a channel variable from the a-leg's zrtp-hash,
then relies on the dialplan to export this channel variable to the
b-leg, where it is put into the SDP.
While it was a great start and wonderful for testing, this approach
has some drawbacks that motivated the present work:
* There's no good way to pass the zrtp-hash from the b-leg back to
the a-leg. In fact, the implementation seems to send the a-leg's
zrtp-hash back to the originating client in the 200 OK. This is
not correct.
* To support video, we'd need to have a separate dialplan variable,
and the dialplan author would need to deal with that explicitly.
* The API is problematic as it requires the dialplan author to
understand intricate details of how ZRTP works to implement a
correct dialplan. Further, by providing too fine-grained control
(but at the same time, not enough control) it would limit our
ability to make the behavior smarter once people started relying on
this.
2012-05-24 20:39:03 +00:00
# define SWITCH_ZRTP_PASSTHRU_VARIABLE "zrtp_passthru"
2007-02-28 15:48:17 +00:00
# define SWITCH_ENDPOINT_DISPOSITION_VARIABLE "endpoint_disposition"
2007-03-30 22:13:19 +00:00
# define SWITCH_HOLD_MUSIC_VARIABLE "hold_music"
2011-01-05 23:53:27 +00:00
# define SWITCH_TEMP_HOLD_MUSIC_VARIABLE "temp_hold_music"
2007-02-16 20:07:35 +00:00
# define SWITCH_EXPORT_VARS_VARIABLE "export_vars"
2010-10-01 22:26:03 +00:00
# define SWITCH_BRIDGE_EXPORT_VARS_VARIABLE "bridge_export_vars"
2007-02-05 19:35:31 +00:00
# define SWITCH_R_SDP_VARIABLE "switch_r_sdp"
# define SWITCH_L_SDP_VARIABLE "switch_l_sdp"
# define SWITCH_B_SDP_VARIABLE "switch_m_sdp"
# define SWITCH_BRIDGE_VARIABLE "bridge_to"
2010-08-20 18:28:17 +00:00
# define SWITCH_LAST_BRIDGE_VARIABLE "last_bridge_to"
2007-02-05 19:35:31 +00:00
# define SWITCH_SIGNAL_BRIDGE_VARIABLE "signal_bridge_to"
2007-03-09 20:37:30 +00:00
# define SWITCH_SIGNAL_BOND_VARIABLE "signal_bond"
2012-05-29 18:10:15 +00:00
# define SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE "originate_signal_bond"
2007-02-05 19:35:31 +00:00
# define SWITCH_ORIGINATOR_VARIABLE "originator"
# define SWITCH_ORIGINATOR_CODEC_VARIABLE "originator_codec"
2009-02-10 19:09:06 +00:00
# define SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE "originator_video_codec"
2007-02-05 19:35:31 +00:00
# define SWITCH_LOCAL_MEDIA_IP_VARIABLE "local_media_ip"
# define SWITCH_LOCAL_MEDIA_PORT_VARIABLE "local_media_port"
2011-09-09 07:47:56 +00:00
# define SWITCH_ADVERTISED_MEDIA_IP_VARIABLE "advertised_media_ip"
2007-02-05 19:35:31 +00:00
# define SWITCH_REMOTE_MEDIA_IP_VARIABLE "remote_media_ip"
# define SWITCH_REMOTE_MEDIA_PORT_VARIABLE "remote_media_port"
2007-04-19 21:40:50 +00:00
# define SWITCH_REMOTE_VIDEO_IP_VARIABLE "remote_video_ip"
# define SWITCH_REMOTE_VIDEO_PORT_VARIABLE "remote_video_port"
# define SWITCH_LOCAL_VIDEO_IP_VARIABLE "local_video_ip"
# define SWITCH_LOCAL_VIDEO_PORT_VARIABLE "local_video_port"
2006-11-30 21:28:32 +00:00
# define SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE "hangup_after_bridge"
2008-11-07 14:10:02 +00:00
# define SWITCH_PARK_AFTER_BRIDGE_VARIABLE "park_after_bridge"
2009-03-20 20:40:30 +00:00
# define SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE "transfer_after_bridge"
2007-07-26 00:49:02 +00:00
# define SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE "exec_after_bridge_app"
# define SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE "exec_after_bridge_arg"
2007-02-06 18:11:25 +00:00
# define SWITCH_MAX_FORWARDS_VARIABLE "max_forwards"
2008-05-22 01:08:30 +00:00
# define SWITCH_DISABLE_APP_LOG_VARIABLE "disable_app_log"
2007-02-05 19:35:31 +00:00
# define SWITCH_SPEECH_KEY "speech"
# define SWITCH_UUID_BRIDGE "uuid_bridge"
2006-09-02 23:04:25 +00:00
# define SWITCH_BITS_PER_BYTE 8
2009-01-09 20:34:01 +00:00
# define SWITCH_DEFAULT_FILE_BUFFER_LEN 65536
2009-02-23 16:31:59 +00:00
# define SWITCH_DTMF_LOG_LEN 1000
2012-10-27 17:27:00 +00:00
# define SWITCH_MAX_TRANS 2000
2013-10-15 21:24:32 +00:00
# define SWITCH_CORE_SESSION_MAX_PRIVATES 2
2014-11-20 03:25:18 +00:00
# define SWITCH_DEFAULT_VIDEO_SIZE 1200
2014-12-11 06:16:18 +00:00
# define SWITCH_RTCP_AUDIO_INTERVAL_MSEC "5000"
# define SWITCH_RTCP_VIDEO_INTERVAL_MSEC "1000"
2013-10-15 21:24:32 +00:00
2014-01-30 00:08:27 +00:00
/* Jitter */
# define JITTER_VARIANCE_THRESHOLD 400.0
/* IPDV */
# define IPDV_THRESHOLD 1.0
/* Burst and Lost Rate */
# define LOST_BURST_ANALYZE 500
/* Burst */
# define LOST_BURST_CAPTURE 1024
2009-01-09 20:34:01 +00:00
typedef uint8_t switch_byte_t ;
2006-09-02 23:04:25 +00:00
2013-10-15 21:24:32 +00:00
typedef enum {
SWITCH_PVT_PRIMARY = 0 ,
SWITCH_PVT_SECONDARY
} switch_pvt_class_t ;
2011-08-25 14:27:39 +00:00
/*!
\ enum switch_dtmf_source_t
\ brief DTMF sources
< pre >
SWITCH_DTMF_UNKNOWN - Unknown source
SWITCH_DTMF_INBAND_AUDIO - From audio
SWITCH_DTMF_RTP - From RTP as a telephone event
SWITCH_DTMF_ENDPOINT - From endpoint signaling
SWITCH_DTMF_APP - From application
< / pre >
*/
typedef enum {
SWITCH_DTMF_UNKNOWN ,
SWITCH_DTMF_INBAND_AUDIO ,
SWITCH_DTMF_RTP ,
SWITCH_DTMF_ENDPOINT ,
SWITCH_DTMF_APP
} switch_dtmf_source_t ;
2011-09-01 15:11:16 +00:00
typedef enum {
DIGIT_TARGET_SELF ,
2011-09-02 14:34:40 +00:00
DIGIT_TARGET_PEER ,
DIGIT_TARGET_BOTH
2011-09-01 15:11:16 +00:00
} switch_digit_action_target_t ;
2010-10-08 18:50:15 +00:00
typedef enum {
2013-02-26 17:49:17 +00:00
DTMF_FLAG_SKIP_PROCESS = ( 1 < < 0 ) ,
DTMF_FLAG_SENSITIVE = ( 1 < < 1 )
2010-10-08 18:50:15 +00:00
} dtmf_flag_t ;
2007-12-22 00:32:20 +00:00
typedef struct {
char digit ;
uint32_t duration ;
2010-10-08 18:50:15 +00:00
int32_t flags ;
2011-08-25 14:27:39 +00:00
switch_dtmf_source_t source ;
2007-12-22 00:32:20 +00:00
} switch_dtmf_t ;
2009-02-23 16:31:59 +00:00
typedef enum {
SWITCH_CALL_DIRECTION_INBOUND ,
SWITCH_CALL_DIRECTION_OUTBOUND
} switch_call_direction_t ;
2008-05-19 21:02:26 +00:00
typedef enum {
SBF_DIAL_ALEG = ( 1 < < 0 ) ,
SBF_EXEC_ALEG = ( 1 < < 1 ) ,
SBF_DIAL_BLEG = ( 1 < < 2 ) ,
SBF_EXEC_BLEG = ( 1 < < 3 ) ,
SBF_EXEC_OPPOSITE = ( 1 < < 4 ) ,
2008-12-31 01:08:51 +00:00
SBF_EXEC_SAME = ( 1 < < 5 ) ,
2009-09-24 22:21:44 +00:00
SBF_ONCE = ( 1 < < 6 ) ,
SBF_EXEC_INLINE = ( 1 < < 7 )
2008-06-05 13:34:39 +00:00
} switch_bind_flag_enum_t ;
typedef uint32_t switch_bind_flag_t ;
2008-05-19 21:02:26 +00:00
typedef enum {
2008-05-19 22:23:11 +00:00
SWITCH_DTMF_RECV = 0 ,
SWITCH_DTMF_SEND = 1
2008-05-19 21:02:26 +00:00
} switch_dtmf_direction_t ;
2007-12-20 21:42:00 +00:00
typedef enum {
SOF_NONE = 0 ,
SOF_NOBLOCK = ( 1 < < 0 ) ,
2008-08-11 21:27:20 +00:00
SOF_FORKED_DIAL = ( 1 < < 1 ) ,
2013-10-17 16:18:01 +00:00
SOF_NO_EFFECTIVE_ANI = ( 1 < < 2 ) ,
SOF_NO_EFFECTIVE_ANIII = ( 1 < < 3 ) ,
SOF_NO_EFFECTIVE_CID_NUM = ( 1 < < 4 ) ,
SOF_NO_EFFECTIVE_CID_NAME = ( 1 < < 5 ) ,
SOF_NO_LIMITS = ( 1 < < 6 )
2008-06-05 13:34:39 +00:00
} switch_originate_flag_enum_t ;
typedef uint32_t switch_originate_flag_t ;
2007-12-20 21:42:00 +00:00
2007-12-11 19:15:02 +00:00
typedef enum {
SPF_NONE = 0 ,
SPF_ODD = ( 1 < < 0 ) ,
2014-01-23 19:23:58 +00:00
SPF_EVEN = ( 1 < < 1 ) ,
SPF_ROBUST_TCP = ( 1 < < 2 ) ,
SPF_ROBUST_UDP = ( 1 < < 3 )
2008-06-05 13:34:39 +00:00
} switch_port_flag_enum_t ;
typedef uint32_t switch_port_flag_t ;
2007-12-11 19:15:02 +00:00
2007-11-30 22:56:01 +00:00
typedef enum {
2010-05-25 15:30:40 +00:00
ED_NONE = 0 ,
2007-11-30 22:56:01 +00:00
ED_MUX_READ = ( 1 < < 0 ) ,
ED_MUX_WRITE = ( 1 < < 1 ) ,
2012-05-07 18:44:10 +00:00
ED_DTMF = ( 1 < < 2 ) ,
2015-02-10 02:03:56 +00:00
ED_COPY_DISPLAY = ( 1 < < 3 ) ,
ED_BRIDGE_READ = ( 1 < < 4 ) ,
ED_BRIDGE_WRITE = ( 1 < < 5 )
2008-06-05 13:34:39 +00:00
} switch_eavesdrop_flag_enum_t ;
typedef uint32_t switch_eavesdrop_flag_t ;
2007-11-30 22:56:01 +00:00
2007-09-29 01:06:08 +00:00
typedef enum {
SCF_NONE = 0 ,
2008-05-27 04:30:03 +00:00
SCF_USE_SQL = ( 1 < < 0 ) ,
2011-12-14 19:23:54 +00:00
SCF_NO_NEW_OUTBOUND_SESSIONS = ( 1 < < 1 ) ,
SCF_NO_NEW_INBOUND_SESSIONS = ( 1 < < 2 ) ,
SCF_NO_NEW_SESSIONS = ( SCF_NO_NEW_OUTBOUND_SESSIONS | SCF_NO_NEW_INBOUND_SESSIONS ) ,
SCF_SHUTTING_DOWN = ( 1 < < 3 ) ,
SCF_VG = ( 1 < < 4 ) ,
SCF_RESTART = ( 1 < < 5 ) ,
SCF_SHUTDOWN_REQUESTED = ( 1 < < 6 ) ,
SCF_USE_AUTO_NAT = ( 1 < < 7 ) ,
SCF_EARLY_HANGUP = ( 1 < < 8 ) ,
SCF_CALIBRATE_CLOCK = ( 1 < < 9 ) ,
SCF_USE_HEAVY_TIMING = ( 1 < < 10 ) ,
SCF_USE_CLOCK_RT = ( 1 < < 11 ) ,
SCF_VERBOSE_EVENTS = ( 1 < < 12 ) ,
SCF_USE_WIN32_MONOTONIC = ( 1 < < 13 ) ,
SCF_AUTO_SCHEMAS = ( 1 < < 14 ) ,
SCF_MINIMAL = ( 1 < < 15 ) ,
SCF_USE_NAT_MAPPING = ( 1 < < 16 ) ,
SCF_CLEAR_SQL = ( 1 < < 17 ) ,
SCF_THREADED_SYSTEM_EXEC = ( 1 < < 18 ) ,
SCF_SYNC_CLOCK_REQUESTED = ( 1 < < 19 ) ,
2012-09-30 01:48:48 +00:00
SCF_CORE_NON_SQLITE_DB_REQ = ( 1 < < 20 ) ,
2012-07-27 23:53:04 +00:00
SCF_DEBUG_SQL = ( 1 < < 21 ) ,
2012-08-21 05:14:43 +00:00
SCF_API_EXPANSION = ( 1 < < 22 ) ,
2014-11-11 19:25:47 +00:00
SCF_SESSION_THREAD_POOL = ( 1 < < 23 ) ,
SCF_DIALPLAN_TIMESTAMPS = ( 1 < < 24 )
2008-06-05 13:34:39 +00:00
} switch_core_flag_enum_t ;
typedef uint32_t switch_core_flag_t ;
2007-04-09 18:38:47 +00:00
2007-06-13 20:40:06 +00:00
typedef enum {
SWITCH_ENDPOINT_INTERFACE ,
SWITCH_TIMER_INTERFACE ,
SWITCH_DIALPLAN_INTERFACE ,
SWITCH_CODEC_INTERFACE ,
SWITCH_APPLICATION_INTERFACE ,
SWITCH_API_INTERFACE ,
SWITCH_FILE_INTERFACE ,
SWITCH_SPEECH_INTERFACE ,
SWITCH_DIRECTORY_INTERFACE ,
SWITCH_CHAT_INTERFACE ,
SWITCH_SAY_INTERFACE ,
SWITCH_ASR_INTERFACE ,
2010-04-02 02:31:14 +00:00
SWITCH_MANAGEMENT_INTERFACE ,
2011-09-21 19:31:10 +00:00
SWITCH_LIMIT_INTERFACE ,
2013-10-15 21:24:32 +00:00
SWITCH_CHAT_APPLICATION_INTERFACE ,
SWITCH_JSON_API_INTERFACE ,
2007-06-13 20:40:06 +00:00
} switch_module_interface_name_t ;
2007-04-09 18:38:47 +00:00
typedef enum {
SUF_NONE = 0 ,
SUF_THREAD_RUNNING = ( 1 < < 0 ) ,
2007-04-13 16:24:02 +00:00
SUF_READY = ( 1 < < 1 ) ,
SUF_NATIVE = ( 1 < < 2 )
2008-06-05 13:34:39 +00:00
} switch_unicast_flag_enum_t ;
typedef uint32_t switch_unicast_flag_t ;
2007-04-09 18:38:47 +00:00
2007-03-17 19:51:08 +00:00
typedef enum {
SWITCH_FALSE = 0 ,
SWITCH_TRUE = 1
} switch_bool_t ;
2010-03-08 06:50:27 +00:00
/* WARNING, Do not forget to update *SAY_METHOD_NAMES[] in src/switch_ivr_play_say.c */
2006-12-20 21:25:14 +00:00
typedef enum {
SSM_NA ,
SSM_PRONOUNCED ,
2007-01-02 23:08:26 +00:00
SSM_ITERATED ,
2011-11-15 15:51:46 +00:00
SSM_COUNTED ,
SSM_PRONOUNCED_YEAR
2006-12-20 21:25:14 +00:00
} switch_say_method_t ;
2010-03-29 16:15:25 +00:00
/* WARNING, Do not forget to update *SAY_TYPE_NAMES[] in src/switch_ivr_say.c */
2006-12-20 21:25:14 +00:00
typedef enum {
SST_NUMBER ,
SST_ITEMS ,
SST_PERSONS ,
SST_MESSAGES ,
SST_CURRENCY ,
SST_TIME_MEASUREMENT ,
SST_CURRENT_DATE ,
SST_CURRENT_TIME ,
SST_CURRENT_DATE_TIME ,
SST_TELEPHONE_NUMBER ,
SST_TELEPHONE_EXTENSION ,
SST_URL ,
2007-01-02 23:08:26 +00:00
SST_IP_ADDRESS ,
2006-12-20 21:25:14 +00:00
SST_EMAIL_ADDRESS ,
SST_POSTAL_ADDRESS ,
SST_ACCOUNT_NUMBER ,
SST_NAME_SPELLED ,
2009-02-16 22:24:25 +00:00
SST_NAME_PHONETIC ,
SST_SHORT_DATE_TIME
2006-12-20 21:25:14 +00:00
} switch_say_type_t ;
2010-03-07 19:34:05 +00:00
typedef enum {
SSG_MASCULINE ,
SSG_FEMININE ,
2014-02-02 11:33:37 +00:00
SSG_NEUTER ,
SSG_UTRUM
2010-03-07 19:34:05 +00:00
} switch_say_gender_t ;
2007-03-07 18:34:22 +00:00
typedef enum {
SMA_NONE ,
SMA_GET ,
2007-03-24 04:52:46 +00:00
SMA_SET
2007-03-07 18:34:22 +00:00
} switch_management_action_t ;
2006-12-20 21:25:14 +00:00
2007-03-28 23:37:12 +00:00
typedef enum {
SSHF_NONE = 0 ,
SSHF_OWN_THREAD = ( 1 < < 0 ) ,
2007-03-30 14:57:06 +00:00
SSHF_FREE_ARG = ( 1 < < 1 ) ,
SSHF_NO_DEL = ( 1 < < 2 )
2008-06-05 13:34:39 +00:00
} switch_scheduler_flag_enum_t ;
typedef uint32_t switch_scheduler_flag_t ;
2007-03-28 23:37:12 +00:00
2006-10-31 21:38:06 +00:00
typedef enum {
SMF_NONE = 0 ,
SMF_REBRIDGE = ( 1 < < 0 ) ,
2006-11-10 08:13:01 +00:00
SMF_ECHO_ALEG = ( 1 < < 1 ) ,
SMF_ECHO_BLEG = ( 1 < < 2 ) ,
SMF_FORCE = ( 1 < < 3 ) ,
2008-03-12 00:11:33 +00:00
SMF_LOOP = ( 1 < < 4 ) ,
2008-09-19 19:58:01 +00:00
SMF_HOLD_BLEG = ( 1 < < 5 ) ,
2009-09-24 22:21:44 +00:00
SMF_IMMEDIATE = ( 1 < < 6 ) ,
2009-12-10 01:29:02 +00:00
SMF_EXEC_INLINE = ( 1 < < 7 ) ,
2014-10-10 21:09:43 +00:00
SMF_PRIORITY = ( 1 < < 8 ) ,
SMF_REPLYONLY_A = ( 1 < < 9 ) ,
SMF_REPLYONLY_B = ( 1 < < 10 )
2008-06-05 13:34:39 +00:00
} switch_media_flag_enum_t ;
typedef uint32_t switch_media_flag_t ;
2006-10-31 21:38:06 +00:00
2006-09-02 23:04:25 +00:00
typedef enum {
SWITCH_BITPACK_MODE_RFC3551 ,
SWITCH_BITPACK_MODE_AAL2
} switch_bitpack_mode_t ;
2006-09-09 03:39:28 +00:00
typedef enum {
SWITCH_ABC_TYPE_INIT ,
SWITCH_ABC_TYPE_READ ,
SWITCH_ABC_TYPE_WRITE ,
2007-01-31 23:09:33 +00:00
SWITCH_ABC_TYPE_WRITE_REPLACE ,
2007-06-13 03:09:53 +00:00
SWITCH_ABC_TYPE_READ_REPLACE ,
2007-12-06 22:26:37 +00:00
SWITCH_ABC_TYPE_READ_PING ,
2013-02-25 22:32:09 +00:00
SWITCH_ABC_TYPE_TAP_NATIVE_READ ,
SWITCH_ABC_TYPE_TAP_NATIVE_WRITE ,
2012-08-28 08:12:12 +00:00
SWITCH_ABC_TYPE_CLOSE ,
SWITCH_ABC_TYPE_READ_VIDEO_PING
2006-09-09 03:39:28 +00:00
} switch_abc_type_t ;
2006-09-02 23:04:25 +00:00
typedef struct {
switch_byte_t * buf ;
uint32_t buflen ;
switch_byte_t * cur ;
uint32_t bytes ;
uint32_t bits_tot ;
switch_byte_t bits_cur ;
switch_byte_t bits_rem ;
switch_byte_t frame_bits ;
switch_byte_t shiftby ;
2006-09-03 13:29:13 +00:00
switch_byte_t this_byte ;
2006-09-02 23:04:25 +00:00
switch_byte_t under ;
switch_byte_t over ;
switch_bitpack_mode_t mode ;
} switch_bitpack_t ;
2006-02-28 21:21:48 +00:00
struct switch_directories {
char * base_dir ;
char * mod_dir ;
char * conf_dir ;
char * log_dir ;
2009-09-04 18:26:15 +00:00
char * run_dir ;
2006-02-28 21:21:48 +00:00
char * db_dir ;
char * script_dir ;
2006-03-01 06:25:56 +00:00
char * temp_dir ;
2006-05-10 03:23:05 +00:00
char * htdocs_dir ;
2006-11-09 05:39:04 +00:00
char * grammar_dir ;
2007-10-12 03:28:59 +00:00
char * storage_dir ;
2014-09-01 00:22:08 +00:00
char * cache_dir ;
2010-01-11 03:47:19 +00:00
char * recordings_dir ;
2010-01-11 16:32:35 +00:00
char * sounds_dir ;
2012-11-21 14:54:06 +00:00
char * lib_dir ;
2013-02-01 20:29:40 +00:00
char * certs_dir ;
2006-02-28 21:21:48 +00:00
} ;
typedef struct switch_directories switch_directories ;
2006-03-01 06:25:56 +00:00
SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs ;
2006-02-28 21:21:48 +00:00
2013-04-17 20:33:07 +00:00
struct switch_filenames {
char * conf_name ;
} ;
typedef struct switch_filenames switch_filenames ;
SWITCH_DECLARE_DATA extern switch_filenames SWITCH_GLOBAL_filenames ;
2008-10-13 15:42:11 +00:00
# define SWITCH_MAX_STACKS 16
2006-10-31 21:57:59 +00:00
# define SWITCH_THREAD_STACKSIZE 240 * 1024
2008-09-26 15:50:12 +00:00
# define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
2008-05-27 04:30:03 +00:00
# define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
# define SWITCH_INTERVAL_PAD 10 /* A little extra buffer space to be safe */
2008-12-17 01:53:46 +00:00
# define SWITCH_MAX_SAMPLE_LEN 48
2008-05-27 04:30:03 +00:00
# define SWITCH_BYTES_PER_SAMPLE 2 /* slin is 2 bytes per sample */
2014-07-02 21:55:21 +00:00
# define SWITCH_RECOMMENDED_BUFFER_SIZE 8192
2008-06-30 17:52:22 +00:00
# define SWITCH_MAX_CODECS 50
2006-02-07 20:47:15 +00:00
# define SWITCH_MAX_STATE_HANDLERS 30
2006-07-19 01:19:46 +00:00
# define SWITCH_CORE_QUEUE_LEN 100000
2007-03-07 18:34:22 +00:00
# define SWITCH_MAX_MANAGEMENT_BUFFER_LEN 1024 * 8
2006-05-12 19:28:21 +00:00
2008-02-15 20:11:44 +00:00
# define SWITCH_ACCEPTABLE_INTERVAL(_i) (_i && _i <= SWITCH_MAX_INTERVAL && (_i % 10) == 0)
2008-02-15 17:54:13 +00:00
2006-10-16 04:39:00 +00:00
typedef enum {
2009-03-10 13:16:14 +00:00
SWITCH_CPF_NONE = 0 ,
2006-10-16 04:39:00 +00:00
SWITCH_CPF_SCREEN = ( 1 < < 0 ) ,
SWITCH_CPF_HIDE_NAME = ( 1 < < 1 ) ,
SWITCH_CPF_HIDE_NUMBER = ( 1 < < 2 )
2008-06-05 13:34:39 +00:00
} switch_caller_profile_flag_enum_t ;
typedef uint32_t switch_caller_profile_flag_t ;
2006-07-25 22:37:52 +00:00
typedef enum {
2007-03-29 22:31:56 +00:00
SWITCH_AUDIO_COL_STR_TITLE = 0x01 ,
SWITCH_AUDIO_COL_STR_COPYRIGHT = 0x02 ,
SWITCH_AUDIO_COL_STR_SOFTWARE = 0x03 ,
SWITCH_AUDIO_COL_STR_ARTIST = 0x04 ,
SWITCH_AUDIO_COL_STR_COMMENT = 0x05 ,
SWITCH_AUDIO_COL_STR_DATE = 0x06
2006-07-25 22:37:52 +00:00
} switch_audio_col_t ;
2006-05-12 19:28:21 +00:00
typedef enum {
SWITCH_XML_SECTION_RESULT = 0 ,
SWITCH_XML_SECTION_CONFIG = ( 1 < < 0 ) ,
SWITCH_XML_SECTION_DIRECTORY = ( 1 < < 1 ) ,
2006-12-20 21:25:14 +00:00
SWITCH_XML_SECTION_DIALPLAN = ( 1 < < 2 ) ,
2013-08-28 16:25:35 +00:00
SWITCH_XML_SECTION_LANGUAGES = ( 1 < < 3 ) ,
2011-09-21 19:31:10 +00:00
SWITCH_XML_SECTION_CHATPLAN = ( 1 < < 4 ) ,
2010-02-06 03:38:24 +00:00
2009-06-10 05:08:53 +00:00
/* Nothing after this line */
SWITCH_XML_SECTION_MAX = ( 1 < < 4 )
2008-06-05 13:34:39 +00:00
} switch_xml_section_enum_t ;
typedef uint32_t switch_xml_section_t ;
2006-05-12 19:28:21 +00:00
2006-04-21 22:31:08 +00:00
/*!
2006-05-10 21:28:28 +00:00
\ enum switch_vad_flag_t
2006-04-21 22:31:08 +00:00
\ brief RTP Related Flags
< pre >
SWITCH_VAD_FLAG_TALKING - Currently Talking
SWITCH_VAD_FLAG_EVENTS_TALK - Fire events when talking is detected
SWITCH_VAD_FLAG_EVENTS_NOTALK - Fire events when not talking is detected
2006-04-22 16:06:55 +00:00
SWITCH_VAD_FLAG_CNG - Send CNG
2006-04-21 22:31:08 +00:00
< / pre >
*/
typedef enum {
2007-03-29 22:31:56 +00:00
SWITCH_VAD_FLAG_TALKING = ( 1 < < 0 ) ,
SWITCH_VAD_FLAG_EVENTS_TALK = ( 1 < < 1 ) ,
SWITCH_VAD_FLAG_EVENTS_NOTALK = ( 1 < < 2 ) ,
2010-11-19 00:24:32 +00:00
SWITCH_VAD_FLAG_CNG = ( 1 < < 3 )
2008-06-05 13:34:39 +00:00
} switch_vad_flag_enum_t ;
typedef uint32_t switch_vad_flag_t ;
2006-04-21 22:31:08 +00:00
2009-04-03 21:48:52 +00:00
typedef struct {
switch_size_t raw_bytes ;
switch_size_t media_bytes ;
switch_size_t packet_count ;
2012-06-22 23:08:59 +00:00
switch_size_t period_packet_count ;
2009-04-03 21:48:52 +00:00
switch_size_t media_packet_count ;
switch_size_t skip_packet_count ;
switch_size_t jb_packet_count ;
switch_size_t dtmf_packet_count ;
switch_size_t cng_packet_count ;
switch_size_t flush_packet_count ;
2011-05-06 20:25:00 +00:00
switch_size_t largest_jb_size ;
2014-01-30 00:08:27 +00:00
/* Jitter */
int64_t last_proc_time ;
int64_t jitter_n ;
int64_t jitter_add ;
int64_t jitter_addsq ;
double variance ;
double min_variance ;
double max_variance ;
double std_deviation ;
/* Burst and Packet Loss */
double lossrate ;
double burstrate ;
double mean_interval ;
int loss [ LOST_BURST_CAPTURE ] ;
int last_loss ;
int recved ;
int last_processed_seq ;
switch_size_t flaws ;
switch_size_t last_flaw ;
double R ;
double mos ;
2009-04-03 21:48:52 +00:00
} switch_rtp_numbers_t ;
2010-09-10 16:59:47 +00:00
typedef struct {
2014-07-21 09:40:59 +00:00
uint32_t packet_count ; /* sent packet count */
uint32_t octet_count ;
2012-07-11 20:23:12 +00:00
uint32_t peer_ssrc ;
2014-07-21 09:40:59 +00:00
uint32_t last_rpt_ts ; /* RTP timestamp at which the last report was generated and sent */
uint32_t ssrc ; /* identifier of the source */
uint32_t csrc ; /* contributing source 0-15 32bit each */
uint32_t last_pkt_tsdiff ; /* Jitter calculation, timestamp difference between the two last received packet */
double inter_jitter ; /* Jitter calculation, Interarrival jitter */
uint32_t last_rpt_ext_seq ; /* Packet loss calculation, extended sequence number at the begining of this RTCP report interval */
uint16_t last_rpt_cycle ; /* Packet loss calculation, sequence number cycle at the begining of the current RTCP report interval */
uint16_t period_pkt_count ; /* Packet loss calculation, packet count received during this RTCP report interval */
uint16_t pkt_count ; /* Packet loss calculation, packet count received during this session */
uint32_t rtcp_rtp_count ; /* RTCP report generated count */
uint32_t high_ext_seq_recv ; /* Packet loss calculation, highest extended sequence number received and processed for stats */
uint16_t cycle ; /* Packet loss calculation, sequence number cycle of the current RTCP report interval */
uint32_t bad_seq ; /* Bad SEQ found, used to detect reset on the other side */
uint16_t base_seq ; /* Packet loss calculation, first sequence number received */
uint32_t cum_lost ; /* Packet loss calculation, cumulative number of packet lost */
uint32_t last_recv_lsr_local ; /* RTT calculation, When receiving an SR we save our local timestamp in fraction of 65536 seconds */
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 */
2014-09-12 20:41:49 +00:00
uint32_t init ;
2010-09-10 16:59:47 +00:00
} switch_rtcp_numbers_t ;
2009-04-03 21:48:52 +00:00
typedef struct {
2009-04-15 15:08:21 +00:00
switch_rtp_numbers_t inbound ;
switch_rtp_numbers_t outbound ;
2010-09-10 16:59:47 +00:00
switch_rtcp_numbers_t rtcp ;
2012-06-22 23:08:59 +00:00
uint32_t read_count ;
2009-04-03 21:48:52 +00:00
} switch_rtp_stats_t ;
2009-04-16 22:13:55 +00:00
typedef enum {
SWITCH_RTP_FLUSH_ONCE ,
SWITCH_RTP_FLUSH_STICK ,
SWITCH_RTP_FLUSH_UNSTICK
} switch_rtp_flush_t ;
2009-04-03 21:48:52 +00:00
2007-03-07 18:34:22 +00:00
# define SWITCH_RTP_CNG_PAYLOAD 13
2006-04-21 22:31:08 +00:00
2006-04-03 21:00:13 +00:00
/*!
\ enum switch_rtp_flag_t
\ brief RTP Related Flags
< pre >
2006-04-21 22:31:08 +00:00
SWITCH_RTP_FLAG_NOBLOCK - Do not block
SWITCH_RTP_FLAG_IO - IO is ready
SWITCH_RTP_FLAG_USE_TIMER - Timeout Reads and replace with a CNG Frame
SWITCH_RTP_FLAG_SECURE - Secure RTP
SWITCH_RTP_FLAG_AUTOADJ - Auto - Adjust the dest based on the source
SWITCH_RTP_FLAG_RAW_WRITE - Try to forward packets unscathed
SWITCH_RTP_FLAG_GOOGLEHACK - Convert payload from 102 to 97
SWITCH_RTP_FLAG_VAD - Enable VAD
2006-05-04 01:15:38 +00:00
SWITCH_RTP_FLAG_BREAK - Stop what you are doing and return SWITCH_STATUS_BREAK
2006-09-20 20:25:26 +00:00
SWITCH_RTP_FLAG_DATAWAIT - Do not return from reads unless there is data even when non blocking
2006-10-12 20:37:08 +00:00
SWITCH_RTP_FLAG_BUGGY_2833 - Emulate the bug in cisco equipment to allow interop
2007-03-07 18:34:22 +00:00
SWITCH_RTP_FLAG_PASS_RFC2833 - Pass 2833 ( ignore it )
2009-04-16 22:13:55 +00:00
SWITCH_RTP_FLAG_AUTO_CNG - Generate outbound CNG frames when idle
2006-04-03 21:00:13 +00:00
< / pre >
*/
typedef enum {
2012-12-18 22:06:29 +00:00
SWITCH_RTP_FLAG_NOBLOCK = 0 ,
2013-12-30 19:21:45 +00:00
SWITCH_RTP_FLAG_DTMF_ON ,
2012-12-18 22:06:29 +00:00
SWITCH_RTP_FLAG_IO ,
SWITCH_RTP_FLAG_USE_TIMER ,
SWITCH_RTP_FLAG_RTCP_PASSTHRU ,
SWITCH_RTP_FLAG_SECURE_SEND ,
SWITCH_RTP_FLAG_SECURE_RECV ,
SWITCH_RTP_FLAG_AUTOADJ ,
SWITCH_RTP_FLAG_RAW_WRITE ,
SWITCH_RTP_FLAG_GOOGLEHACK ,
SWITCH_RTP_FLAG_VAD ,
SWITCH_RTP_FLAG_BREAK ,
SWITCH_RTP_FLAG_UDPTL ,
SWITCH_RTP_FLAG_DATAWAIT ,
SWITCH_RTP_FLAG_BYTESWAP ,
SWITCH_RTP_FLAG_PASS_RFC2833 ,
SWITCH_RTP_FLAG_AUTO_CNG ,
SWITCH_RTP_FLAG_SECURE_SEND_RESET ,
SWITCH_RTP_FLAG_SECURE_RECV_RESET ,
SWITCH_RTP_FLAG_PROXY_MEDIA ,
SWITCH_RTP_FLAG_SHUTDOWN ,
SWITCH_RTP_FLAG_FLUSH ,
SWITCH_RTP_FLAG_AUTOFLUSH ,
SWITCH_RTP_FLAG_STICKY_FLUSH ,
SWITCH_ZRTP_FLAG_SECURE_SEND ,
SWITCH_ZRTP_FLAG_SECURE_RECV ,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND ,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV ,
SWITCH_RTP_FLAG_DEBUG_RTP_READ ,
SWITCH_RTP_FLAG_DEBUG_RTP_WRITE ,
SWITCH_RTP_FLAG_VIDEO ,
SWITCH_RTP_FLAG_ENABLE_RTCP ,
2013-01-17 01:04:57 +00:00
SWITCH_RTP_FLAG_RTCP_MUX ,
2013-08-21 21:30:59 +00:00
SWITCH_RTP_FLAG_KILL_JB ,
2013-10-15 21:24:32 +00:00
SWITCH_RTP_FLAG_VIDEO_BREAK ,
2013-10-28 18:39:23 +00:00
SWITCH_RTP_FLAG_PAUSE ,
2013-11-20 20:38:16 +00:00
SWITCH_RTP_FLAG_FIR ,
SWITCH_RTP_FLAG_PLI ,
2014-02-28 23:55:04 +00:00
SWITCH_RTP_FLAG_RESET ,
2014-10-27 19:13:36 +00:00
SWITCH_RTP_FLAG_MUTE ,
2015-01-09 19:35:42 +00:00
SWITCH_RTP_FLAG_NACK ,
2012-12-18 22:06:29 +00:00
SWITCH_RTP_FLAG_INVALID
2013-01-17 01:04:57 +00:00
} switch_rtp_flag_t ;
2006-02-26 00:12:17 +00:00
2008-12-29 21:23:17 +00:00
typedef enum {
2010-02-06 03:38:24 +00:00
RTP_BUG_NONE = 0 , /* won't be using this one much ;) */
2008-12-29 21:23:17 +00:00
RTP_BUG_CISCO_SKIP_MARK_BIT_2833 = ( 1 < < 0 ) ,
/* Some Cisco devices get mad when you send the mark bit on new 2833 because it makes
them flush their jitterbuffer and the dtmf along with it .
This flag will disable the sending of the mark bit on the first DTMF packet .
2010-02-06 03:38:24 +00:00
*/
2008-12-29 21:23:17 +00:00
2010-06-07 19:06:41 +00:00
RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833 = ( 1 < < 1 ) ,
2010-02-06 03:38:24 +00:00
/*
Sonus wrongly expects that , when sending a multi - packet 2833 DTMF event , The sender
should increment the RTP timestamp in each packet when , in reality , the sender should
send the same exact timestamp and increment the duration field in the 2833 payload .
This allows a reconstruction of the duration if any of the packets are lost .
final_duration - initial_timestamp = total_samples
However , if the duration value exceeds the space allocated ( 16 bits ) , The sender should increment
the timestamp one unit and reset the duration to 0.
Always sending a duration of 0 with a new timestamp should be tolerated but is rarely intentional
and is mistakenly done by many devices .
The issue is that the Sonus expects everyone to do it this way instead of tolerating either way .
Sonus will actually ignore every packet with the same timestamp before concluding if it ' s DTMF .
2008-12-29 21:23:17 +00:00
2010-02-06 03:38:24 +00:00
This flag will cause each packet to have a new timestamp .
*/
2010-06-07 19:06:41 +00:00
2010-11-10 22:55:56 +00:00
RTP_BUG_IGNORE_MARK_BIT = ( 1 < < 2 ) ,
2010-06-07 19:06:41 +00:00
/*
A Huawei SBC has been discovered that sends the mark bit on every single RTP packet .
Since this causes the RTP stack to flush it ' s buffers , it horribly messes up the timing on the channel .
This flag will do nothing when an inbound packet contains the mark bit .
*/
2010-11-10 22:55:56 +00:00
RTP_BUG_SEND_LINEAR_TIMESTAMPS = ( 1 < < 3 ) ,
/*
Our friends at Sonus get real mad when the timestamps are not in perfect sequence even during periods of silence .
With this flag , we will only increment the timestamp when write packets even if they are eons apart .
*/
RTP_BUG_START_SEQ_AT_ZERO = ( 1 < < 4 ) ,
/*
Our friends at Sonus also get real mad if the sequence number does not start at 0.
Typically , we set this to a random starting value for your saftey .
This is a security risk you take upon yourself when you enable this flag .
*/
RTP_BUG_NEVER_SEND_MARKER = ( 1 < < 5 ) ,
/*
Our friends at Sonus are on a roll , They also get easily dumbfounded by marker bits .
This flag will never send any . Sheesh . . . .
*/
2011-08-24 20:36:59 +00:00
RTP_BUG_IGNORE_DTMF_DURATION = ( 1 < < 6 ) ,
2010-11-10 22:55:56 +00:00
2011-01-07 22:04:24 +00:00
/*
Guess Who ? . . . Yep , Sonus ( and who know ' s who else ) likes to interweave DTMF with the audio stream making it take
2 X as long as it should and sending an incorrect duration making the DTMF very delayed .
This flag will treat every dtmf as if it were 50 ms and queue it on recipt of the leading packet rather than at the end .
*/
2010-06-07 19:06:41 +00:00
2011-09-08 13:57:28 +00:00
2011-10-07 15:40:30 +00:00
RTP_BUG_ACCEPT_ANY_PACKETS = ( 1 < < 7 ) ,
2011-09-08 13:57:28 +00:00
/*
Oracle ' s Contact Center Anywhere ( CCA ) likes to use a single RTP socket to send all its outbound audio .
This messes up our ability to auto adjust to NATTED RTP and causes us to ignore its audio packets .
This flag will allow compatibility with this dying product .
*/
2012-07-06 16:12:14 +00:00
RTP_BUG_GEN_ONE_GEN_ALL = ( 1 < < 8 ) ,
2011-10-07 15:40:30 +00:00
/*
Some RTP endpoints ( and by some we mean * cough * _SONUS_ ! ) do not like it when the timestamps jump forward or backwards in time .
So say you are generating a file that says " please wait for me to complete your call, or generating ringback "
Now you place and outbound call and you are bridging . Well , while you were playing the file , you were generating your own RTP timestamps .
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 . . . . . .
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 .
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
actual timestamps in the frames .
*/
2012-12-11 13:58:09 +00:00
RTP_BUG_CHANGE_SSRC_ON_MARKER = ( 1 < < 9 ) ,
2012-07-06 16:12:14 +00:00
/*
By default FS will change the SSRC when the marker is set and it detects a timestamp reset .
If this setting is enabled it will NOT do this ( old behaviour ) .
*/
2011-10-07 15:40:30 +00:00
2013-07-29 15:18:05 +00:00
RTP_BUG_FLUSH_JB_ON_DTMF = ( 1 < < 10 ) ,
2012-12-11 13:58:09 +00:00
/* FLUSH JITTERBUFFER When getting RFC2833 to reduce bleed through */
2014-10-02 16:55:53 +00:00
RTP_BUG_ACCEPT_ANY_PAYLOAD = ( 1 < < 11 ) ,
2013-07-29 15:18:05 +00:00
/*
Make FS accept any payload type instead of dropping and returning CNG frame . Workaround while FS only supports a single payload per rtp session .
This can be used by endpoint modules to detect payload changes and act appropriately ( ex : sofia could send a reINVITE with single codec ) .
This should probably be a flag , but flag enum is already full !
*/
2012-12-11 13:58:09 +00:00
2014-10-02 16:55:53 +00:00
RTP_BUG_ALWAYS_AUTO_ADJUST = ( 1 < < 12 )
/*
Leave the auto - adjust behavior enableed permenantly rather than only at appropriate times . ( IMPLICITLY sets RTP_BUG_ACCEPT_ANY_PACKETS )
*/
2008-12-29 21:23:17 +00:00
} switch_rtp_bug_flag_t ;
2008-02-09 00:38:23 +00:00
# ifdef _MSC_VER
# pragma pack(push, r1, 1)
# endif
2008-07-15 16:15:49 +00:00
# if SWITCH_BYTE_ORDER == __BIG_ENDIAN
2008-02-09 00:38:23 +00:00
typedef struct {
2008-05-27 04:30:03 +00:00
unsigned version : 2 ; /* protocol version */
unsigned p : 1 ; /* padding flag */
unsigned x : 1 ; /* header extension flag */
unsigned cc : 4 ; /* CSRC count */
unsigned m : 1 ; /* marker bit */
unsigned pt : 7 ; /* payload type */
unsigned seq : 16 ; /* sequence number */
unsigned ts : 32 ; /* timestamp */
unsigned ssrc : 32 ; /* synchronization source */
2008-02-09 00:38:23 +00:00
} switch_rtp_hdr_t ;
2012-12-14 01:49:02 +00:00
typedef struct {
unsigned length : 16 ; /* length */
unsigned profile : 16 ; /* defined by profile */
} switch_rtp_hdr_ext_t ;
2008-02-09 00:38:23 +00:00
# else /* BIG_ENDIAN */
typedef struct {
2008-05-27 04:30:03 +00:00
unsigned cc : 4 ; /* CSRC count */
unsigned x : 1 ; /* header extension flag */
unsigned p : 1 ; /* padding flag */
unsigned version : 2 ; /* protocol version */
unsigned pt : 7 ; /* payload type */
unsigned m : 1 ; /* marker bit */
unsigned seq : 16 ; /* sequence number */
unsigned ts : 32 ; /* timestamp */
unsigned ssrc : 32 ; /* synchronization source */
2008-02-09 00:38:23 +00:00
} switch_rtp_hdr_t ;
2012-12-14 01:49:02 +00:00
typedef struct {
unsigned profile : 16 ; /* defined by profile */
unsigned length : 16 ; /* length */
} switch_rtp_hdr_ext_t ;
2008-02-09 00:38:23 +00:00
# endif
2008-02-18 22:37:29 +00:00
# ifdef _MSC_VER
# pragma pack(pop, r1)
# endif
2010-04-20 00:07:23 +00:00
# ifdef _MSC_VER
# pragma pack(push, r1, 1)
# endif
2014-12-09 20:18:36 +00:00
typedef struct switch_rtcp_sdes_unit_s {
unsigned char type ;
unsigned char length ;
char value [ ] ;
} switch_rtcp_sdes_unit_t ;
2010-04-20 00:07:23 +00:00
# if SWITCH_BYTE_ORDER == __BIG_ENDIAN
2014-07-21 09:40:59 +00:00
typedef struct switch_rtcp_hdr_s {
2010-04-20 00:07:23 +00:00
unsigned version : 2 ; /* protocol version */
unsigned p : 1 ; /* padding flag */
unsigned count : 5 ; /* number of reception report blocks */
unsigned type : 8 ; /* packet type */
unsigned length : 16 ; /* length in 32-bit words - 1 */
} switch_rtcp_hdr_t ;
# else /* BIG_ENDIAN */
2014-07-21 09:40:59 +00:00
typedef struct switch_rtcp_hdr_s {
2010-04-20 00:07:23 +00:00
unsigned count : 5 ; /* number of reception report blocks */
unsigned p : 1 ; /* padding flag */
unsigned version : 2 ; /* protocol version */
unsigned type : 8 ; /* packet type */
unsigned length : 16 ; /* length in 32-bit words - 1 */
} switch_rtcp_hdr_t ;
# endif
# ifdef _MSC_VER
# pragma pack(pop, r1)
# endif
2012-01-11 23:49:35 +00:00
typedef struct audio_buffer_header_s {
uint32_t ts ;
uint32_t len ;
} audio_buffer_header_t ;
2006-02-26 00:12:17 +00:00
/*!
\ enum switch_priority_t
\ brief Priority Indication
< pre >
SWITCH_PRIORITY_NORMAL - Normal Priority
SWITCH_PRIORITY_LOW - Low Priority
SWITCH_PRIORITY_HIGH - High Priority
< / pre >
*/
typedef enum {
SWITCH_PRIORITY_NORMAL ,
SWITCH_PRIORITY_LOW ,
2007-06-08 14:52:50 +00:00
SWITCH_PRIORITY_HIGH
2006-02-26 00:12:17 +00:00
} switch_priority_t ;
2006-01-26 17:57:25 +00:00
/*!
\ enum switch_ivr_option_t
\ brief Possible options related to ivr functions
< pre >
2006-01-27 16:43:57 +00:00
SWITCH_IVR_OPTION_NONE - nothing whatsoever
SWITCH_IVR_OPTION_ASYNC - Asynchronous ( do things in the background when applicable )
SWITCH_IVR_OPTION_FILE - string argument implies a filename
2006-01-26 17:57:25 +00:00
< / pre >
*/
typedef enum {
2006-01-27 16:43:57 +00:00
SWITCH_IVR_OPTION_NONE = 0 ,
SWITCH_IVR_OPTION_ASYNC = ( 1 < < 0 ) ,
SWITCH_IVR_OPTION_FILE = ( 1 < < 1 )
2008-06-05 13:34:39 +00:00
} switch_ivr_option_enum_t ;
typedef uint32_t switch_ivr_option_t ;
2006-05-10 03:23:05 +00:00
2006-01-09 19:48:20 +00:00
/*!
2006-04-29 06:05:03 +00:00
\ enum switch_core_session_message_types_t
2006-01-09 19:48:20 +00:00
\ brief Possible types of messages for inter - session communication
< pre >
2006-02-22 02:50:33 +00:00
SWITCH_MESSAGE_REDIRECT_AUDIO - Indication to redirect audio to another location if possible
SWITCH_MESSAGE_TRANSMIT_TEXT - A text message
2007-04-16 16:53:30 +00:00
SWITCH_MESSAGE_INDICATE_ANSWER - indicate answer
2006-02-22 02:50:33 +00:00
SWITCH_MESSAGE_INDICATE_PROGRESS - indicate progress
2006-04-17 18:25:43 +00:00
SWITCH_MESSAGE_INDICATE_BRIDGE - indicate a bridge starting
2006-10-06 22:39:49 +00:00
SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
SWITCH_MESSAGE_INDICATE_TRANSFER - indicate a transfer is taking place
2006-10-31 21:38:06 +00:00
SWITCH_MESSAGE_INDICATE_MEDIA - indicate media is required
SWITCH_MESSAGE_INDICATE_NOMEDIA - indicate no - media is required
SWITCH_MESSAGE_INDICATE_HOLD - indicate hold
SWITCH_MESSAGE_INDICATE_UNHOLD - indicate unhold
2007-01-10 21:26:10 +00:00
SWITCH_MESSAGE_INDICATE_REDIRECT - indicate redirect
2008-01-03 00:50:53 +00:00
SWITCH_MESSAGE_INDICATE_RESPOND - indicate reject
2007-05-01 21:21:35 +00:00
SWITCH_MESSAGE_INDICATE_BROADCAST - indicate media broadcast
2007-09-19 18:24:47 +00:00
SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT - indicate media broadcast
2008-01-03 23:42:15 +00:00
SWITCH_MESSAGE_INDICATE_DEFLECT - indicate deflect
2008-02-07 00:04:14 +00:00
SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ - indicate video refresh request
2006-01-09 19:48:20 +00:00
< / pre >
*/
typedef enum {
SWITCH_MESSAGE_REDIRECT_AUDIO ,
2006-02-22 02:50:33 +00:00
SWITCH_MESSAGE_TRANSMIT_TEXT ,
2007-04-16 16:53:30 +00:00
SWITCH_MESSAGE_INDICATE_ANSWER ,
2006-04-17 18:25:43 +00:00
SWITCH_MESSAGE_INDICATE_PROGRESS ,
SWITCH_MESSAGE_INDICATE_BRIDGE ,
2006-10-06 22:39:49 +00:00
SWITCH_MESSAGE_INDICATE_UNBRIDGE ,
2006-10-12 00:59:09 +00:00
SWITCH_MESSAGE_INDICATE_TRANSFER ,
2006-10-31 21:38:06 +00:00
SWITCH_MESSAGE_INDICATE_RINGING ,
SWITCH_MESSAGE_INDICATE_MEDIA ,
SWITCH_MESSAGE_INDICATE_NOMEDIA ,
SWITCH_MESSAGE_INDICATE_HOLD ,
SWITCH_MESSAGE_INDICATE_UNHOLD ,
2007-04-21 15:04:01 +00:00
SWITCH_MESSAGE_INDICATE_REDIRECT ,
2008-01-03 00:50:53 +00:00
SWITCH_MESSAGE_INDICATE_RESPOND ,
2007-09-19 18:24:47 +00:00
SWITCH_MESSAGE_INDICATE_BROADCAST ,
2008-01-03 23:42:15 +00:00
SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT ,
2008-02-07 00:04:14 +00:00
SWITCH_MESSAGE_INDICATE_DEFLECT ,
2008-03-11 03:45:16 +00:00
SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ ,
2008-05-13 20:36:23 +00:00
SWITCH_MESSAGE_INDICATE_DISPLAY ,
2008-11-05 00:20:30 +00:00
SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY ,
2008-11-25 17:53:35 +00:00
SWITCH_MESSAGE_INDICATE_AUDIO_SYNC ,
2008-12-30 19:50:33 +00:00
SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA ,
2009-10-22 14:54:29 +00:00
SWITCH_MESSAGE_INDICATE_UUID_CHANGE ,
2010-01-20 19:20:11 +00:00
SWITCH_MESSAGE_INDICATE_SIMPLIFY ,
2013-04-26 22:47:06 +00:00
SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA ,
2010-01-21 18:03:54 +00:00
SWITCH_MESSAGE_INDICATE_PROXY_MEDIA ,
2010-02-06 03:38:24 +00:00
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC ,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE ,
2010-04-16 15:01:00 +00:00
SWITCH_MESSAGE_INDICATE_PHONE_EVENT ,
2010-05-13 02:25:54 +00:00
SWITCH_MESSAGE_INDICATE_T38_DESCRIPTION ,
SWITCH_MESSAGE_INDICATE_UDPTL_MODE ,
2010-06-18 21:52:39 +00:00
SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS ,
2010-12-10 23:47:24 +00:00
SWITCH_MESSAGE_INDICATE_JITTER_BUFFER ,
2010-12-29 19:15:14 +00:00
SWITCH_MESSAGE_INDICATE_RECOVERY_REFRESH ,
2011-06-16 19:37:22 +00:00
SWITCH_MESSAGE_INDICATE_SIGNAL_DATA ,
2012-08-31 20:35:13 +00:00
SWITCH_MESSAGE_INDICATE_MESSAGE ,
2011-11-23 21:38:54 +00:00
SWITCH_MESSAGE_INDICATE_INFO ,
2011-12-08 18:26:31 +00:00
SWITCH_MESSAGE_INDICATE_AUDIO_DATA ,
2012-05-08 13:50:33 +00:00
SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE ,
2012-06-22 23:08:59 +00:00
SWITCH_MESSAGE_INDICATE_STUN_ERROR ,
2012-09-07 20:33:09 +00:00
SWITCH_MESSAGE_INDICATE_MEDIA_RENEG ,
2014-04-16 01:02:44 +00:00
SWITCH_MESSAGE_INDICATE_KEEPALIVE ,
2014-10-27 19:13:36 +00:00
SWITCH_MESSAGE_INDICATE_HARD_MUTE ,
2013-10-24 19:29:29 +00:00
SWITCH_MESSAGE_REFER_EVENT ,
2013-09-11 17:58:00 +00:00
SWITCH_MESSAGE_ANSWER_EVENT ,
SWITCH_MESSAGE_PROGRESS_EVENT ,
SWITCH_MESSAGE_RING_EVENT ,
2014-03-07 00:17:47 +00:00
SWITCH_MESSAGE_RESAMPLE_EVENT ,
2014-04-15 16:22:36 +00:00
SWITCH_MESSAGE_HEARTBEAT_EVENT ,
2008-11-05 00:20:30 +00:00
SWITCH_MESSAGE_INVALID
2006-04-29 06:05:03 +00:00
} switch_core_session_message_types_t ;
2006-01-09 19:48:20 +00:00
2008-12-30 19:50:33 +00:00
typedef struct {
2010-05-13 02:25:54 +00:00
uint16_t T38FaxVersion ;
2008-12-30 19:50:33 +00:00
uint32_t T38MaxBitRate ;
switch_bool_t T38FaxFillBitRemoval ;
switch_bool_t T38FaxTranscodingMMR ;
switch_bool_t T38FaxTranscodingJBIG ;
const char * T38FaxRateManagement ;
uint32_t T38FaxMaxBuffer ;
uint32_t T38FaxMaxDatagram ;
const char * T38FaxUdpEC ;
const char * T38VendorInfo ;
2010-06-17 15:23:37 +00:00
const char * remote_ip ;
2010-09-29 20:47:58 +00:00
uint16_t remote_port ;
2010-06-17 15:23:37 +00:00
const char * local_ip ;
2010-09-29 20:47:58 +00:00
uint16_t local_port ;
2011-09-20 01:11:23 +00:00
const char * sdp_o_line ;
2008-12-30 19:50:33 +00:00
} switch_t38_options_t ;
2006-01-09 19:48:20 +00:00
2006-01-05 21:03:22 +00:00
/*!
\ enum switch_stack_t
\ brief Expression of how to stack a list
< pre >
SWITCH_STACK_BOTTOM - Stack on the bottom
SWITCH_STACK_TOP - Stack on the top
< / pre >
*/
2005-12-23 21:09:36 +00:00
typedef enum {
2010-05-25 21:54:13 +00:00
SWITCH_STACK_BOTTOM = ( 1 < < 0 ) ,
SWITCH_STACK_TOP = ( 1 < < 1 ) ,
2011-05-25 20:42:36 +00:00
SWITCH_STACK_NODUP = ( 1 < < 2 ) ,
SWITCH_STACK_UNSHIFT = ( 1 < < 3 ) ,
SWITCH_STACK_PUSH = ( 1 < < 4 ) ,
2005-12-23 21:09:36 +00:00
} switch_stack_t ;
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_status_t
2006-01-05 21:03:22 +00:00
\ brief Common return values
< pre >
SWITCH_STATUS_SUCCESS - General Success ( common return value for most functions )
SWITCH_STATUS_FALSE - General Falsehood
SWITCH_STATUS_TIMEOUT - A Timeout has occured
SWITCH_STATUS_RESTART - An indication to restart the previous operation
SWITCH_STATUS_TERM - An indication to terminate
SWITCH_STATUS_NOTIMPL - An indication that requested resource is not impelemented
SWITCH_STATUS_MEMERR - General memory error
SWITCH_STATUS_NOOP - NOTHING
SWITCH_STATUS_RESAMPLE - An indication that a resample has occured
SWITCH_STATUS_GENERR - A general Error
SWITCH_STATUS_INUSE - An indication that requested resource is in use
2006-01-27 21:33:45 +00:00
SWITCH_STATUS_BREAK - A non - fatal break of an operation
2006-05-30 17:19:01 +00:00
SWITCH_STATUS_SOCKERR - A socket error
SWITCH_STATUS_MORE_DATA - Need More Data
2006-06-06 23:07:37 +00:00
SWITCH_STATUS_NOTFOUND - Not Found
2006-11-09 05:39:04 +00:00
SWITCH_STATUS_UNLOAD - Unload
2007-05-03 16:28:23 +00:00
SWITCH_STATUS_NOUNLOAD - Never Unload
2006-01-05 21:03:22 +00:00
< / pre >
*/
2005-11-19 20:07:43 +00:00
typedef enum {
SWITCH_STATUS_SUCCESS ,
SWITCH_STATUS_FALSE ,
SWITCH_STATUS_TIMEOUT ,
SWITCH_STATUS_RESTART ,
2011-01-11 21:09:03 +00:00
SWITCH_STATUS_INTR ,
2005-11-19 20:07:43 +00:00
SWITCH_STATUS_NOTIMPL ,
SWITCH_STATUS_MEMERR ,
SWITCH_STATUS_NOOP ,
2005-12-30 00:00:21 +00:00
SWITCH_STATUS_RESAMPLE ,
2005-12-14 22:46:09 +00:00
SWITCH_STATUS_GENERR ,
2006-01-27 21:33:45 +00:00
SWITCH_STATUS_INUSE ,
SWITCH_STATUS_BREAK ,
2006-05-30 17:19:01 +00:00
SWITCH_STATUS_SOCKERR ,
2006-06-06 23:07:37 +00:00
SWITCH_STATUS_MORE_DATA ,
2006-11-09 05:39:04 +00:00
SWITCH_STATUS_NOTFOUND ,
2007-05-03 16:28:23 +00:00
SWITCH_STATUS_UNLOAD ,
2008-03-13 01:08:42 +00:00
SWITCH_STATUS_NOUNLOAD ,
2008-10-29 00:04:20 +00:00
SWITCH_STATUS_IGNORE ,
2008-11-13 20:23:59 +00:00
SWITCH_STATUS_TOO_SMALL ,
2010-10-04 23:23:43 +00:00
SWITCH_STATUS_FOUND ,
2010-10-15 23:00:49 +00:00
SWITCH_STATUS_CONTINUE ,
2011-01-11 21:09:03 +00:00
SWITCH_STATUS_TERM ,
2013-09-26 17:31:35 +00:00
SWITCH_STATUS_NOT_INITALIZED ,
SWITCH_STATUS_XBREAK = 35 ,
SWITCH_STATUS_WINBREAK = 730035
2006-04-29 23:43:28 +00:00
} switch_status_t ;
2005-11-19 20:07:43 +00:00
2006-04-11 21:13:44 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_log_level_t
2006-04-11 21:13:44 +00:00
\ brief Log Level Enumeration
< pre >
SWITCH_LOG_DEBUG - Debug
SWITCH_LOG_INFO - Info
SWITCH_LOG_NOTICE - Notice
SWITCH_LOG_WARNING - Warning
2006-04-16 06:05:53 +00:00
SWITCH_LOG_ERROR - Error
2006-04-11 21:13:44 +00:00
SWITCH_LOG_CRIT - Critical
SWITCH_LOG_ALERT - Alert
2007-10-04 17:25:06 +00:00
SWITCH_LOG_CONSOLE - Console
2006-04-11 21:13:44 +00:00
< / pre >
*/
typedef enum {
2009-11-20 23:12:07 +00:00
SWITCH_LOG_DEBUG10 = 110 ,
SWITCH_LOG_DEBUG9 = 109 ,
SWITCH_LOG_DEBUG8 = 108 ,
SWITCH_LOG_DEBUG7 = 107 ,
SWITCH_LOG_DEBUG6 = 106 ,
SWITCH_LOG_DEBUG5 = 105 ,
SWITCH_LOG_DEBUG4 = 104 ,
SWITCH_LOG_DEBUG3 = 103 ,
SWITCH_LOG_DEBUG2 = 102 ,
SWITCH_LOG_DEBUG1 = 101 ,
2006-04-11 21:13:44 +00:00
SWITCH_LOG_DEBUG = 7 ,
2007-03-29 22:31:56 +00:00
SWITCH_LOG_INFO = 6 ,
2006-04-11 21:13:44 +00:00
SWITCH_LOG_NOTICE = 5 ,
SWITCH_LOG_WARNING = 4 ,
2006-04-16 06:05:53 +00:00
SWITCH_LOG_ERROR = 3 ,
2006-04-11 21:13:44 +00:00
SWITCH_LOG_CRIT = 2 ,
SWITCH_LOG_ALERT = 1 ,
2007-12-10 19:16:50 +00:00
SWITCH_LOG_CONSOLE = 0 ,
2012-10-11 17:44:31 +00:00
SWITCH_LOG_INVALID = 64 ,
SWITCH_LOG_UNINIT = 1000 ,
2006-04-29 23:43:28 +00:00
} switch_log_level_t ;
2006-04-11 21:13:44 +00:00
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_text_channel_t
2006-01-05 21:03:22 +00:00
\ brief A target to write log / debug info to
< pre >
2006-04-11 21:13:44 +00:00
SWITCH_CHANNEL_ID_LOG - Write to the currently defined log
SWITCH_CHANNEL_ID_LOG_CLEAN - Write to the currently defined log with no extra file / line / date information
SWITCH_CHANNEL_ID_EVENT - Write to the event engine as a LOG event
2006-01-05 21:03:22 +00:00
< / pre >
*/
2005-11-19 20:07:43 +00:00
typedef enum {
2006-04-11 21:13:44 +00:00
SWITCH_CHANNEL_ID_LOG ,
SWITCH_CHANNEL_ID_LOG_CLEAN ,
2010-01-20 19:19:48 +00:00
SWITCH_CHANNEL_ID_EVENT ,
SWITCH_CHANNEL_ID_SESSION
2006-04-29 23:43:28 +00:00
} switch_text_channel_t ;
2005-11-19 20:07:43 +00:00
2006-10-12 00:59:09 +00:00
typedef enum {
2008-11-20 02:07:59 +00:00
SCSMF_DYNAMIC = ( 1 < < 0 ) ,
SCSMF_FREE_STRING_REPLY = ( 1 < < 1 ) ,
2009-11-24 06:00:48 +00:00
SCSMF_FREE_POINTER_REPLY = ( 1 < < 2 )
2008-06-05 13:34:39 +00:00
} switch_core_session_message_flag_enum_t ;
typedef uint32_t switch_core_session_message_flag_t ;
2006-10-12 00:59:09 +00:00
2007-06-20 09:19:45 +00:00
# define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
# define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
2010-01-20 19:19:48 +00:00
# define SWITCH_CHANNEL_SESSION_LOG_CLEAN(x) SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, switch_core_session_get_uuid((x))
2007-06-20 09:19:45 +00:00
# define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
2010-01-20 19:19:48 +00:00
# define SWITCH_CHANNEL_SESSION_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)(x)
# define SWITCH_CHANNEL_CHANNEL_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)switch_channel_get_session(x)
# define SWITCH_CHANNEL_UUID_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, (x)
2005-11-19 20:07:43 +00:00
2010-06-05 00:03:36 +00:00
typedef enum {
CCS_DOWN ,
CCS_DIALING ,
CCS_RINGING ,
CCS_EARLY ,
CCS_ACTIVE ,
CCS_HELD ,
2013-10-30 19:08:27 +00:00
CCS_RING_WAIT ,
2013-06-05 16:19:44 +00:00
CCS_HANGUP ,
2014-05-30 19:30:59 +00:00
CCS_UNHELD
2010-06-05 00:03:36 +00:00
} switch_channel_callstate_t ;
2013-06-05 16:19:44 +00:00
typedef enum {
SDS_DOWN ,
2013-06-11 00:13:05 +00:00
SDS_RINGING ,
2013-06-05 16:19:44 +00:00
SDS_ACTIVE ,
SDS_ACTIVE_MULTI ,
SDS_HELD ,
2014-05-30 19:30:59 +00:00
SDS_UNHELD ,
2013-06-05 16:19:44 +00:00
SDS_HANGUP
} switch_device_state_t ;
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_channel_state_t
2008-05-05 15:30:55 +00:00
\ brief Channel States ( these are the defaults , CS_SOFT_EXECUTE , CS_EXCHANGE_MEDIA , and CS_CONSUME_MEDIA are often overridden by specific apps )
2006-01-05 21:03:22 +00:00
< pre >
2009-03-04 04:19:33 +00:00
CS_NEW - Channel is newly created .
CS_INIT - Channel has been initilized .
CS_ROUTING - Channel is looking for an extension to execute .
CS_SOFT_EXECUTE - Channel is ready to execute from 3 rd party control .
CS_EXECUTE - Channel is executing it ' s dialplan .
2008-05-05 15:30:55 +00:00
CS_EXCHANGE_MEDIA - Channel is exchanging media with another channel .
CS_PARK - Channel is accepting media awaiting commands .
CS_CONSUME_MEDIA - Channel is consuming all media and dropping it .
2009-03-04 04:19:33 +00:00
CS_HIBERNATE - Channel is in a sleep state .
CS_RESET - Channel is in a reset state .
CS_HANGUP - Channel is flagged for hangup and ready to end .
2009-03-04 04:35:30 +00:00
CS_REPORTING - Channel is ready to collect call detail .
2009-04-10 17:43:18 +00:00
CS_DESTROY - Channel is ready to be destroyed and out of the state machine
2006-01-05 21:03:22 +00:00
< / pre >
2006-01-02 05:00:28 +00:00
*/
2005-11-19 20:07:43 +00:00
typedef enum {
CS_NEW ,
CS_INIT ,
2008-05-05 15:30:55 +00:00
CS_ROUTING ,
CS_SOFT_EXECUTE ,
2005-11-19 20:07:43 +00:00
CS_EXECUTE ,
2008-05-05 15:30:55 +00:00
CS_EXCHANGE_MEDIA ,
2007-12-13 22:17:20 +00:00
CS_PARK ,
2008-05-05 15:30:55 +00:00
CS_CONSUME_MEDIA ,
2006-10-31 21:38:06 +00:00
CS_HIBERNATE ,
2007-07-03 02:10:35 +00:00
CS_RESET ,
2005-11-19 20:07:43 +00:00
CS_HANGUP ,
2009-03-04 04:19:33 +00:00
CS_REPORTING ,
2009-04-10 17:43:18 +00:00
CS_DESTROY ,
2007-12-19 23:24:55 +00:00
CS_NONE
2006-04-29 23:43:28 +00:00
} switch_channel_state_t ;
2005-11-19 20:07:43 +00:00
2010-06-15 20:48:12 +00:00
typedef enum {
SWITCH_RING_READY_NONE ,
SWITCH_RING_READY_RINGING ,
SWITCH_RING_READY_QUEUED
} switch_ring_ready_t ;
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_channel_flag_t
2006-01-05 21:03:22 +00:00
\ brief Channel Flags
< pre >
2008-12-11 15:20:24 +00:00
CF_ANSWERED - Channel is answered
CF_OUTBOUND - Channel is an outbound channel
CF_EARLY_MEDIA - Channel is ready for audio before answer
CF_ORIGINATOR - Channel is an originator
CF_TRANSFER - Channel is being transfered
CF_ACCEPT_CNG - Channel will accept CNG frames
CF_REDIRECT - Channel is being redirected
CF_BRIDGED - Channel in a bridge
CF_HOLD - Channel is on hold
CF_SERVICE - Channel has a service thread
CF_TAGGED - Channel is tagged
CF_WINNER - Channel is the winner
CF_CONTROLLED - Channel is under control
CF_PROXY_MODE - Channel has no media
CF_SUSPEND - Suspend i / o
CF_EVENT_PARSE - Suspend control events
CF_GEN_RINGBACK - Channel is generating it ' s own ringback
CF_RING_READY - Channel is ready to send ringback
CF_BREAK - Channel should stop what it ' s doing
CF_BROADCAST - Channel is broadcasting
CF_UNICAST - Channel has a unicast connection
CF_VIDEO - Channel has video
CF_EVENT_LOCK - Don ' t parse events
CF_RESET - Tell extension parser to reset
CF_ORIGINATING - Channel is originating
CF_STOP_BROADCAST - Signal to stop broadcast
2014-02-25 03:22:11 +00:00
CF_AUDIO_PAUSE - Audio is not ready to read / write
CF_VIDEO_PAUSE - Video is not ready to read / write
2006-01-05 21:03:22 +00:00
< / pre >
*/
2009-10-14 19:26:10 +00:00
typedef enum {
CC_MEDIA_ACK = 1 ,
2009-10-20 17:03:03 +00:00
CC_BYPASS_MEDIA ,
CC_PROXY_MEDIA ,
2011-01-05 22:25:07 +00:00
CC_JITTERBUFFER ,
CC_FS_RTP ,
2011-08-29 16:04:38 +00:00
CC_QUEUEABLE_DTMF_DELAY ,
2009-10-14 19:26:10 +00:00
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CC_FLAG_MAX
} switch_channel_cap_t ;
2005-11-19 20:07:43 +00:00
typedef enum {
2008-12-11 15:20:24 +00:00
CF_ANSWERED = 1 ,
CF_OUTBOUND ,
CF_EARLY_MEDIA ,
2009-10-07 04:30:19 +00:00
CF_BRIDGE_ORIGINATOR ,
2012-10-29 14:47:01 +00:00
CF_UUID_BRIDGE_ORIGINATOR ,
2008-12-11 15:20:24 +00:00
CF_TRANSFER ,
CF_ACCEPT_CNG ,
CF_REDIRECT ,
CF_BRIDGED ,
CF_HOLD ,
CF_SERVICE ,
CF_TAGGED ,
CF_WINNER ,
CF_CONTROLLED ,
CF_PROXY_MODE ,
2015-01-23 21:12:26 +00:00
CF_PROXY_OFF ,
2008-12-11 15:20:24 +00:00
CF_SUSPEND ,
CF_EVENT_PARSE ,
CF_GEN_RINGBACK ,
CF_RING_READY ,
CF_BREAK ,
CF_BROADCAST ,
CF_UNICAST ,
CF_VIDEO ,
CF_EVENT_LOCK ,
2009-12-10 01:29:02 +00:00
CF_EVENT_LOCK_PRI ,
2008-12-11 15:20:24 +00:00
CF_RESET ,
CF_ORIGINATING ,
CF_STOP_BROADCAST ,
CF_PROXY_MEDIA ,
CF_INNER_BRIDGE ,
CF_REQ_MEDIA ,
CF_VERBOSE_EVENTS ,
2009-01-23 18:44:25 +00:00
CF_PAUSE_BUGS ,
2009-02-21 23:19:58 +00:00
CF_DIVERT_EVENTS ,
2009-03-04 04:19:33 +00:00
CF_BLOCK_STATE ,
2009-04-23 13:15:03 +00:00
CF_FS_RTP ,
2009-04-28 14:13:05 +00:00
CF_REPORTING ,
2009-04-30 22:45:46 +00:00
CF_PARK ,
2009-05-11 16:52:01 +00:00
CF_TIMESTAMP_SET ,
2009-10-07 04:30:19 +00:00
CF_ORIGINATOR ,
CF_XFER_ZOMBIE ,
2009-10-14 19:26:10 +00:00
CF_MEDIA_ACK ,
2009-10-20 17:03:03 +00:00
CF_THREAD_SLEEPING ,
2009-10-22 22:11:28 +00:00
CF_DISABLE_RINGBACK ,
CF_NOT_READY ,
2009-11-03 16:50:16 +00:00
CF_SIGNAL_BRIDGE_TTL ,
CF_MEDIA_BRIDGE_TTL ,
2009-11-09 23:49:35 +00:00
CF_BYPASS_MEDIA_AFTER_BRIDGE ,
2009-11-24 18:18:09 +00:00
CF_LEG_HOLDING ,
2009-12-02 18:13:11 +00:00
CF_BROADCAST_DROP_MEDIA ,
2009-12-11 00:28:54 +00:00
CF_EARLY_HANGUP ,
2010-01-22 00:51:32 +00:00
CF_MEDIA_SET ,
2010-06-02 22:31:08 +00:00
CF_CONSUME_ON_ORIGINATE ,
2010-10-05 14:59:13 +00:00
CF_PASSTHRU_PTIME_MISMATCH ,
2010-10-07 23:30:07 +00:00
CF_BRIDGE_NOWRITE ,
2010-10-13 21:17:36 +00:00
CF_RECOVERED ,
2010-12-10 23:47:24 +00:00
CF_JITTERBUFFER ,
2011-11-08 14:02:17 +00:00
CF_JITTERBUFFER_PLC ,
2010-12-16 15:45:43 +00:00
CF_DIALPLAN ,
2013-04-05 13:28:49 +00:00
CF_BLEG ,
2010-12-23 01:10:30 +00:00
CF_BLOCK_BROADCAST_UNTIL_MEDIA ,
2010-12-23 02:38:57 +00:00
CF_CNG_PLC ,
2011-03-11 19:00:16 +00:00
CF_ATTENDED_TRANSFER ,
CF_LAZY_ATTENDED_TRANSFER ,
2011-07-16 07:33:39 +00:00
CF_SIGNAL_DATA ,
CF_SIMPLIFY ,
2011-09-13 22:12:37 +00:00
CF_ZOMBIE_EXEC ,
2011-10-25 13:47:01 +00:00
CF_INTERCEPT ,
2011-11-02 13:54:03 +00:00
CF_INTERCEPTED ,
2012-01-13 21:22:31 +00:00
CF_VIDEO_REFRESH_REQ ,
2012-01-17 18:19:23 +00:00
CF_SERVICE_AUDIO ,
CF_SERVICE_VIDEO ,
add enhanced zrtp passthrough (zrtp passthru) mode
ZRTP passthrough mode allows two ZRTP-capable clients to negotiate an
end-to-end security association through FreeSWITCH. The clients are
therefore able to be certain that the FreeSWITCH instance mediating
the call cannot eavesdrop on their conversation.
Importantly, this capability is maintained across multiple FreeSWITCH
hops. If widely deployed, this enables a global network architecture
where two people can speak securely with strong cryptographically
protected authentication and confidentiality.
With this commit we implement a zrtp-passthru mode that handles all
the details of the negotiation intelligently. This mode can be
selected by setting the boolean parameter inbound-zrtp-passthru in the
sofia profile. This will also force late-negotiation as it is
essential for correctly negotiating an end-to-end ZRTP security
association.
When an incoming call with a zrtp-hash is received and this mode is
enabled, we find the first audio and the first video zrtp-hash in the
SDP and store them as remote values on this channel. Once a b-leg is
available, we set the local zrtp-hash values on that channel to the
remote zrtp-hash values collected from the a-leg.
Because zrtp-passthru absolutely requires that the channels negotiate
the same codec, we offer to the b-leg only codecs that the a-leg can
speak. Once the b-leg accepts a codec, we will force that choice onto
the a-leg.
If the b-leg sends us zrtp-hash values in the signaling, we store
those as remote values on the b-leg and copy them to the local values
on the a-leg.
At this point, each leg has the zrtp-hash values from the other, and
we know we can do ZRTP passthrough mode on the call. We send the
b-leg's zrtp-hash back to the a-leg in the 200 OK.
We then enable UDPTL mode on the rtp streams for both the audio and
the video so that we don't interfere in the ZRTP negotiation.
If the b-leg fails to return a zrtp-hash in the signaling, we set up a
ZRTP security association with the a-leg ourselves, if we are so
equipped. Likewise, if the a-leg fails to send a zrtp-hash in the
signaling, we attempt to set up a ZRTP security association ourselves
with the b-leg.
The zrtp-passthru mode can also be enabled in the dialplan by setting
the boolean channel variable zrtp_passthru. If enabled in this
manner, we can't force late-negotiation, so the user would need to be
sure this is configured.
If ZRTP passthrough mode is not enabled in either manner, this change
should have no effect.
Channel variables for each of the various zrtp-hash values are set,
though it is anticipated that there is no good reason to use them, so
they may be removed without warning. For checking whether zrtp
passthrough mode was successful, we provide the channel variable
zrtp_passthru_active which is set on both legs.
Though not implemented by this commit, the changes here should make it
more straightforward to add correct zrtp-hash values to the signaling
and verify that correct hello hash values are received when FreeSWITCH
is acting as a terminating leg of the ZRTP security association.
A historical note...
This commit replaces the recently-added sdp_zrtp_hash_string method,
commit 2ab1605a8887adc62be1b75f6ef67af87ff080de.
This prior method sets a channel variable from the a-leg's zrtp-hash,
then relies on the dialplan to export this channel variable to the
b-leg, where it is put into the SDP.
While it was a great start and wonderful for testing, this approach
has some drawbacks that motivated the present work:
* There's no good way to pass the zrtp-hash from the b-leg back to
the a-leg. In fact, the implementation seems to send the a-leg's
zrtp-hash back to the originating client in the 200 OK. This is
not correct.
* To support video, we'd need to have a separate dialplan variable,
and the dialplan author would need to deal with that explicitly.
* The API is problematic as it requires the dialplan author to
understand intricate details of how ZRTP works to implement a
correct dialplan. Further, by providing too fine-grained control
(but at the same time, not enough control) it would limit our
ability to make the behavior smarter once people started relying on
this.
2012-05-24 20:39:03 +00:00
CF_ZRTP_PASSTHRU_REQ ,
CF_ZRTP_PASSTHRU ,
2012-03-29 23:37:10 +00:00
CF_ZRTP_HASH ,
2012-05-04 23:59:25 +00:00
CF_CHANNEL_SWAP ,
2013-06-05 16:19:44 +00:00
CF_DEVICE_LEG ,
CF_FINAL_DEVICE_LEG ,
2012-05-07 13:17:41 +00:00
CF_PICKUP ,
2012-05-08 13:50:33 +00:00
CF_CONFIRM_BLIND_TRANSFER ,
2012-07-03 13:05:41 +00:00
CF_NO_PRESENCE ,
2012-07-11 20:15:43 +00:00
CF_CONFERENCE ,
2013-10-16 22:58:03 +00:00
CF_CONFERENCE_ADV ,
2012-08-22 21:24:09 +00:00
CF_RECOVERING ,
CF_RECOVERING_BRIDGE ,
CF_TRACKED ,
CF_TRACKABLE ,
2012-08-29 15:38:37 +00:00
CF_NO_CDR ,
2012-08-30 21:51:06 +00:00
CF_EARLY_OK ,
2012-10-22 17:37:41 +00:00
CF_MEDIA_TRANS ,
2012-11-16 03:07:58 +00:00
CF_HOLD_ON_BRIDGE ,
2012-12-19 02:35:44 +00:00
CF_SECURE ,
2012-12-21 04:57:47 +00:00
CF_LIBERAL_DTMF ,
CF_SLA_BARGE ,
CF_SLA_BARGING ,
CF_PROTO_HOLD , //TFLAG_SIP_HOLD
CF_HOLD_LOCK ,
CF_VIDEO_POSSIBLE , //TFLAG_VIDEO
2012-12-21 20:22:25 +00:00
CF_NOTIMER_DURING_BRIDGE ,
CF_PASS_RFC2833 ,
2012-12-21 22:57:59 +00:00
CF_T38_PASSTHRU ,
CF_DROP_DTMF ,
2012-12-22 03:30:14 +00:00
CF_REINVITE ,
2012-12-22 17:51:03 +00:00
CF_AUTOFLUSH_DURING_BRIDGE ,
CF_RTP_NOTIMER_DURING_BRIDGE ,
2015-01-12 17:34:42 +00:00
CF_AVPF ,
CF_AVPF_MOZ ,
2013-01-10 04:31:25 +00:00
CF_ICE ,
2013-02-01 20:29:40 +00:00
CF_DTLS ,
2013-02-19 21:45:06 +00:00
CF_VERBOSE_SDP ,
2013-02-21 15:13:37 +00:00
CF_DTLS_OK ,
2014-03-17 16:27:42 +00:00
CF_3PCC ,
2013-06-18 00:52:37 +00:00
CF_VIDEO_PASSIVE ,
2013-06-20 18:08:09 +00:00
CF_NOVIDEO ,
2013-07-11 22:38:24 +00:00
CF_VIDEO_ECHO ,
2013-09-10 21:55:31 +00:00
CF_SLA_INTERCEPT ,
2013-09-12 16:47:54 +00:00
CF_VIDEO_BREAK ,
2014-02-25 03:22:11 +00:00
CF_AUDIO_PAUSE ,
CF_VIDEO_PAUSE ,
2014-02-05 02:15:08 +00:00
CF_BYPASS_MEDIA_AFTER_HOLD ,
2014-02-26 22:24:25 +00:00
CF_HANGUP_HELD ,
2014-03-07 00:17:47 +00:00
CF_CONFERENCE_RESET_MEDIA ,
2014-11-18 22:39:32 +00:00
CF_VIDEO_DECODED_READ ,
2014-11-20 22:30:19 +00:00
CF_VIDEO_DEBUG_READ ,
CF_VIDEO_DEBUG_WRITE ,
2008-12-11 15:20:24 +00:00
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
2011-08-26 01:21:53 +00:00
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
2008-12-11 15:20:24 +00:00
CF_FLAG_MAX
} switch_channel_flag_t ;
2008-11-21 00:09:11 +00:00
2009-01-22 14:01:15 +00:00
typedef enum {
2010-05-13 02:25:54 +00:00
CF_APP_TAGGED = ( 1 < < 0 ) ,
2011-06-08 23:50:21 +00:00
CF_APP_T38 = ( 1 < < 1 ) ,
CF_APP_T38_REQ = ( 1 < < 2 ) ,
2011-09-21 19:56:49 +00:00
CF_APP_T38_FAIL = ( 1 < < 3 ) ,
CF_APP_T38_NEGOTIATED = ( 1 < < 4 )
2009-01-22 14:01:15 +00:00
} switch_channel_app_flag_t ;
2006-04-06 19:50:53 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_frame_flag_t
2006-04-06 19:50:53 +00:00
\ brief Frame Flags
< pre >
2007-05-04 23:29:35 +00:00
SFF_CNG = ( 1 < < 0 ) - Frame represents comfort noise
SFF_RAW_RTP = ( 1 < < 1 ) - Frame has raw rtp accessible
2013-09-24 18:39:29 +00:00
SFF_RTP_HEADER = ( 1 < < 2 ) - Get the rtp header from the frame header
SFF_PLC = ( 1 < < 3 ) - Frame has generated PLC data
SFF_RFC2833 = ( 1 < < 4 ) - Frame has rfc2833 dtmf data
SFF_DYNAMIC = ( 1 < < 5 ) - Frame is dynamic and should be freed
SFF_MARKER = ( 1 < < 11 ) - Frame flag has Marker set , only set by encoder
2014-08-23 08:54:50 +00:00
SFF_WAIT_KEY_FRAME = ( 1 < < 12 ) - Need a key from before could decode , or force generate a key frame on encode
2006-04-06 19:50:53 +00:00
< / pre >
*/
typedef enum {
2006-05-15 18:16:43 +00:00
SFF_NONE = 0 ,
2006-04-18 00:24:52 +00:00
SFF_CNG = ( 1 < < 0 ) ,
2007-04-19 21:40:50 +00:00
SFF_RAW_RTP = ( 1 < < 1 ) ,
2007-05-04 23:29:35 +00:00
SFF_RTP_HEADER = ( 1 < < 2 ) ,
2007-10-23 21:32:17 +00:00
SFF_PLC = ( 1 < < 3 ) ,
2008-02-21 17:48:41 +00:00
SFF_RFC2833 = ( 1 < < 4 ) ,
2009-04-13 18:35:26 +00:00
SFF_PROXY_PACKET = ( 1 < < 5 ) ,
2009-05-22 18:19:55 +00:00
SFF_DYNAMIC = ( 1 < < 6 ) ,
2010-05-13 02:25:54 +00:00
SFF_ZRTP = ( 1 < < 7 ) ,
2011-09-09 18:56:04 +00:00
SFF_UDPTL_PACKET = ( 1 < < 8 ) ,
2013-01-17 01:04:57 +00:00
SFF_NOT_AUDIO = ( 1 < < 9 ) ,
2013-09-24 18:39:29 +00:00
SFF_RTCP = ( 1 < < 10 ) ,
SFF_MARKER = ( 1 < < 11 ) ,
2014-11-14 02:52:57 +00:00
SFF_WAIT_KEY_FRAME = ( 1 < < 12 ) ,
2014-11-15 01:01:56 +00:00
SFF_RAW_RTP_PARSE_FRAME = ( 1 < < 13 ) ,
2014-11-18 22:39:32 +00:00
SFF_PICTURE_RESET = ( 1 < < 14 ) ,
2014-11-18 23:36:55 +00:00
SFF_SAME_IMAGE = ( 1 < < 15 ) ,
SFF_USE_VIDEO_TIMESTAMP = ( 1 < < 16 )
2008-06-05 13:34:39 +00:00
} switch_frame_flag_enum_t ;
typedef uint32_t switch_frame_flag_t ;
2006-04-06 19:50:53 +00:00
2007-02-26 21:38:10 +00:00
typedef enum {
SAF_NONE = 0 ,
2009-09-17 19:05:58 +00:00
SAF_SUPPORT_NOMEDIA = ( 1 < < 0 ) ,
2009-12-02 18:13:11 +00:00
SAF_ROUTING_EXEC = ( 1 < < 1 ) ,
2011-09-13 14:35:41 +00:00
SAF_MEDIA_TAP = ( 1 < < 2 ) ,
2012-10-31 17:56:09 +00:00
SAF_ZOMBIE_EXEC = ( 1 < < 3 ) ,
SAF_NO_LOOPBACK = ( 1 < < 4 )
2008-06-05 13:34:39 +00:00
} switch_application_flag_enum_t ;
typedef uint32_t switch_application_flag_t ;
2007-02-26 21:38:10 +00:00
2011-09-21 19:31:10 +00:00
typedef enum {
SCAF_NONE = 0
} switch_chat_application_flag_enum_t ;
typedef uint32_t switch_chat_application_flag_t ;
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_signal_t
2006-01-05 21:03:22 +00:00
\ brief Signals to send to channels
< pre >
SWITCH_SIG_KILL - Kill the channel
2006-04-25 18:02:12 +00:00
SWITCH_SIG_XFER - Stop the current io but leave it viable
2006-01-05 21:03:22 +00:00
< / pre >
*/
2005-11-19 20:07:43 +00:00
typedef enum {
2006-04-25 18:02:12 +00:00
SWITCH_SIG_NONE ,
SWITCH_SIG_KILL ,
2006-12-18 21:40:04 +00:00
SWITCH_SIG_XFER ,
2007-03-29 22:31:56 +00:00
SWITCH_SIG_BREAK
2006-04-29 23:43:28 +00:00
} switch_signal_t ;
2005-11-19 20:07:43 +00:00
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_codec_flag_t
2006-01-05 21:03:22 +00:00
\ brief Codec related flags
< pre >
SWITCH_CODEC_FLAG_ENCODE = ( 1 < < 0 ) - Codec can encode
SWITCH_CODEC_FLAG_DECODE = ( 1 < < 1 ) - Codec can decode
SWITCH_CODEC_FLAG_SILENCE_START = ( 1 < < 2 ) - Start period of silence
SWITCH_CODEC_FLAG_SILENCE_STOP = ( 1 < < 3 ) - End period of silence
SWITCH_CODEC_FLAG_SILENCE = ( 1 < < 4 ) - Silence
SWITCH_CODEC_FLAG_FREE_POOL = ( 1 < < 5 ) - Free codec ' s pool on destruction
2006-09-02 23:04:25 +00:00
SWITCH_CODEC_FLAG_AAL2 = ( 1 < < 6 ) - USE AAL2 Bitpacking
2006-09-08 15:43:45 +00:00
SWITCH_CODEC_FLAG_PASSTHROUGH = ( 1 < < 7 ) - Passthrough only
2006-01-05 21:03:22 +00:00
< / pre >
*/
2005-11-19 20:07:43 +00:00
typedef enum {
2007-03-29 22:31:56 +00:00
SWITCH_CODEC_FLAG_ENCODE = ( 1 < < 0 ) ,
SWITCH_CODEC_FLAG_DECODE = ( 1 < < 1 ) ,
SWITCH_CODEC_FLAG_SILENCE_START = ( 1 < < 2 ) ,
SWITCH_CODEC_FLAG_SILENCE_STOP = ( 1 < < 3 ) ,
SWITCH_CODEC_FLAG_SILENCE = ( 1 < < 4 ) ,
SWITCH_CODEC_FLAG_FREE_POOL = ( 1 < < 5 ) ,
SWITCH_CODEC_FLAG_AAL2 = ( 1 < < 6 ) ,
2009-04-09 17:17:12 +00:00
SWITCH_CODEC_FLAG_PASSTHROUGH = ( 1 < < 7 ) ,
SWITCH_CODEC_FLAG_READY = ( 1 < < 8 )
2008-06-05 13:34:39 +00:00
} switch_codec_flag_enum_t ;
typedef uint32_t switch_codec_flag_t ;
2005-11-19 20:07:43 +00:00
2006-01-27 16:43:57 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_speech_flag_t
2006-01-27 16:43:57 +00:00
\ brief Speech related flags
< pre >
2006-11-09 05:39:04 +00:00
SWITCH_SPEECH_FLAG_HASTEXT = ( 1 < < 0 ) - Interface is has text to read .
SWITCH_SPEECH_FLAG_PEEK = ( 1 < < 1 ) - Read data but do not erase it .
SWITCH_SPEECH_FLAG_FREE_POOL = ( 1 < < 2 ) - Free interface ' s pool on destruction .
SWITCH_SPEECH_FLAG_BLOCKING = ( 1 < < 3 ) - Indicate that a blocking call is desired
SWITCH_SPEECH_FLAG_PAUSE = ( 1 < < 4 ) - Pause toggle for playback
2006-01-27 16:43:57 +00:00
< / pre >
*/
typedef enum {
2007-03-29 22:31:56 +00:00
SWITCH_SPEECH_FLAG_NONE = 0 ,
SWITCH_SPEECH_FLAG_HASTEXT = ( 1 < < 0 ) ,
SWITCH_SPEECH_FLAG_PEEK = ( 1 < < 1 ) ,
SWITCH_SPEECH_FLAG_FREE_POOL = ( 1 < < 2 ) ,
SWITCH_SPEECH_FLAG_BLOCKING = ( 1 < < 3 ) ,
2009-02-18 18:53:28 +00:00
SWITCH_SPEECH_FLAG_PAUSE = ( 1 < < 4 ) ,
SWITCH_SPEECH_FLAG_OPEN = ( 1 < < 5 ) ,
SWITCH_SPEECH_FLAG_DONE = ( 1 < < 6 )
2008-06-05 13:34:39 +00:00
} switch_speech_flag_enum_t ;
typedef uint32_t switch_speech_flag_t ;
2006-01-27 16:43:57 +00:00
2006-11-09 05:39:04 +00:00
/*!
\ enum switch_asr_flag_t
\ brief Asr related flags
< pre >
SWITCH_ASR_FLAG_DATA = ( 1 < < 0 ) - Interface has data
SWITCH_ASR_FLAG_FREE_POOL = ( 1 < < 1 ) - Pool needs to be freed
SWITCH_ASR_FLAG_CLOSED = ( 1 < < 2 ) - Interface has been closed
SWITCH_ASR_FLAG_FIRE_EVENTS = ( 1 < < 3 ) - Fire all speech events
SWITCH_ASR_FLAG_AUTO_RESUME = ( 1 < < 4 ) - Auto Resume
< / pre >
*/
typedef enum {
2007-03-29 22:31:56 +00:00
SWITCH_ASR_FLAG_NONE = 0 ,
SWITCH_ASR_FLAG_DATA = ( 1 < < 0 ) ,
SWITCH_ASR_FLAG_FREE_POOL = ( 1 < < 1 ) ,
SWITCH_ASR_FLAG_CLOSED = ( 1 < < 2 ) ,
SWITCH_ASR_FLAG_FIRE_EVENTS = ( 1 < < 3 ) ,
SWITCH_ASR_FLAG_AUTO_RESUME = ( 1 < < 4 )
2008-06-05 13:34:39 +00:00
} switch_asr_flag_enum_t ;
typedef uint32_t switch_asr_flag_t ;
2006-02-09 16:28:49 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_directory_flag_t
2006-02-09 16:28:49 +00:00
\ brief Directory Handle related flags
< pre >
SWITCH_DIRECTORY_FLAG_FREE_POOL = ( 1 < < 0 ) - Free interface ' s pool on destruction .
< / pre >
*/
typedef enum {
2007-06-08 14:52:50 +00:00
SWITCH_DIRECTORY_FLAG_FREE_POOL = ( 1 < < 0 )
2006-02-09 16:28:49 +00:00
2008-06-05 13:34:39 +00:00
} switch_directory_flag_enum_t ;
typedef uint32_t switch_directory_flag_t ;
2006-02-09 16:28:49 +00:00
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_codec_type_t
2006-01-05 21:03:22 +00:00
\ brief Codec types
< pre >
SWITCH_CODEC_TYPE_AUDIO - Audio Codec
SWITCH_CODEC_TYPE_VIDEO - Video Codec
SWITCH_CODEC_TYPE_T38 - T38 Codec
SWITCH_CODEC_TYPE_APP - Application Codec
< / pre >
*/
typedef enum {
SWITCH_CODEC_TYPE_AUDIO ,
SWITCH_CODEC_TYPE_VIDEO ,
SWITCH_CODEC_TYPE_T38 ,
2007-03-24 04:52:46 +00:00
SWITCH_CODEC_TYPE_APP
2006-04-29 23:43:28 +00:00
} switch_codec_type_t ;
2006-01-05 21:03:22 +00:00
2012-10-18 19:29:00 +00:00
typedef enum {
SWITCH_MEDIA_TYPE_AUDIO ,
SWITCH_MEDIA_TYPE_VIDEO
} switch_media_type_t ;
2012-12-19 02:35:44 +00:00
# define SWITCH_MEDIA_TYPE_TOTAL 2
2012-10-18 19:29:00 +00:00
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_timer_flag_t
2006-01-05 21:03:22 +00:00
\ brief Timer related flags
< pre >
SWITCH_TIMER_FLAG_FREE_POOL = ( 1 < < 0 ) - Free timer ' s pool on destruction
< / pre >
*/
2005-12-26 21:01:22 +00:00
typedef enum {
2007-06-08 14:52:50 +00:00
SWITCH_TIMER_FLAG_FREE_POOL = ( 1 < < 0 )
2008-06-05 13:34:39 +00:00
} switch_timer_flag_enum_t ;
typedef uint32_t switch_timer_flag_t ;
2005-12-26 21:01:22 +00:00
2006-11-09 05:39:04 +00:00
/*!
\ enum switch_timer_flag_t
\ brief Timer related flags
< pre >
SMBF_READ_STREAM - Include the Read Stream
SMBF_WRITE_STREAM - Include the Write Stream
2007-06-13 03:09:53 +00:00
SMBF_WRITE_REPLACE - Replace the Write Stream
SMBF_READ_REPLACE - Replace the Read Stream
2007-11-23 18:35:38 +00:00
SMBF_STEREO - Record in stereo
2013-02-26 17:05:44 +00:00
SMBF_ANSWER_REQ - Don ' t record until the channel is answered
SMBF_BRIDGE_REQ - Don ' t record until the channel is bridged
2008-01-21 17:14:43 +00:00
SMBF_THREAD_LOCK - Only let the same thread who created the bug remove it .
2011-12-15 02:19:15 +00:00
SMBF_PRUNE -
SMBF_NO_PAUSE -
SMBF_STEREO_SWAP - Record in stereo : Write Stream - left channel , Read Stream - right channel
2006-11-09 05:39:04 +00:00
< / pre >
*/
typedef enum {
SMBF_BOTH = 0 ,
SMBF_READ_STREAM = ( 1 < < 0 ) ,
2007-01-31 23:09:33 +00:00
SMBF_WRITE_STREAM = ( 1 < < 1 ) ,
2007-06-13 03:09:53 +00:00
SMBF_WRITE_REPLACE = ( 1 < < 2 ) ,
2007-10-01 16:34:28 +00:00
SMBF_READ_REPLACE = ( 1 < < 3 ) ,
2007-12-06 22:26:37 +00:00
SMBF_READ_PING = ( 1 < < 4 ) ,
SMBF_STEREO = ( 1 < < 5 ) ,
2009-10-26 21:59:25 +00:00
SMBF_ANSWER_REQ = ( 1 < < 6 ) ,
2013-02-26 17:05:44 +00:00
SMBF_BRIDGE_REQ = ( 1 < < 7 ) ,
SMBF_THREAD_LOCK = ( 1 < < 8 ) ,
SMBF_PRUNE = ( 1 < < 9 ) ,
SMBF_NO_PAUSE = ( 1 < < 10 ) ,
SMBF_STEREO_SWAP = ( 1 < < 11 ) ,
SMBF_LOCK = ( 1 < < 12 ) ,
SMBF_TAP_NATIVE_READ = ( 1 < < 13 ) ,
2013-03-27 22:19:40 +00:00
SMBF_TAP_NATIVE_WRITE = ( 1 < < 14 ) ,
2013-04-11 20:03:13 +00:00
SMBF_ONE_ONLY = ( 1 < < 15 ) ,
SMBF_MASK = ( 1 < < 16 )
2008-06-05 13:34:39 +00:00
} switch_media_bug_flag_enum_t ;
typedef uint32_t switch_media_bug_flag_t ;
2006-11-09 05:39:04 +00:00
2006-01-05 21:03:22 +00:00
/*!
2006-04-29 23:43:28 +00:00
\ enum switch_file_flag_t
2006-01-05 21:03:22 +00:00
\ brief File flags
< pre >
SWITCH_FILE_FLAG_READ = ( 1 < < 0 ) - Open for read
SWITCH_FILE_FLAG_WRITE = ( 1 < < 1 ) - Open for write
SWITCH_FILE_FLAG_FREE_POOL = ( 1 < < 2 ) - Free file handle ' s pool on destruction
SWITCH_FILE_DATA_SHORT = ( 1 < < 3 ) - Read data in shorts
SWITCH_FILE_DATA_INT = ( 1 < < 4 ) - Read data in ints
SWITCH_FILE_DATA_FLOAT = ( 1 < < 5 ) - Read data in floats
SWITCH_FILE_DATA_DOUBLE = ( 1 < < 6 ) - Read data in doubles
2006-01-09 18:40:56 +00:00
SWITCH_FILE_DATA_RAW = ( 1 < < 7 ) - Read data as is
2006-02-28 02:08:42 +00:00
SWITCH_FILE_PAUSE = ( 1 < < 8 ) - Pause
2007-03-12 20:17:34 +00:00
SWITCH_FILE_NATIVE = ( 1 < < 9 ) - File is in native format ( no transcoding )
SWITCH_FILE_SEEK = ( 1 < < 10 ) - File has done a seek
2007-03-15 22:49:58 +00:00
SWITCH_FILE_OPEN = ( 1 < < 11 ) - File is open
2006-01-05 21:03:22 +00:00
< / pre >
*/
2005-12-27 18:46:12 +00:00
typedef enum {
2007-03-29 22:31:56 +00:00
SWITCH_FILE_FLAG_READ = ( 1 < < 0 ) ,
SWITCH_FILE_FLAG_WRITE = ( 1 < < 1 ) ,
SWITCH_FILE_FLAG_FREE_POOL = ( 1 < < 2 ) ,
SWITCH_FILE_DATA_SHORT = ( 1 < < 3 ) ,
SWITCH_FILE_DATA_INT = ( 1 < < 4 ) ,
SWITCH_FILE_DATA_FLOAT = ( 1 < < 5 ) ,
SWITCH_FILE_DATA_DOUBLE = ( 1 < < 6 ) ,
SWITCH_FILE_DATA_RAW = ( 1 < < 7 ) ,
SWITCH_FILE_PAUSE = ( 1 < < 8 ) ,
SWITCH_FILE_NATIVE = ( 1 < < 9 ) ,
SWITCH_FILE_SEEK = ( 1 < < 10 ) ,
2008-04-04 21:18:16 +00:00
SWITCH_FILE_OPEN = ( 1 < < 11 ) ,
2009-01-09 20:34:01 +00:00
SWITCH_FILE_CALLBACK = ( 1 < < 12 ) ,
SWITCH_FILE_DONE = ( 1 < < 13 ) ,
2009-11-17 21:40:09 +00:00
SWITCH_FILE_BUFFER_DONE = ( 1 < < 14 ) ,
2010-10-27 00:34:47 +00:00
SWITCH_FILE_WRITE_APPEND = ( 1 < < 15 ) ,
2013-02-19 19:17:24 +00:00
SWITCH_FILE_WRITE_OVER = ( 1 < < 16 ) ,
2013-09-20 18:34:57 +00:00
SWITCH_FILE_NOMUX = ( 1 < < 17 ) ,
SWITCH_FILE_BREAK_ON_CHANGE = ( 1 < < 18 )
2008-06-05 13:34:39 +00:00
} switch_file_flag_enum_t ;
typedef uint32_t switch_file_flag_t ;
2005-12-27 18:46:12 +00:00
2005-11-19 20:07:43 +00:00
typedef enum {
2008-05-08 19:19:47 +00:00
SWITCH_IO_FLAG_NONE = 0 ,
2010-07-29 22:41:23 +00:00
SWITCH_IO_FLAG_NOBLOCK = ( 1 < < 0 ) ,
SWITCH_IO_FLAG_SINGLE_READ = ( 1 < < 1 )
2008-06-05 13:34:39 +00:00
} switch_io_flag_enum_t ;
typedef uint32_t switch_io_flag_t ;
2005-11-19 20:07:43 +00:00
2005-12-13 19:53:29 +00:00
/* make sure this is synced with the EVENT_NAMES array in switch_event.c
also never put any new ones before EVENT_ALL
*/
2006-01-05 21:03:22 +00:00
/*!
2006-05-10 21:28:28 +00:00
\ enum switch_event_types_t
2006-01-05 21:03:22 +00:00
\ brief Built - in Events
< pre >
SWITCH_EVENT_CUSTOM - A custom event
2013-08-29 17:21:10 +00:00
SWITCH_EVENT_CLONE - A cloned event
2006-04-25 23:11:56 +00:00
SWITCH_EVENT_CHANNEL_CREATE - A channel has been created
SWITCH_EVENT_CHANNEL_DESTROY - A channel has been destroyed
2006-01-05 21:03:22 +00:00
SWITCH_EVENT_CHANNEL_STATE - A channel has changed state
2013-08-29 17:21:10 +00:00
SWITCH_EVENT_CHANNEL_CALLSTATE - A channel has changed call state
2006-01-05 21:03:22 +00:00
SWITCH_EVENT_CHANNEL_ANSWER - A channel has been answered
SWITCH_EVENT_CHANNEL_HANGUP - A channel has been hungup
2013-08-29 17:21:10 +00:00
SWITCH_EVENT_CHANNEL_HANGUP_COMPLETE - A channel has completed the hangup
2006-04-11 14:55:14 +00:00
SWITCH_EVENT_CHANNEL_EXECUTE - A channel has executed a module ' s application
2007-06-23 05:41:07 +00:00
SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE - A channel has finshed executing a module ' s application
2013-08-29 17:21:10 +00:00
SWITCH_EVENT_CHANNEL_HOLD - A channel has been put on hold
SWITCH_EVENT_CHANNEL_UNHOLD - A channel has been unheld
SWITCH_EVENT_CHANNEL_BRIDGE - A channel has bridged to another channel
SWITCH_EVENT_CHANNEL_UNBRIDGE - A channel has unbridged from another channel
2008-10-02 15:38:45 +00:00
SWITCH_EVENT_CHANNEL_PROGRESS - A channel has started ringing
SWITCH_EVENT_CHANNEL_PROGRESS_MEDIA - A channel has started early media
2006-09-07 03:58:01 +00:00
SWITCH_EVENT_CHANNEL_OUTGOING - A channel has been unparked
2013-08-29 17:21:10 +00:00
SWITCH_EVENT_CHANNEL_PARK - A channel has been parked
SWITCH_EVENT_CHANNEL_UNPARK - A channel has been unparked
SWITCH_EVENT_CHANNEL_APPLICATION - A channel has called and event from an application
SWITCH_EVENT_CHANNEL_ORIGINATE - A channel has been originated
SWITCH_EVENT_CHANNEL_UUID - A channel has changed uuid
2006-01-05 21:03:22 +00:00
SWITCH_EVENT_API - An API call has been executed
SWITCH_EVENT_LOG - A LOG event has been triggered
SWITCH_EVENT_INBOUND_CHAN - A new inbound channel has been created
SWITCH_EVENT_OUTBOUND_CHAN - A new outbound channel has been created
SWITCH_EVENT_STARTUP - The system has been started
SWITCH_EVENT_SHUTDOWN - The system has been shutdown
2013-08-29 17:21:10 +00:00
SWITCH_EVENT_PUBLISH - Publish
SWITCH_EVENT_UNPUBLISH - UnPublish
SWITCH_EVENT_TALK - Talking Detected
SWITCH_EVENT_NOTALK - Not Talking Detected
SWITCH_EVENT_SESSION_CRASH - Session Crashed
SWITCH_EVENT_MODULE_LOAD - Module was loaded
SWITCH_EVENT_MODULE_UNLOAD - Module was unloaded
SWITCH_EVENT_DTMF - DTMF was sent
SWITCH_EVENT_MESSAGE - A Basic Message
SWITCH_EVENT_PRESENCE_IN - Presence in
SWITCH_EVENT_NOTIFY_IN - Received incoming NOTIFY from gateway subscription
SWITCH_EVENT_PRESENCE_OUT - Presence out
SWITCH_EVENT_PRESENCE_PROBE - Presence probe
SWITCH_EVENT_MESSAGE_WAITING - A message is waiting
SWITCH_EVENT_MESSAGE_QUERY - A query for MESSAGE_WAITING events
SWITCH_EVENT_ROSTER - ?
SWITCH_EVENT_CODEC - Codec Change
SWITCH_EVENT_BACKGROUND_JOB - Background Job
SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
SWITCH_EVENT_DETECTED_TONE - Detected Tone
SWITCH_EVENT_PRIVATE_COMMAND - A private command event
SWITCH_EVENT_HEARTBEAT - Machine is alive
SWITCH_EVENT_TRAP - Error Trap
SWITCH_EVENT_ADD_SCHEDULE - Something has been scheduled
SWITCH_EVENT_DEL_SCHEDULE - Something has been unscheduled
SWITCH_EVENT_EXE_SCHEDULE - Something scheduled has been executed
SWITCH_EVENT_RE_SCHEDULE - Something scheduled has been rescheduled
SWITCH_EVENT_RELOADXML - XML registry has been reloaded
SWITCH_EVENT_NOTIFY - Notification
SWITCH_EVENT_PHONE_FEATURE - Notification ( DND / CFWD / etc )
SWITCH_EVENT_PHONE_FEATURE_SUBSCRIBE - Phone feature subscription
SWITCH_EVENT_SEND_MESSAGE - Message
SWITCH_EVENT_RECV_MESSAGE - Message
SWITCH_EVENT_REQUEST_PARAMS
SWITCH_EVENT_CHANNEL_DATA
SWITCH_EVENT_GENERAL
SWITCH_EVENT_COMMAND
SWITCH_EVENT_SESSION_HEARTBEAT
SWITCH_EVENT_CLIENT_DISCONNECTED
SWITCH_EVENT_SERVER_DISCONNECTED
SWITCH_EVENT_SEND_INFO
SWITCH_EVENT_RECV_INFO
SWITCH_EVENT_RECV_RTCP_MESSAGE
SWITCH_EVENT_CALL_SECURE
SWITCH_EVENT_NAT - NAT Management ( new / del / status )
SWITCH_EVENT_RECORD_START
SWITCH_EVENT_RECORD_STOP
SWITCH_EVENT_PLAYBACK_START
SWITCH_EVENT_PLAYBACK_STOP
SWITCH_EVENT_CALL_UPDATE
SWITCH_EVENT_FAILURE - A failure occurred which might impact the normal functioning of the switch
SWITCH_EVENT_SOCKET_DATA
SWITCH_EVENT_MEDIA_BUG_START
SWITCH_EVENT_MEDIA_BUG_STOP
SWITCH_EVENT_CONFERENCE_DATA_QUERY
SWITCH_EVENT_CONFERENCE_DATA
SWITCH_EVENT_CALL_SETUP_REQ
SWITCH_EVENT_CALL_SETUP_RESULT
SWITCH_EVENT_CALL_DETAIL
SWITCH_EVENT_DEVICE_STATE
2006-01-05 21:03:22 +00:00
SWITCH_EVENT_ALL - All events at once
< / pre >
*/
2005-12-13 19:53:29 +00:00
typedef enum {
SWITCH_EVENT_CUSTOM ,
2009-02-26 18:54:00 +00:00
SWITCH_EVENT_CLONE ,
2006-04-04 21:26:21 +00:00
SWITCH_EVENT_CHANNEL_CREATE ,
2006-04-25 23:11:56 +00:00
SWITCH_EVENT_CHANNEL_DESTROY ,
2005-12-21 22:25:22 +00:00
SWITCH_EVENT_CHANNEL_STATE ,
2010-06-07 23:01:02 +00:00
SWITCH_EVENT_CHANNEL_CALLSTATE ,
2005-12-21 22:25:22 +00:00
SWITCH_EVENT_CHANNEL_ANSWER ,
2006-01-05 21:03:22 +00:00
SWITCH_EVENT_CHANNEL_HANGUP ,
2009-05-29 17:18:03 +00:00
SWITCH_EVENT_CHANNEL_HANGUP_COMPLETE ,
2006-04-11 14:55:14 +00:00
SWITCH_EVENT_CHANNEL_EXECUTE ,
2007-06-23 05:41:07 +00:00
SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE ,
2010-06-05 00:03:36 +00:00
SWITCH_EVENT_CHANNEL_HOLD ,
SWITCH_EVENT_CHANNEL_UNHOLD ,
2006-04-11 14:55:14 +00:00
SWITCH_EVENT_CHANNEL_BRIDGE ,
SWITCH_EVENT_CHANNEL_UNBRIDGE ,
2006-08-29 15:17:06 +00:00
SWITCH_EVENT_CHANNEL_PROGRESS ,
2008-10-02 15:38:45 +00:00
SWITCH_EVENT_CHANNEL_PROGRESS_MEDIA ,
2006-08-29 15:17:06 +00:00
SWITCH_EVENT_CHANNEL_OUTGOING ,
2006-09-07 03:58:01 +00:00
SWITCH_EVENT_CHANNEL_PARK ,
SWITCH_EVENT_CHANNEL_UNPARK ,
2007-06-23 05:41:07 +00:00
SWITCH_EVENT_CHANNEL_APPLICATION ,
2007-10-16 13:56:44 +00:00
SWITCH_EVENT_CHANNEL_ORIGINATE ,
2008-11-04 16:46:33 +00:00
SWITCH_EVENT_CHANNEL_UUID ,
2005-12-23 02:24:56 +00:00
SWITCH_EVENT_API ,
2005-12-21 22:25:22 +00:00
SWITCH_EVENT_LOG ,
2005-12-13 19:53:29 +00:00
SWITCH_EVENT_INBOUND_CHAN ,
SWITCH_EVENT_OUTBOUND_CHAN ,
SWITCH_EVENT_STARTUP ,
2005-12-14 21:29:46 +00:00
SWITCH_EVENT_SHUTDOWN ,
2006-02-13 23:59:14 +00:00
SWITCH_EVENT_PUBLISH ,
SWITCH_EVENT_UNPUBLISH ,
2006-04-21 22:31:08 +00:00
SWITCH_EVENT_TALK ,
SWITCH_EVENT_NOTALK ,
2006-04-27 21:09:58 +00:00
SWITCH_EVENT_SESSION_CRASH ,
2006-05-01 19:44:21 +00:00
SWITCH_EVENT_MODULE_LOAD ,
2007-05-03 16:28:23 +00:00
SWITCH_EVENT_MODULE_UNLOAD ,
2006-05-04 17:51:53 +00:00
SWITCH_EVENT_DTMF ,
2006-07-25 14:14:07 +00:00
SWITCH_EVENT_MESSAGE ,
2006-10-12 00:59:09 +00:00
SWITCH_EVENT_PRESENCE_IN ,
2008-11-24 15:52:55 +00:00
SWITCH_EVENT_NOTIFY_IN ,
2006-10-12 00:59:09 +00:00
SWITCH_EVENT_PRESENCE_OUT ,
2006-12-16 03:00:56 +00:00
SWITCH_EVENT_PRESENCE_PROBE ,
2007-04-02 20:20:46 +00:00
SWITCH_EVENT_MESSAGE_WAITING ,
SWITCH_EVENT_MESSAGE_QUERY ,
2006-10-18 22:57:35 +00:00
SWITCH_EVENT_ROSTER ,
2006-08-25 01:33:28 +00:00
SWITCH_EVENT_CODEC ,
2006-09-07 03:58:01 +00:00
SWITCH_EVENT_BACKGROUND_JOB ,
2006-11-09 05:39:04 +00:00
SWITCH_EVENT_DETECTED_SPEECH ,
2007-06-16 02:25:40 +00:00
SWITCH_EVENT_DETECTED_TONE ,
2007-02-19 21:06:27 +00:00
SWITCH_EVENT_PRIVATE_COMMAND ,
2007-02-22 17:38:34 +00:00
SWITCH_EVENT_HEARTBEAT ,
2007-03-05 20:55:41 +00:00
SWITCH_EVENT_TRAP ,
2007-03-30 00:10:33 +00:00
SWITCH_EVENT_ADD_SCHEDULE ,
SWITCH_EVENT_DEL_SCHEDULE ,
SWITCH_EVENT_EXE_SCHEDULE ,
SWITCH_EVENT_RE_SCHEDULE ,
2008-03-03 19:32:42 +00:00
SWITCH_EVENT_RELOADXML ,
2008-07-22 22:23:50 +00:00
SWITCH_EVENT_NOTIFY ,
2013-08-23 19:54:49 +00:00
SWITCH_EVENT_PHONE_FEATURE ,
SWITCH_EVENT_PHONE_FEATURE_SUBSCRIBE ,
2008-07-22 22:23:50 +00:00
SWITCH_EVENT_SEND_MESSAGE ,
2008-07-23 18:19:56 +00:00
SWITCH_EVENT_RECV_MESSAGE ,
2008-10-02 17:10:05 +00:00
SWITCH_EVENT_REQUEST_PARAMS ,
SWITCH_EVENT_CHANNEL_DATA ,
SWITCH_EVENT_GENERAL ,
SWITCH_EVENT_COMMAND ,
2008-10-07 21:03:37 +00:00
SWITCH_EVENT_SESSION_HEARTBEAT ,
2009-02-21 23:19:58 +00:00
SWITCH_EVENT_CLIENT_DISCONNECTED ,
SWITCH_EVENT_SERVER_DISCONNECTED ,
2009-04-20 17:07:54 +00:00
SWITCH_EVENT_SEND_INFO ,
SWITCH_EVENT_RECV_INFO ,
2010-04-20 00:07:23 +00:00
SWITCH_EVENT_RECV_RTCP_MESSAGE ,
2009-05-28 17:50:06 +00:00
SWITCH_EVENT_CALL_SECURE ,
2009-06-30 18:59:05 +00:00
SWITCH_EVENT_NAT ,
2009-08-21 22:29:44 +00:00
SWITCH_EVENT_RECORD_START ,
SWITCH_EVENT_RECORD_STOP ,
2011-02-25 16:55:33 +00:00
SWITCH_EVENT_PLAYBACK_START ,
SWITCH_EVENT_PLAYBACK_STOP ,
2009-10-08 16:52:55 +00:00
SWITCH_EVENT_CALL_UPDATE ,
2009-12-09 14:42:30 +00:00
SWITCH_EVENT_FAILURE ,
2010-01-04 17:46:55 +00:00
SWITCH_EVENT_SOCKET_DATA ,
2010-03-02 01:11:15 +00:00
SWITCH_EVENT_MEDIA_BUG_START ,
SWITCH_EVENT_MEDIA_BUG_STOP ,
2012-07-11 20:15:43 +00:00
SWITCH_EVENT_CONFERENCE_DATA_QUERY ,
SWITCH_EVENT_CONFERENCE_DATA ,
SWITCH_EVENT_CALL_SETUP_REQ ,
SWITCH_EVENT_CALL_SETUP_RESULT ,
2013-06-05 16:19:44 +00:00
SWITCH_EVENT_CALL_DETAIL ,
SWITCH_EVENT_DEVICE_STATE ,
2005-12-13 19:53:29 +00:00
SWITCH_EVENT_ALL
2006-04-29 01:00:52 +00:00
} switch_event_types_t ;
2005-12-13 19:53:29 +00:00
2006-07-12 18:39:19 +00:00
typedef enum {
SWITCH_INPUT_TYPE_DTMF ,
2007-03-24 04:52:46 +00:00
SWITCH_INPUT_TYPE_EVENT
2006-07-12 18:39:19 +00:00
} switch_input_type_t ;
2006-04-21 23:16:26 +00:00
typedef enum {
2008-07-03 22:51:09 +00:00
SWITCH_CAUSE_NONE = 0 ,
2008-07-23 14:19:53 +00:00
SWITCH_CAUSE_UNALLOCATED_NUMBER = 1 ,
2006-04-21 23:16:26 +00:00
SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET = 2 ,
SWITCH_CAUSE_NO_ROUTE_DESTINATION = 3 ,
SWITCH_CAUSE_CHANNEL_UNACCEPTABLE = 6 ,
SWITCH_CAUSE_CALL_AWARDED_DELIVERED = 7 ,
SWITCH_CAUSE_NORMAL_CLEARING = 16 ,
SWITCH_CAUSE_USER_BUSY = 17 ,
SWITCH_CAUSE_NO_USER_RESPONSE = 18 ,
SWITCH_CAUSE_NO_ANSWER = 19 ,
2006-10-25 03:45:20 +00:00
SWITCH_CAUSE_SUBSCRIBER_ABSENT = 20 ,
2006-04-21 23:16:26 +00:00
SWITCH_CAUSE_CALL_REJECTED = 21 ,
SWITCH_CAUSE_NUMBER_CHANGED = 22 ,
2006-10-25 03:45:20 +00:00
SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION = 23 ,
SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR = 25 ,
2006-04-21 23:16:26 +00:00
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER = 27 ,
SWITCH_CAUSE_INVALID_NUMBER_FORMAT = 28 ,
SWITCH_CAUSE_FACILITY_REJECTED = 29 ,
SWITCH_CAUSE_RESPONSE_TO_STATUS_ENQUIRY = 30 ,
SWITCH_CAUSE_NORMAL_UNSPECIFIED = 31 ,
SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION = 34 ,
SWITCH_CAUSE_NETWORK_OUT_OF_ORDER = 38 ,
SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE = 41 ,
SWITCH_CAUSE_SWITCH_CONGESTION = 42 ,
SWITCH_CAUSE_ACCESS_INFO_DISCARDED = 43 ,
SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL = 44 ,
SWITCH_CAUSE_PRE_EMPTED = 45 ,
SWITCH_CAUSE_FACILITY_NOT_SUBSCRIBED = 50 ,
SWITCH_CAUSE_OUTGOING_CALL_BARRED = 52 ,
SWITCH_CAUSE_INCOMING_CALL_BARRED = 54 ,
SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH = 57 ,
SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL = 58 ,
2006-10-25 03:45:20 +00:00
SWITCH_CAUSE_SERVICE_UNAVAILABLE = 63 ,
2006-04-21 23:16:26 +00:00
SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL = 65 ,
SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED = 66 ,
SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED = 69 ,
2006-10-25 03:45:20 +00:00
SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED = 79 ,
2006-04-21 23:16:26 +00:00
SWITCH_CAUSE_INVALID_CALL_REFERENCE = 81 ,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION = 88 ,
SWITCH_CAUSE_INVALID_MSG_UNSPECIFIED = 95 ,
SWITCH_CAUSE_MANDATORY_IE_MISSING = 96 ,
SWITCH_CAUSE_MESSAGE_TYPE_NONEXIST = 97 ,
SWITCH_CAUSE_WRONG_MESSAGE = 98 ,
SWITCH_CAUSE_IE_NONEXIST = 99 ,
SWITCH_CAUSE_INVALID_IE_CONTENTS = 100 ,
SWITCH_CAUSE_WRONG_CALL_STATE = 101 ,
SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE = 102 ,
SWITCH_CAUSE_MANDATORY_IE_LENGTH_ERROR = 103 ,
SWITCH_CAUSE_PROTOCOL_ERROR = 111 ,
2006-04-27 15:02:35 +00:00
SWITCH_CAUSE_INTERWORKING = 127 ,
2008-07-03 22:51:09 +00:00
SWITCH_CAUSE_SUCCESS = 142 ,
2006-10-25 04:28:49 +00:00
SWITCH_CAUSE_ORIGINATOR_CANCEL = 487 ,
2006-07-07 18:59:14 +00:00
SWITCH_CAUSE_CRASH = 500 ,
2006-08-17 00:53:09 +00:00
SWITCH_CAUSE_SYSTEM_SHUTDOWN = 501 ,
2006-09-20 20:25:26 +00:00
SWITCH_CAUSE_LOSE_RACE = 502 ,
2006-10-04 23:11:11 +00:00
SWITCH_CAUSE_MANAGER_REQUEST = 503 ,
SWITCH_CAUSE_BLIND_TRANSFER = 600 ,
2007-03-28 23:37:12 +00:00
SWITCH_CAUSE_ATTENDED_TRANSFER = 601 ,
2007-06-08 22:28:32 +00:00
SWITCH_CAUSE_ALLOTTED_TIMEOUT = 602 ,
2007-10-31 13:08:45 +00:00
SWITCH_CAUSE_USER_CHALLENGE = 603 ,
2007-12-08 00:14:21 +00:00
SWITCH_CAUSE_MEDIA_TIMEOUT = 604 ,
2008-08-11 16:12:55 +00:00
SWITCH_CAUSE_PICKED_OFF = 605 ,
2008-10-09 00:38:59 +00:00
SWITCH_CAUSE_USER_NOT_REGISTERED = 606 ,
2011-12-15 17:16:41 +00:00
SWITCH_CAUSE_PROGRESS_TIMEOUT = 607 ,
SWITCH_CAUSE_INVALID_GATEWAY = 608 ,
SWITCH_CAUSE_GATEWAY_DOWN = 609 ,
SWITCH_CAUSE_INVALID_URL = 610 ,
2012-09-12 15:22:03 +00:00
SWITCH_CAUSE_INVALID_PROFILE = 611 ,
2014-06-28 01:18:50 +00:00
SWITCH_CAUSE_NO_PICKUP = 612 ,
SWITCH_CAUSE_SRTP_READ_ERROR = 613
2006-04-21 23:16:26 +00:00
} switch_call_cause_t ;
2006-09-20 20:25:26 +00:00
typedef enum {
SCSC_PAUSE_INBOUND ,
2011-12-14 19:23:54 +00:00
SCSC_PAUSE_OUTBOUND ,
SCSC_PAUSE_ALL ,
2006-09-20 20:25:26 +00:00
SCSC_HUPALL ,
SCSC_SHUTDOWN ,
2007-10-03 23:43:01 +00:00
SCSC_CHECK_RUNNING ,
2007-10-04 14:19:51 +00:00
SCSC_LOGLEVEL ,
2007-10-04 17:25:06 +00:00
SCSC_SPS ,
2007-10-04 21:35:50 +00:00
SCSC_LAST_SPS ,
2007-10-05 13:42:11 +00:00
SCSC_RECLAIM ,
2008-01-11 00:43:49 +00:00
SCSC_MAX_SESSIONS ,
2008-04-18 17:03:34 +00:00
SCSC_SYNC_CLOCK ,
SCSC_MAX_DTMF_DURATION ,
2009-09-16 21:24:22 +00:00
SCSC_MIN_DTMF_DURATION ,
2008-10-02 16:46:20 +00:00
SCSC_DEFAULT_DTMF_DURATION ,
2008-10-03 14:58:36 +00:00
SCSC_SHUTDOWN_ELEGANT ,
2008-10-21 19:05:25 +00:00
SCSC_SHUTDOWN_ASAP ,
SCSC_CANCEL_SHUTDOWN ,
2009-11-20 23:12:07 +00:00
SCSC_SEND_SIGHUP ,
2009-12-17 00:03:17 +00:00
SCSC_DEBUG_LEVEL ,
2010-01-08 22:10:03 +00:00
SCSC_FLUSH_DB_HANDLES ,
2010-01-14 16:02:46 +00:00
SCSC_SHUTDOWN_NOW ,
2014-06-10 22:21:38 +00:00
SCSC_REINCARNATE_NOW ,
2010-01-14 21:00:32 +00:00
SCSC_CALIBRATE_CLOCK ,
SCSC_SAVE_HISTORY ,
2010-03-10 20:21:34 +00:00
SCSC_CRASH ,
2010-04-27 21:52:29 +00:00
SCSC_MIN_IDLE_CPU ,
2010-06-30 03:00:24 +00:00
SCSC_VERBOSE_EVENTS ,
2011-06-27 15:09:15 +00:00
SCSC_SHUTDOWN_CHECK ,
2011-12-14 19:23:54 +00:00
SCSC_PAUSE_INBOUND_CHECK ,
SCSC_PAUSE_OUTBOUND_CHECK ,
2011-06-27 15:09:15 +00:00
SCSC_PAUSE_CHECK ,
2011-09-12 19:24:58 +00:00
SCSC_READY_CHECK ,
2011-10-12 19:55:32 +00:00
SCSC_THREADED_SYSTEM_EXEC ,
2012-04-02 17:58:40 +00:00
SCSC_SYNC_CLOCK_WHEN_IDLE ,
SCSC_DEBUG_SQL ,
2012-07-12 19:30:37 +00:00
SCSC_SQL ,
2012-08-22 21:24:09 +00:00
SCSC_API_EXPANSION ,
2013-07-19 20:16:42 +00:00
SCSC_RECOVER ,
2013-07-20 03:40:05 +00:00
SCSC_SPS_PEAK ,
2013-07-20 20:00:06 +00:00
SCSC_SPS_PEAK_FIVEMIN ,
SCSC_SESSIONS_PEAK ,
SCSC_SESSIONS_PEAK_FIVEMIN
2006-09-20 20:25:26 +00:00
} switch_session_ctl_t ;
2006-04-21 23:16:26 +00:00
2009-11-04 21:07:18 +00:00
typedef enum {
SSH_FLAG_STICKY = ( 1 < < 0 )
} switch_state_handler_flag_t ;
2012-08-09 16:56:29 +00:00
# ifdef WIN32
2012-08-09 21:27:15 +00:00
typedef SOCKET switch_os_socket_t ;
2014-07-17 20:03:57 +00:00
# define SWITCH_SOCK_INVALID INVALID_SOCKET
2012-08-09 16:56:29 +00:00
# else
2012-08-09 21:27:15 +00:00
typedef int switch_os_socket_t ;
2014-07-17 20:03:57 +00:00
# define SWITCH_SOCK_INVALID -1
2012-08-09 16:56:29 +00:00
# endif
2007-06-13 20:40:06 +00:00
typedef struct apr_pool_t switch_memory_pool_t ;
2007-03-09 20:44:13 +00:00
typedef uint16_t switch_port_t ;
2006-04-18 16:50:34 +00:00
typedef uint8_t switch_payload_t ;
2007-04-21 01:03:58 +00:00
typedef struct switch_app_log switch_app_log_t ;
2006-04-29 01:00:52 +00:00
typedef struct switch_rtp switch_rtp_t ;
2010-04-20 00:07:23 +00:00
typedef struct switch_rtcp switch_rtcp_t ;
2006-04-29 06:05:03 +00:00
typedef struct switch_core_session_message switch_core_session_message_t ;
2006-04-29 01:00:52 +00:00
typedef struct switch_event_header switch_event_header_t ;
typedef struct switch_event switch_event_t ;
2006-04-29 06:05:03 +00:00
typedef struct switch_event_subclass switch_event_subclass_t ;
typedef struct switch_event_node switch_event_node_t ;
typedef struct switch_loadable_module switch_loadable_module_t ;
typedef struct switch_frame switch_frame_t ;
2010-04-20 00:07:23 +00:00
typedef struct switch_rtcp_frame switch_rtcp_frame_t ;
2006-04-29 06:05:03 +00:00
typedef struct switch_channel switch_channel_t ;
2012-10-10 01:20:32 +00:00
typedef struct switch_sql_queue_manager switch_sql_queue_manager_t ;
2006-04-29 06:05:03 +00:00
typedef struct switch_file_handle switch_file_handle_t ;
typedef struct switch_core_session switch_core_session_t ;
typedef struct switch_caller_profile switch_caller_profile_t ;
typedef struct switch_caller_extension switch_caller_extension_t ;
typedef struct switch_caller_application switch_caller_application_t ;
typedef struct switch_state_handler_table switch_state_handler_table_t ;
typedef struct switch_timer switch_timer_t ;
2014-08-03 19:15:26 +00:00
typedef struct switch_image switch_image_t ;
2006-04-29 06:05:03 +00:00
typedef struct switch_codec switch_codec_t ;
typedef struct switch_core_thread_session switch_core_thread_session_t ;
typedef struct switch_codec_implementation switch_codec_implementation_t ;
typedef struct switch_buffer switch_buffer_t ;
2014-11-15 01:01:56 +00:00
typedef union switch_codec_settings switch_codec_settings_t ;
2010-09-29 21:52:34 +00:00
typedef struct switch_codec_fmtp switch_codec_fmtp_t ;
2007-11-20 02:27:48 +00:00
typedef struct switch_odbc_handle switch_odbc_handle_t ;
2012-09-30 01:48:48 +00:00
typedef struct switch_pgsql_handle switch_pgsql_handle_t ;
typedef struct switch_pgsql_result switch_pgsql_result_t ;
2007-03-29 22:31:56 +00:00
2006-04-29 23:43:28 +00:00
typedef struct switch_io_routines switch_io_routines_t ;
typedef struct switch_speech_handle switch_speech_handle_t ;
2006-11-09 05:39:04 +00:00
typedef struct switch_asr_handle switch_asr_handle_t ;
2006-04-29 23:43:28 +00:00
typedef struct switch_directory_handle switch_directory_handle_t ;
typedef struct switch_loadable_module_interface switch_loadable_module_interface_t ;
typedef struct switch_endpoint_interface switch_endpoint_interface_t ;
typedef struct switch_timer_interface switch_timer_interface_t ;
typedef struct switch_dialplan_interface switch_dialplan_interface_t ;
typedef struct switch_codec_interface switch_codec_interface_t ;
typedef struct switch_application_interface switch_application_interface_t ;
2011-09-21 19:31:10 +00:00
typedef struct switch_chat_application_interface switch_chat_application_interface_t ;
2006-04-29 23:43:28 +00:00
typedef struct switch_api_interface switch_api_interface_t ;
2013-10-15 21:24:32 +00:00
typedef struct switch_json_api_interface switch_json_api_interface_t ;
2006-04-29 23:43:28 +00:00
typedef struct switch_file_interface switch_file_interface_t ;
typedef struct switch_speech_interface switch_speech_interface_t ;
2006-11-09 05:39:04 +00:00
typedef struct switch_asr_interface switch_asr_interface_t ;
2006-04-29 23:43:28 +00:00
typedef struct switch_directory_interface switch_directory_interface_t ;
2006-10-19 07:13:34 +00:00
typedef struct switch_chat_interface switch_chat_interface_t ;
2007-03-07 18:34:22 +00:00
typedef struct switch_management_interface switch_management_interface_t ;
2006-09-07 03:58:01 +00:00
typedef struct switch_core_port_allocator switch_core_port_allocator_t ;
2006-09-09 03:39:28 +00:00
typedef struct switch_media_bug switch_media_bug_t ;
2010-04-02 02:31:14 +00:00
typedef struct switch_limit_interface switch_limit_interface_t ;
2009-12-14 20:10:06 +00:00
2014-04-09 18:26:41 +00:00
typedef void ( * hashtable_destructor_t ) ( void * ptr ) ;
2009-12-14 20:10:06 +00:00
struct switch_console_callback_match_node {
char * val ;
struct switch_console_callback_match_node * next ;
} ;
typedef struct switch_console_callback_match_node switch_console_callback_match_node_t ;
struct switch_console_callback_match {
struct switch_console_callback_match_node * head ;
struct switch_console_callback_match_node * end ;
2009-12-15 23:05:49 +00:00
int count ;
2009-12-15 19:26:58 +00:00
int dynamic ;
2009-12-14 20:10:06 +00:00
} ;
typedef struct switch_console_callback_match switch_console_callback_match_t ;
2012-05-07 18:44:10 +00:00
typedef void ( * switch_media_bug_exec_cb_t ) ( switch_media_bug_t * bug , void * user_data ) ;
2011-06-01 15:48:42 +00:00
typedef void ( * switch_cap_callback_t ) ( const char * var , const char * val , void * user_data ) ;
2009-12-14 20:10:06 +00:00
typedef switch_status_t ( * switch_console_complete_callback_t ) ( const char * , const char * , switch_console_callback_match_t * * matches ) ;
2007-03-29 22:31:56 +00:00
typedef switch_bool_t ( * switch_media_bug_callback_t ) ( switch_media_bug_t * , void * , switch_abc_type_t ) ;
2009-01-19 16:10:54 +00:00
typedef switch_bool_t ( * switch_tone_detect_callback_t ) ( switch_core_session_t * , const char * , const char * ) ;
2008-07-07 17:10:17 +00:00
typedef struct switch_xml_binding switch_xml_binding_t ;
2008-02-01 06:22:13 +00:00
2014-11-18 22:39:32 +00:00
typedef void ( * switch_video_function_t ) ( switch_core_session_t * session , void * user_data ) ;
2008-02-01 06:22:13 +00:00
typedef switch_status_t ( * switch_core_codec_encode_func_t ) ( switch_codec_t * codec ,
2008-05-27 04:30:03 +00:00
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 ) ;
2008-02-01 06:22:13 +00:00
typedef switch_status_t ( * switch_core_codec_decode_func_t ) ( switch_codec_t * codec ,
2008-05-27 04:30:03 +00:00
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 ) ;
2014-08-03 19:15:26 +00:00
2014-11-18 22:39:32 +00:00
typedef switch_status_t ( * switch_core_codec_video_encode_func_t ) ( switch_codec_t * codec , switch_frame_t * frame ) ;
2014-08-03 19:15:26 +00:00
2014-11-18 22:39:32 +00:00
typedef switch_status_t ( * switch_core_codec_video_decode_func_t ) ( switch_codec_t * codec , switch_frame_t * frame ) ;
2014-11-13 03:30:39 +00:00
typedef enum {
SCC_VIDEO_REFRESH = 0
} switch_codec_control_command_t ;
typedef enum {
SCCT_NONE = 0
} switch_codec_control_type_t ;
typedef enum {
SWITCH_IO_READ ,
SWITCH_IO_WRITE
} switch_io_type_t ;
typedef 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 * rtype ,
void * * ret_data ) ;
2008-02-01 06:22:13 +00:00
2014-11-14 02:52:57 +00:00
typedef switch_status_t ( * switch_image_write_callback_t ) ( switch_core_session_t * session , switch_frame_t * frame , switch_image_t * img , void * user_data ) ;
2008-02-01 06:22:13 +00:00
typedef switch_status_t ( * switch_core_codec_init_func_t ) ( switch_codec_t * , switch_codec_flag_t , const switch_codec_settings_t * codec_settings ) ;
2010-09-29 21:52:34 +00:00
typedef switch_status_t ( * switch_core_codec_fmtp_parse_func_t ) ( const char * fmtp , switch_codec_fmtp_t * codec_fmtp ) ;
2008-02-01 06:22:13 +00:00
typedef switch_status_t ( * switch_core_codec_destroy_func_t ) ( switch_codec_t * ) ;
2011-09-21 19:31:10 +00:00
typedef switch_status_t ( * switch_chat_application_function_t ) ( switch_event_t * , const char * ) ;
# define SWITCH_STANDARD_CHAT_APP(name) static switch_status_t name (switch_event_t *message, const char *data)
2008-02-01 06:22:13 +00:00
2007-11-01 11:28:26 +00:00
typedef void ( * switch_application_function_t ) ( switch_core_session_t * , const char * ) ;
# define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, const char *data)
2007-06-20 05:39:50 +00:00
2012-08-22 21:24:09 +00:00
typedef int ( * switch_core_recover_callback_t ) ( switch_core_session_t * session ) ;
2007-03-29 22:31:56 +00:00
typedef void ( * switch_event_callback_t ) ( switch_event_t * ) ;
2007-04-20 23:45:14 +00:00
typedef switch_caller_extension_t * ( * switch_dialplan_hunt_function_t ) ( switch_core_session_t * , void * , switch_caller_profile_t * ) ;
2010-02-06 03:38:24 +00:00
# define SWITCH_STANDARD_DIALPLAN(name) static switch_caller_extension_t *name (switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
2007-06-20 06:14:57 +00:00
2010-03-24 16:11:24 +00:00
typedef switch_bool_t ( * switch_hash_delete_callback_t ) ( _In_ const void * key , _In_ const void * val , _In_opt_ void * pData ) ;
# define SWITCH_HASH_DELETE_FUNC(name) static switch_bool_t name (const void *key, const void *val, void *pData)
2007-05-12 21:43:41 +00:00
2007-03-29 22:31:56 +00:00
typedef struct switch_scheduler_task switch_scheduler_task_t ;
2007-05-12 21:43:41 +00:00
2007-03-29 22:31:56 +00:00
typedef void ( * switch_scheduler_func_t ) ( switch_scheduler_task_t * task ) ;
2007-05-12 21:43:41 +00:00
# define SWITCH_STANDARD_SCHED_FUNC(name) static void name (switch_scheduler_task_t *task)
2007-03-29 22:31:56 +00:00
typedef switch_status_t ( * switch_state_handler_t ) ( switch_core_session_t * ) ;
2006-05-10 15:47:54 +00:00
typedef struct switch_stream_handle switch_stream_handle_t ;
2014-09-04 01:00:38 +00:00
typedef uint8_t * ( * switch_stream_handle_read_function_t ) ( switch_stream_handle_t * handle , int * len ) ;
2007-03-29 22:31:56 +00:00
typedef switch_status_t ( * switch_stream_handle_write_function_t ) ( switch_stream_handle_t * handle , const char * fmt , . . . ) ;
2007-11-28 19:56:25 +00:00
typedef switch_status_t ( * switch_stream_handle_raw_write_function_t ) ( switch_stream_handle_t * handle , uint8_t * data , switch_size_t datalen ) ;
2007-05-12 21:36:15 +00:00
2008-05-27 04:30:03 +00:00
typedef 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 ) ;
2007-05-12 21:36:15 +00:00
2011-03-30 00:55:28 +00:00
2008-02-09 05:16:58 +00:00
# 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)
2007-05-12 21:36:15 +00:00
2013-10-15 21:24:32 +00:00
typedef switch_status_t ( * switch_json_api_function_t ) ( const cJSON * json , _In_opt_ switch_core_session_t * session , cJSON * * json_reply ) ;
# define SWITCH_STANDARD_JSON_API(name) static switch_status_t name (const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
2007-03-29 22:31:56 +00:00
typedef switch_status_t ( * switch_input_callback_function_t ) ( switch_core_session_t * session , void * input ,
2007-03-30 00:13:31 +00:00
switch_input_type_t input_type , void * buf , unsigned int buflen ) ;
2007-10-02 00:09:49 +00:00
typedef switch_status_t ( * switch_read_frame_callback_function_t ) ( switch_core_session_t * session , switch_frame_t * frame , void * user_data ) ;
2006-12-22 02:13:56 +00:00
typedef struct switch_say_interface switch_say_interface_t ;
2010-10-04 23:23:43 +00:00
2010-10-08 18:50:15 +00:00
# define DMACHINE_MAX_DIGIT_LEN 512
typedef enum {
DM_MATCH_POSITIVE ,
DM_MATCH_NEGATIVE
} dm_match_type_t ;
2010-10-04 23:23:43 +00:00
struct switch_ivr_dmachine ;
typedef struct switch_ivr_dmachine switch_ivr_dmachine_t ;
struct switch_ivr_dmachine_match {
switch_ivr_dmachine_t * dmachine ;
const char * match_digits ;
int32_t match_key ;
2010-10-08 18:50:15 +00:00
dm_match_type_t type ;
2010-10-04 23:23:43 +00:00
void * user_data ;
} ;
typedef struct switch_ivr_dmachine_match switch_ivr_dmachine_match_t ;
typedef switch_status_t ( * switch_ivr_dmachine_callback_t ) ( switch_ivr_dmachine_match_t * match ) ;
2012-12-10 16:56:07 +00:00
# define MAX_ARG_RECURSION 25
# define arg_recursion_check_start(_args) if (_args) { \
if ( _args - > loops > = MAX_ARG_RECURSION ) { \
switch_log_printf ( SWITCH_CHANNEL_LOG , SWITCH_LOG_ERROR , \
" RECURSION ERROR! It's not the best idea to call things that collect input recursively from an input callback. \n " ) ; \
return SWITCH_STATUS_GENERR ; \
} else { _args - > loops + + ; } \
}
# define arg_recursion_check_stop(_args) if (_args) _args->loops--
2006-12-23 16:40:37 +00:00
typedef struct {
2007-03-29 22:31:56 +00:00
switch_input_callback_function_t input_callback ;
void * buf ;
uint32_t buflen ;
2007-10-02 00:09:49 +00:00
switch_read_frame_callback_function_t read_frame_callback ;
void * user_data ;
2010-10-04 23:23:43 +00:00
switch_ivr_dmachine_t * dmachine ;
2012-12-10 16:56:07 +00:00
int loops ;
2006-12-23 16:40:37 +00:00
} switch_input_args_t ;
2010-03-07 19:34:05 +00:00
2011-03-30 00:55:28 +00:00
2010-03-07 19:34:05 +00:00
typedef struct {
switch_say_type_t type ;
switch_say_method_t method ;
switch_say_gender_t gender ;
2011-03-30 00:55:28 +00:00
const char * ext ;
2010-03-07 19:34:05 +00:00
} switch_say_args_t ;
2011-03-30 00:55:28 +00:00
2007-03-29 22:31:56 +00:00
typedef switch_status_t ( * switch_say_callback_t ) ( switch_core_session_t * session ,
2010-03-07 19:34:05 +00:00
char * tosay ,
switch_say_args_t * say_args ,
switch_input_args_t * args ) ;
2011-03-30 00:55:28 +00:00
typedef switch_status_t ( * switch_say_string_callback_t ) ( switch_core_session_t * session ,
char * tosay ,
switch_say_args_t * say_args , char * * rstr ) ;
struct switch_say_file_handle ;
typedef struct switch_say_file_handle switch_say_file_handle_t ;
typedef switch_status_t ( * switch_new_say_callback_t ) ( switch_say_file_handle_t * sh ,
char * tosay ,
switch_say_args_t * say_args ) ;
2006-05-10 03:23:05 +00:00
typedef struct switch_xml * switch_xml_t ;
typedef struct switch_core_time_duration switch_core_time_duration_t ;
2011-06-28 13:05:12 +00:00
typedef switch_xml_t ( * switch_xml_open_root_function_t ) ( uint8_t reload , const char * * err , void * user_data ) ;
2010-02-06 03:38:24 +00:00
typedef 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 ) ;
2005-11-19 20:07:43 +00:00
2014-03-08 19:37:09 +00:00
struct switch_hashtable ;
struct switch_hashtable_iterator ;
typedef struct switch_hashtable switch_hash_t ;
2015-01-09 19:35:42 +00:00
typedef struct switch_hashtable switch_inthash_t ;
2014-03-08 19:37:09 +00:00
typedef struct switch_hashtable_iterator switch_hash_index_t ;
2007-09-29 01:06:08 +00:00
2008-03-26 22:14:09 +00:00
struct switch_network_list ;
typedef struct switch_network_list switch_network_list_t ;
2007-06-13 14:35:55 +00:00
2010-10-01 16:43:43 +00:00
# define SWITCH_API_VERSION 5
2007-06-13 20:40:06 +00:00
# define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
2007-06-13 14:35:55 +00:00
# define SWITCH_MODULE_RUNTIME_ARGS (void)
# define SWITCH_MODULE_SHUTDOWN_ARGS (void)
2008-05-27 04:30:03 +00:00
typedef switch_status_t ( * switch_module_load_t ) SWITCH_MODULE_LOAD_ARGS ;
typedef switch_status_t ( * switch_module_runtime_t ) SWITCH_MODULE_RUNTIME_ARGS ;
typedef switch_status_t ( * switch_module_shutdown_t ) SWITCH_MODULE_SHUTDOWN_ARGS ;
2007-06-13 14:35:55 +00:00
# define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS
# define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS
# define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS
2012-10-01 15:20:48 +00:00
typedef enum {
SWITCH_PRI_LOW = 1 ,
SWITCH_PRI_NORMAL = 10 ,
SWITCH_PRI_IMPORTANT = 50 ,
SWITCH_PRI_REALTIME = 99 ,
} switch_thread_priority_t ;
2008-11-08 11:21:54 +00:00
typedef enum {
SMODF_NONE = 0 ,
SMODF_GLOBAL_SYMBOLS = ( 1 < < 0 )
} switch_module_flag_enum_t ;
typedef uint32_t switch_module_flag_t ;
2007-06-13 14:35:55 +00:00
typedef struct switch_loadable_module_function_table {
int switch_api_version ;
switch_module_load_t load ;
switch_module_shutdown_t shutdown ;
switch_module_runtime_t runtime ;
2008-11-08 11:21:54 +00:00
switch_module_flag_t flags ;
2007-06-13 14:35:55 +00:00
} switch_loadable_module_function_table_t ;
2010-09-02 15:39:52 +00:00
typedef int ( * switch_modulename_callback_func_t ) ( void * user_data , const char * module_name ) ;
2011-01-06 23:41:17 +00:00
typedef struct switch_slin_data switch_slin_data_t ;
2008-11-08 11:21:54 +00:00
# define SWITCH_MODULE_DEFINITION_EX(name, load, shutdown, runtime, flags) \
2007-06-13 14:35:55 +00:00
static const char modname [ ] = # name ; \
SWITCH_MOD_DECLARE_DATA switch_loadable_module_function_table_t name # # _module_interface = { \
SWITCH_API_VERSION , \
load , \
shutdown , \
2008-11-08 11:21:54 +00:00
runtime , \
flags \
2007-06-13 14:35:55 +00:00
}
2008-11-08 11:21:54 +00:00
# define SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime) \
SWITCH_MODULE_DEFINITION_EX ( name , load , shutdown , runtime , SMODF_NONE )
2007-06-13 14:35:55 +00:00
2006-05-10 15:47:54 +00:00
/* things we don't deserve to know about */
2006-01-05 21:03:22 +00:00
/*! \brief A channel */
2005-11-19 20:07:43 +00:00
struct switch_channel ;
2006-01-05 21:03:22 +00:00
/*! \brief A core session representing a call and all of it's resources */
2005-11-19 20:07:43 +00:00
struct switch_core_session ;
2006-09-08 19:17:23 +00:00
/*! \brief An audio bug */
2006-09-09 03:39:28 +00:00
struct switch_media_bug ;
2006-11-13 16:29:16 +00:00
/*! \brief A digit stream parser object */
struct switch_ivr_digit_stream_parser ;
2012-10-10 01:20:32 +00:00
struct sql_queue_manager ;
2005-11-19 20:07:43 +00:00
2012-12-18 22:06:29 +00:00
struct switch_media_handle_s ;
typedef struct switch_media_handle_s switch_media_handle_t ;
2013-10-15 21:24:32 +00:00
typedef uint32_t switch_event_channel_id_t ;
typedef void ( * switch_event_channel_func_t ) ( const char * event_channel , cJSON * json , const char * key , switch_event_channel_id_t id ) ;
struct switch_live_array_s ;
typedef struct switch_live_array_s switch_live_array_t ;
2014-02-25 23:02:47 +00:00
typedef enum {
SDP_TYPE_REQUEST ,
SDP_TYPE_RESPONSE
} switch_sdp_type_t ;
typedef enum {
AEAD_AES_256_GCM_8 ,
AEAD_AES_128_GCM_8 ,
AES_CM_256_HMAC_SHA1_80 ,
AES_CM_192_HMAC_SHA1_80 ,
AES_CM_128_HMAC_SHA1_80 ,
AES_CM_256_HMAC_SHA1_32 ,
AES_CM_192_HMAC_SHA1_32 ,
AES_CM_128_HMAC_SHA1_32 ,
AES_CM_128_NULL_AUTH ,
CRYPTO_INVALID
} switch_rtp_crypto_key_type_t ;
typedef struct payload_map_s {
switch_media_type_t type ;
switch_sdp_type_t sdp_type ;
uint32_t ptime ;
uint32_t rate ;
uint8_t allocated ;
uint8_t negotiated ;
uint8_t current ;
unsigned long hash ;
char * rm_encoding ;
char * iananame ;
switch_payload_t pt ;
unsigned long rm_rate ;
unsigned long adv_rm_rate ;
uint32_t codec_ms ;
uint32_t bitrate ;
char * rm_fmtp ;
switch_payload_t agreed_pt ;
switch_payload_t recv_pt ;
char * fmtp_out ;
char * remote_sdp_ip ;
switch_port_t remote_sdp_port ;
int channels ;
int adv_channels ;
struct payload_map_s * next ;
} payload_map_t ;
typedef enum {
ICE_GOOGLE_JINGLE = ( 1 < < 0 ) ,
ICE_VANILLA = ( 1 < < 1 ) ,
ICE_CONTROLLED = ( 1 < < 2 )
} switch_core_media_ice_type_t ;
2014-07-17 20:03:57 +00:00
typedef enum {
SWITCH_POLL_READ = ( 1 < < 0 ) ,
SWITCH_POLL_WRITE = ( 1 < < 1 ) ,
SWITCH_POLL_ERROR = ( 1 < < 2 ) ,
SWITCH_POLL_HUP = ( 1 < < 3 ) ,
SWITCH_POLL_RDNORM = ( 1 < < 4 ) ,
SWITCH_POLL_RDBAND = ( 1 < < 5 ) ,
SWITCH_POLL_PRI = ( 1 < < 6 ) ,
SWITCH_POLL_INVALID = ( 1 < < 7 )
} switch_poll_t ;
2012-12-18 22:06:29 +00:00
2014-07-24 19:23:08 +00:00
typedef struct switch_waitlist_s {
switch_os_socket_t sock ;
uint32_t events ;
uint32_t revents ;
} switch_waitlist_t ;
2014-12-17 00:48:07 +00:00
struct switch_vb_s ;
typedef struct switch_vb_s switch_vb_t ;
2014-07-24 19:23:08 +00:00
2006-09-07 15:15:39 +00:00
SWITCH_END_EXTERN_C
2005-11-19 20:07:43 +00:00
# endif
2006-11-27 22:30:48 +00:00
/* For Emacs:
* Local Variables :
* mode : c
2008-02-03 22:14:57 +00:00
* indent - tabs - mode : t
2006-11-27 22:30:48 +00:00
* tab - width : 4
* c - basic - offset : 4
* End :
* For VIM :
2013-06-25 16:50:17 +00:00
* vim : set softtabstop = 4 shiftwidth = 4 tabstop = 4 noet :
2006-11-27 22:30:48 +00:00
*/