mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-08 20:43:51 +00:00
Merge branch 'master' into smgmaster
This commit is contained in:
commit
2d4b16516a
278 files changed
+61707
-5167
No files matched your search
@@ -193,6 +193,11 @@ struct switch_media_bug {
|
||||
struct switch_media_bug *next;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
DBTYPE_DEFAULT = 0,
|
||||
DBTYPE_MSSQL = 1,
|
||||
} switch_dbtype_t;
|
||||
|
||||
struct switch_runtime {
|
||||
switch_time_t initiated;
|
||||
switch_time_t reference;
|
||||
@@ -237,6 +242,7 @@ struct switch_runtime {
|
||||
double min_idle_time;
|
||||
int sql_buffer_len;
|
||||
int max_sql_buffer_len;
|
||||
switch_dbtype_t odbc_dbtype;
|
||||
};
|
||||
|
||||
extern struct switch_runtime runtime;
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef struct switch_io_event_hook_kill_channel switch_io_event_hook_kill_chann
|
||||
typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf_t;
|
||||
typedef struct switch_io_event_hook_recv_dtmf switch_io_event_hook_recv_dtmf_t;
|
||||
typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
|
||||
typedef struct switch_io_event_hook_state_run switch_io_event_hook_state_run_t;
|
||||
typedef struct switch_io_event_hook_resurrect_session switch_io_event_hook_resurrect_session_t;
|
||||
typedef switch_status_t (*switch_outgoing_channel_hook_t)
|
||||
(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t *, switch_originate_flag_t);
|
||||
@@ -58,6 +59,7 @@ typedef switch_status_t (*switch_kill_channel_hook_t) (switch_core_session_t *,
|
||||
typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, const switch_dtmf_t *, switch_dtmf_direction_t direction);
|
||||
typedef switch_status_t (*switch_recv_dtmf_hook_t) (switch_core_session_t *, const switch_dtmf_t *, switch_dtmf_direction_t direction);
|
||||
typedef switch_status_t (*switch_state_change_hook_t) (switch_core_session_t *);
|
||||
typedef switch_status_t (*switch_state_run_hook_t) (switch_core_session_t *);
|
||||
typedef switch_call_cause_t (*switch_resurrect_session_hook_t) (switch_core_session_t **, switch_memory_pool_t **, void *);
|
||||
|
||||
/*! \brief Node in which to store custom receive message callback hooks */
|
||||
@@ -136,6 +138,13 @@ struct switch_io_event_hook_state_change {
|
||||
struct switch_io_event_hook_state_change *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store state run callback hooks */
|
||||
struct switch_io_event_hook_state_run {
|
||||
/*! the state run channel callback hook */
|
||||
switch_state_run_hook_t state_run;
|
||||
struct switch_io_event_hook_state_run *next;
|
||||
};
|
||||
|
||||
|
||||
struct switch_io_event_hook_resurrect_session {
|
||||
switch_resurrect_session_hook_t resurrect_session;
|
||||
@@ -166,6 +175,7 @@ struct switch_io_event_hooks {
|
||||
switch_io_event_hook_recv_dtmf_t *recv_dtmf;
|
||||
/*! a list of state change hooks */
|
||||
switch_io_event_hook_state_change_t *state_change;
|
||||
switch_io_event_hook_state_run_t *state_run;
|
||||
switch_io_event_hook_resurrect_session_t *resurrect_session;
|
||||
};
|
||||
|
||||
@@ -218,6 +228,7 @@ NEW_HOOK_DECL_ADD_P(outgoing_channel);
|
||||
NEW_HOOK_DECL_ADD_P(receive_message);
|
||||
NEW_HOOK_DECL_ADD_P(receive_event);
|
||||
NEW_HOOK_DECL_ADD_P(state_change);
|
||||
NEW_HOOK_DECL_ADD_P(state_run);
|
||||
NEW_HOOK_DECL_ADD_P(read_frame);
|
||||
NEW_HOOK_DECL_ADD_P(write_frame);
|
||||
NEW_HOOK_DECL_ADD_P(video_read_frame);
|
||||
@@ -231,6 +242,7 @@ NEW_HOOK_DECL_REM_P(outgoing_channel);
|
||||
NEW_HOOK_DECL_REM_P(receive_message);
|
||||
NEW_HOOK_DECL_REM_P(receive_event);
|
||||
NEW_HOOK_DECL_REM_P(state_change);
|
||||
NEW_HOOK_DECL_REM_P(state_run);
|
||||
NEW_HOOK_DECL_REM_P(read_frame);
|
||||
NEW_HOOK_DECL_REM_P(write_frame);
|
||||
NEW_HOOK_DECL_REM_P(video_read_frame);
|
||||
|
||||
@@ -345,11 +345,15 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(_In_z_ char
|
||||
*/
|
||||
#define switch_event_create(event, id) switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY)
|
||||
|
||||
static inline switch_status_t switch_event_create_plain(switch_event_t **event, switch_event_types_t event_id)
|
||||
static inline switch_status_t switch_event_create_plain(switch_event_t **event, switch_event_types_t event_id)
|
||||
{
|
||||
switch_status_t status = switch_event_create(event, SWITCH_EVENT_CLONE);
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
(*event)->event_id = event_id;
|
||||
|
||||
if (event_id == SWITCH_EVENT_REQUEST_PARAMS || event_id == SWITCH_EVENT_CHANNEL_DATA) {
|
||||
(*event)->flags |= EF_UNIQ_HEADERS;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -840,11 +840,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say_ip(switch_core_session_t *session
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname);
|
||||
SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname, const char *prefix);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid);
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_ivr_dmachine_set_match_callback(switch_ivr_dmachine_t *dmachine, switch_ivr_dmachine_callback_t match_callback);
|
||||
SWITCH_DECLARE(void) switch_ivr_dmachine_set_nonmatch_callback(switch_ivr_dmachine_t *dmachine, switch_ivr_dmachine_callback_t nonmatch_callback);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_create(switch_ivr_dmachine_t **dmachine_p,
|
||||
const char *name,
|
||||
switch_memory_pool_t *pool,
|
||||
|
||||
@@ -134,6 +134,7 @@ typedef switch_status_t (*switch_io_send_dtmf_t) (switch_core_session_t *, const
|
||||
typedef switch_status_t (*switch_io_receive_message_t) (switch_core_session_t *, switch_core_session_message_t *);
|
||||
typedef switch_status_t (*switch_io_receive_event_t) (switch_core_session_t *, switch_event_t *);
|
||||
typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
|
||||
typedef switch_status_t (*switch_io_state_run_t) (switch_core_session_t *);
|
||||
typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
|
||||
typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
|
||||
typedef switch_call_cause_t (*switch_io_resurrect_session_t) (switch_core_session_t **, switch_memory_pool_t **, void *);
|
||||
@@ -174,6 +175,8 @@ struct switch_io_routines {
|
||||
switch_io_read_video_frame_t read_video_frame;
|
||||
/*! write a video frame to a session */
|
||||
switch_io_write_video_frame_t write_video_frame;
|
||||
/*! change a sessions channel run state */
|
||||
switch_io_state_run_t state_run;
|
||||
/*! resurrect a session */
|
||||
switch_io_resurrect_session_t resurrect_session;
|
||||
void *padding[10];
|
||||
|
||||
@@ -58,6 +58,8 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_exec(switch_odbc_handle_
|
||||
char **err);
|
||||
SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_exec_string(switch_odbc_handle_t *handle, const char *sql, char *resbuf, size_t len, char **err);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_odbc_available(void);
|
||||
SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_SQLSetAutoCommitAttr(switch_odbc_handle_t *handle, switch_bool_t on);
|
||||
SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_SQLEndTran(switch_odbc_handle_t *handle, switch_bool_t commit);
|
||||
SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_statement_handle_free(switch_odbc_statement_handle_t *stmt);
|
||||
|
||||
/*!
|
||||
|
||||
@@ -596,7 +596,7 @@ typedef enum {
|
||||
*/
|
||||
|
||||
|
||||
RTP_BUG_IGNORE_MARK_BIT = (1 << 2)
|
||||
RTP_BUG_IGNORE_MARK_BIT = (1 << 2),
|
||||
|
||||
/*
|
||||
A Huawei SBC has been discovered that sends the mark bit on every single RTP packet.
|
||||
@@ -606,6 +606,34 @@ typedef enum {
|
||||
|
||||
*/
|
||||
|
||||
|
||||
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....
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} switch_rtp_bug_flag_t;
|
||||
|
||||
@@ -840,6 +868,7 @@ typedef enum {
|
||||
SWITCH_STATUS_IGNORE,
|
||||
SWITCH_STATUS_TOO_SMALL,
|
||||
SWITCH_STATUS_FOUND,
|
||||
SWITCH_STATUS_CONTINUE,
|
||||
SWITCH_STATUS_NOT_INITALIZED
|
||||
} switch_status_t;
|
||||
|
||||
@@ -1063,6 +1092,7 @@ typedef enum {
|
||||
CF_CONSUME_ON_ORIGINATE,
|
||||
CF_PASSTHRU_PTIME_MISMATCH,
|
||||
CF_BRIDGE_NOWRITE,
|
||||
CF_RECOVERED,
|
||||
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
||||
CF_FLAG_MAX
|
||||
} switch_channel_flag_t;
|
||||
@@ -1266,7 +1296,8 @@ typedef enum {
|
||||
SMBF_STEREO = (1 << 5),
|
||||
SMBF_ANSWER_REQ = (1 << 6),
|
||||
SMBF_THREAD_LOCK = (1 << 7),
|
||||
SMBF_PRUNE = (1 << 8)
|
||||
SMBF_PRUNE = (1 << 8),
|
||||
SMBF_NO_PAUSE = (1 << 9)
|
||||
} switch_media_bug_flag_enum_t;
|
||||
typedef uint32_t switch_media_bug_flag_t;
|
||||
|
||||
@@ -1304,7 +1335,8 @@ typedef enum {
|
||||
SWITCH_FILE_CALLBACK = (1 << 12),
|
||||
SWITCH_FILE_DONE = (1 << 13),
|
||||
SWITCH_FILE_BUFFER_DONE = (1 << 14),
|
||||
SWITCH_FILE_WRITE_APPEND = (1 << 15)
|
||||
SWITCH_FILE_WRITE_APPEND = (1 << 15),
|
||||
SWITCH_FILE_WRITE_OVER = (1 << 16)
|
||||
} switch_file_flag_enum_t;
|
||||
typedef uint32_t switch_file_flag_t;
|
||||
|
||||
|
||||
@@ -54,6 +54,13 @@ SWITCH_DECLARE(int) switch_isspace(int c);
|
||||
SWITCH_DECLARE(int) switch_isupper(int c);
|
||||
SWITCH_DECLARE(int) switch_isxdigit(int c);
|
||||
|
||||
typedef union{
|
||||
uint32_t v4;
|
||||
struct in6_addr v6;
|
||||
} ip_t;
|
||||
|
||||
SWITCH_DECLARE(switch_bool_t) switch_testv6_subnet(ip_t _ip, ip_t _net, ip_t _mask);
|
||||
|
||||
#define switch_goto_status(_status, _label) status = _status; goto _label
|
||||
#define switch_goto_int(_n, _i, _label) _n = _i; goto _label
|
||||
#define switch_samples_per_packet(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval)))
|
||||
@@ -322,7 +329,7 @@ SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key);
|
||||
\param key the key to test
|
||||
\return TRUE or FALSE
|
||||
*/
|
||||
#define is_dtmf(key) ((key > 47 && key < 58) || (key > 64 && key < 69) || (key > 96 && key < 101) || key == 35 || key == 42 || key == 87 || key == 119 || key == 70)
|
||||
#define is_dtmf(key) ((key > 47 && key < 58) || (key > 64 && key < 69) || (key > 96 && key < 101) || key == 35 || key == 42 || key == 87 || key == 119 || key == 70 || key == 102)
|
||||
|
||||
#define end_of(_s) *(*_s == '\0' ? _s : _s + strlen(_s) - 1)
|
||||
#define end_of_p(_s) (*_s == '\0' ? _s : _s + strlen(_s) - 1)
|
||||
@@ -694,7 +701,7 @@ SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char clos
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(int) switch_parse_cidr(const char *string, uint32_t *ip, uint32_t *mask, uint32_t *bitp);
|
||||
SWITCH_DECLARE(int) switch_parse_cidr(const char *string, ip_t *ip, ip_t *mask, uint32_t *bitp);
|
||||
SWITCH_DECLARE(switch_status_t) switch_network_list_create(switch_network_list_t **list, const char *name, switch_bool_t default_type,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_network_list_add_cidr_token(switch_network_list_t *list, const char *cidr_str, switch_bool_t ok, const char *token);
|
||||
@@ -703,6 +710,7 @@ SWITCH_DECLARE(switch_status_t) switch_network_list_add_cidr_token(switch_networ
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_network_list_add_host_mask(switch_network_list_t *list, const char *host, const char *mask_str, switch_bool_t ok);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip_token(switch_network_list_t *list, uint32_t ip, const char **token);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip6_token(switch_network_list_t *list, ip_t ip, const char **token);
|
||||
#define switch_network_list_validate_ip(_list, _ip) switch_network_list_validate_ip_token(_list, _ip, NULL);
|
||||
|
||||
#define switch_test_subnet(_ip, _net, _mask) (_mask ? ((_net & _mask) == (_ip & _mask)) : _net ? _net == _ip : 1)
|
||||
@@ -711,7 +719,7 @@ SWITCH_DECLARE(int) switch_inet_pton(int af, const char *src, void *dst);
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_dow_int2str(int val);
|
||||
SWITCH_DECLARE(int) switch_dow_str2int(const char *exp);
|
||||
SWITCH_DECLARE(int) switch_dow_cmp(const char *exp, int val);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_dow_cmp(const char *exp, int val);
|
||||
SWITCH_DECLARE(int) switch_number_cmp(const char *exp, int val);
|
||||
SWITCH_DECLARE(int) switch_tod_cmp(const char *exp, int val);
|
||||
|
||||
|
||||
Reference in new issue
Block a user