2005-11-19 20:07:43 +00:00
|
|
|
/*
|
|
|
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
* Portions created by the Initial Developer are Copyright (C)
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
* 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>
|
2006-04-28 20:04:08 +00:00
|
|
|
|
2006-09-07 14:23:31 +00:00
|
|
|
SWITCH_BEGIN_EXTERN_C
|
2005-11-19 20:07:43 +00:00
|
|
|
|
2006-02-28 23:00:34 +00:00
|
|
|
#ifdef WIN32
|
2006-03-01 17:06:10 +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
|
|
|
|
|
2006-02-28 21:21:48 +00:00
|
|
|
#ifndef SWITCH_PREFIX_DIR
|
|
|
|
#define SWITCH_PREFIX_DIR "."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWITCH_MOD_DIR
|
2006-03-01 17:06:10 +00:00
|
|
|
#define SWITCH_MOD_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "mod"
|
2006-02-28 21:21:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWITCH_CONF_DIR
|
2006-03-01 17:06:10 +00:00
|
|
|
#define SWITCH_CONF_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "conf"
|
2006-02-28 21:21:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWITCH_LOG_DIR
|
2006-03-01 17:06:10 +00:00
|
|
|
#define SWITCH_LOG_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "log"
|
2006-02-28 21:21:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWITCH_DB_DIR
|
2006-03-01 17:06:10 +00:00
|
|
|
#define SWITCH_DB_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "db"
|
2006-02-28 21:21:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWITCH_SCRIPT_DIR
|
2006-03-01 17:06:10 +00:00
|
|
|
#define SWITCH_SCRIPT_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "scripts"
|
2006-02-28 21:21:48 +00:00
|
|
|
#endif
|
|
|
|
|
2006-05-10 04:06:01 +00:00
|
|
|
#ifndef SWITCH_HTDOCS_DIR
|
|
|
|
#define SWITCH_HTDOCS_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "htdocs"
|
|
|
|
#endif
|
|
|
|
|
2006-10-06 22:39:49 +00:00
|
|
|
#define SWITCH_R_SDP_VARIABLE "_switch_r_sdp_"
|
|
|
|
#define SWITCH_L_SDP_VARIABLE "_switch_l_sdp_"
|
2006-10-31 21:38:06 +00:00
|
|
|
#define SWITCH_B_SDP_VARIABLE "_switch_m_sdp_"
|
|
|
|
#define SWITCH_BRIDGE_VARIABLE "_bridge_to_"
|
|
|
|
#define SWITCH_SIGNAL_BRIDGE_VARIABLE "_signal_bridge_to_"
|
|
|
|
#define SWITCH_ORIGINATOR_VARIABLE "_originator_"
|
|
|
|
#define SWITCH_LOCAL_MEDIA_IP_VARIABLE "_local_media_ip_"
|
|
|
|
#define SWITCH_LOCAL_MEDIA_PORT_VARIABLE "_local_media_port_"
|
|
|
|
#define SWITCH_REMOTE_MEDIA_IP_VARIABLE "_remote_media_ip_"
|
|
|
|
#define SWITCH_REMOTE_MEDIA_PORT_VARIABLE "_remote_media_port_"
|
|
|
|
|
2006-10-06 22:39:49 +00:00
|
|
|
|
2006-09-02 23:04:25 +00:00
|
|
|
#define SWITCH_BITS_PER_BYTE 8
|
|
|
|
typedef uint8_t switch_byte_t;
|
|
|
|
|
2006-10-31 21:38:06 +00:00
|
|
|
typedef enum {
|
|
|
|
SMF_NONE = 0,
|
|
|
|
SMF_REBRIDGE = (1 << 0),
|
|
|
|
SMF_ECHO_BRIDGED = (1 << 1)
|
|
|
|
} switch_media_flag_t;
|
|
|
|
|
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,
|
|
|
|
SWITCH_ABC_TYPE_CLOSE,
|
|
|
|
} 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;
|
|
|
|
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-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
|
|
|
|
2006-09-18 22:22:25 +00:00
|
|
|
#define SWITCH_THREAD_STACKSIZE 256 * 1024
|
2006-03-29 19:11:20 +00:00
|
|
|
#define SWITCH_RECCOMMENDED_BUFFER_SIZE 2048
|
2005-12-06 17:18:56 +00:00
|
|
|
#define SWITCH_MAX_CODECS 30
|
2006-02-07 20:47:15 +00:00
|
|
|
#define SWITCH_MAX_STATE_HANDLERS 30
|
2006-02-23 22:41:08 +00:00
|
|
|
#define SWITCH_TRUE 1
|
|
|
|
#define SWITCH_FALSE 0
|
2006-07-19 01:19:46 +00:00
|
|
|
#define SWITCH_CORE_QUEUE_LEN 100000
|
2006-05-12 19:28:21 +00:00
|
|
|
|
2006-10-16 04:39:00 +00:00
|
|
|
typedef enum {
|
|
|
|
SWITCH_CPF_SCREEN = (1 << 0),
|
|
|
|
SWITCH_CPF_HIDE_NAME = (1 << 1),
|
|
|
|
SWITCH_CPF_HIDE_NUMBER = (1 << 2)
|
|
|
|
} switch_caller_profile_flag_t;
|
2006-07-25 22:37:52 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
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
|
|
|
|
} 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),
|
|
|
|
SWITCH_XML_SECTION_DIALPLAN = (1 << 2)
|
|
|
|
} switch_xml_section_t;
|
|
|
|
|
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 {
|
|
|
|
SWITCH_VAD_FLAG_TALKING = ( 1 << 0 ),
|
|
|
|
SWITCH_VAD_FLAG_EVENTS_TALK = ( 1 << 1 ),
|
|
|
|
SWITCH_VAD_FLAG_EVENTS_NOTALK = ( 1 << 2 ),
|
2006-04-22 16:06:55 +00:00
|
|
|
SWITCH_VAD_FLAG_CNG = ( 1 << 3)
|
2006-04-21 22:31:08 +00:00
|
|
|
} switch_vad_flag_t;
|
|
|
|
|
|
|
|
|
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_TIMER_RECLOCK - Resync the timer to the current clock on slips
|
|
|
|
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-05-04 20:19:23 +00:00
|
|
|
SWITCH_RTP_FLAG_MINI - Use mini RTP when possible
|
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
|
2006-04-03 21:00:13 +00:00
|
|
|
</pre>
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2006-04-07 17:32:14 +00:00
|
|
|
SWITCH_RTP_FLAG_NOBLOCK = ( 1 << 0),
|
|
|
|
SWITCH_RTP_FLAG_IO = (1 << 1),
|
2006-04-10 17:14:53 +00:00
|
|
|
SWITCH_RTP_FLAG_USE_TIMER = (1 << 2),
|
2006-04-21 22:31:08 +00:00
|
|
|
SWITCH_RTP_FLAG_TIMER_RECLOCK = (1 << 3),
|
|
|
|
SWITCH_RTP_FLAG_SECURE = (1 << 4),
|
|
|
|
SWITCH_RTP_FLAG_AUTOADJ = (1 << 5),
|
|
|
|
SWITCH_RTP_FLAG_RAW_WRITE = (1 << 6),
|
|
|
|
SWITCH_RTP_FLAG_GOOGLEHACK = (1 << 7),
|
2006-05-04 01:15:38 +00:00
|
|
|
SWITCH_RTP_FLAG_VAD = (1 << 8),
|
2006-05-04 20:19:23 +00:00
|
|
|
SWITCH_RTP_FLAG_BREAK = ( 1 << 9),
|
2006-09-20 20:25:26 +00:00
|
|
|
SWITCH_RTP_FLAG_MINI = ( 1 << 10),
|
2006-10-12 20:37:08 +00:00
|
|
|
SWITCH_RTP_FLAG_DATAWAIT = (1 << 11),
|
|
|
|
SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 12)
|
2006-04-03 21:00:13 +00:00
|
|
|
} switch_rtp_flag_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,
|
|
|
|
SWITCH_PRIORITY_HIGH,
|
|
|
|
} 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)
|
2006-01-26 17:57:25 +00:00
|
|
|
} 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
|
|
|
|
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
|
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,
|
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,
|
2006-04-29 06:05:03 +00:00
|
|
|
} switch_core_session_message_types_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 {
|
|
|
|
SWITCH_STACK_BOTTOM,
|
|
|
|
SWITCH_STACK_TOP
|
|
|
|
} 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-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,
|
|
|
|
SWITCH_STATUS_TERM,
|
|
|
|
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,
|
|
|
|
SWITCH_STATUS_NOTFOUND
|
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_CONSOLE - Console
|
|
|
|
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
|
|
|
|
SWITCH_LOG_EMERG - Emergency
|
|
|
|
</pre>
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
SWITCH_LOG_CONSOLE = 8,
|
|
|
|
SWITCH_LOG_DEBUG = 7,
|
|
|
|
SWITCH_LOG_INFO = 6,
|
|
|
|
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,
|
|
|
|
SWITCH_LOG_EMERG = 0
|
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,
|
2005-12-21 22:25:22 +00:00
|
|
|
SWITCH_CHANNEL_ID_EVENT
|
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 {
|
|
|
|
SCSMF_DYNAMIC = (1 << 0)
|
|
|
|
} switch_core_session_message_flag_t;
|
|
|
|
|
2005-12-22 01:57:32 +00:00
|
|
|
#define SWITCH_UUID_FORMATTED_LENGTH APR_UUID_FORMATTED_LENGTH
|
2006-04-11 21:13:44 +00:00
|
|
|
#define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __FUNCTION__, __LINE__
|
|
|
|
#define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __FUNCTION__, __LINE__
|
2005-12-21 22:25:22 +00:00
|
|
|
#define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __FUNCTION__, __LINE__
|
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_channel_state_t
|
2006-01-05 21:03:22 +00:00
|
|
|
\brief Channel States
|
|
|
|
<pre>
|
|
|
|
CS_NEW - Channel is newly created
|
|
|
|
CS_INIT - Channel has been initilized
|
|
|
|
CS_RING - Channel is looking for a dialplan
|
|
|
|
CS_TRANSMIT - Channel is in a passive transmit state
|
|
|
|
CS_EXECUTE - Channel is executing it's dialplan
|
|
|
|
CS_LOOPBACK - Channel is in loopback
|
2006-04-28 19:46:57 +00:00
|
|
|
CS_HOLD - Channel is on hold
|
2006-10-31 21:38:06 +00:00
|
|
|
CS_HIBERNATE - Channel is in a sleep state
|
2006-01-05 21:03:22 +00:00
|
|
|
CS_HANGUP - Channel is flagged for hangup and ready to end
|
|
|
|
CS_DONE - Channel is ready to be destroyed and out of the state machine
|
|
|
|
</pre>
|
2006-01-02 05:00:28 +00:00
|
|
|
*/
|
2005-11-19 20:07:43 +00:00
|
|
|
typedef enum {
|
|
|
|
CS_NEW,
|
|
|
|
CS_INIT,
|
|
|
|
CS_RING,
|
|
|
|
CS_TRANSMIT,
|
|
|
|
CS_EXECUTE,
|
|
|
|
CS_LOOPBACK,
|
2006-04-28 19:46:57 +00:00
|
|
|
CS_HOLD,
|
2006-10-31 21:38:06 +00:00
|
|
|
CS_HIBERNATE,
|
2005-11-19 20:07:43 +00:00
|
|
|
CS_HANGUP,
|
2006-01-05 21:03:22 +00:00
|
|
|
CS_DONE
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_channel_state_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_channel_flag_t
|
2006-01-05 21:03:22 +00:00
|
|
|
\brief Channel Flags
|
|
|
|
|
|
|
|
<pre>
|
2006-04-06 19:50:53 +00:00
|
|
|
CF_ANSWERED = (1 << 0) - Channel is answered
|
|
|
|
CF_OUTBOUND = (1 << 1) - Channel is an outbound channel
|
|
|
|
CF_EARLY_MEDIA = (1 << 2) - Channel is ready for audio before answer
|
|
|
|
CF_ORIGINATOR = (1 << 3) - Channel is an originator
|
|
|
|
CF_TRANSFER = (1 << 4) - Channel is being transfered
|
2006-04-25 18:02:12 +00:00
|
|
|
CF_ACCEPT_CNG = (1 << 5) - Channel will accept CNG frames
|
|
|
|
CF_LOCK_THREAD = (1 << 6) - Prevent the channel thread from exiting while this flag is set
|
2006-04-28 19:46:57 +00:00
|
|
|
CF_BRIDGED = (1 << 7) - Channel in a bridge
|
|
|
|
CF_HOLD = (1 << 8) - Channel is on hold
|
2006-06-09 22:59:13 +00:00
|
|
|
CF_SERVICE = (1 << 9) - Channel has a service thread
|
2006-08-17 00:53:09 +00:00
|
|
|
CF_TAGGED = (1 << 10) - Channel is tagged
|
2006-09-07 03:58:01 +00:00
|
|
|
CF_WINNER = (1 << 11) - Channel is the winner
|
|
|
|
CF_CONTROLLED = (1 << 12) - Channel is under control
|
2006-10-06 22:39:49 +00:00
|
|
|
CF_NOMEDIA = (1 << 13) - Channel has no media
|
2006-10-31 21:38:06 +00:00
|
|
|
CF_SUSPEND = (1 << 14) - Suspend i/o
|
|
|
|
CF_EVENT_PARSE = (1 << 15) - Suspend control events
|
2006-01-05 21:03:22 +00:00
|
|
|
</pre>
|
|
|
|
*/
|
|
|
|
|
2005-11-19 20:07:43 +00:00
|
|
|
typedef enum {
|
2006-04-06 19:50:53 +00:00
|
|
|
CF_ANSWERED = (1 << 0),
|
|
|
|
CF_OUTBOUND = (1 << 1),
|
|
|
|
CF_EARLY_MEDIA = (1 << 2),
|
|
|
|
CF_ORIGINATOR = (1 << 3),
|
|
|
|
CF_TRANSFER = (1 << 4),
|
2006-04-25 18:02:12 +00:00
|
|
|
CF_ACCEPT_CNG = (1 << 5),
|
2006-04-28 19:46:57 +00:00
|
|
|
CF_LOCK_THREAD = (1 << 6),
|
|
|
|
CF_BRIDGED = (1 << 7),
|
2006-06-09 22:59:13 +00:00
|
|
|
CF_HOLD = (1 << 8),
|
2006-08-17 00:53:09 +00:00
|
|
|
CF_SERVICE = (1 << 9),
|
|
|
|
CF_TAGGED = (1 << 10),
|
2006-09-07 03:58:01 +00:00
|
|
|
CF_WINNER = (1 << 11),
|
2006-10-06 22:39:49 +00:00
|
|
|
CF_CONTROLLED = (1 << 12),
|
2006-10-31 21:38:06 +00:00
|
|
|
CF_NOMEDIA = (1 << 13),
|
|
|
|
CF_SUSPEND = (1 << 14),
|
|
|
|
CF_EVENT_PARSE = (1 << 15)
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_channel_flag_t;
|
2005-11-19 20:07:43 +00:00
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
|
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>
|
2006-04-18 00:24:52 +00:00
|
|
|
SFF_CNG = (1 << 0) - Frame represents comfort noise
|
|
|
|
SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible
|
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),
|
|
|
|
SFF_RAW_RTP = (1 << 1)
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_frame_flag_t;
|
2006-04-06 19:50:53 +00:00
|
|
|
|
|
|
|
|
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,
|
|
|
|
SWITCH_SIG_XFER
|
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 {
|
|
|
|
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),
|
2006-01-05 21:03:22 +00:00
|
|
|
SWITCH_CODEC_FLAG_SILENCE = (1 << 4),
|
2005-12-26 21:01:22 +00:00
|
|
|
SWITCH_CODEC_FLAG_FREE_POOL = (1 << 5),
|
2006-09-08 15:43:45 +00:00
|
|
|
SWITCH_CODEC_FLAG_AAL2 = (1 << 6),
|
|
|
|
SWITCH_CODEC_FLAG_PASSTHROUGH = (1 << 7)
|
2006-04-29 23:43:28 +00:00
|
|
|
} 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>
|
|
|
|
SWITCH_SPEECH_FLAG_TTS = (1 << 0) - Interface can/should convert text to speech.
|
|
|
|
SWITCH_SPEECH_FLAG_ASR = (1 << 1) - Interface can/should convert audio to text.
|
|
|
|
SWITCH_SPEECH_FLAG_HASTEXT = (1 << 2) - Interface is has text to read.
|
|
|
|
SWITCH_SPEECH_FLAG_PEEK = (1 << 3) - Read data but do not erase it.
|
|
|
|
SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 4) - Free interface's pool on destruction.
|
2006-02-26 20:23:23 +00:00
|
|
|
SWITCH_SPEECH_FLAG_BLOCKING = (1 << 5) - Indicate that a blocking call is desired
|
2006-06-08 19:22:54 +00:00
|
|
|
SWITCH_SPEECH_FLAG_PAUSE = (1 << 6) - Pause toggle for playback
|
2006-01-27 16:43:57 +00:00
|
|
|
</pre>
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
SWITCH_SPEECH_FLAG_TTS = (1 << 0),
|
|
|
|
SWITCH_SPEECH_FLAG_ASR = (1 << 1),
|
|
|
|
SWITCH_SPEECH_FLAG_HASTEXT = (1 << 2),
|
|
|
|
SWITCH_SPEECH_FLAG_PEEK = (1 << 3),
|
|
|
|
SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 4),
|
2006-02-26 20:23:23 +00:00
|
|
|
SWITCH_SPEECH_FLAG_BLOCKING = (1 << 5),
|
2006-06-08 19:22:54 +00:00
|
|
|
SWITCH_SPEECH_FLAG_PAUSE = (1 << 6)
|
2006-01-27 16:43:57 +00:00
|
|
|
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_speech_flag_t;
|
2006-01-27 16:43:57 +00:00
|
|
|
|
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 {
|
|
|
|
SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0),
|
|
|
|
|
2006-04-29 23:43:28 +00:00
|
|
|
} 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,
|
|
|
|
SWITCH_CODEC_TYPE_APP
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_codec_type_t;
|
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 {
|
|
|
|
SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0),
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_timer_flag_t;
|
2005-12-26 21:01:22 +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
|
2006-01-05 21:03:22 +00:00
|
|
|
</pre>
|
|
|
|
*/
|
2005-12-27 18:46:12 +00:00
|
|
|
typedef enum {
|
|
|
|
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),
|
2006-02-28 02:08:42 +00:00
|
|
|
SWITCH_FILE_PAUSE = (1 << 8)
|
2006-04-29 23:43:28 +00:00
|
|
|
} switch_file_flag_t;
|
2005-12-27 18:46:12 +00:00
|
|
|
|
2005-11-19 20:07:43 +00:00
|
|
|
typedef enum {
|
|
|
|
SWITCH_IO_FLAG_NOOP = 0,
|
2006-04-29 23:43:28 +00:00
|
|
|
} 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
|
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
|
|
|
|
SWITCH_EVENT_CHANNEL_ANSWER - A channel has been answered
|
|
|
|
SWITCH_EVENT_CHANNEL_HANGUP - A channel has been hungup
|
2006-04-11 14:55:14 +00:00
|
|
|
SWITCH_EVENT_CHANNEL_EXECUTE - A channel has executed a module's application
|
|
|
|
SWITCH_EVENT_CHANNEL_BRIDGE - A channel has bridged to another channel
|
|
|
|
SWITCH_EVENT_CHANNEL_UNBRIDGE - A channel has unbridged from another channel
|
2006-09-07 03:58:01 +00:00
|
|
|
SWITCH_EVENT_CHANNEL_PROGRESS - A channel has been parked
|
|
|
|
SWITCH_EVENT_CHANNEL_OUTGOING - A channel has been unparked
|
|
|
|
SWITCH_EVENT_CHANNEL_PARK - A channel has been parked
|
|
|
|
SWITCH_EVENT_CHANNEL_UNPARK - A channel has been unparked
|
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
|
2006-02-13 23:59:14 +00:00
|
|
|
SWITCH_EVENT_PUBLISH - Publish
|
|
|
|
SWITCH_EVENT_UNPUBLISH - UnPublish
|
2006-04-21 22:31:08 +00:00
|
|
|
SWITCH_EVENT_TALK - Talking Detected
|
|
|
|
SWITCH_EVENT_NOTALK - Not Talking Detected
|
2006-04-27 21:09:58 +00:00
|
|
|
SWITCH_EVENT_SESSION_CRASH - Session Crashed
|
2006-05-04 17:51:53 +00:00
|
|
|
SWITCH_EVENT_MODULE_LOAD - Module was loaded
|
|
|
|
SWITCH_EVENT_DTMF - DTMF was sent
|
2006-07-25 14:14:07 +00:00
|
|
|
SWITCH_EVENT_MESSAGE - A Basic Message
|
2006-10-12 00:59:09 +00:00
|
|
|
SWITCH_EVENT_PRESENCE - Presence Info
|
2006-08-25 01:33:28 +00:00
|
|
|
SWITCH_EVENT_CODEC - Codec Change
|
2006-09-07 03:58:01 +00:00
|
|
|
SWITCH_EVENT_BACKGROUND_JOB - Background Job
|
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,
|
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,
|
|
|
|
SWITCH_EVENT_CHANNEL_ANSWER,
|
2006-01-05 21:03:22 +00:00
|
|
|
SWITCH_EVENT_CHANNEL_HANGUP,
|
2006-04-11 14:55:14 +00:00
|
|
|
SWITCH_EVENT_CHANNEL_EXECUTE,
|
|
|
|
SWITCH_EVENT_CHANNEL_BRIDGE,
|
|
|
|
SWITCH_EVENT_CHANNEL_UNBRIDGE,
|
2006-08-29 15:17:06 +00:00
|
|
|
SWITCH_EVENT_CHANNEL_PROGRESS,
|
|
|
|
SWITCH_EVENT_CHANNEL_OUTGOING,
|
2006-09-07 03:58:01 +00:00
|
|
|
SWITCH_EVENT_CHANNEL_PARK,
|
|
|
|
SWITCH_EVENT_CHANNEL_UNPARK,
|
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,
|
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,
|
|
|
|
SWITCH_EVENT_PRESENCE_OUT,
|
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,
|
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,
|
|
|
|
SWITCH_INPUT_TYPE_EVENT
|
|
|
|
} switch_input_type_t;
|
2006-04-21 23:16:26 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SWITCH_CAUSE_UNALLOCATED = 1,
|
|
|
|
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,
|
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,
|
|
|
|
SWITCH_CAUSE_ATTENDED_TRANSFER = 601
|
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,
|
|
|
|
SCSC_HUPALL,
|
|
|
|
SCSC_SHUTDOWN,
|
|
|
|
SCSC_CHECK_RUNNING
|
|
|
|
} switch_session_ctl_t;
|
2006-04-21 23:16:26 +00:00
|
|
|
|
2006-04-18 16:50:34 +00:00
|
|
|
typedef uint8_t switch_payload_t;
|
2006-04-29 01:00:52 +00:00
|
|
|
typedef struct switch_rtp switch_rtp_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;
|
|
|
|
typedef struct switch_channel switch_channel_t;
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
typedef struct switch_codec_settings switch_codec_settings_t;
|
|
|
|
typedef struct switch_config switch_config_t;
|
|
|
|
|
2006-04-29 23:43:28 +00:00
|
|
|
typedef struct switch_io_event_hook_outgoing_channel switch_io_event_hook_outgoing_channel_t;
|
|
|
|
typedef struct switch_io_event_hook_answer_channel switch_io_event_hook_answer_channel_t;
|
|
|
|
typedef struct switch_io_event_hook_receive_message switch_io_event_hook_receive_message_t;
|
2006-07-12 18:39:19 +00:00
|
|
|
typedef struct switch_io_event_hook_receive_event switch_io_event_hook_receive_event_t;
|
2006-04-29 23:43:28 +00:00
|
|
|
typedef struct switch_io_event_hook_read_frame switch_io_event_hook_read_frame_t;
|
|
|
|
typedef struct switch_io_event_hook_write_frame switch_io_event_hook_write_frame_t;
|
|
|
|
typedef struct switch_io_event_hook_kill_channel switch_io_event_hook_kill_channel_t;
|
|
|
|
typedef struct switch_io_event_hook_waitfor_read switch_io_event_hook_waitfor_read_t;
|
|
|
|
typedef struct switch_io_event_hook_waitfor_write switch_io_event_hook_waitfor_write_t;
|
|
|
|
typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf_t;
|
|
|
|
typedef struct switch_io_routines switch_io_routines_t;
|
|
|
|
typedef struct switch_io_event_hooks switch_io_event_hooks_t;
|
|
|
|
|
|
|
|
typedef struct switch_speech_handle switch_speech_handle_t;
|
|
|
|
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;
|
|
|
|
typedef struct switch_api_interface switch_api_interface_t;
|
|
|
|
typedef struct switch_file_interface switch_file_interface_t;
|
|
|
|
typedef struct switch_speech_interface switch_speech_interface_t;
|
|
|
|
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;
|
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;
|
|
|
|
typedef void (*switch_media_bug_callback_t)(switch_media_bug_t *, void *, switch_abc_type_t);
|
2006-04-29 23:43:28 +00:00
|
|
|
typedef void (*switch_application_function_t)(switch_core_session_t *, char *);
|
2006-04-29 01:00:52 +00:00
|
|
|
typedef void (*switch_event_callback_t)(switch_event_t *);
|
2006-04-29 23:43:28 +00:00
|
|
|
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t)(switch_core_session_t *);
|
|
|
|
typedef switch_status_t (*switch_state_handler_t)(switch_core_session_t *);
|
|
|
|
typedef switch_status_t (*switch_outgoing_channel_hook_t)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *);
|
|
|
|
typedef switch_status_t (*switch_answer_channel_hook_t)(switch_core_session_t *);
|
|
|
|
typedef switch_status_t (*switch_receive_message_hook_t)(switch_core_session_t *, switch_core_session_message_t *);
|
2006-07-12 18:39:19 +00:00
|
|
|
typedef switch_status_t (*switch_receive_event_hook_t)(switch_core_session_t *, switch_event_t *);
|
2006-04-29 23:43:28 +00:00
|
|
|
typedef switch_status_t (*switch_read_frame_hook_t)(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
|
|
|
|
typedef switch_status_t (*switch_write_frame_hook_t)(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
|
|
|
|
typedef switch_status_t (*switch_kill_channel_hook_t)(switch_core_session_t *, int);
|
|
|
|
typedef switch_status_t (*switch_waitfor_read_hook_t)(switch_core_session_t *, int, int);
|
|
|
|
typedef switch_status_t (*switch_waitfor_write_hook_t)(switch_core_session_t *, int, int);
|
|
|
|
typedef switch_status_t (*switch_send_dtmf_hook_t)(switch_core_session_t *, char *);
|
2006-05-10 15:47:54 +00:00
|
|
|
typedef struct switch_stream_handle switch_stream_handle_t;
|
|
|
|
typedef switch_status_t (*switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, char *fmt, ...);
|
2006-07-26 20:12:49 +00:00
|
|
|
typedef switch_status_t (*switch_api_function_t)(char *in, switch_core_session_t *session, switch_stream_handle_t *stream);
|
2006-07-12 18:39:19 +00:00
|
|
|
typedef switch_status_t (*switch_input_callback_function_t)(switch_core_session_t *session,
|
|
|
|
void *input,
|
|
|
|
switch_input_type_t input_type,
|
|
|
|
void *buf,
|
|
|
|
unsigned int buflen);
|
2006-04-29 23:43:28 +00:00
|
|
|
typedef int (*switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames);
|
|
|
|
typedef switch_status_t (*switch_module_load_t) (switch_loadable_module_interface_t **, char *);
|
|
|
|
typedef switch_status_t (*switch_module_reload_t) (void);
|
|
|
|
typedef switch_status_t (*switch_module_pause_t) (void);
|
|
|
|
typedef switch_status_t (*switch_module_resume_t) (void);
|
|
|
|
typedef switch_status_t (*switch_module_status_t) (void);
|
|
|
|
typedef switch_status_t (*switch_module_runtime_t) (void);
|
|
|
|
typedef switch_status_t (*switch_module_shutdown_t) (void);
|
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;
|
|
|
|
typedef switch_xml_t (*switch_xml_search_function_t)(char *section,
|
|
|
|
char *tag_name,
|
|
|
|
char *key_name,
|
2006-05-10 15:47:54 +00:00
|
|
|
char *key_value,
|
|
|
|
char *params);
|
2005-11-19 20:07:43 +00:00
|
|
|
|
2006-01-05 21:03:22 +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;
|
2005-11-19 20:07:43 +00:00
|
|
|
|
2006-09-07 15:15:39 +00:00
|
|
|
SWITCH_END_EXTERN_C
|
2005-11-19 20:07:43 +00:00
|
|
|
|
|
|
|
#endif
|