mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
Merge branch 'master' into smgmaster
Conflicts: build/modules.conf.in
This commit is contained in:
@@ -1323,6 +1323,8 @@ SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, switch_sockaddr_t *where, int32_t flags, const char *buf,
|
||||
switch_size_t *len);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_send_nonblock(switch_socket_t *sock, const char *buf, switch_size_t *len);
|
||||
|
||||
/**
|
||||
* @param from The apr_sockaddr_t to fill in the recipient info
|
||||
|
||||
@@ -109,6 +109,8 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_read(_In_ switch_buffer_t *buffer, _
|
||||
*/
|
||||
SWITCH_DECLARE(switch_size_t) switch_buffer_peek(_In_ switch_buffer_t *buffer, _In_ void *data, _In_ switch_size_t datalen);
|
||||
|
||||
SWITCH_DECLARE(switch_size_t) switch_buffer_peek_zerocopy(_In_ switch_buffer_t *buffer, _Out_ const void **ptr);
|
||||
|
||||
/*! \brief Read data endlessly from a switch_buffer_t
|
||||
* \param buffer any buffer of type switch_buffer_t
|
||||
* \param data pointer to the read data to be returned
|
||||
|
||||
@@ -251,6 +251,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
|
||||
const char *varname, const char *value, switch_bool_t var_check);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_add_variable_var_check(switch_channel_t *channel,
|
||||
const char *varname, const char *value, switch_bool_t var_check, switch_stack_t stack);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_printf(switch_channel_t *channel, const char *varname, const char *fmt, ...);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_name_printf(switch_channel_t *channel, const char *val, const char *fmt, ...);
|
||||
|
||||
@@ -277,6 +279,8 @@ SWITCH_DECLARE(void) switch_channel_process_export(switch_channel_t *channel, sw
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_channel_t *channel, const char *varname,
|
||||
const char *export_varname, const char *fmt, ...);
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_set_scope_variables(switch_channel_t *channel, switch_event_t **event);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_get_scope_variables(switch_channel_t *channel, switch_event_t **event);
|
||||
|
||||
/*!
|
||||
\brief Retrieve a variable from a given channel
|
||||
@@ -284,8 +288,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_cha
|
||||
\param varname the name of the variable
|
||||
\return the value of the requested variable
|
||||
*/
|
||||
SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *channel, const char *varname, switch_bool_t dup);
|
||||
#define switch_channel_get_variable(_c, _v) switch_channel_get_variable_dup(_c, _v, SWITCH_TRUE)
|
||||
SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *channel, const char *varname, switch_bool_t dup, int idx);
|
||||
#define switch_channel_get_variable(_c, _v) switch_channel_get_variable_dup(_c, _v, SWITCH_TRUE, -1)
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event);
|
||||
|
||||
|
||||
@@ -248,6 +248,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(_Inout_ switch_media
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(_In_ switch_core_session_t *session);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_session_t *session, switch_stream_handle_t *stream);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session);
|
||||
|
||||
/*!
|
||||
\brief Read a frame from the bug
|
||||
@@ -1226,7 +1227,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_insert(_In_ switch_hash_t *hash
|
||||
\note the string key must be a constant or a dynamic string
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const void *data,
|
||||
_In_ switch_mutex_t *mutex);
|
||||
_In_opt_ switch_mutex_t *mutex);
|
||||
/*!
|
||||
\brief Retrieve data from a given hash
|
||||
\param hash the hash to retrieve from
|
||||
\param key the key to retrieve
|
||||
\param mutex optional rwlock to wrlock
|
||||
\return a pointer to the data held in the key
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_wrlock(switch_hash_t *hash, const char *key, const void *data, switch_thread_rwlock_t *rwlock);
|
||||
|
||||
/*!
|
||||
\brief Delete data from a hash based on desired key
|
||||
@@ -1243,7 +1252,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete(_In_ switch_hash_t *hash
|
||||
\param mutex optional mutex to lock
|
||||
\return SWITCH_STATUS_SUCCESS if the data is deleted
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_mutex_t *mutex);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ switch_mutex_t *mutex);
|
||||
|
||||
/*!
|
||||
\brief Delete data from a hash based on desired key
|
||||
\param hash the hash to delete from
|
||||
\param key the key from which to delete the data
|
||||
\param mutex optional rwlock to wrlock
|
||||
\return SWITCH_STATUS_SUCCESS if the data is deleted
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_wrlock(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ switch_thread_rwlock_t *rwlock);
|
||||
|
||||
/*!
|
||||
\brief Delete data from a hash based on callback function
|
||||
@@ -1271,6 +1289,15 @@ SWITCH_DECLARE(void *) switch_core_hash_find(_In_ switch_hash_t *hash, _In_z_ co
|
||||
*/
|
||||
SWITCH_DECLARE(void *) switch_core_hash_find_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_mutex_t *mutex);
|
||||
|
||||
/*!
|
||||
\brief Retrieve data from a given hash
|
||||
\param hash the hash to retrieve from
|
||||
\param key the key to retrieve
|
||||
\param mutex optional rwlock to rdlock
|
||||
\return a pointer to the data held in the key
|
||||
*/
|
||||
SWITCH_DECLARE(void *) switch_core_hash_find_rdlock(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_thread_rwlock_t *rwlock);
|
||||
|
||||
/*!
|
||||
\brief Gets the first element of a hashtable
|
||||
\param depricate_me [deprecated] NULL
|
||||
|
||||
@@ -40,9 +40,6 @@ static inline void switch_curl_init(void)
|
||||
|
||||
if (curl_count == 0) {
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
#if defined(HAVE_OPENSSL)
|
||||
switch_ssl_init_ssl_locks();
|
||||
#endif
|
||||
}
|
||||
|
||||
curl_count++;
|
||||
@@ -56,10 +53,6 @@ static inline void switch_curl_destroy()
|
||||
curl_count--;
|
||||
|
||||
if (curl_count == 0) {
|
||||
|
||||
#if defined(HAVE_OPENSSL)
|
||||
switch_ssl_destroy_ssl_locks();
|
||||
#endif
|
||||
curl_global_cleanup();
|
||||
}
|
||||
switch_core_curl_count(&curl_count);
|
||||
|
||||
@@ -67,6 +67,10 @@ SWITCH_BEGIN_EXTERN_C
|
||||
char *name;
|
||||
/*! the header value */
|
||||
char *value;
|
||||
/*! array space */
|
||||
char **array;
|
||||
/*! array index */
|
||||
int idx;
|
||||
/*! hash of the header name */
|
||||
unsigned long hash;
|
||||
struct switch_event_header *next;
|
||||
@@ -146,7 +150,10 @@ SWITCH_DECLARE(switch_status_t) switch_event_set_priority(switch_event_t *event,
|
||||
\param header_name the name of the header to read
|
||||
\return the value of the requested header
|
||||
*/
|
||||
_Ret_opt_z_ SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, const char *header_name);
|
||||
|
||||
SWITCH_DECLARE(switch_event_header_t *) switch_event_get_header_ptr(switch_event_t *event, const char *header_name);
|
||||
_Ret_opt_z_ SWITCH_DECLARE(char *) switch_event_get_header_idx(switch_event_t *event, const char *header_name, int idx);
|
||||
#define switch_event_get_header(_e, _h) switch_event_get_header_idx(_e, _h, -1)
|
||||
|
||||
#define switch_event_get_header_nil(e, h) switch_str_nil(switch_event_get_header(e,h))
|
||||
|
||||
@@ -184,7 +191,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_header_string(switch_event_t *e
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_del_header_val(switch_event_t *event, const char *header_name, const char *val);
|
||||
#define switch_event_del_header(_e, _h) switch_event_del_header_val(_e, _h, NULL)
|
||||
|
||||
SWITCH_DECLARE(int) switch_event_add_array(switch_event_t *event, const char *var, const char *val);
|
||||
/*!
|
||||
\brief Destroy an event
|
||||
\param event pointer to the pointer to event to destroy
|
||||
|
||||
@@ -62,6 +62,12 @@ SWITCH_BEGIN_EXTERN_C struct switch_unicast_conninfo {
|
||||
};
|
||||
typedef struct switch_unicast_conninfo switch_unicast_conninfo_t;
|
||||
|
||||
#define SWITCH_IVR_VERIFY_SILENCE_DIVISOR(divisor) \
|
||||
{ \
|
||||
if ((divisor) <= 0 && (divisor) != -1) { \
|
||||
divisor = 400; \
|
||||
} \
|
||||
}
|
||||
|
||||
/**
|
||||
* @defgroup switch_ivr IVR Library
|
||||
|
||||
@@ -70,6 +70,10 @@ SWITCH_DECLARE(switch_status_t) switch_regex_match(const char *target, const cha
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_regex_match_partial(const char *target, const char *expression, int *partial_match);
|
||||
|
||||
SWITCH_DECLARE(void) switch_capture_regex(switch_regex_t *re, int match_count, const char *field_data,
|
||||
int *ovector, const char *var, switch_cap_callback_t callback, void *user_data);
|
||||
|
||||
SWITCH_DECLARE_NONSTD(void) switch_regex_set_var_callback(const char *var, const char *val, void *user_data);
|
||||
|
||||
#define switch_regex_safe_free(re) if (re) {\
|
||||
switch_regex_free(re);\
|
||||
|
||||
@@ -90,7 +90,9 @@ static inline void switch_ssl_destroy_ssl_locks()
|
||||
if (ssl_count == 0) {
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
for (i = 0; i < CRYPTO_num_locks(); i++) {
|
||||
switch_mutex_destroy(ssl_mutexes[i]);
|
||||
if (ssl_mutexes[i]) {
|
||||
switch_mutex_destroy(ssl_mutexes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
OPENSSL_free(ssl_mutexes);
|
||||
|
||||
@@ -830,7 +830,9 @@ SWITCH_STACK_TOP - Stack on the top
|
||||
typedef enum {
|
||||
SWITCH_STACK_BOTTOM = (1 << 0),
|
||||
SWITCH_STACK_TOP = (1 << 1),
|
||||
SWITCH_STACK_NODUP = (1 << 2)
|
||||
SWITCH_STACK_NODUP = (1 << 2),
|
||||
SWITCH_STACK_UNSHIFT = (1 << 3),
|
||||
SWITCH_STACK_PUSH = (1 << 4),
|
||||
} switch_stack_t;
|
||||
|
||||
/*!
|
||||
@@ -1118,7 +1120,9 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
CF_APP_TAGGED = (1 << 0),
|
||||
CF_APP_T38 = (1 << 1)
|
||||
CF_APP_T38 = (1 << 1),
|
||||
CF_APP_T38_REQ = (1 << 2),
|
||||
CF_APP_T38_FAIL = (1 << 3)
|
||||
} switch_channel_app_flag_t;
|
||||
|
||||
|
||||
@@ -1688,6 +1692,7 @@ struct switch_console_callback_match {
|
||||
};
|
||||
typedef struct switch_console_callback_match switch_console_callback_match_t;
|
||||
|
||||
typedef void (*switch_cap_callback_t) (const char *var, const char *val, void *user_data);
|
||||
typedef switch_status_t (*switch_console_complete_callback_t) (const char *, const char *, switch_console_callback_match_t **matches);
|
||||
typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t);
|
||||
typedef switch_bool_t (*switch_tone_detect_callback_t) (switch_core_session_t *, const char *, const char *);
|
||||
|
||||
@@ -793,9 +793,9 @@ SWITCH_DECLARE(int) switch_split_user_domain(char *in, char **user, char **domai
|
||||
|
||||
/* malloc or DIE macros */
|
||||
#ifdef NDEBUG
|
||||
#define switch_malloc(ptr, len) (void)( (!!(ptr = malloc(len))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%s", __FILE__, __LINE__),abort(), 0), ptr )
|
||||
#define switch_zmalloc(ptr, len) (void)( (!!(ptr = calloc(1, (len)))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%s", __FILE__, __LINE__),abort(), 0), ptr)
|
||||
#define switch_strdup(ptr, s) (void)( (!!(ptr = strdup(s))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%s", __FILE__, __LINE__),abort(), 0), ptr)
|
||||
#define switch_malloc(ptr, len) (void)( (!!(ptr = malloc(len))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr )
|
||||
#define switch_zmalloc(ptr, len) (void)( (!!(ptr = calloc(1, (len)))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr)
|
||||
#define switch_strdup(ptr, s) (void)( (!!(ptr = strdup(s))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr)
|
||||
#else
|
||||
#if (_MSC_VER >= 1500) // VC9+
|
||||
#define switch_malloc(ptr, len) (void)(assert(((ptr) = malloc((len)))),ptr);__analysis_assume( ptr )
|
||||
|
||||
@@ -378,7 +378,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const ch
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_merged(const char *key, const char *user_name, const char *domain_name,
|
||||
const char *ip, switch_xml_t *user, switch_event_t *params);
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_xml_clear_user_cache(const char *key, const char *user_name, const char *domain_name);
|
||||
SWITCH_DECLARE(void) switch_xml_merge_user(switch_xml_t user, switch_xml_t domain, switch_xml_t group);
|
||||
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_dup(switch_xml_t xml);
|
||||
|
||||
Reference in New Issue
Block a user