mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-13 07:45:26 +00:00
change from sqlite hash to newly added one
This commit is contained in:
parent
32cce8027e
commit
804ef7709d
6
libs/freetdm/mod_freetdm/mod_freetdm.c
Executable file → Normal file
6
libs/freetdm/mod_freetdm/mod_freetdm.c
Executable file → Normal file
@ -3511,7 +3511,7 @@ static switch_status_t load_config(void)
|
||||
parse_gsm_spans(cfg, spans);
|
||||
}
|
||||
|
||||
switch_core_hash_init(&globals.ss7_configs, module_pool);
|
||||
switch_core_hash_init(&globals.ss7_configs);
|
||||
if ((spans = switch_xml_child(cfg, "sangoma_ss7_spans"))) {
|
||||
for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) {
|
||||
ftdm_status_t zstatus = FTDM_FAIL;
|
||||
@ -5530,8 +5530,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_freetdm_shutdown)
|
||||
void *val;
|
||||
|
||||
/* destroy ss7 configs */
|
||||
for (hi = switch_hash_first(NULL, globals.ss7_configs); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.ss7_configs); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
ftdm_conf_node_destroy(val);
|
||||
}
|
||||
|
||||
|
@ -76183,7 +76183,7 @@ index 9b20546..4489cfc 100644
|
||||
- MIMETypeAdd("text/html", "html");
|
||||
+
|
||||
for (hi = switch_core_mime_index(); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if (var && val) {
|
||||
@@ -955,38 +1042,52 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
|
||||
switch_snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch_http.log");
|
||||
|
@ -186,7 +186,7 @@ SWITCH_DECLARE(char *) switch_copy_string(_Out_z_cap_(dst_size)
|
||||
* progress at the same time.
|
||||
|
||||
*/
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(switch_memory_pool_t *p, switch_hash_t *ht);
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_first(switch_memory_pool_t *p, switch_hash_t *ht);
|
||||
|
||||
/**
|
||||
* Continue iterating over the entries in a hash table.
|
||||
@ -194,7 +194,7 @@ SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(switch_memory_pool_t *p,
|
||||
* @return a pointer to the updated iteration state. NULL if there are no more
|
||||
* entries.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *ht);
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(switch_hash_index_t *ht);
|
||||
|
||||
/**
|
||||
* Get the current entry's details from the iteration state.
|
||||
@ -205,7 +205,7 @@ SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *ht);
|
||||
* @remark The return pointers should point to a variable that will be set to the
|
||||
* corresponding data, or they may be NULL if the data isn't interesting.
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t *hi, const void **key, switch_ssize_t *klen, void **val);
|
||||
SWITCH_DECLARE(void) switch_core_hash_this(switch_hash_index_t *hi, const void **key, switch_ssize_t *klen, void **val);
|
||||
|
||||
|
||||
|
||||
|
@ -1350,9 +1350,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(_In_ switch_core_s
|
||||
\param pool the pool to use for the new hash
|
||||
\return SWITCH_STATUS_SUCCESS if the hash is created
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(_Out_ switch_hash_t **hash, _In_ switch_memory_pool_t *pool, switch_bool_t case_sensitive);
|
||||
#define switch_core_hash_init(_hash, _pool) switch_core_hash_init_case(_hash, _pool, SWITCH_TRUE)
|
||||
#define switch_core_hash_init_nocase(_hash, _pool) switch_core_hash_init_case(_hash, _pool, SWITCH_FALSE)
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(_Out_ switch_hash_t **hash, switch_bool_t case_sensitive);
|
||||
#define switch_core_hash_init(_hash) switch_core_hash_init_case(_hash, SWITCH_TRUE)
|
||||
#define switch_core_hash_init_nocase(_hash) switch_core_hash_init_case(_hash, SWITCH_FALSE)
|
||||
|
||||
|
||||
|
||||
@ -1479,30 +1479,7 @@ SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(_In_ switch_hash_ind
|
||||
SWITCH_DECLARE(void) switch_core_hash_this(_In_ switch_hash_index_t *hi, _Out_opt_ptrdiff_cap_(klen)
|
||||
const void **key, _Out_opt_ switch_ssize_t *klen, _Out_ void **val);
|
||||
|
||||
/*!
|
||||
\brief DEPRECATED in favor of switch_core_hash_first(). Gets the first element of a hashtable.
|
||||
\param deprecate_me [deprecated] NULL
|
||||
\param hash the hashtable to use
|
||||
\return The element, or NULL if it wasn't found
|
||||
*/
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(char *deprecate_me, _In_ switch_hash_t *hash);
|
||||
|
||||
/*!
|
||||
\brief DEPRECATED in favor of switch_core_hash_next(). Gets the next element of a hashtable.
|
||||
\param hi The current element
|
||||
\return The next element, or NULL if there are no more
|
||||
*/
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(_In_ switch_hash_index_t *hi);
|
||||
|
||||
/*!
|
||||
\brief DEPRECATED in favor of switch_core_hash_this(). Gets the key and value of the current hash element.
|
||||
\param hi The current element
|
||||
\param key [out] the key
|
||||
\param klen [out] the key's size
|
||||
\param val [out] the value
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_hash_this(_In_ switch_hash_index_t *hi, _Out_opt_ptrdiff_cap_(klen)
|
||||
const void **key, _Out_opt_ switch_ssize_t *klen, _Out_ void **val);
|
||||
|
||||
///\}
|
||||
|
||||
|
@ -2239,9 +2239,10 @@ 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);
|
||||
|
||||
typedef struct switch_hash switch_hash_t;
|
||||
struct HashElem;
|
||||
typedef struct HashElem switch_hash_index_t;
|
||||
struct switch_hashtable;
|
||||
struct switch_hashtable_iterator;
|
||||
typedef struct switch_hashtable switch_hash_t;
|
||||
typedef struct switch_hashtable_iterator switch_hash_index_t;
|
||||
|
||||
struct switch_network_list;
|
||||
typedef struct switch_network_list switch_network_list_t;
|
||||
|
@ -63,7 +63,7 @@ blacklist_t *blacklist_create(const char *name)
|
||||
switch_assert(bl);
|
||||
bl->pool = pool;
|
||||
|
||||
switch_core_hash_init(&bl->list, pool);
|
||||
switch_core_hash_init(&bl->list);
|
||||
switch_mutex_init(&bl->list_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
|
||||
return bl;
|
||||
@ -126,10 +126,10 @@ static switch_status_t do_config(switch_bool_t reload)
|
||||
switch_mutex_lock(globals.lists_mutex);
|
||||
|
||||
/* Destroy any active lists */
|
||||
while ((hi = switch_hash_first(NULL, globals.lists))) {
|
||||
while ((hi = switch_core_hash_first( globals.lists))) {
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
blacklist_free((blacklist_t*)val);
|
||||
switch_core_hash_delete(globals.lists, (const char*)key);
|
||||
}
|
||||
@ -282,8 +282,8 @@ SWITCH_STANDARD_API(blacklist_api_function)
|
||||
switch_mutex_lock(globals.lists_mutex);
|
||||
if (switch_file_open(&fd, filename, SWITCH_FOPEN_WRITE | SWITCH_FOPEN_TRUNCATE | SWITCH_FOPEN_CREATE, SWITCH_FPROT_OS_DEFAULT, globals.pool)
|
||||
== SWITCH_STATUS_SUCCESS) {
|
||||
for (hi = switch_hash_first(NULL, bl->list); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( bl->list); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
switch_file_printf(fd, "%s\n", (char *)var);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "adding %s to the dump file\n", (char *)var);
|
||||
}
|
||||
@ -317,10 +317,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_blacklist_load)
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
globals.pool = pool;
|
||||
|
||||
switch_core_hash_init(&globals.files, globals.pool);
|
||||
switch_core_hash_init(&globals.files);
|
||||
switch_mutex_init(&globals.files_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
switch_core_hash_init(&globals.lists, globals.pool);
|
||||
switch_core_hash_init(&globals.lists);
|
||||
switch_mutex_init(&globals.lists_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
do_config(SWITCH_FALSE);
|
||||
|
@ -3198,12 +3198,12 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||
switch_hash_index_t *hi;
|
||||
stream->write_function(stream, "%s", "name|strategy|moh_sound|time_base_score|tier_rules_apply|tier_rule_wait_second|tier_rule_wait_multiply_level|tier_rule_no_agent_no_wait|discard_abandoned_after|abandoned_resume_allowed|max_wait_time|max_wait_time_with_no_agent|max_wait_time_with_no_agent_time_reached|record_template\n");
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.queue_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.queue_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
cc_queue_t *queue;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
queue = (cc_queue_t *) val;
|
||||
stream->write_function(stream, "%s|%s|%s|%s|%s|%d|%s|%s|%d|%s|%d|%d|%d|%s\n", queue->name, queue->strategy, queue->moh, queue->time_base_score, (queue->tier_rules_apply?"true":"false"), queue->tier_rule_wait_second, (queue->tier_rule_wait_multiply_level?"true":"false"), (queue->tier_rule_no_agent_no_wait?"true":"false"), queue->discard_abandoned_after, (queue->abandoned_resume_allowed?"true":"false"), queue->max_wait_time, queue->max_wait_time_with_no_agent, queue->max_wait_time_with_no_agent_time_reached, queue->record_template);
|
||||
queue = NULL;
|
||||
@ -3251,7 +3251,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||
switch_hash_index_t *hi;
|
||||
int queue_count = 0;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.queue_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.queue_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
queue_count++;
|
||||
}
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
@ -3309,7 +3309,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load)
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
globals.pool = pool;
|
||||
|
||||
switch_core_hash_init(&globals.queue_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.queue_hash);
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
|
||||
@ -3394,8 +3394,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_callcenter_shutdown)
|
||||
}
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
while ((hi = switch_hash_first(NULL, globals.queue_hash))) {
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
while ((hi = switch_core_hash_first( globals.queue_hash))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
queue = (cc_queue_t *) val;
|
||||
|
||||
switch_core_hash_delete(globals.queue_hash, queue->name);
|
||||
|
@ -5278,8 +5278,8 @@ static switch_status_t list_conferences(const char *line, const char *cursor, sw
|
||||
const void *vvar;
|
||||
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.conference_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
switch_console_push_match(&my_matches, (const char *) vvar);
|
||||
}
|
||||
switch_mutex_unlock(globals.hash_mutex);
|
||||
@ -5770,9 +5770,9 @@ static switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_st
|
||||
|
||||
if (conference == NULL) {
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.conference_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
int fcount = 0;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
conference = (conference_obj_t *) val;
|
||||
|
||||
stream->write_function(stream, "Conference %s (%u member%s rate: %u%s flags: ",
|
||||
@ -6249,8 +6249,8 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc
|
||||
|
||||
if (conference == NULL) {
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.conference_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
conference = (conference_obj_t *) val;
|
||||
|
||||
x_conference = switch_xml_add_child_d(x_conferences, "conference", off++);
|
||||
@ -10050,7 +10050,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load)
|
||||
globals.conference_pool = pool;
|
||||
|
||||
/* Setup a hash to store conferences by name */
|
||||
switch_core_hash_init(&globals.conference_hash, globals.conference_pool);
|
||||
switch_core_hash_init(&globals.conference_hash);
|
||||
switch_mutex_init(&globals.conference_mutex, SWITCH_MUTEX_NESTED, globals.conference_pool);
|
||||
switch_mutex_init(&globals.id_mutex, SWITCH_MUTEX_NESTED, globals.conference_pool);
|
||||
switch_mutex_init(&globals.hash_mutex, SWITCH_MUTEX_NESTED, globals.conference_pool);
|
||||
|
@ -652,7 +652,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_db_load)
|
||||
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_mutex_init(&globals.db_hash_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_core_hash_init(&globals.db_hash, pool);
|
||||
switch_core_hash_init(&globals.db_hash);
|
||||
|
||||
status = switch_event_reserve_subclass(LIMIT_EVENT_USAGE);
|
||||
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_INUSE) {
|
||||
|
@ -1038,7 +1038,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_directory_load)
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
globals.pool = pool;
|
||||
|
||||
switch_core_hash_init(&globals.profile_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
if ((status = load_config(SWITCH_FALSE)) != SWITCH_STATUS_SUCCESS) {
|
||||
@ -1070,8 +1070,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_directory_shutdown)
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
|
||||
while ((hi = switch_hash_first(NULL, globals.profile_hash))) {
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
while ((hi = switch_core_hash_first( globals.profile_hash))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
profile = (dir_profile_t *) val;
|
||||
|
||||
switch_core_hash_delete(globals.profile_hash, profile->name);
|
||||
|
4
src/mod/applications/mod_dptools/mod_dptools.c
Executable file → Normal file
4
src/mod/applications/mod_dptools/mod_dptools.c
Executable file → Normal file
@ -5591,9 +5591,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
|
||||
switch_file_interface_t *file_interface;
|
||||
|
||||
globals.pool = pool;
|
||||
switch_core_hash_init(&globals.pickup_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.pickup_hash);
|
||||
switch_mutex_init(&globals.pickup_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_core_hash_init(&globals.mutex_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.mutex_hash);
|
||||
switch_mutex_init(&globals.mutex_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
|
@ -660,7 +660,7 @@ static void fifo_init_use_count(void)
|
||||
if (globals.use_hash) {
|
||||
switch_core_hash_destroy(&globals.use_hash);
|
||||
}
|
||||
switch_core_hash_init(&globals.use_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.use_hash);
|
||||
switch_mutex_unlock(globals.use_mutex);
|
||||
}
|
||||
|
||||
@ -935,7 +935,7 @@ static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mu
|
||||
switch_assert(node->fifo_list[x]);
|
||||
}
|
||||
|
||||
switch_core_hash_init(&node->consumer_hash, node->pool);
|
||||
switch_core_hash_init(&node->consumer_hash);
|
||||
switch_thread_rwlock_create(&node->rwlock, node->pool);
|
||||
switch_mutex_init(&node->mutex, SWITCH_MUTEX_NESTED, node->pool);
|
||||
switch_mutex_init(&node->update_mutex, SWITCH_MUTEX_NESTED, node->pool);
|
||||
@ -975,8 +975,8 @@ static int node_idle_consumers(fifo_node_t *node)
|
||||
int total = 0;
|
||||
|
||||
switch_mutex_lock(node->mutex);
|
||||
for (hi = switch_hash_first(NULL, node->consumer_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( node->consumer_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
session = (switch_core_session_t *) val;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
if (!switch_channel_test_flag(channel, CF_BRIDGED)) {
|
||||
@ -3802,14 +3802,14 @@ static int xml_hash(switch_xml_t xml, switch_hash_t *hash, char *container, char
|
||||
x_tmp = switch_xml_add_child_d(xml, container, cc_off++);
|
||||
switch_assert(x_tmp);
|
||||
|
||||
for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
int c_off = 0, d_off = 0;
|
||||
const char *status;
|
||||
const char *ts;
|
||||
char url_buf[512] = "";
|
||||
char *encoded;
|
||||
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
session = (switch_core_session_t *) val;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
x_caller = switch_xml_add_child_d(x_tmp, tag, c_off++);
|
||||
@ -3987,8 +3987,8 @@ void dump_hash(switch_hash_t *hash, switch_stream_handle_t *stream)
|
||||
const void *var;
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
stream->write_function(stream, " %s\n", (char *)var);
|
||||
}
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
@ -4002,8 +4002,8 @@ void node_dump(switch_stream_handle_t *stream)
|
||||
fifo_node_t *node;
|
||||
void *val;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if ((node = (fifo_node_t *) val)) {
|
||||
stream->write_function(stream, "node: %s\n"
|
||||
" outbound_name: %s\n"
|
||||
@ -4100,8 +4100,8 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
switch_assert(x_report);
|
||||
|
||||
if (argc < 2) {
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
node = (fifo_node_t *) val;
|
||||
|
||||
switch_mutex_lock(node->mutex);
|
||||
@ -4137,8 +4137,8 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
}
|
||||
} else if (!strcasecmp(argv[0], "count")) {
|
||||
if (argc < 2) {
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
node = (fifo_node_t *) val;
|
||||
switch_mutex_lock(node->update_mutex);
|
||||
stream->write_function(stream, "%s:%d:%d:%d:%d:%d\n", (char *) var, node->consumer_count, node_caller_count(node), node->member_count, node->ring_consumer_count, node_idle_consumers(node));
|
||||
@ -4158,8 +4158,8 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
}
|
||||
} else if (!strcasecmp(argv[0], "has_outbound")) {
|
||||
if (argc < 2) {
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
node = (fifo_node_t *) val;
|
||||
switch_mutex_lock(node->update_mutex);
|
||||
stream->write_function(stream, "%s:%d\n", (char *) var, node->has_outbound);
|
||||
@ -4359,8 +4359,8 @@ static switch_status_t load_config(int reload, int del_all)
|
||||
fifo_node_t *node;
|
||||
void *val;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if ((node = (fifo_node_t *) val) && node->is_static && node->ready == 1) {
|
||||
node->ready = -1;
|
||||
}
|
||||
@ -4775,12 +4775,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_fifo_load)
|
||||
}
|
||||
|
||||
globals.pool = pool;
|
||||
switch_core_hash_init(&globals.fifo_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.fifo_hash);
|
||||
|
||||
switch_core_hash_init(&globals.caller_orig_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.consumer_orig_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.bridge_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.use_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.caller_orig_hash);
|
||||
switch_core_hash_init(&globals.consumer_orig_hash);
|
||||
switch_core_hash_init(&globals.bridge_hash);
|
||||
switch_core_hash_init(&globals.use_hash);
|
||||
switch_mutex_init(&globals.caller_orig_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_mutex_init(&globals.consumer_orig_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_mutex_init(&globals.bridge_mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
@ -161,7 +161,7 @@ SWITCH_LIMIT_INCR(limit_incr_hash)
|
||||
/* This is the first limit check on this channel, create a hashtable, set our prviate data */
|
||||
pvt = (limit_hash_private_t *) switch_core_session_alloc(session, sizeof(limit_hash_private_t));
|
||||
memset(pvt, 0, sizeof(limit_hash_private_t));
|
||||
switch_core_hash_init(&pvt->hash, switch_core_session_get_pool(session));
|
||||
switch_core_hash_init(&pvt->hash);
|
||||
switch_channel_set_private(channel, "limit_hash", pvt);
|
||||
}
|
||||
|
||||
@ -291,13 +291,13 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
|
||||
/* clear for uuid */
|
||||
if (realm == NULL && resource == NULL) {
|
||||
/* Loop through the channel's hashtable which contains mapping to all the limit_hash_item_t referenced by that channel */
|
||||
while ((hi = switch_hash_first(NULL, pvt->hash))) {
|
||||
while ((hi = switch_core_hash_first( pvt->hash))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
limit_hash_item_t *item = NULL;
|
||||
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (limit_hash_item_t *) val;
|
||||
item->total_usage--;
|
||||
@ -391,7 +391,7 @@ SWITCH_LIMIT_STATUS(limit_status_hash)
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.limit_hash_rwlock);
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.limit_hash); hi; switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.limit_hash); hi; switch_core_hash_next(hi)) {
|
||||
count++;
|
||||
}
|
||||
|
||||
@ -623,12 +623,12 @@ SWITCH_STANDARD_API(hash_dump_function)
|
||||
|
||||
if (mode & 1) {
|
||||
switch_thread_rwlock_rdlock(globals.limit_hash_rwlock);
|
||||
for (hi = switch_hash_first(NULL, globals.limit_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.limit_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
limit_hash_item_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (limit_hash_item_t *)val;
|
||||
|
||||
@ -639,11 +639,11 @@ SWITCH_STANDARD_API(hash_dump_function)
|
||||
|
||||
if (mode & 2) {
|
||||
switch_thread_rwlock_rdlock(globals.db_hash_rwlock);
|
||||
for (hi = switch_hash_first(NULL, globals.db_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.db_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
if (realm) {
|
||||
if (strstr(key, realmvalue)) {
|
||||
stream->write_function(stream, "D/%s/%s\n", key, (char*)val);
|
||||
@ -679,12 +679,12 @@ SWITCH_STANDARD_API(hash_remote_function)
|
||||
stream->write_function(stream, "Remote connections:\nName\t\t\tState\n");
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
for (hi = switch_hash_first(NULL, globals.remote_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.remote_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
limit_remote_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (limit_remote_t *)val;
|
||||
stream->write_function(stream, "%s\t\t\t%s\n", item->name, state_str(item->state));
|
||||
@ -756,7 +756,7 @@ limit_remote_t *limit_remote_create(const char *name, const char *host, uint16_t
|
||||
r->interval = interval;
|
||||
|
||||
switch_thread_rwlock_create(&r->rwlock, pool);
|
||||
switch_core_hash_init(&r->index, pool);
|
||||
switch_core_hash_init(&r->index);
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
switch_core_hash_insert(globals.remote_hash, name, r);
|
||||
@ -780,11 +780,11 @@ void limit_remote_destroy(limit_remote_t **r)
|
||||
switch_thread_rwlock_wrlock((*r)->rwlock);
|
||||
|
||||
/* Free hashtable data */
|
||||
for (hi = switch_hash_first(NULL, (*r)->index); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( (*r)->index); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
free(val);
|
||||
}
|
||||
@ -803,13 +803,13 @@ static limit_hash_item_t get_remote_usage(const char *key) {
|
||||
switch_hash_index_t *hi;
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
for (hi = switch_hash_first(NULL, globals.remote_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.remote_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *hashkey;
|
||||
switch_ssize_t keylen;
|
||||
limit_remote_t *remote;
|
||||
limit_hash_item_t *item;
|
||||
switch_hash_this(hi, &hashkey, &keylen, &val);
|
||||
switch_core_hash_this(hi, &hashkey, &keylen, &val);
|
||||
|
||||
remote = (limit_remote_t *)val;
|
||||
if (remote->state != REMOTE_UP) {
|
||||
@ -983,9 +983,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_hash_load)
|
||||
switch_thread_rwlock_create(&globals.limit_hash_rwlock, globals.pool);
|
||||
switch_thread_rwlock_create(&globals.db_hash_rwlock, globals.pool);
|
||||
switch_thread_rwlock_create(&globals.remote_hash_rwlock, globals.pool);
|
||||
switch_core_hash_init(&globals.limit_hash, pool);
|
||||
switch_core_hash_init(&globals.db_hash, pool);
|
||||
switch_core_hash_init(&globals.remote_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.limit_hash);
|
||||
switch_core_hash_init(&globals.db_hash);
|
||||
switch_core_hash_init(&globals.remote_hash);
|
||||
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
@ -1031,8 +1031,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
|
||||
limit_remote_t *item = NULL;
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
if ((hi = switch_hash_first(NULL, globals.remote_hash))) {
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
if ((hi = switch_core_hash_first( globals.remote_hash))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
item = (limit_remote_t *)val;
|
||||
}
|
||||
switch_thread_rwlock_unlock(globals.remote_hash_rwlock);
|
||||
@ -1050,20 +1050,20 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
|
||||
switch_thread_rwlock_wrlock(globals.limit_hash_rwlock);
|
||||
switch_thread_rwlock_wrlock(globals.db_hash_rwlock);
|
||||
|
||||
while ((hi = switch_hash_first(NULL, globals.limit_hash))) {
|
||||
while ((hi = switch_core_hash_first( globals.limit_hash))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
free(val);
|
||||
switch_core_hash_delete(globals.limit_hash, key);
|
||||
}
|
||||
|
||||
while ((hi = switch_hash_first(NULL, globals.db_hash))) {
|
||||
while ((hi = switch_core_hash_first( globals.db_hash))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
free(val);
|
||||
switch_core_hash_delete(globals.db_hash, key);
|
||||
}
|
||||
|
@ -1822,7 +1822,7 @@ static switch_status_t do_config(void)
|
||||
cookie_file = val;
|
||||
} else if (!strcasecmp(var, "enable-post-var")) {
|
||||
if (!vars_map && need_vars_map == 0) {
|
||||
if (switch_core_hash_init(&vars_map, globals.pool) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_init(&vars_map) != SWITCH_STATUS_SUCCESS) {
|
||||
need_vars_map = -1;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't init params hash!\n");
|
||||
continue;
|
||||
@ -3011,8 +3011,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load)
|
||||
switch_dir_make_recursive(globals.cache_path, SWITCH_DEFAULT_DIR_PERMS, pool);
|
||||
|
||||
|
||||
switch_core_hash_init(&globals.profile_hash, globals.pool);
|
||||
switch_core_hash_init_case(&globals.parse_hash, globals.pool, SWITCH_FALSE);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
switch_core_hash_init_case(&globals.parse_hash, SWITCH_FALSE);
|
||||
|
||||
bind_parser("execute", parse_execute);
|
||||
bind_parser("sms", parse_sms);
|
||||
@ -3063,8 +3063,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_httapi_shutdown)
|
||||
void *val;
|
||||
const void *vvar;
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (client_profile_t *) val;
|
||||
switch_event_destroy(&profile->dial_params.app_list);
|
||||
switch_event_destroy(&profile->var_params.expand_var_list);
|
||||
|
@ -1631,8 +1631,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_http_cache_load)
|
||||
|
||||
memset(&gcache, 0, sizeof(url_cache_t));
|
||||
gcache.pool = pool;
|
||||
switch_core_hash_init(&gcache.map, gcache.pool);
|
||||
switch_core_hash_init(&gcache.profiles, gcache.pool);
|
||||
switch_core_hash_init(&gcache.map);
|
||||
switch_core_hash_init(&gcache.profiles);
|
||||
switch_core_hash_init_nocase(&gcache.fqdn_profiles, gcache.pool);
|
||||
switch_mutex_init(&gcache.mutex, SWITCH_MUTEX_UNNESTED, gcache.pool);
|
||||
switch_thread_rwlock_create(&gcache.shutdown_lock, gcache.pool);
|
||||
|
@ -900,7 +900,7 @@ static switch_status_t lcr_do_lookup(callback_t *cb_struct)
|
||||
}
|
||||
|
||||
/* allocate the dedup hash */
|
||||
if (switch_core_hash_init(&cb_struct->dedup_hash, cb_struct->pool) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_init(&cb_struct->dedup_hash) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_ERROR, "Error initializing the dedup hash\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
@ -1067,7 +1067,7 @@ static switch_status_t lcr_load_config()
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to determine database RANDOM function\n");
|
||||
};
|
||||
|
||||
switch_core_hash_init(&globals.profile_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
if ((x_profiles = switch_xml_child(cfg, "profiles"))) {
|
||||
for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) {
|
||||
char *name = (char *) switch_xml_attr_soft(x_profile, "name");
|
||||
@ -2038,8 +2038,8 @@ SWITCH_STANDARD_API(dialplan_lcr_admin_function)
|
||||
}
|
||||
switch_assert(argv[0]);
|
||||
if (!strcasecmp(argv[0], "show") && !strcasecmp(argv[1], "profiles")) {
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (profile_t *) val;
|
||||
|
||||
stream->write_function(stream, "Name:\t\t%s\n", profile->name);
|
||||
|
6
src/mod/applications/mod_redis/mod_redis.c
Executable file → Normal file
6
src/mod/applications/mod_redis/mod_redis.c
Executable file → Normal file
@ -97,7 +97,7 @@ SWITCH_LIMIT_INCR(limit_incr_redis)
|
||||
} else {
|
||||
/* This is the first limit check on this channel, create a hashtable, set our prviate data and add a state handler */
|
||||
pvt = (limit_redis_private_t *) switch_core_session_alloc(session, sizeof(limit_redis_private_t));
|
||||
switch_core_hash_init(&pvt->hash, switch_core_session_get_pool(session));
|
||||
switch_core_hash_init(&pvt->hash));
|
||||
switch_mutex_init(&pvt->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
|
||||
switch_channel_set_private(channel, "limit_redis", pvt);
|
||||
}
|
||||
@ -172,13 +172,13 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
|
||||
/* clear for uuid */
|
||||
if (realm == NULL && resource == NULL) {
|
||||
/* Loop through the channel's hashtable which contains mapping to all the limit_redis_item_t referenced by that channel */
|
||||
while ((hi = switch_hash_first(NULL, pvt->hash))) {
|
||||
while ((hi = switch_core_hash_first( pvt->hash))) {
|
||||
void *p_val = NULL;
|
||||
const void *p_key;
|
||||
char *p_uuid_key = NULL;
|
||||
switch_ssize_t keylen;
|
||||
|
||||
switch_hash_this(hi, &p_key, &keylen, &p_val);
|
||||
switch_core_hash_this(hi, &p_key, &keylen, &p_val);
|
||||
|
||||
if (credis_decr(redis, (const char*)p_key, &val) != 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", (char *)p_key);
|
||||
|
@ -493,7 +493,7 @@ switch_status_t load_configuration(switch_bool_t reload)
|
||||
}
|
||||
|
||||
switch_core_new_memory_pool(&spandsp_globals.config_pool);
|
||||
switch_core_hash_init(&spandsp_globals.tones, spandsp_globals.config_pool);
|
||||
switch_core_hash_init(&spandsp_globals.tones);
|
||||
|
||||
spandsp_globals.modem_dialplan = "XML";
|
||||
spandsp_globals.modem_context = "default";
|
||||
|
@ -139,8 +139,8 @@ SWITCH_STANDARD_API(dump_hash)
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.spy_hash_lock);
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.spy_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.spy_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
spy = (spy_t *) val;
|
||||
|
||||
stream->write_function(stream, "%s :");
|
||||
@ -319,7 +319,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spy_load)
|
||||
|
||||
globals.pool = pool;
|
||||
|
||||
switch_core_hash_init(&globals.spy_hash, pool);
|
||||
switch_core_hash_init(&globals.spy_hash);
|
||||
switch_thread_rwlock_create(&globals.spy_hash_lock, pool);
|
||||
globals.spy_count = 0;
|
||||
|
||||
|
@ -170,13 +170,13 @@ static void do_unload(void) {
|
||||
|
||||
switch_mutex_lock(MUTEX);
|
||||
|
||||
while ((hi = switch_hash_first(NULL, globals.translate_profiles))) {
|
||||
while ((hi = switch_core_hash_first( globals.translate_profiles))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
translate_rule_t *rl, *nrl;
|
||||
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "deleting translate profile [%s]\n", (char *) key);
|
||||
|
||||
for (nrl = val; rl;) {
|
||||
@ -201,7 +201,7 @@ static void do_load(void)
|
||||
{
|
||||
switch_mutex_lock(MUTEX);
|
||||
|
||||
switch_core_hash_init(&globals.translate_profiles, globals.pool);
|
||||
switch_core_hash_init(&globals.translate_profiles);
|
||||
switch_thread_rwlock_create(&globals.profile_hash_rwlock, globals.pool);
|
||||
load_config();
|
||||
|
||||
|
@ -71,7 +71,7 @@ static valet_lot_t *valet_find_lot(const char *name, switch_bool_t create)
|
||||
switch_zmalloc(lot, sizeof(*lot));
|
||||
lot->name = strdup(name);
|
||||
switch_mutex_init(&lot->mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_core_hash_init(&lot->hash, NULL);
|
||||
switch_core_hash_init(&lot->hash);
|
||||
switch_core_hash_insert(globals.hash, name, lot);
|
||||
}
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
@ -120,8 +120,8 @@ static void check_timeouts(void)
|
||||
}
|
||||
|
||||
globals.last_timeout_check = now;
|
||||
for (hi = switch_hash_first(NULL, globals.hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
switch_console_push_match(&matches, (const char *) var);
|
||||
}
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
@ -135,8 +135,8 @@ static void check_timeouts(void)
|
||||
|
||||
top:
|
||||
|
||||
for (i_hi = switch_hash_first(NULL, lot->hash); i_hi; i_hi = switch_hash_next(i_hi)) {
|
||||
switch_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_hash_next(i_hi)) {
|
||||
switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
i_ext = (char *) i_var;
|
||||
token = (valet_token_t *) i_val;
|
||||
|
||||
@ -167,9 +167,9 @@ static int find_longest(valet_lot_t *lot, int min, int max)
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
|
||||
switch_mutex_lock(lot->mutex);
|
||||
for (i_hi = switch_hash_first(NULL, lot->hash); i_hi; i_hi = switch_hash_next(i_hi)) {
|
||||
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_hash_next(i_hi)) {
|
||||
int i;
|
||||
switch_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
token = (valet_token_t *) i_val;
|
||||
cur = (now - token->start_time);
|
||||
i = atoi(token->ext);
|
||||
@ -257,8 +257,8 @@ static int valet_lot_count(valet_lot_t *lot)
|
||||
now = switch_epoch_time_now(NULL);
|
||||
|
||||
switch_mutex_lock(lot->mutex);
|
||||
for (i_hi = switch_hash_first(NULL, lot->hash); i_hi; i_hi = switch_hash_next(i_hi)) {
|
||||
switch_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_hash_next(i_hi)) {
|
||||
switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
token = (valet_token_t *) i_val;
|
||||
if (token->timeout > 0 && (token->timeout < now || token->timeout == 1)) {
|
||||
continue;
|
||||
@ -738,13 +738,13 @@ SWITCH_STANDARD_API(valet_info_function)
|
||||
stream->write_function(stream, "<lots>\n");
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_hash_index_t *i_hi;
|
||||
const void *i_var;
|
||||
void *i_val;
|
||||
char *i_ext;
|
||||
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
name = (char *) var;
|
||||
lot = (valet_lot_t *) val;
|
||||
|
||||
@ -754,10 +754,10 @@ SWITCH_STANDARD_API(valet_info_function)
|
||||
stream->write_function(stream, " <lot name=\"%s\">\n", name);
|
||||
|
||||
switch_mutex_lock(lot->mutex);
|
||||
for (i_hi = switch_hash_first(NULL, lot->hash); i_hi; i_hi = switch_hash_next(i_hi)) {
|
||||
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_hash_next(i_hi)) {
|
||||
valet_token_t *token;
|
||||
|
||||
switch_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
|
||||
i_ext = (char *) i_var;
|
||||
token = (valet_token_t *) i_val;
|
||||
|
||||
@ -848,8 +848,8 @@ static void pres_event_handler(switch_event_t *event)
|
||||
const char *nvar;
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
nvar = (const char *) var;
|
||||
|
||||
if (!strchr(nvar, '@') || switch_stristr(domain_name, nvar)) {
|
||||
@ -930,7 +930,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_valet_parking_load)
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
|
||||
globals.pool = pool;
|
||||
switch_core_hash_init(&globals.hash, NULL);
|
||||
switch_core_hash_init(&globals.hash);
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
|
@ -3866,9 +3866,9 @@ SWITCH_STANDARD_API(boxcount_api_function)
|
||||
/* Kept for backwards-compatibility */
|
||||
switch_hash_index_t *hi;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
if ((hi = switch_hash_first(NULL, globals.profile_hash))) {
|
||||
if ((hi = switch_core_hash_first( globals.profile_hash))) {
|
||||
void *val;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
total_new_messages = total_saved_messages = 0;
|
||||
message_count(profile, id, domain, "inbox", &total_new_messages, &total_saved_messages,
|
||||
@ -4020,8 +4020,8 @@ static void actual_message_query_handler(switch_event_t *event)
|
||||
"Cound not find a profile for domain: [%s] Returning 0 messages\nWhen message-query-exact-match is enabled you must have a dedicated vm profile per distinct domain name you wish to use.\n", domain);
|
||||
}
|
||||
} else {
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
parse_profile();
|
||||
|
||||
@ -4923,8 +4923,8 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
||||
} else if (!strcasecmp(argv[0], "status")) {
|
||||
stream->write_function(stream, "============================\n");
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
stream->write_function(stream, "Profile: %s\n", profile->name);
|
||||
}
|
||||
@ -4958,8 +4958,8 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
||||
void *value;
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (index = switch_hash_first(NULL, globals.profile_hash); index; index = switch_hash_next(index)) {
|
||||
switch_hash_this(index, NULL, NULL, &value);
|
||||
for (index = switch_core_hash_first( globals.profile_hash); index; index = switch_core_hash_next(index)) {
|
||||
switch_core_hash_this(index, NULL, NULL, &value);
|
||||
profile = (vm_profile_t *) value;
|
||||
if (profile) {
|
||||
switch_thread_rwlock_rdlock(profile->rwlock);
|
||||
@ -6179,7 +6179,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voicemail_load)
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
globals.pool = pool;
|
||||
|
||||
switch_core_hash_init(&globals.profile_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
@ -6261,8 +6261,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_voicemail_shutdown)
|
||||
}
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
while ((hi = switch_hash_first(NULL, globals.profile_hash))) {
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
while ((hi = switch_core_hash_first( globals.profile_hash))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
|
||||
switch_core_hash_delete(globals.profile_hash, profile->name);
|
||||
|
@ -538,8 +538,8 @@ static switch_status_t profile_create(profile_t ** profile, const char *name, sw
|
||||
lprofile->gsl_mime_type = "application/x-nuance-gsl";
|
||||
lprofile->jsgf_mime_type = "application/x-jsgf";
|
||||
lprofile->ssml_mime_type = "application/ssml+xml";
|
||||
switch_core_hash_init(&lprofile->default_synth_params, pool);
|
||||
switch_core_hash_init(&lprofile->default_recog_params, pool);
|
||||
switch_core_hash_init(&lprofile->default_synth_params);
|
||||
switch_core_hash_init(&lprofile->default_recog_params);
|
||||
*profile = lprofile;
|
||||
|
||||
if (globals.enable_profile_events && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_PROFILE_CREATE) == SWITCH_STATUS_SUCCESS) {
|
||||
@ -873,7 +873,7 @@ static switch_status_t speech_channel_create(speech_channel_t ** schannel, const
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
goto done;
|
||||
}
|
||||
switch_core_hash_init(&schan->params, pool);
|
||||
switch_core_hash_init(&schan->params);
|
||||
schan->data = NULL;
|
||||
if (zstr(name)) {
|
||||
schan->name = "";
|
||||
@ -1155,11 +1155,11 @@ static switch_status_t synth_channel_set_params(speech_channel_t *schannel, mrcp
|
||||
{
|
||||
/* loop through each param and add to synth header or vendor-specific-params */
|
||||
switch_hash_index_t *hi = NULL;
|
||||
for (hi = switch_hash_first(NULL, schannel->params); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( schannel->params); hi; hi = switch_core_hash_next(hi)) {
|
||||
char *param_name = NULL, *param_val = NULL;
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
param_name = (char *) key;
|
||||
param_val = (char *) val;
|
||||
if (!zstr(param_name) && !zstr(param_val)) {
|
||||
@ -1630,11 +1630,11 @@ static switch_status_t synth_speech_open(switch_speech_handle_t *sh, const char
|
||||
}
|
||||
|
||||
/* Set default TTS params */
|
||||
for (hi = switch_hash_first(NULL, profile->default_synth_params); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( profile->default_synth_params); hi; hi = switch_core_hash_next(hi)) {
|
||||
char *param_name = NULL, *param_val = NULL;
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
param_name = (char *) key;
|
||||
param_val = (char *) val;
|
||||
speech_channel_set_param(schannel, param_name, param_val);
|
||||
@ -2192,12 +2192,12 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel)
|
||||
r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
|
||||
|
||||
/* count enabled grammars */
|
||||
for (egk = switch_hash_first(NULL, r->enabled_grammars); egk; egk = switch_hash_next(egk)) {
|
||||
for (egk = switch_core_hash_first( r->enabled_grammars); egk; egk = switch_core_hash_next(egk)) {
|
||||
// NOTE: This postponed type check is necessary to allow a non-URI-list grammar to execute alone
|
||||
if (grammar_uri_count == 1 && grammar->type != GRAMMAR_TYPE_URI)
|
||||
goto no_grammar_alone;
|
||||
++grammar_uri_count;
|
||||
switch_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
|
||||
switch_core_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
|
||||
if (grammar->type != GRAMMAR_TYPE_URI && grammar_uri_count != 1) {
|
||||
no_grammar_alone:
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Grammar '%s' can only be used alone (not a URI list)\n", schannel->name, key);
|
||||
@ -2224,8 +2224,8 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel)
|
||||
/* get the enabled grammars list */
|
||||
grammar_uri_list = switch_core_alloc(schannel->memory_pool, grammar_uri_list_len + 1);
|
||||
grammar_uri_list_len = 0;
|
||||
for (egk = switch_hash_first(NULL, r->enabled_grammars); egk; egk = switch_hash_next(egk)) {
|
||||
switch_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
|
||||
for (egk = switch_core_hash_first( r->enabled_grammars); egk; egk = switch_core_hash_next(egk)) {
|
||||
switch_core_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
|
||||
len = strlen(grammar->data);
|
||||
if (!len)
|
||||
continue;
|
||||
@ -2497,7 +2497,7 @@ static switch_status_t recog_channel_disable_all_grammars(speech_channel_t *scha
|
||||
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Disabling all grammars\n", schannel->name);
|
||||
switch_core_hash_destroy(&r->enabled_grammars);
|
||||
switch_core_hash_init(&r->enabled_grammars, schannel->memory_pool);
|
||||
switch_core_hash_init(&r->enabled_grammars);
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -2807,11 +2807,11 @@ static switch_status_t recog_channel_set_params(speech_channel_t *schannel, mrcp
|
||||
{
|
||||
/* loop through each param and add to recog header or vendor-specific-params */
|
||||
switch_hash_index_t *hi = NULL;
|
||||
for (hi = switch_hash_first(NULL, schannel->params); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( schannel->params); hi; hi = switch_core_hash_next(hi)) {
|
||||
char *param_name = NULL, *param_val = NULL;
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
param_name = (char *) key;
|
||||
param_val = (char *) val;
|
||||
if (!zstr(param_name) && !zstr(param_val)) {
|
||||
@ -3111,8 +3111,8 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
|
||||
r = (recognizer_data_t *) switch_core_alloc(ah->memory_pool, sizeof(recognizer_data_t));
|
||||
schannel->data = r;
|
||||
memset(r, 0, sizeof(recognizer_data_t));
|
||||
switch_core_hash_init(&r->grammars, ah->memory_pool);
|
||||
switch_core_hash_init(&r->enabled_grammars, ah->memory_pool);
|
||||
switch_core_hash_init(&r->grammars);
|
||||
switch_core_hash_init(&r->enabled_grammars);
|
||||
|
||||
/* Open the channel */
|
||||
if (zstr(profile_name)) {
|
||||
@ -3129,11 +3129,11 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
|
||||
}
|
||||
|
||||
/* Set default ASR params */
|
||||
for (hi = switch_hash_first(NULL, profile->default_recog_params); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( profile->default_recog_params); hi; hi = switch_core_hash_next(hi)) {
|
||||
char *param_name = NULL, *param_val = NULL;
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
param_name = (char *) key;
|
||||
param_val = (char *) val;
|
||||
speech_channel_set_param(schannel, param_name, param_val);
|
||||
|
@ -930,7 +930,7 @@ SWITCH_STANDARD_API(sangoma_function)
|
||||
#define STATS_FORMAT "%-10.10s %-10.10s %-10.10s %-10.10s %-10.10s %-10.10s %-10.10s %-10.10s %-10.10s %-10.10s %-15.15s %-15.15s\n"
|
||||
stream->write_function(stream, STATS_FORMAT,
|
||||
"Session", "Codec", "Enc", "Dec", "Enc Tx", "Enc Rx", "Dec Tx", "Dec Rx", "Enc Lost", "Dec Lost", "Enc AvgRxMs", "Dec AvgRxMs");
|
||||
for (hi = switch_hash_first(NULL, g_sessions_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( g_sessions_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
struct sangoma_transcoding_session *sess;
|
||||
char sessid_str[25];
|
||||
char encoder_tx_str[25];
|
||||
@ -942,7 +942,7 @@ SWITCH_STANDARD_API(sangoma_function)
|
||||
char encoder_avgrxus_str[25];
|
||||
char decoder_avgrxus_str[25];
|
||||
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
sess = val;
|
||||
|
||||
snprintf(sessid_str, sizeof(sessid_str), "%lu", sess->sessid);
|
||||
@ -1236,7 +1236,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
|
||||
|
||||
switch_mutex_init(&g_sessions_lock, SWITCH_MUTEX_UNNESTED, pool);
|
||||
|
||||
switch_core_hash_init(&g_sessions_hash, pool);
|
||||
switch_core_hash_init(&g_sessions_hash);
|
||||
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
|
@ -829,7 +829,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_alsa_load)
|
||||
|
||||
|
||||
|
||||
switch_core_hash_init(&globals.call_hash, module_pool);
|
||||
switch_core_hash_init(&globals.call_hash);
|
||||
switch_mutex_init(&globals.device_lock, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_mutex_init(&globals.pvt_lock, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_mutex_init(&globals.flag_mutex, SWITCH_MUTEX_NESTED, module_pool);
|
||||
|
@ -569,8 +569,8 @@ static void pres_event_handler(switch_event_t *event)
|
||||
switch_mprintf("select sub_from, sub_to,'%q','%q','%q','%q' from jabber_subscriptions where sub_to = '%q%q'", type, rpid, status, proto, pstr,
|
||||
from);
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
|
||||
if (!(profile->user_flags & LDL_FLAG_COMPONENT)) {
|
||||
@ -701,8 +701,8 @@ static void roster_event_handler(switch_event_t *event)
|
||||
sql = switch_mprintf("select *,'%q' from jabber_subscriptions", status ? status : "");
|
||||
}
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
|
||||
if (!(profile->user_flags & LDL_FLAG_COMPONENT)) {
|
||||
@ -738,8 +738,8 @@ static void ipchanged_event_handler(switch_event_t *event)
|
||||
mdl_profile_t *profile;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s]\n", old_ip4, new_ip4);
|
||||
if (globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
if (old_ip4 && profile->extip && !strcmp(profile->extip, old_ip4)) {
|
||||
tmp = profile->extip;
|
||||
@ -799,8 +799,8 @@ static void sign_off(void)
|
||||
sql = switch_mprintf("select * from jabber_subscriptions");
|
||||
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
|
||||
if (!(profile->user_flags & LDL_FLAG_COMPONENT)) {
|
||||
@ -2684,8 +2684,8 @@ static switch_status_t list_profiles(const char *line, const char *cursor, switc
|
||||
switch_console_callback_match_t *my_matches = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
if (!strncmp("dl_logout", line, 9)) {
|
||||
if (profile->handle) {
|
||||
@ -3090,8 +3090,8 @@ SWITCH_STANDARD_API(dingaling)
|
||||
if (argv[0] && !strncasecmp(argv[0], "status", 6)) {
|
||||
stream->write_function(stream, "--DingaLing status--\n");
|
||||
stream->write_function(stream, "login | connected\n");
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
stream->write_function(stream, "%s | ", profile->login);
|
||||
if (profile->handle && ldl_handle_authorized(profile->handle)) {
|
||||
@ -3276,7 +3276,7 @@ static switch_status_t soft_reload(void)
|
||||
void *data = NULL;
|
||||
switch_hash_t *name_hash;
|
||||
switch_hash_index_t *hi;
|
||||
switch_core_hash_init(&name_hash, module_pool);
|
||||
switch_core_hash_init(&name_hash);
|
||||
|
||||
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
|
||||
@ -3345,8 +3345,8 @@ static switch_status_t soft_reload(void)
|
||||
|
||||
switch_xml_free(xml);
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &data);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &data);
|
||||
profile = (mdl_profile_t *) data;
|
||||
|
||||
if (switch_core_hash_find(name_hash, profile->name)) {
|
||||
@ -3356,8 +3356,8 @@ static switch_status_t soft_reload(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (hi = switch_hash_first(NULL, name_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &data);
|
||||
for (hi = switch_core_hash_first( name_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &data);
|
||||
|
||||
if ((profile = switch_core_hash_find(globals.profile_hash, (char *) data))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleting unused profile %s [%s]\n", profile->name, profile->login);
|
||||
@ -3382,7 +3382,7 @@ static switch_status_t load_config(void)
|
||||
|
||||
switch_find_local_ip(globals.guess_ip, sizeof(globals.guess_ip), NULL, AF_INET);
|
||||
|
||||
switch_core_hash_init(&globals.profile_hash, module_pool);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
|
||||
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
|
||||
|
@ -1308,9 +1308,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load)
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
|
||||
switch_core_hash_init(&globals.call_hash, module_pool);
|
||||
switch_core_hash_init(&globals.sh_streams, module_pool);
|
||||
switch_core_hash_init(&globals.endpoints, module_pool);
|
||||
switch_core_hash_init(&globals.call_hash);
|
||||
switch_core_hash_init(&globals.sh_streams);
|
||||
switch_core_hash_init(&globals.endpoints);
|
||||
switch_mutex_init(&globals.device_lock, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_mutex_init(&globals.pvt_lock, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_mutex_init(&globals.streams_lock, SWITCH_MUTEX_NESTED, module_pool);
|
||||
@ -2491,11 +2491,11 @@ static switch_status_t list_shared_streams(char **argv, int argc, switch_stream_
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
int cnt = 0;
|
||||
for (hi = switch_hash_first(NULL, globals.sh_streams); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.sh_streams); hi; hi = switch_core_hash_next(hi)) {
|
||||
const void *var;
|
||||
void *val;
|
||||
shared_audio_stream_t *s = NULL;
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
s = val;
|
||||
stream->write_function(stream, "%s> indev: %d, outdev: %d, sample-rate: %d, codec-ms: %d, channels: %d\n",
|
||||
s->name, s->indev, s->outdev, s->sample_rate, s->codec_ms, s->channels);
|
||||
@ -2509,11 +2509,11 @@ static switch_status_t list_endpoints(char **argv, int argc, switch_stream_handl
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
int cnt = 0;
|
||||
for (hi = switch_hash_first(NULL, globals.endpoints); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.endpoints); hi; hi = switch_core_hash_next(hi)) {
|
||||
const void *var;
|
||||
void *val;
|
||||
audio_endpoint_t *e = NULL;
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
e = val;
|
||||
stream->write_function(stream, "%s> instream: %s, outstream: %s\n",
|
||||
e->name, e->in_stream ? e->in_stream->name : "(none)",
|
||||
|
@ -788,7 +788,7 @@ switch_status_t rtmp_session_request(rtmp_profile_t *profile, rtmp_session_t **n
|
||||
switch_core_hash_insert_wrlock(rtmp_globals.session_hash, (*newsession)->uuid, *newsession, rtmp_globals.session_rwlock);
|
||||
switch_core_hash_insert_wrlock(profile->session_hash, (*newsession)->uuid, *newsession, profile->session_rwlock);
|
||||
|
||||
switch_core_hash_init(&(*newsession)->session_hash, pool);
|
||||
switch_core_hash_init(&(*newsession)->session_hash);
|
||||
switch_thread_rwlock_create(&(*newsession)->session_rwlock, pool);
|
||||
|
||||
#ifdef RTMP_DEBUG_IO
|
||||
@ -827,13 +827,13 @@ static void rtmp_garbage_colletor(void)
|
||||
|
||||
top:
|
||||
|
||||
for (hi = switch_hash_first(NULL, rtmp_globals.session_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( rtmp_globals.session_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
rtmp_session_t *rsession;
|
||||
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
rsession = (rtmp_session_t *) val;
|
||||
|
||||
if (rsession->state == RS_DESTROY) {
|
||||
@ -868,14 +868,14 @@ switch_status_t rtmp_real_session_destroy(rtmp_session_t **rsession)
|
||||
int sess = 0;
|
||||
|
||||
switch_thread_rwlock_rdlock((*rsession)->session_rwlock);
|
||||
for (hi = switch_hash_first(NULL, (*rsession)->session_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( (*rsession)->session_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
switch_channel_t *channel;
|
||||
switch_core_session_t *session;
|
||||
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
/* If there are any sessions attached, abort the destroy operation */
|
||||
if ((session = switch_core_session_locate((char *)key)) != NULL ) {
|
||||
@ -1050,10 +1050,10 @@ switch_status_t rtmp_profile_start(const char *profilename)
|
||||
|
||||
switch_thread_rwlock_create(&profile->rwlock, pool);
|
||||
switch_mutex_init(&profile->mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&profile->session_hash, pool);
|
||||
switch_core_hash_init(&profile->session_hash);
|
||||
switch_thread_rwlock_create(&profile->session_rwlock, pool);
|
||||
switch_thread_rwlock_create(&profile->reg_rwlock, pool);
|
||||
switch_core_hash_init(&profile->reg_hash, pool);
|
||||
switch_core_hash_init(&profile->reg_hash);
|
||||
|
||||
if (!strcmp(profile->io_name, "tcp")) {
|
||||
if (rtmp_tcp_init(profile, profile->bind_address, &profile->io, pool) != SWITCH_STATUS_SUCCESS) {
|
||||
@ -1086,12 +1086,12 @@ switch_status_t rtmp_profile_destroy(rtmp_profile_t **profile) {
|
||||
switch_thread_rwlock_wrlock((*profile)->rwlock);
|
||||
|
||||
/* Kill all sessions */
|
||||
while ((hi = switch_hash_first(NULL, (*profile)->session_hash))) {
|
||||
while ((hi = switch_core_hash_first( (*profile)->session_hash))) {
|
||||
void *val;
|
||||
rtmp_session_t *session;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
session = val;
|
||||
|
||||
@ -1633,12 +1633,12 @@ SWITCH_STANDARD_API(rtmp_function)
|
||||
stream->write_function(stream, "\nSessions:\n");
|
||||
stream->write_function(stream, "uuid,address,user,domain,flashVer,state\n");
|
||||
switch_thread_rwlock_rdlock(profile->session_rwlock);
|
||||
for (hi = switch_hash_first(NULL, profile->session_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( profile->session_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
rtmp_session_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (rtmp_session_t *)val;
|
||||
stream->write_function(stream, "%s,%s:%d,%s,%s,%s,%s\n",
|
||||
@ -1655,12 +1655,12 @@ SWITCH_STANDARD_API(rtmp_function)
|
||||
stream->write_function(stream, "user,nickname,uuid\n");
|
||||
|
||||
switch_thread_rwlock_rdlock(profile->reg_rwlock);
|
||||
for (hi = switch_hash_first(NULL, profile->reg_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( profile->reg_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
rtmp_reg_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (rtmp_reg_t *)val;
|
||||
for (;item;item = item->next) {
|
||||
@ -1681,12 +1681,12 @@ SWITCH_STANDARD_API(rtmp_function)
|
||||
} else {
|
||||
switch_hash_index_t *hi;
|
||||
switch_thread_rwlock_rdlock(rtmp_globals.profile_rwlock);
|
||||
for (hi = switch_hash_first(NULL, rtmp_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( rtmp_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
rtmp_profile_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (rtmp_profile_t *)val;
|
||||
stream->write_function(stream, "%s\t%s:%s\tprofile\n", item->name, item->io->name, item->io->address);
|
||||
@ -1805,8 +1805,8 @@ static switch_status_t console_complete_hashtable(switch_hash_t *hash, const cha
|
||||
switch_console_callback_match_t *my_matches = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
switch_console_push_match(&my_matches, (const char *) vvar);
|
||||
}
|
||||
|
||||
@ -1845,9 +1845,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rtmp_load)
|
||||
memset(&rtmp_globals, 0, sizeof(rtmp_globals));
|
||||
|
||||
switch_mutex_init(&rtmp_globals.mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&rtmp_globals.profile_hash, pool);
|
||||
switch_core_hash_init(&rtmp_globals.session_hash, pool);
|
||||
switch_core_hash_init(&rtmp_globals.invoke_hash, pool);
|
||||
switch_core_hash_init(&rtmp_globals.profile_hash);
|
||||
switch_core_hash_init(&rtmp_globals.session_hash);
|
||||
switch_core_hash_init(&rtmp_globals.invoke_hash);
|
||||
switch_thread_rwlock_create(&rtmp_globals.profile_rwlock, pool);
|
||||
switch_thread_rwlock_create(&rtmp_globals.session_rwlock, pool);
|
||||
|
||||
@ -1933,12 +1933,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_rtmp_shutdown)
|
||||
switch_hash_index_t *hi;
|
||||
|
||||
switch_mutex_lock(rtmp_globals.mutex);
|
||||
while ((hi = switch_hash_first(NULL, rtmp_globals.profile_hash))) {
|
||||
while ((hi = switch_core_hash_first( rtmp_globals.profile_hash))) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
rtmp_profile_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (rtmp_profile_t *)val;
|
||||
|
||||
|
@ -243,12 +243,12 @@ switch_status_t rtmp_check_auth(rtmp_session_t *rsession, const char *user, cons
|
||||
if (disallow_multiple_registration) {
|
||||
switch_hash_index_t *hi;
|
||||
switch_thread_rwlock_rdlock(rsession->profile->session_rwlock);
|
||||
for (hi = switch_hash_first(NULL, rsession->profile->session_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( rsession->profile->session_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
rtmp_session_t *item;
|
||||
switch_hash_this(hi, &key, &keylen, &val);
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
|
||||
item = (rtmp_session_t *)val;
|
||||
if (rtmp_session_check_user(item, user, domain) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -197,8 +197,8 @@ skinny_profile_t *skinny_find_profile_by_domain(const char *domain_name)
|
||||
skinny_profile_t *profile = NULL, *tmp_profile;
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
tmp_profile = (skinny_profile_t *) val;
|
||||
|
||||
switch_mutex_lock(tmp_profile->listener_mutex);
|
||||
@ -1401,8 +1401,8 @@ static void walk_listeners(skinny_listener_callback_func_t callback, void *pvt)
|
||||
|
||||
/* walk listeners */
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (skinny_profile_t *) val;
|
||||
|
||||
profile_walk_listeners(profile, callback, pvt);
|
||||
@ -2086,7 +2086,7 @@ static switch_status_t load_skinny_config(void)
|
||||
}
|
||||
|
||||
/* Soft Key Set Sets */
|
||||
switch_core_hash_init(&profile->soft_key_set_sets_hash, profile->pool);
|
||||
switch_core_hash_init(&profile->soft_key_set_sets_hash);
|
||||
if ((xsoft_key_set_sets = switch_xml_child(xprofile, "soft-key-set-sets"))) {
|
||||
switch_xml_t xsoft_key_set_set;
|
||||
for (xsoft_key_set_set = switch_xml_child(xsoft_key_set_sets, "soft-key-set-set"); xsoft_key_set_set; xsoft_key_set_set = xsoft_key_set_set->next) {
|
||||
@ -2154,7 +2154,7 @@ static switch_status_t load_skinny_config(void)
|
||||
|
||||
|
||||
/* Device types */
|
||||
switch_core_hash_init(&profile->device_type_params_hash, profile->pool);
|
||||
switch_core_hash_init(&profile->device_type_params_hash);
|
||||
if ((xdevice_types = switch_xml_child(xprofile, "device-types"))) {
|
||||
switch_xml_t xdevice_type;
|
||||
for (xdevice_type = switch_xml_child(xdevice_types, "device-type"); xdevice_type; xdevice_type = xdevice_type->next) {
|
||||
@ -2441,8 +2441,8 @@ static void skinny_trap_event_handler(switch_event_t *event)
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
if (globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((profile = (skinny_profile_t *) val) && profile->auto_restart) {
|
||||
if (!strcmp(profile->ip, old_ip4)) {
|
||||
skinny_profile_set(profile, "ip", new_ip4);
|
||||
@ -2470,14 +2470,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
globals.running = 1;
|
||||
globals.auto_restart = SWITCH_TRUE;
|
||||
|
||||
load_skinny_config();
|
||||
|
||||
/* at least one profile */
|
||||
if (!switch_hash_first(NULL, globals.profile_hash)) {
|
||||
if (!switch_core_hash_first( globals.profile_hash)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No profile found!\n");
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
@ -2540,11 +2540,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
|
||||
|
||||
/* launch listeners */
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
void *val;
|
||||
skinny_profile_t *profile;
|
||||
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (skinny_profile_t *) val;
|
||||
|
||||
launch_skinny_profile_thread(profile);
|
||||
@ -2587,9 +2587,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown)
|
||||
|
||||
/* close sockets */
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
skinny_profile_t *profile;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (skinny_profile_t *) val;
|
||||
|
||||
close_socket(&profile->sock, profile);
|
||||
|
@ -49,8 +49,8 @@ static switch_status_t skinny_api_list_profiles(const char *line, const char *cu
|
||||
|
||||
/* walk profiles */
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (skinny_profile_t *) val;
|
||||
|
||||
switch_console_push_match(&my_matches, profile->name);
|
||||
|
@ -2375,8 +2375,8 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
||||
stream->write_function(stream, "%25s\t%32s\t%s\t%s\t%s\n", "Profile::Gateway-Name", " Data ", "State", "IB Calls(F/T)", "OB Calls(F/T)");
|
||||
stream->write_function(stream, "%s\n", line);
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (sofia_profile_t *) val;
|
||||
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
|
||||
|
||||
@ -2608,8 +2608,8 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
||||
stream->write_function(stream, "%25s\t%s\t %40s\t%s\n", "Name", " Type", "Data", "State");
|
||||
stream->write_function(stream, "%s\n", line);
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (sofia_profile_t *) val;
|
||||
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
|
||||
|
||||
@ -2720,8 +2720,8 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
|
||||
stream->write_function(stream, "<gateways>\n", header);
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (sofia_profile_t *) val;
|
||||
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
|
||||
|
||||
@ -2892,8 +2892,8 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
|
||||
stream->write_function(stream, "%s\n", header);
|
||||
stream->write_function(stream, "<profiles>\n");
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (sofia_profile_t *) val;
|
||||
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
|
||||
|
||||
@ -3555,8 +3555,8 @@ SWITCH_STANDARD_API(sofia_contact_function)
|
||||
const void *var;
|
||||
void *val;
|
||||
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) {
|
||||
select_from_profile(profile, user, domain, concat, exclude_contact, &mystream, SWITCH_TRUE);
|
||||
profile = NULL;
|
||||
@ -3740,8 +3740,8 @@ SWITCH_STANDARD_API(sofia_presence_data_function)
|
||||
const void *var;
|
||||
void *val;
|
||||
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) {
|
||||
get_presence_data(profile, user, domain, search, stream);
|
||||
profile = NULL;
|
||||
@ -5137,8 +5137,8 @@ static void general_event_handler(switch_event_t *event)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash && !zstr(old_ip4) && !zstr(new_ip4)) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
|
||||
if ((profile = (sofia_profile_t *) val)) {
|
||||
if (!zstr(profile->extsipip) && !strcmp(profile->extsipip, old_ip4)) {
|
||||
@ -5166,10 +5166,10 @@ static void general_event_handler(switch_event_t *event)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
int rb = 0;
|
||||
uint32_t x = 0;
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((profile = (sofia_profile_t *) val) && profile->auto_restart) {
|
||||
if (!strcmp(profile->sipip, old_ip4)) {
|
||||
profile->sipip = switch_core_strdup(profile->pool, new_ip4);
|
||||
@ -5279,8 +5279,8 @@ switch_status_t list_profiles_full(const char *line, const char *cursor, switch_
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
|
||||
profile = (sofia_profile_t *) val;
|
||||
if (!show_aliases && strcmp((char *)vvar, profile->name)) {
|
||||
@ -5317,8 +5317,8 @@ static switch_status_t list_gateways(const char *line, const char *cursor, switc
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
profile = (sofia_profile_t *) val;
|
||||
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
|
||||
sofia_gateway_t *gp;
|
||||
@ -5444,8 +5444,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
|
||||
strcpy(mod_sofia_globals.hostname, switch_core_get_switchname());
|
||||
|
||||
|
||||
switch_core_hash_init(&mod_sofia_globals.profile_hash, mod_sofia_globals.pool);
|
||||
switch_core_hash_init(&mod_sofia_globals.gateway_hash, mod_sofia_globals.pool);
|
||||
switch_core_hash_init(&mod_sofia_globals.profile_hash);
|
||||
switch_core_hash_init(&mod_sofia_globals.gateway_hash);
|
||||
switch_mutex_init(&mod_sofia_globals.hash_mutex, SWITCH_MUTEX_NESTED, mod_sofia_globals.pool);
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.mutex);
|
||||
|
@ -3950,9 +3950,9 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
||||
}
|
||||
|
||||
profile->dbname = switch_core_strdup(profile->pool, url);
|
||||
switch_core_hash_init(&profile->chat_hash, profile->pool);
|
||||
switch_core_hash_init(&profile->reg_nh_hash, profile->pool);
|
||||
switch_core_hash_init(&profile->mwi_debounce_hash, profile->pool);
|
||||
switch_core_hash_init(&profile->chat_hash);
|
||||
switch_core_hash_init(&profile->reg_nh_hash);
|
||||
switch_core_hash_init(&profile->mwi_debounce_hash);
|
||||
switch_thread_rwlock_create(&profile->rwlock, profile->pool);
|
||||
switch_mutex_init(&profile->flag_mutex, SWITCH_MUTEX_NESTED, profile->pool);
|
||||
profile->dtmf_duration = 100;
|
||||
@ -7149,8 +7149,8 @@ nua_handle_t *sofia_global_nua_handle_by_replaces(sip_replaces_t *replaces)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((profile = (sofia_profile_t *) val)) {
|
||||
if (!(nh = nua_handle_by_replaces(profile->nua, replaces))) {
|
||||
nh = nua_handle_by_call_id(profile->nua, replaces->rp_call_id);
|
||||
|
@ -1653,8 +1653,8 @@ void sofia_glue_restart_all_profiles(void)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val)) {
|
||||
int rsec = 10;
|
||||
int diff = (int) (switch_epoch_time_now(NULL) - pptr->started);
|
||||
@ -1688,8 +1688,8 @@ void sofia_glue_global_siptrace(switch_bool_t on)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val)) {
|
||||
nua_set_params(pptr->nua, TPTAG_LOG(on), TAG_END());
|
||||
}
|
||||
@ -1708,8 +1708,8 @@ void sofia_glue_global_standby(switch_bool_t on)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val)) {
|
||||
if (on) {
|
||||
sofia_set_pflag_locked(pptr, PFLAG_STANDBY);
|
||||
@ -1732,8 +1732,8 @@ void sofia_glue_global_capture(switch_bool_t on)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val)) {
|
||||
nua_set_params(pptr->nua, TPTAG_CAPT(on ? mod_sofia_globals.capture_server : NULL), TAG_END());
|
||||
}
|
||||
@ -1753,8 +1753,8 @@ void sofia_glue_global_watchdog(switch_bool_t on)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val)) {
|
||||
pptr->watchdog_enabled = (on ? 1 : 0);
|
||||
}
|
||||
@ -1776,8 +1776,8 @@ void sofia_glue_del_profile(sofia_profile_t *profile)
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
|
||||
aliases[i++] = strdup((char *) var);
|
||||
if (i == 512) {
|
||||
|
@ -912,7 +912,7 @@ static void do_dialog_probe(switch_event_t *event)
|
||||
h4235 = switch_core_alloc(pool, sizeof(*h4235));
|
||||
h4235->pool = pool;
|
||||
h4235->profile = profile;
|
||||
switch_core_hash_init(&h4235->hash, h4235->pool);
|
||||
switch_core_hash_init(&h4235->hash);
|
||||
sofia_glue_execute_sql_callback(profile, profile->dbh_mutex, sql, sofia_dialog_probe_callback, h4235);
|
||||
switch_safe_free(sql);
|
||||
if (mod_sofia_globals.debug_presence > 0) {
|
||||
@ -3499,7 +3499,7 @@ static int sync_sla(sofia_profile_t *profile, const char *to_user, const char *t
|
||||
switch_core_new_memory_pool(&pool);
|
||||
sh = switch_core_alloc(pool, sizeof(*sh));
|
||||
sh->pool = pool;
|
||||
switch_core_hash_init(&sh->hash, sh->pool);
|
||||
switch_core_hash_init(&sh->hash);
|
||||
|
||||
sql = switch_mprintf("select sip_from_user,sip_from_host,call_info,call_info_state,uuid from sip_dialogs "
|
||||
"where call_info_state is not null and call_info_state != '' and call_info_state != 'idle' and hostname='%q' and profile_name='%q' "
|
||||
|
@ -1099,8 +1099,8 @@ void sofia_reg_close_handles(sofia_profile_t *profile)
|
||||
switch_mutex_lock(profile->flag_mutex);
|
||||
if (profile->reg_nh_hash) {
|
||||
top:
|
||||
for (hi = switch_hash_first(NULL, profile->reg_nh_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( profile->reg_nh_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((nh = (nua_handle_t *) val)) {
|
||||
nua_handle_unref(nh);
|
||||
nua_handle_destroy(nh);
|
||||
@ -3132,8 +3132,8 @@ sofia_gateway_t *sofia_reg_find_gateway_by_realm__(const char *file, const char
|
||||
void *val;
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.gateway_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( mod_sofia_globals.gateway_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if (key && (gateway = (sofia_gateway_t *) val) && !gateway->deleted && gateway->register_realm && !strcasecmp(gateway->register_realm, key)) {
|
||||
break;
|
||||
} else {
|
||||
|
@ -1864,7 +1864,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_unicall_load)
|
||||
module_pool = pool;
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_core_hash_init(&globals.call_hash, module_pool);
|
||||
switch_core_hash_init(&globals.call_hash);
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_mutex_init(&globals.hash_mutex, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_mutex_init(&globals.channel_mutex, SWITCH_MUTEX_NESTED, module_pool);
|
||||
|
@ -279,8 +279,8 @@ static void do_rotate_all()
|
||||
}
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.fd_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
fd = (cdr_fd_t *) val;
|
||||
switch_mutex_lock(fd->mutex);
|
||||
do_rotate(fd);
|
||||
@ -296,8 +296,8 @@ static void do_teardown()
|
||||
void *val;
|
||||
cdr_fd_t *fd;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.fd_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
fd = (cdr_fd_t *) val;
|
||||
switch_mutex_lock(fd->mutex);
|
||||
if (fd->fd > -1) {
|
||||
@ -355,8 +355,8 @@ static switch_status_t load_config(switch_memory_pool_t *pool)
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_core_hash_init(&globals.fd_hash, pool);
|
||||
switch_core_hash_init(&globals.template_hash, pool);
|
||||
switch_core_hash_init(&globals.fd_hash);
|
||||
switch_core_hash_init(&globals.template_hash);
|
||||
|
||||
globals.pool = pool;
|
||||
|
||||
|
@ -401,8 +401,8 @@ static void event_handler(switch_event_t *event)
|
||||
}
|
||||
|
||||
if (sig && !strcmp(sig, "HUP")) {
|
||||
for (hi = switch_hash_first(NULL, globals.fd_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
fd = (cdr_fd_t *) val;
|
||||
switch_mutex_lock(fd->mutex);
|
||||
do_rotate(fd);
|
||||
@ -448,7 +448,7 @@ static switch_status_t load_config(switch_memory_pool_t *pool)
|
||||
}
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_core_hash_init(&globals.fd_hash, pool);
|
||||
switch_core_hash_init(&globals.fd_hash);
|
||||
switch_mutex_init(&globals.db_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
|
||||
globals.pool = pool;
|
||||
|
@ -196,7 +196,7 @@ static switch_status_t load_config(switch_memory_pool_t *pool)
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_core_hash_init(&globals.template_hash, pool);
|
||||
switch_core_hash_init(&globals.template_hash);
|
||||
|
||||
globals.pool = pool;
|
||||
|
||||
|
@ -497,7 +497,7 @@ static switch_status_t handle_msg_setevent(listener_t *listener, erlang_msg *msg
|
||||
}
|
||||
|
||||
/* create new hash */
|
||||
switch_core_hash_init(&event_hash, listener->pool);
|
||||
switch_core_hash_init(&event_hash);
|
||||
|
||||
if(!switch_test_flag(listener, LFLAG_EVENTS)) {
|
||||
switch_set_flag_locked(listener, LFLAG_EVENTS);
|
||||
@ -562,7 +562,7 @@ static switch_status_t handle_msg_session_setevent(listener_t *listener, erlang_
|
||||
}
|
||||
|
||||
/* create new hash */
|
||||
switch_core_hash_init(&event_hash, session->pool);
|
||||
switch_core_hash_init(&event_hash);
|
||||
|
||||
for (i = 1; i < arity; i++){
|
||||
if (!ei_decode_atom(buf->buff, &buf->index, atom)) {
|
||||
@ -1132,8 +1132,8 @@ static switch_status_t handle_ref_tuple(listener_t *listener, erlang_msg * msg,
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hashed ref to %s\n", hash);
|
||||
|
||||
switch_thread_rwlock_rdlock(listener->session_rwlock);
|
||||
for (iter = switch_hash_first(NULL, listener->sessions); iter; iter = switch_hash_next(iter)) {
|
||||
switch_hash_this(iter, &key, NULL, &val);
|
||||
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) {
|
||||
switch_core_hash_this(iter, &key, NULL, &val);
|
||||
se = (session_elem_t*)val;
|
||||
if (se->spawn_reply && !strncmp(se->spawn_reply->hash, hash, 100)) {
|
||||
|
||||
|
@ -364,8 +364,8 @@ session_elem_t *find_session_elem_by_pid(listener_t *listener, erlang_pid *pid)
|
||||
session_elem_t *session = NULL;
|
||||
|
||||
switch_thread_rwlock_rdlock(listener->session_rwlock);
|
||||
for (iter = switch_hash_first(NULL, listener->sessions); iter; iter = switch_hash_next(iter)) {
|
||||
switch_hash_this(iter, &key, NULL, &val);
|
||||
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) {
|
||||
switch_core_hash_this(iter, &key, NULL, &val);
|
||||
|
||||
if (((session_elem_t*)val)->process.type == ERLANG_PID && !ei_compare_pids(pid, &((session_elem_t*)val)->process.pid)) {
|
||||
session = (session_elem_t*)val;
|
||||
@ -644,8 +644,8 @@ static switch_status_t check_attached_sessions(listener_t *listener, int *msgs_s
|
||||
|
||||
/* TODO try to minimize critical section */
|
||||
switch_thread_rwlock_rdlock(listener->session_rwlock);
|
||||
for (iter = switch_hash_first(NULL, listener->sessions); iter; iter = switch_hash_next(iter)) {
|
||||
switch_hash_this(iter, &key, NULL, &value);
|
||||
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) {
|
||||
switch_core_hash_this(iter, &key, NULL, &value);
|
||||
sp = (session_elem_t*)value;
|
||||
if (switch_test_flag(sp, LFLAG_WAITING_FOR_PID)) {
|
||||
continue;
|
||||
@ -1270,8 +1270,8 @@ static listener_t *new_listener(struct ei_cnode_s *ec, int clientfd)
|
||||
switch_thread_rwlock_create(&listener->event_rwlock, pool);
|
||||
switch_thread_rwlock_create(&listener->session_rwlock, listener->pool);
|
||||
|
||||
switch_core_hash_init(&listener->event_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->sessions, listener->pool);
|
||||
switch_core_hash_init(&listener->event_hash);
|
||||
switch_core_hash_init(&listener->sessions);
|
||||
|
||||
return listener;
|
||||
}
|
||||
@ -1326,8 +1326,8 @@ void destroy_listener(listener_t * listener)
|
||||
|
||||
/* clean up all the attached sessions */
|
||||
switch_thread_rwlock_wrlock(listener->session_rwlock);
|
||||
for (iter = switch_hash_first(NULL, listener->sessions); iter; iter = switch_hash_next(iter)) {
|
||||
switch_hash_this(iter, &key, NULL, &value);
|
||||
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) {
|
||||
switch_core_hash_this(iter, &key, NULL, &value);
|
||||
s = (session_elem_t*)value;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Orphaning call %s\n", s->uuid_str);
|
||||
destroy_session_elem(s);
|
||||
@ -1383,7 +1383,7 @@ session_elem_t *session_elem_create(listener_t *listener, switch_core_session_t
|
||||
|
||||
switch_queue_create(&session_element->event_queue, SWITCH_CORE_QUEUE_LEN, session_element->pool);
|
||||
switch_mutex_init(&session_element->flag_mutex, SWITCH_MUTEX_NESTED, session_element->pool);
|
||||
switch_core_hash_init(&session_element->event_hash, session_element->pool);
|
||||
switch_core_hash_init(&session_element->event_hash);
|
||||
session_element->spawn_reply = NULL;
|
||||
|
||||
for (x = 0; x <= SWITCH_EVENT_ALL; x++) {
|
||||
@ -1522,7 +1522,7 @@ int count_listener_sessions(listener_t *listener)
|
||||
switch_hash_index_t *iter;
|
||||
|
||||
switch_thread_rwlock_rdlock(listener->session_rwlock);
|
||||
for (iter = switch_hash_first(NULL, listener->sessions); iter; iter = switch_hash_next(iter)) {
|
||||
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) {
|
||||
count++;
|
||||
}
|
||||
switch_thread_rwlock_unlock(listener->session_rwlock);
|
||||
@ -1743,9 +1743,9 @@ SWITCH_STANDARD_API(erlang_cmd)
|
||||
|
||||
found = 1;
|
||||
switch_thread_rwlock_rdlock(l->session_rwlock);
|
||||
for (iter = switch_hash_first(NULL, l->sessions); iter; iter = switch_hash_next(iter)) {
|
||||
for (iter = switch_core_hash_first( l->sessions); iter; iter = switch_core_hash_next(iter)) {
|
||||
empty = 0;
|
||||
switch_hash_this(iter, &key, NULL, &value);
|
||||
switch_core_hash_this(iter, &key, NULL, &value);
|
||||
sp = (session_elem_t*)value;
|
||||
stream->write_function(stream, "Outbound session for %s in state %s\n", sp->uuid_str,
|
||||
switch_channel_state_name(sp->channel_state));
|
||||
@ -1784,8 +1784,8 @@ SWITCH_STANDARD_API(erlang_cmd)
|
||||
}
|
||||
stream->write_function(stream, "CUSTOM:\n", switch_event_name(x));
|
||||
|
||||
for (iter = switch_hash_first(NULL, l->event_hash); iter; iter = switch_hash_next(iter)) {
|
||||
switch_hash_this(iter, &key, NULL, &val);
|
||||
for (iter = switch_core_hash_first( l->event_hash); iter; iter = switch_core_hash_next(iter)) {
|
||||
switch_core_hash_this(iter, &key, NULL, &val);
|
||||
stream->write_function(stream, "\t%s\n", (char *)key);
|
||||
}
|
||||
stream->write_function(stream, "\n", (char *)key);
|
||||
@ -1863,7 +1863,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_erlang_event_load)
|
||||
switch_thread_rwlock_create(&globals.bindings_rwlock, pool);
|
||||
switch_mutex_init(&globals.fetch_reply_mutex, SWITCH_MUTEX_DEFAULT, pool);
|
||||
switch_mutex_init(&globals.listener_count_mutex, SWITCH_MUTEX_UNNESTED, pool);
|
||||
switch_core_hash_init(&globals.fetch_reply_hash, pool);
|
||||
switch_core_hash_init(&globals.fetch_reply_hash);
|
||||
|
||||
/* intialize the unique reference stuff */
|
||||
switch_mutex_init(&globals.ref_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
|
@ -228,7 +228,7 @@ static void event_handler(switch_event_t *event)
|
||||
switch_safe_free(globals.psk);
|
||||
globals.psk = NULL;
|
||||
}
|
||||
switch_core_hash_init(&globals.event_hash, module_pool);
|
||||
switch_core_hash_init(&globals.event_hash);
|
||||
memset(globals.event_list, 0, SWITCH_EVENT_ALL + 1);
|
||||
if (load_config() != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to reload config file\n");
|
||||
@ -247,8 +247,8 @@ static void event_handler(switch_event_t *event)
|
||||
struct peer_status *last;
|
||||
char *host;
|
||||
|
||||
for (cur = switch_hash_first(NULL, globals.peer_hash); cur; cur = switch_hash_next(cur)) {
|
||||
switch_hash_this(cur, &key, &keylen, &value);
|
||||
for (cur = switch_core_hash_first( globals.peer_hash); cur; cur = switch_core_hash_next(cur)) {
|
||||
switch_core_hash_this(cur, &key, &keylen, &value);
|
||||
host = (char *) key;
|
||||
last = (struct peer_status *) value;
|
||||
if (last->active && (now - (last->lastseen)) > 60) {
|
||||
@ -351,8 +351,8 @@ SWITCH_STANDARD_API(multicast_peers)
|
||||
char *host;
|
||||
int i = 0;
|
||||
|
||||
for (cur = switch_hash_first(NULL, globals.peer_hash); cur; cur = switch_hash_next(cur)) {
|
||||
switch_hash_this(cur, &key, &keylen, &value);
|
||||
for (cur = switch_core_hash_first( globals.peer_hash); cur; cur = switch_core_hash_next(cur)) {
|
||||
switch_core_hash_this(cur, &key, &keylen, &value);
|
||||
host = (char *) key;
|
||||
last = (struct peer_status *) value;
|
||||
|
||||
@ -377,8 +377,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load)
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
module_pool = pool;
|
||||
|
||||
switch_core_hash_init(&globals.event_hash, module_pool);
|
||||
switch_core_hash_init(&globals.peer_hash, module_pool);
|
||||
switch_core_hash_init(&globals.event_hash);
|
||||
switch_core_hash_init(&globals.peer_hash);
|
||||
|
||||
globals.key_count = 0;
|
||||
|
||||
|
@ -473,7 +473,7 @@ SWITCH_STANDARD_APP(socket_function)
|
||||
switch_mutex_init(&listener->flag_mutex, SWITCH_MUTEX_NESTED, listener->pool);
|
||||
switch_mutex_init(&listener->filter_mutex, SWITCH_MUTEX_NESTED, listener->pool);
|
||||
|
||||
switch_core_hash_init(&listener->event_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->event_hash);
|
||||
switch_set_flag(listener, LFLAG_AUTHED);
|
||||
switch_set_flag(listener, LFLAG_OUTBOUND);
|
||||
for (x = 1; x < argc; x++) {
|
||||
@ -839,7 +839,7 @@ SWITCH_STANDARD_API(event_sink_function)
|
||||
switch_mutex_init(&listener->filter_mutex, SWITCH_MUTEX_NESTED, listener->pool);
|
||||
|
||||
|
||||
switch_core_hash_init(&listener->event_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->event_hash);
|
||||
switch_set_flag(listener, LFLAG_AUTHED);
|
||||
switch_set_flag(listener, LFLAG_STATEFUL);
|
||||
switch_set_flag(listener, LFLAG_ALLOW_LOG);
|
||||
@ -1773,7 +1773,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||
|
||||
switch_snprintf(event_reply, sizeof(event_reply), "Allowed-Events: %s\n", allowed_events);
|
||||
|
||||
switch_core_hash_init(&listener->allowed_event_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->allowed_event_hash);
|
||||
|
||||
edup = strdup(allowed_events);
|
||||
cur = edup;
|
||||
@ -1828,7 +1828,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||
|
||||
switch_snprintf(api_reply, sizeof(api_reply), "Allowed-API: %s\n", allowed_api);
|
||||
|
||||
switch_core_hash_init(&listener->allowed_api_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->allowed_api_hash);
|
||||
|
||||
edup = strdup(allowed_api);
|
||||
cur = edup;
|
||||
@ -2522,7 +2522,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||
}
|
||||
/* wipe the hash */
|
||||
switch_core_hash_destroy(&listener->event_hash);
|
||||
switch_core_hash_init(&listener->event_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->event_hash);
|
||||
switch_snprintf(reply, reply_len, "+OK no longer listening for events");
|
||||
} else {
|
||||
switch_snprintf(reply, reply_len, "-ERR not listening for events");
|
||||
@ -2939,7 +2939,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
|
||||
switch_mutex_init(&listener->flag_mutex, SWITCH_MUTEX_NESTED, listener->pool);
|
||||
switch_mutex_init(&listener->filter_mutex, SWITCH_MUTEX_NESTED, listener->pool);
|
||||
|
||||
switch_core_hash_init(&listener->event_hash, listener->pool);
|
||||
switch_core_hash_init(&listener->event_hash);
|
||||
switch_socket_create_pollset(&listener->pollfd, listener->sock, SWITCH_POLLIN | SWITCH_POLLERR, listener->pool);
|
||||
|
||||
|
||||
|
@ -495,9 +495,9 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
cdr_profile_t *profile;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (cdr_profile_t *) val;
|
||||
|
||||
tmpstatus = my_on_reporting_cb(session, profile);
|
||||
@ -518,9 +518,9 @@ static void event_handler(switch_event_t *event)
|
||||
const char *sig = switch_event_get_header(event, "Trapped-Signal");
|
||||
|
||||
if (sig && !strcmp(sig, "HUP")) {
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
cdr_profile_t *profile;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (cdr_profile_t *) val;
|
||||
|
||||
if (profile->rotate) {
|
||||
@ -732,7 +732,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_format_cdr_load)
|
||||
globals.pool = pool;
|
||||
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.profile_hash);
|
||||
|
||||
/* parse the config */
|
||||
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
||||
@ -785,9 +785,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_format_cdr_shutdown)
|
||||
switch_event_unbind(&globals.node);
|
||||
switch_core_remove_state_handler(&state_handlers);
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
cdr_profile_t *profile;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (cdr_profile_t *) val;
|
||||
|
||||
if ( profile ) {
|
||||
|
@ -466,11 +466,11 @@ static void broadcast_event(struct rayo_actor *from, iks *rayo_event, int online
|
||||
{
|
||||
switch_hash_index_t *hi = NULL;
|
||||
switch_mutex_lock(globals.clients_mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.clients_roster); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.clients_roster); hi; hi = switch_core_hash_next(hi)) {
|
||||
struct rayo_client *rclient;
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
rclient = (struct rayo_client *)val;
|
||||
switch_assert(rclient);
|
||||
|
||||
@ -1028,11 +1028,11 @@ static void rayo_call_cleanup(struct rayo_actor *actor)
|
||||
}
|
||||
|
||||
/* send <end> to all offered clients */
|
||||
for (hi = switch_hash_first(NULL, call->pcps); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( call->pcps); hi; hi = switch_core_hash_next(hi)) {
|
||||
const void *key;
|
||||
void *val;
|
||||
const char *client_jid = NULL;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
client_jid = (const char *)key;
|
||||
switch_assert(client_jid);
|
||||
iks_insert_attrib(revent, "to", client_jid);
|
||||
@ -1229,7 +1229,7 @@ static struct rayo_call *rayo_call_init(struct rayo_call *call, switch_memory_po
|
||||
call->dial_request_id = NULL;
|
||||
call->end_event = NULL;
|
||||
call->dial_request_failed = 0;
|
||||
switch_core_hash_init(&call->pcps, pool);
|
||||
switch_core_hash_init(&call->pcps);
|
||||
}
|
||||
|
||||
switch_safe_free(call_jid);
|
||||
@ -1277,8 +1277,8 @@ static struct rayo_mixer *rayo_mixer_init(struct rayo_mixer *mixer, switch_memor
|
||||
char *mixer_jid = switch_mprintf("%s@%s", name, RAYO_JID(globals.server));
|
||||
mixer = RAYO_MIXER(rayo_actor_init(RAYO_ACTOR(mixer), pool, RAT_MIXER, "", name, mixer_jid, rayo_mixer_cleanup, rayo_mixer_send, file, line));
|
||||
if (mixer) {
|
||||
switch_core_hash_init(&mixer->members, pool);
|
||||
switch_core_hash_init(&mixer->subscribers, pool);
|
||||
switch_core_hash_init(&mixer->members);
|
||||
switch_core_hash_init(&mixer->subscribers);
|
||||
}
|
||||
switch_safe_free(mixer_jid);
|
||||
return mixer;
|
||||
@ -1486,7 +1486,7 @@ static struct rayo_peer_server *rayo_peer_server_create(const char *jid)
|
||||
}
|
||||
rserver = RAYO_PEER_SERVER(RAYO_ACTOR_INIT(RAYO_ACTOR(rserver), pool, RAT_PEER_SERVER, "", jid, jid, rayo_peer_server_cleanup, rayo_peer_server_send));
|
||||
if (rserver) {
|
||||
switch_core_hash_init(&rserver->clients, pool);
|
||||
switch_core_hash_init(&rserver->clients);
|
||||
} else {
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
}
|
||||
@ -3523,11 +3523,11 @@ SWITCH_STANDARD_APP(rayo_app)
|
||||
/* Offer call to all ONLINE clients */
|
||||
/* TODO load balance offers so first session doesn't always get offer first? */
|
||||
switch_mutex_lock(globals.clients_mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.clients_roster); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( globals.clients_roster); hi; hi = switch_core_hash_next(hi)) {
|
||||
struct rayo_client *rclient;
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
rclient = (struct rayo_client *)val;
|
||||
switch_assert(rclient);
|
||||
|
||||
@ -4272,8 +4272,8 @@ static switch_status_t list_actors(const char *line, const char *cursor, switch_
|
||||
struct rayo_actor *actor;
|
||||
|
||||
switch_mutex_lock(globals.actors_mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.actors); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.actors); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
|
||||
actor = (struct rayo_actor *) val;
|
||||
if (match(actor)) {
|
||||
@ -4448,16 +4448,16 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
globals.pool = pool;
|
||||
switch_core_hash_init(&globals.command_handlers, pool);
|
||||
switch_core_hash_init(&globals.event_handlers, pool);
|
||||
switch_core_hash_init(&globals.clients_roster, pool);
|
||||
switch_core_hash_init(&globals.command_handlers);
|
||||
switch_core_hash_init(&globals.event_handlers);
|
||||
switch_core_hash_init(&globals.clients_roster);
|
||||
switch_mutex_init(&globals.clients_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&globals.actors, pool);
|
||||
switch_core_hash_init(&globals.destroy_actors, pool);
|
||||
switch_core_hash_init(&globals.actors_by_id, pool);
|
||||
switch_core_hash_init(&globals.actors);
|
||||
switch_core_hash_init(&globals.destroy_actors);
|
||||
switch_core_hash_init(&globals.actors_by_id);
|
||||
switch_mutex_init(&globals.actors_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&globals.dial_gateways, pool);
|
||||
switch_core_hash_init(&globals.cmd_aliases, pool);
|
||||
switch_core_hash_init(&globals.dial_gateways);
|
||||
switch_core_hash_init(&globals.cmd_aliases);
|
||||
switch_thread_rwlock_create(&globals.shutdown_rwlock, pool);
|
||||
switch_queue_create(&globals.msg_queue, 25000, pool);
|
||||
|
||||
|
@ -99,7 +99,7 @@ struct nlsml_parser {
|
||||
static struct tag_def *add_tag_def(const char *tag, tag_attribs_fn attribs_fn, tag_cdata_fn cdata_fn, const char *children_tags)
|
||||
{
|
||||
struct tag_def *def = switch_core_alloc(globals.pool, sizeof(*def));
|
||||
switch_core_hash_init(&def->children_tags, globals.pool);
|
||||
switch_core_hash_init(&def->children_tags);
|
||||
if (!zstr(children_tags)) {
|
||||
char *children_tags_dup = switch_core_strdup(globals.pool, children_tags);
|
||||
char *tags[32] = { 0 };
|
||||
@ -451,7 +451,7 @@ int nlsml_init(void)
|
||||
|
||||
globals.init = SWITCH_TRUE;
|
||||
switch_core_new_memory_pool(&globals.pool);
|
||||
switch_core_hash_init(&globals.tag_defs, globals.pool);
|
||||
switch_core_hash_init(&globals.tag_defs);
|
||||
|
||||
add_root_tag_def("result", process_attribs_ignore, process_cdata_ignore, "interpretation");
|
||||
add_tag_def("interpretation", process_attribs_ignore, process_cdata_ignore, "input,model,xf:model,instance,xf:instance");
|
||||
|
@ -82,7 +82,7 @@ static void subscribe(const char *uuid, const char *signal_type, const char *jid
|
||||
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "Subscribe %s => %s\n", signal_type, jid);
|
||||
if (!signal_subscribers) {
|
||||
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "Create %s subscriber hash\n", signal_type);
|
||||
switch_core_hash_init(&signal_subscribers, NULL);
|
||||
switch_core_hash_init(&signal_subscribers);
|
||||
switch_core_hash_insert(globals.subscribers, key, signal_subscribers);
|
||||
}
|
||||
switch_core_hash_insert(signal_subscribers, jid, "1");
|
||||
@ -291,7 +291,7 @@ iks *rayo_cpa_component_start(struct rayo_actor *call, struct rayo_message *msg,
|
||||
return iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "Failed to create CPA entity");
|
||||
}
|
||||
|
||||
switch_core_hash_init(&component->signals, pool);
|
||||
switch_core_hash_init(&component->signals);
|
||||
|
||||
/* start CPA detectors */
|
||||
for (grammar = iks_find(input, "grammar"); grammar; grammar = iks_next_tag(grammar)) {
|
||||
@ -376,7 +376,7 @@ switch_status_t rayo_cpa_component_load(switch_loadable_module_interface_t **mod
|
||||
switch_event_bind("rayo_cpa_component", SWITCH_EVENT_CHANNEL_HANGUP_COMPLETE, NULL, on_channel_hangup_complete_event, NULL);
|
||||
|
||||
globals.pool = pool;
|
||||
switch_core_hash_init(&globals.subscribers, pool);
|
||||
switch_core_hash_init(&globals.subscribers);
|
||||
switch_mutex_init(&globals.subscribers_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
|
||||
return rayo_cpa_detector_load(module_interface, pool, config_file);
|
||||
|
@ -261,7 +261,7 @@ static switch_status_t do_config(switch_memory_pool_t *pool, const char *config_
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
|
||||
switch_core_hash_init(&bound_events, pool);
|
||||
switch_core_hash_init(&bound_events);
|
||||
|
||||
cpa_xml = switch_xml_child(cfg, "cpa");
|
||||
if (cpa_xml) {
|
||||
@ -279,7 +279,7 @@ static switch_status_t do_config(switch_memory_pool_t *pool, const char *config_
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CPA detector: %s\n", name);
|
||||
detector = switch_core_alloc(pool, sizeof(*detector));
|
||||
switch_core_hash_init(&detector->signal_type_map, pool);
|
||||
switch_core_hash_init(&detector->signal_type_map);
|
||||
detector->name = switch_core_strdup(pool, name);
|
||||
switch_uuid_str(id, sizeof(id));
|
||||
detector->uuid = switch_core_strdup(pool, id);
|
||||
@ -390,8 +390,8 @@ static switch_status_t rayo_cpa_detector_signal_types(const char *line, const ch
|
||||
const void *vvar;
|
||||
switch_console_callback_match_t *my_matches = NULL;
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.detectors); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.detectors); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
switch_console_push_match(&my_matches, (const char *) vvar);
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ switch_status_t rayo_cpa_detector_load(switch_loadable_module_interface_t **modu
|
||||
switch_console_set_complete("add rayo_cpa ::console::list_uuid ::rayo_cpa::list_signal_types stop");
|
||||
switch_console_add_complete_func("::rayo_cpa::list_signal_types", rayo_cpa_detector_signal_types);
|
||||
|
||||
switch_core_hash_init(&globals.detectors, pool);
|
||||
switch_core_hash_init(&globals.detectors);
|
||||
if (do_config(pool, config_file) != SWITCH_STATUS_SUCCESS) {
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
|
@ -564,7 +564,7 @@ static iks *start_call_input(struct input_component *component, switch_core_sess
|
||||
/* create input component */
|
||||
handler = switch_core_session_alloc(session, sizeof(*handler));
|
||||
switch_mutex_init(&handler->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
|
||||
switch_core_hash_init(&handler->dtmf_components, NULL);
|
||||
switch_core_hash_init(&handler->dtmf_components);
|
||||
switch_channel_set_private(switch_core_session_get_channel(session), RAYO_INPUT_COMPONENT_PRIVATE_VAR, handler);
|
||||
handler->last_recognizer = "";
|
||||
|
||||
|
@ -1204,7 +1204,7 @@ switch_status_t rayo_output_component_load(switch_loadable_module_interface_t **
|
||||
file_interface->file_seek = rayo_file_seek;
|
||||
|
||||
switch_mutex_init(&fileman_globals.mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&fileman_globals.hash, pool);
|
||||
switch_core_hash_init(&fileman_globals.hash);
|
||||
|
||||
file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
|
||||
file_interface->interface_name = "mod_rayo";
|
||||
|
@ -387,7 +387,7 @@ static struct srgs_node *sn_insert_string(switch_memory_pool_t *pool, struct srg
|
||||
static struct tag_def *add_tag_def(const char *tag, tag_attribs_fn attribs_fn, tag_cdata_fn cdata_fn, const char *children_tags)
|
||||
{
|
||||
struct tag_def *def = switch_core_alloc(globals.pool, sizeof(*def));
|
||||
switch_core_hash_init(&def->children_tags, globals.pool);
|
||||
switch_core_hash_init(&def->children_tags);
|
||||
if (!zstr(children_tags)) {
|
||||
char *children_tags_dup = switch_core_strdup(globals.pool, children_tags);
|
||||
char *tags[32] = { 0 };
|
||||
@ -821,7 +821,7 @@ struct srgs_grammar *srgs_grammar_new(struct srgs_parser *parser)
|
||||
grammar->root = NULL;
|
||||
grammar->cur = NULL;
|
||||
grammar->uuid = (parser && !zstr(parser->uuid)) ? switch_core_strdup(pool, parser->uuid) : "";
|
||||
switch_core_hash_init(&grammar->rules, pool);
|
||||
switch_core_hash_init(&grammar->rules);
|
||||
switch_mutex_init(&grammar->mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
return grammar;
|
||||
}
|
||||
@ -856,7 +856,7 @@ struct srgs_parser *srgs_parser_new(const char *uuid)
|
||||
parser = switch_core_alloc(pool, sizeof(*parser));
|
||||
parser->pool = pool;
|
||||
parser->uuid = zstr(uuid) ? "" : switch_core_strdup(pool, uuid);
|
||||
switch_core_hash_init(&parser->cache, pool);
|
||||
switch_core_hash_init(&parser->cache);
|
||||
switch_mutex_init(&parser->mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
}
|
||||
return parser;
|
||||
@ -1611,7 +1611,7 @@ int srgs_init(void)
|
||||
|
||||
globals.init = SWITCH_TRUE;
|
||||
switch_core_new_memory_pool(&globals.pool);
|
||||
switch_core_hash_init(&globals.tag_defs, globals.pool);
|
||||
switch_core_hash_init(&globals.tag_defs);
|
||||
|
||||
add_root_tag_def("grammar", process_grammar, process_cdata_bad, "meta,metadata,lexicon,tag,rule");
|
||||
add_tag_def("ruleref", process_ruleref, process_cdata_bad, "");
|
||||
|
@ -1750,8 +1750,8 @@ struct xmpp_stream_context *xmpp_stream_context_create(const char *domain, const
|
||||
context = switch_core_alloc(pool, sizeof(*context));
|
||||
context->pool = pool;
|
||||
switch_mutex_init(&context->streams_mutex, SWITCH_MUTEX_NESTED, context->pool);
|
||||
switch_core_hash_init(&context->routes, context->pool);
|
||||
switch_core_hash_init(&context->streams, context->pool);
|
||||
switch_core_hash_init(&context->routes);
|
||||
switch_core_hash_init(&context->streams);
|
||||
context->dialback_secret = switch_core_strdup(context->pool, domain_secret);
|
||||
context->ready_callback = ready;
|
||||
context->destroy_callback = destroy;
|
||||
@ -1759,7 +1759,7 @@ struct xmpp_stream_context *xmpp_stream_context_create(const char *domain, const
|
||||
context->shutdown = 0;
|
||||
context->domain = switch_core_strdup(context->pool, domain);
|
||||
switch_thread_rwlock_create(&context->shutdown_rwlock, context->pool);
|
||||
switch_core_hash_init(&context->users, context->pool);
|
||||
switch_core_hash_init(&context->users);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
@ -810,8 +810,8 @@ SWITCH_STANDARD_API(show_local_stream_function)
|
||||
switch_mutex_lock(globals.mutex);
|
||||
|
||||
if (zstr(cmd)) {
|
||||
for (hi = switch_hash_first(NULL, globals.source_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( globals.source_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((source = (local_stream_source_t *) val)) {
|
||||
stream->write_function(stream, "%s,%s\n", source->name, source->location);
|
||||
}
|
||||
@ -981,7 +981,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_local_stream_load)
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&globals.source_hash, pool);
|
||||
switch_core_hash_init(&globals.source_hash);
|
||||
if (!launch_streams(NULL)) {
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_stream_load)
|
||||
globals.running = 1;
|
||||
globals.threads = 0;
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
|
||||
switch_core_hash_init(&globals.source_hash, module_pool);
|
||||
switch_core_hash_init(&globals.source_hash);
|
||||
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
|
@ -434,7 +434,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load)
|
||||
{
|
||||
switch_file_interface_t *file_interface;
|
||||
|
||||
switch_core_hash_init(&globals.format_hash, pool);
|
||||
switch_core_hash_init(&globals.format_hash);
|
||||
|
||||
if (setup_formats() != SWITCH_STATUS_SUCCESS) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -198,7 +198,7 @@ struct ssml_context {
|
||||
static struct tag_def *add_tag_def(const char *tag, tag_attribs_fn attribs_fn, tag_cdata_fn cdata_fn, const char *children_tags)
|
||||
{
|
||||
struct tag_def *def = switch_core_alloc(globals.pool, sizeof(*def));
|
||||
switch_core_hash_init(&def->children_tags, globals.pool);
|
||||
switch_core_hash_init(&def->children_tags);
|
||||
if (!zstr(children_tags)) {
|
||||
char *children_tags_dup = switch_core_strdup(globals.pool, children_tags);
|
||||
char *tags[32] = { 0 };
|
||||
@ -339,12 +339,12 @@ static struct voice *find_voice(struct ssml_node *cur_node, switch_hash_t *map,
|
||||
}
|
||||
|
||||
/* find best language, name, gender match */
|
||||
for (hi = switch_hash_first(NULL, map); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( map); hi; hi = switch_core_hash_next(hi)) {
|
||||
const void *key;
|
||||
void *val;
|
||||
struct voice *candidate;
|
||||
int candidate_score = 0;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
candidate = (struct voice *)val;
|
||||
candidate_score = score_voice(candidate, cur_node, lang_required);
|
||||
if (candidate_score > 0 && candidate_score > best_score) {
|
||||
@ -1110,12 +1110,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_ssml_load)
|
||||
*/
|
||||
|
||||
globals.pool = pool;
|
||||
switch_core_hash_init(&globals.voice_cache, pool);
|
||||
switch_core_hash_init(&globals.tts_voice_map, pool);
|
||||
switch_core_hash_init(&globals.say_voice_map, pool);
|
||||
switch_core_hash_init(&globals.interpret_as_map, pool);
|
||||
switch_core_hash_init(&globals.language_map, pool);
|
||||
switch_core_hash_init(&globals.tag_defs, pool);
|
||||
switch_core_hash_init(&globals.voice_cache);
|
||||
switch_core_hash_init(&globals.tts_voice_map);
|
||||
switch_core_hash_init(&globals.say_voice_map);
|
||||
switch_core_hash_init(&globals.interpret_as_map);
|
||||
switch_core_hash_init(&globals.language_map);
|
||||
switch_core_hash_init(&globals.tag_defs);
|
||||
|
||||
add_root_tag_def("speak", process_xml_lang, process_cdata_tts, "audio,break,emphasis,mark,phoneme,prosody,say-as,voice,sub,p,s,lexicon,metadata,meta");
|
||||
add_tag_def("p", process_xml_lang, process_cdata_tts, "audio,break,emphasis,mark,phoneme,prosody,say-as,voice,sub,s");
|
||||
|
@ -11550,7 +11550,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_hash_this(void * jarg1, void * ja
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_hash_first(char * jarg1, void * jarg2) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_hash_first(char * jarg1, void * jarg2) {
|
||||
void * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
switch_hash_t *arg2 = (switch_hash_t *) 0 ;
|
||||
@ -11558,25 +11558,25 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_hash_first(char * jarg1, void * jarg
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (switch_hash_t *)jarg2;
|
||||
result = (switch_hash_index_t *)switch_hash_first(arg1,arg2);
|
||||
result = (switch_hash_index_t *)switch_core_hash_first(arg1,arg2);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_hash_next(void * jarg1) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_hash_next(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_hash_index_t *arg1 = (switch_hash_index_t *) 0 ;
|
||||
switch_hash_index_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_hash_index_t *)jarg1;
|
||||
result = (switch_hash_index_t *)switch_hash_next(arg1);
|
||||
result = (switch_hash_index_t *)switch_core_hash_next(arg1);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_hash_this(void * jarg1, void * jarg2, void * jarg3, void * jarg4) {
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_hash_this(void * jarg1, void * jarg2, void * jarg3, void * jarg4) {
|
||||
switch_hash_index_t *arg1 = (switch_hash_index_t *) 0 ;
|
||||
void **arg2 = (void **) 0 ;
|
||||
switch_ssize_t *arg3 = (switch_ssize_t *) 0 ;
|
||||
@ -11586,7 +11586,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_hash_this(void * jarg1, void * jarg2,
|
||||
arg2 = (void **)jarg2;
|
||||
arg3 = (switch_ssize_t *)jarg3;
|
||||
arg4 = (void **)jarg4;
|
||||
switch_hash_this(arg1,(void const **)arg2,arg3,arg4);
|
||||
switch_core_hash_this(arg1,(void const **)arg2,arg3,arg4);
|
||||
}
|
||||
|
||||
|
||||
|
@ -5644,6 +5644,592 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_loadable_module_function_table_
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_type_set(void * jarg1, int jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_media_type_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (switch_media_type_t)jarg2;
|
||||
if (arg1) (arg1)->type = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_payload_map_t_type_get(void * jarg1) {
|
||||
int jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_media_type_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (switch_media_type_t) ((arg1)->type);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_sdp_type_set(void * jarg1, int jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_sdp_type_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (switch_sdp_type_t)jarg2;
|
||||
if (arg1) (arg1)->sdp_type = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_payload_map_t_sdp_type_get(void * jarg1) {
|
||||
int jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_sdp_type_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (switch_sdp_type_t) ((arg1)->sdp_type);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_ptime_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint32_t)jarg2;
|
||||
if (arg1) (arg1)->ptime = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_ptime_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint32_t) ((arg1)->ptime);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_rate_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint32_t)jarg2;
|
||||
if (arg1) (arg1)->rate = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_rate_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint32_t) ((arg1)->rate);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_allocated_set(void * jarg1, unsigned char jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint8_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint8_t)jarg2;
|
||||
if (arg1) (arg1)->allocated = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_payload_map_t_allocated_get(void * jarg1) {
|
||||
unsigned char jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint8_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint8_t) ((arg1)->allocated);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_negotiated_set(void * jarg1, unsigned char jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint8_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint8_t)jarg2;
|
||||
if (arg1) (arg1)->negotiated = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_payload_map_t_negotiated_get(void * jarg1) {
|
||||
unsigned char jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint8_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint8_t) ((arg1)->negotiated);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_current_set(void * jarg1, unsigned char jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint8_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint8_t)jarg2;
|
||||
if (arg1) (arg1)->current = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_payload_map_t_current_get(void * jarg1) {
|
||||
unsigned char jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint8_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint8_t) ((arg1)->current);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_hash_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
unsigned long arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (unsigned long)jarg2;
|
||||
if (arg1) (arg1)->hash = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_hash_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
unsigned long result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (unsigned long) ((arg1)->hash);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_rm_encoding_set(void * jarg1, char * jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
delete [] arg1->rm_encoding;
|
||||
if (arg2) {
|
||||
arg1->rm_encoding = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->rm_encoding, (const char *)arg2);
|
||||
} else {
|
||||
arg1->rm_encoding = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_payload_map_t_rm_encoding_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (char *) ((arg1)->rm_encoding);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_iananame_set(void * jarg1, char * jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
delete [] arg1->iananame;
|
||||
if (arg2) {
|
||||
arg1->iananame = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->iananame, (const char *)arg2);
|
||||
} else {
|
||||
arg1->iananame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_payload_map_t_iananame_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (char *) ((arg1)->iananame);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_pt_set(void * jarg1, unsigned char jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (switch_payload_t)jarg2;
|
||||
if (arg1) (arg1)->pt = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_payload_map_t_pt_get(void * jarg1) {
|
||||
unsigned char jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_payload_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (switch_payload_t) ((arg1)->pt);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_rm_rate_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
unsigned long arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (unsigned long)jarg2;
|
||||
if (arg1) (arg1)->rm_rate = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_rm_rate_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
unsigned long result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (unsigned long) ((arg1)->rm_rate);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_adv_rm_rate_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
unsigned long arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (unsigned long)jarg2;
|
||||
if (arg1) (arg1)->adv_rm_rate = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_adv_rm_rate_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
unsigned long result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (unsigned long) ((arg1)->adv_rm_rate);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_codec_ms_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint32_t)jarg2;
|
||||
if (arg1) (arg1)->codec_ms = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_codec_ms_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint32_t) ((arg1)->codec_ms);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_bitrate_set(void * jarg1, unsigned long jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (uint32_t)jarg2;
|
||||
if (arg1) (arg1)->bitrate = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_payload_map_t_bitrate_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
uint32_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (uint32_t) ((arg1)->bitrate);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_rm_fmtp_set(void * jarg1, char * jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
delete [] arg1->rm_fmtp;
|
||||
if (arg2) {
|
||||
arg1->rm_fmtp = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->rm_fmtp, (const char *)arg2);
|
||||
} else {
|
||||
arg1->rm_fmtp = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_payload_map_t_rm_fmtp_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (char *) ((arg1)->rm_fmtp);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_agreed_pt_set(void * jarg1, unsigned char jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (switch_payload_t)jarg2;
|
||||
if (arg1) (arg1)->agreed_pt = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_payload_map_t_agreed_pt_get(void * jarg1) {
|
||||
unsigned char jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_payload_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (switch_payload_t) ((arg1)->agreed_pt);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_recv_pt_set(void * jarg1, unsigned char jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (switch_payload_t)jarg2;
|
||||
if (arg1) (arg1)->recv_pt = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_payload_map_t_recv_pt_get(void * jarg1) {
|
||||
unsigned char jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_payload_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (switch_payload_t) ((arg1)->recv_pt);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_fmtp_out_set(void * jarg1, char * jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
delete [] arg1->fmtp_out;
|
||||
if (arg2) {
|
||||
arg1->fmtp_out = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->fmtp_out, (const char *)arg2);
|
||||
} else {
|
||||
arg1->fmtp_out = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_payload_map_t_fmtp_out_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (char *) ((arg1)->fmtp_out);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_remote_sdp_ip_set(void * jarg1, char * jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
delete [] arg1->remote_sdp_ip;
|
||||
if (arg2) {
|
||||
arg1->remote_sdp_ip = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->remote_sdp_ip, (const char *)arg2);
|
||||
} else {
|
||||
arg1->remote_sdp_ip = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_payload_map_t_remote_sdp_ip_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (char *) ((arg1)->remote_sdp_ip);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_remote_sdp_port_set(void * jarg1, unsigned short jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_port_t arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (switch_port_t)jarg2;
|
||||
if (arg1) (arg1)->remote_sdp_port = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned short SWIGSTDCALL CSharp_payload_map_t_remote_sdp_port_get(void * jarg1) {
|
||||
unsigned short jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
switch_port_t result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (switch_port_t) ((arg1)->remote_sdp_port);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_channels_set(void * jarg1, int jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
int arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
if (arg1) (arg1)->channels = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_payload_map_t_channels_get(void * jarg1) {
|
||||
int jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (int) ((arg1)->channels);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_adv_channels_set(void * jarg1, int jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
int arg2 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
if (arg1) (arg1)->adv_channels = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_payload_map_t_adv_channels_get(void * jarg1) {
|
||||
int jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (int) ((arg1)->adv_channels);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_payload_map_t_next_set(void * jarg1, void * jarg2) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
payload_map_s *arg2 = (payload_map_s *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
arg2 = (payload_map_s *)jarg2;
|
||||
if (arg1) (arg1)->next = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_payload_map_t_next_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
payload_map_s *result = 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
result = (payload_map_s *) ((arg1)->next);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_payload_map_t() {
|
||||
void * jresult ;
|
||||
payload_map_s *result = 0 ;
|
||||
|
||||
result = (payload_map_s *)new payload_map_s();
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_payload_map_t(void * jarg1) {
|
||||
payload_map_s *arg1 = (payload_map_s *) 0 ;
|
||||
|
||||
arg1 = (payload_map_s *)jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_db_close(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_core_db_t *arg1 = (switch_core_db_t *) 0 ;
|
||||
@ -11324,17 +11910,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_recv_dtmf(void * jarg1, vo
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_hash_init_case(void * jarg1, void * jarg2, int jarg3) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_hash_init_case(void * jarg1, int jarg2) {
|
||||
int jresult ;
|
||||
switch_hash_t **arg1 = (switch_hash_t **) 0 ;
|
||||
switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ;
|
||||
switch_bool_t arg3 ;
|
||||
switch_bool_t arg2 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_hash_t **)jarg1;
|
||||
arg2 = (switch_memory_pool_t *)jarg2;
|
||||
arg3 = (switch_bool_t)jarg3;
|
||||
result = (switch_status_t)switch_core_hash_init_case(arg1,arg2,arg3);
|
||||
arg2 = (switch_bool_t)jarg2;
|
||||
result = (switch_status_t)switch_core_hash_init_case(arg1,arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
@ -11550,46 +12134,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_hash_this(void * jarg1, void * ja
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_hash_first(char * jarg1, void * jarg2) {
|
||||
void * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
switch_hash_t *arg2 = (switch_hash_t *) 0 ;
|
||||
switch_hash_index_t *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (switch_hash_t *)jarg2;
|
||||
result = (switch_hash_index_t *)switch_hash_first(arg1,arg2);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_hash_next(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_hash_index_t *arg1 = (switch_hash_index_t *) 0 ;
|
||||
switch_hash_index_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_hash_index_t *)jarg1;
|
||||
result = (switch_hash_index_t *)switch_hash_next(arg1);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_hash_this(void * jarg1, void * jarg2, void * jarg3, void * jarg4) {
|
||||
switch_hash_index_t *arg1 = (switch_hash_index_t *) 0 ;
|
||||
void **arg2 = (void **) 0 ;
|
||||
switch_ssize_t *arg3 = (switch_ssize_t *) 0 ;
|
||||
void **arg4 = (void **) 0 ;
|
||||
|
||||
arg1 = (switch_hash_index_t *)jarg1;
|
||||
arg2 = (void **)jarg2;
|
||||
arg3 = (switch_ssize_t *)jarg3;
|
||||
arg4 = (void **)jarg4;
|
||||
switch_hash_this(arg1,(void const **)arg2,arg3,arg4);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_timer_init(void * jarg1, char * jarg2, int jarg3, int jarg4, void * jarg5) {
|
||||
int jresult ;
|
||||
switch_timer_t *arg1 = (switch_timer_t *) 0 ;
|
||||
@ -35780,26 +36324,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get() {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_KEY_LEN_get() {
|
||||
int jresult ;
|
||||
int result;
|
||||
|
||||
result = (int)(30);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_RTP_CRYPTO_KEY_32_get() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)("AES_CM_128_HMAC_SHA1_32");
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_RTP_CRYPTO_KEY_80_get() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
@ -35810,6 +36334,98 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_RTP_CRYPTO_KEY_80_get() {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_name_set(void * jarg1, char * jarg2) {
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
delete [] arg1->name;
|
||||
if (arg2) {
|
||||
arg1->name = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->name, (const char *)arg2);
|
||||
} else {
|
||||
arg1->name = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_name_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
result = (char *) ((arg1)->name);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_type_set(void * jarg1, int jarg2) {
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
switch_rtp_crypto_key_type_t arg2 ;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
arg2 = (switch_rtp_crypto_key_type_t)jarg2;
|
||||
if (arg1) (arg1)->type = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_type_get(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
switch_rtp_crypto_key_type_t result;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
result = (switch_rtp_crypto_key_type_t) ((arg1)->type);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_keylen_set(void * jarg1, int jarg2) {
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
int arg2 ;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
if (arg1) (arg1)->keylen = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_keylen_get(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
result = (int) ((arg1)->keylen);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_srtp_crypto_suite_t() {
|
||||
void * jresult ;
|
||||
switch_srtp_crypto_suite_s *result = 0 ;
|
||||
|
||||
result = (switch_srtp_crypto_suite_s *)new switch_srtp_crypto_suite_s();
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_srtp_crypto_suite_t(void * jarg1) {
|
||||
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
|
||||
|
||||
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_crypto_key_index_set(void * jarg1, unsigned long jarg2) {
|
||||
switch_rtp_crypto_key *arg1 = (switch_rtp_crypto_key *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
@ -36807,7 +37423,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_destroy(void * jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_ice(void * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, int jarg6, void * jarg7, void * jarg8) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_ice(void * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, int jarg6, int jarg7, void * jarg8) {
|
||||
int jresult ;
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@ -36817,7 +37433,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_ice(void * jarg1, char * j
|
||||
ice_proto_t arg6 ;
|
||||
switch_core_media_ice_type_t arg7 ;
|
||||
ice_t *arg8 = (ice_t *) 0 ;
|
||||
switch_core_media_ice_type_t *argp7 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_rtp_t *)jarg1;
|
||||
@ -36826,12 +37441,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_ice(void * jarg1, char * j
|
||||
arg4 = (char *)jarg4;
|
||||
arg5 = (char *)jarg5;
|
||||
arg6 = (ice_proto_t)jarg6;
|
||||
argp7 = (switch_core_media_ice_type_t *)jarg7;
|
||||
if (!argp7) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_core_media_ice_type_t", 0);
|
||||
return 0;
|
||||
}
|
||||
arg7 = *argp7;
|
||||
arg7 = (switch_core_media_ice_type_t)jarg7;
|
||||
arg8 = (ice_t *)jarg8;
|
||||
result = (switch_status_t)switch_rtp_activate_ice(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,arg6,arg7,arg8);
|
||||
jresult = result;
|
||||
|
@ -2147,20 +2147,20 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_core_hash_this(SWIGTYPE_p_HashElem.getCPtr(hi), SWIGTYPE_p_p_void.getCPtr(key), SWIGTYPE_p_switch_ssize_t.getCPtr(klen), SWIGTYPE_p_p_void.getCPtr(val));
|
||||
}
|
||||
|
||||
public static SWIGTYPE_p_HashElem switch_hash_first(string deprecate_me, SWIGTYPE_p_switch_hash hash) {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_hash_first(deprecate_me, SWIGTYPE_p_switch_hash.getCPtr(hash));
|
||||
public static SWIGTYPE_p_HashElem switch_core_hash_first(string deprecate_me, SWIGTYPE_p_switch_hash hash) {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_first(deprecate_me, SWIGTYPE_p_switch_hash.getCPtr(hash));
|
||||
SWIGTYPE_p_HashElem ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_HashElem(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static SWIGTYPE_p_HashElem switch_hash_next(SWIGTYPE_p_HashElem hi) {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_hash_next(SWIGTYPE_p_HashElem.getCPtr(hi));
|
||||
public static SWIGTYPE_p_HashElem switch_core_hash_next(SWIGTYPE_p_HashElem hi) {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_next(SWIGTYPE_p_HashElem.getCPtr(hi));
|
||||
SWIGTYPE_p_HashElem ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_HashElem(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_hash_this(SWIGTYPE_p_HashElem hi, SWIGTYPE_p_p_void key, SWIGTYPE_p_switch_ssize_t klen, SWIGTYPE_p_p_void val) {
|
||||
freeswitchPINVOKE.switch_hash_this(SWIGTYPE_p_HashElem.getCPtr(hi), SWIGTYPE_p_p_void.getCPtr(key), SWIGTYPE_p_switch_ssize_t.getCPtr(klen), SWIGTYPE_p_p_void.getCPtr(val));
|
||||
public static void switch_core_hash_this(SWIGTYPE_p_HashElem hi, SWIGTYPE_p_p_void key, SWIGTYPE_p_switch_ssize_t klen, SWIGTYPE_p_p_void val) {
|
||||
freeswitchPINVOKE.switch_core_hash_this(SWIGTYPE_p_HashElem.getCPtr(hi), SWIGTYPE_p_p_void.getCPtr(key), SWIGTYPE_p_switch_ssize_t.getCPtr(klen), SWIGTYPE_p_p_void.getCPtr(val));
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_timer_init(switch_timer timer, string timer_name, int interval, int samples, SWIGTYPE_p_apr_pool_t pool) {
|
||||
@ -10171,14 +10171,14 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_hash_this")]
|
||||
public static extern void switch_core_hash_this(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_hash_first")]
|
||||
public static extern IntPtr switch_hash_first(string jarg1, HandleRef jarg2);
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_hash_first")]
|
||||
public static extern IntPtr switch_core_hash_first(string jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_hash_next")]
|
||||
public static extern IntPtr switch_hash_next(HandleRef jarg1);
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_hash_next")]
|
||||
public static extern IntPtr switch_core_hash_next(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_hash_this")]
|
||||
public static extern void switch_hash_this(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_hash_this")]
|
||||
public static extern void switch_core_hash_this(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_timer_init")]
|
||||
public static extern int switch_core_timer_init(HandleRef jarg1, string jarg2, int jarg3, int jarg4, HandleRef jarg5);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1040,8 +1040,8 @@ static switch_status_t load_modules(void)
|
||||
memset(&module_manager, 0, sizeof(module_manager));
|
||||
switch_core_new_memory_pool(&module_manager.pool);
|
||||
|
||||
switch_core_hash_init(&module_manager.mod_hash, module_manager.pool);
|
||||
switch_core_hash_init(&module_manager.load_hash, module_manager.pool);
|
||||
switch_core_hash_init(&module_manager.mod_hash);
|
||||
switch_core_hash_init(&module_manager.load_hash);
|
||||
|
||||
if ((xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
||||
switch_xml_t mods, ld;
|
||||
|
@ -269,7 +269,7 @@ static switch_status_t load_modules(void)
|
||||
|
||||
switch_core_new_memory_pool(&module_manager.pool);
|
||||
|
||||
switch_core_hash_init(&module_manager.load_hash, module_manager.pool);
|
||||
switch_core_hash_init(&module_manager.load_hash);
|
||||
|
||||
if ((xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
||||
switch_xml_t mods, ld;
|
||||
|
@ -77,7 +77,7 @@ void FSEventHandler::Init()
|
||||
}
|
||||
|
||||
switch_mutex_init(&_mutex, SWITCH_MUTEX_NESTED, _pool);
|
||||
switch_core_hash_init(&_event_hash, _pool);
|
||||
switch_core_hash_init(&_event_hash);
|
||||
switch_queue_create(&_event_queue, MAX_QUEUE_LEN, _pool);
|
||||
|
||||
_filters = NULL;
|
||||
|
@ -77,7 +77,7 @@ void FSXML::InitRootObject()
|
||||
{
|
||||
/* Create hash and pool - for the root object only */
|
||||
if (switch_core_new_memory_pool(&_pool) == SWITCH_STATUS_SUCCESS && _pool) {
|
||||
if (switch_core_hash_init(&_obj_hash, _pool) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_init(&_obj_hash) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_core_destroy_memory_pool(&_pool);
|
||||
_obj_hash = NULL;
|
||||
_pool = NULL;
|
||||
@ -198,12 +198,12 @@ void FSXML::DestroyHash()
|
||||
}
|
||||
|
||||
/* First destroy all objects in the hash */
|
||||
for (hi = switch_hash_first(NULL, tmp); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( tmp); hi; hi = switch_core_hash_next(hi)) {
|
||||
const void *var = NULL;
|
||||
void *val = NULL;
|
||||
FSXML *obj;
|
||||
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
|
||||
if (val) {
|
||||
obj = static_cast<FSXML *>(val);
|
||||
|
@ -107,7 +107,7 @@ static switch_status_t config_logger(void)
|
||||
switch_core_hash_destroy(&log_hash);
|
||||
}
|
||||
|
||||
switch_core_hash_init(&log_hash, module_pool);
|
||||
switch_core_hash_init(&log_hash);
|
||||
|
||||
if ((settings = switch_xml_child(cfg, "mappings"))) {
|
||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
||||
|
@ -264,11 +264,11 @@ static switch_status_t process_node(const switch_log_node_t *node, switch_log_le
|
||||
const void *var;
|
||||
logfile_profile_t *profile;
|
||||
|
||||
for (hi = switch_hash_first(NULL, profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
size_t mask = 0;
|
||||
size_t ok = 0;
|
||||
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
profile = val;
|
||||
|
||||
ok = switch_log_check_mask(profile->all_level, level);
|
||||
@ -321,7 +321,7 @@ static switch_status_t load_profile(switch_xml_t xml)
|
||||
|
||||
new_profile = switch_core_alloc(module_pool, sizeof(*new_profile));
|
||||
memset(new_profile, 0, sizeof(*new_profile));
|
||||
switch_core_hash_init(&(new_profile->log_hash), module_pool);
|
||||
switch_core_hash_init(&(new_profile->log_hash));
|
||||
new_profile->name = switch_core_strdup(module_pool, switch_str_nil(name));
|
||||
|
||||
new_profile->suffix = 1;
|
||||
@ -380,15 +380,15 @@ static void event_handler(switch_event_t *event)
|
||||
|
||||
if (sig && !strcmp(sig, "HUP")) {
|
||||
if (globals.rotate) {
|
||||
for (hi = switch_hash_first(NULL, profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
profile = val;
|
||||
mod_logfile_rotate(profile);
|
||||
}
|
||||
} else {
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
profile = val;
|
||||
switch_file_close(profile->log_afd);
|
||||
if (mod_logfile_openlogfile(profile, SWITCH_TRUE) != SWITCH_STATUS_SUCCESS) {
|
||||
@ -413,7 +413,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_logfile_load)
|
||||
if (profile_hash) {
|
||||
switch_core_hash_destroy(&profile_hash);
|
||||
}
|
||||
switch_core_hash_init(&profile_hash, module_pool);
|
||||
switch_core_hash_init(&profile_hash);
|
||||
|
||||
if (switch_event_bind_removable(modname, SWITCH_EVENT_TRAP, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
|
||||
@ -461,9 +461,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_logfile_shutdown)
|
||||
switch_log_unbind_logger(mod_logfile_logger);
|
||||
switch_event_unbind(&globals.node);
|
||||
|
||||
for (hi = switch_hash_first(NULL, profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
logfile_profile_t *profile;
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((profile = (logfile_profile_t *) val)) {
|
||||
switch_file_close(profile->log_afd);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Closing %s\n", profile->logfile);
|
||||
|
@ -432,7 +432,7 @@ static switch_status_t do_config(void)
|
||||
use_dynamic_url = 1;
|
||||
} else if (!strcasecmp(var, "enable-post-var")) {
|
||||
if (!vars_map && need_vars_map == 0) {
|
||||
if (switch_core_hash_init(&vars_map, globals.pool) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_init(&vars_map) != SWITCH_STATUS_SUCCESS) {
|
||||
need_vars_map = -1;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't init params hash!\n");
|
||||
continue;
|
||||
|
@ -1196,8 +1196,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
|
||||
|
||||
MIMETypeInit();
|
||||
|
||||
for (hi = switch_core_mime_index(); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_mime_index(); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if (var && val) {
|
||||
MIMETypeAdd((char *) val, (char *) var);
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ static switch_status_t do_config(void)
|
||||
}
|
||||
} else if (!strcasecmp(var, "enable-post-var")) {
|
||||
if (!vars_map && need_vars_map == 0) {
|
||||
if (switch_core_hash_init(&vars_map, globals.pool) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_init(&vars_map) != SWITCH_STATUS_SUCCESS) {
|
||||
need_vars_map = -1;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't init params hash!\n");
|
||||
continue;
|
||||
|
@ -416,7 +416,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
|
||||
|
||||
switch_event_create_plain(&(*channel)->variables, SWITCH_EVENT_CHANNEL_DATA);
|
||||
|
||||
switch_core_hash_init(&(*channel)->private_hash, pool);
|
||||
switch_core_hash_init(&(*channel)->private_hash);
|
||||
switch_queue_create(&(*channel)->dtmf_queue, SWITCH_DTMF_LOG_LEN, pool);
|
||||
switch_queue_create(&(*channel)->dtmf_log_queue, SWITCH_DTMF_LOG_LEN, pool);
|
||||
|
||||
@ -1862,7 +1862,7 @@ SWITCH_DECLARE(void) switch_channel_set_app_flag_key(const char *key, switch_cha
|
||||
switch_mutex_lock(channel->flag_mutex);
|
||||
|
||||
if (!channel->app_flag_hash) {
|
||||
switch_core_hash_init(&channel->app_flag_hash, switch_core_session_get_pool(channel->session));
|
||||
switch_core_hash_init(&channel->app_flag_hash);
|
||||
new++;
|
||||
}
|
||||
|
||||
@ -4686,7 +4686,7 @@ SWITCH_DECLARE(void) switch_channel_global_init(switch_memory_pool_t *pool)
|
||||
globals.pool = pool;
|
||||
|
||||
switch_mutex_init(&globals.device_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&globals.device_hash, globals.pool);
|
||||
switch_core_hash_init(&globals.device_hash);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_global_uninit(void)
|
||||
|
@ -1660,7 +1660,7 @@ static struct {
|
||||
SWITCH_DECLARE(switch_status_t) switch_console_init(switch_memory_pool_t *pool)
|
||||
{
|
||||
switch_mutex_init(&globals.func_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&globals.func_hash, pool);
|
||||
switch_core_hash_init(&globals.func_hash);
|
||||
switch_console_add_complete_func("::console::list_available_modules", (switch_console_complete_callback_t) switch_console_list_available_modules);
|
||||
switch_console_add_complete_func("::console::list_loaded_modules", (switch_console_complete_callback_t) switch_console_list_loaded_modules);
|
||||
switch_console_add_complete_func("::console::list_interfaces", (switch_console_complete_callback_t) switch_console_list_interfaces);
|
||||
|
@ -1022,7 +1022,7 @@ SWITCH_DECLARE(const char *) switch_core_mime_ext2type(const char *ext)
|
||||
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_core_mime_index(void)
|
||||
{
|
||||
return switch_hash_first(NULL, runtime.mime_types);
|
||||
return switch_core_hash_first( runtime.mime_types);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_mime_add_type(const char *type, const char *ext)
|
||||
@ -1250,7 +1250,7 @@ SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload)
|
||||
|
||||
memset(&IP_LIST, 0, sizeof(IP_LIST));
|
||||
switch_core_new_memory_pool(&IP_LIST.pool);
|
||||
switch_core_hash_init(&IP_LIST.hash, IP_LIST.pool);
|
||||
switch_core_hash_init(&IP_LIST.hash);
|
||||
|
||||
|
||||
tmp_name = "rfc1918.auto";
|
||||
@ -1646,8 +1646,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
switch_core_set_globals();
|
||||
switch_core_session_init(runtime.memory_pool);
|
||||
switch_event_create_plain(&runtime.global_vars, SWITCH_EVENT_CHANNEL_DATA);
|
||||
switch_core_hash_init(&runtime.mime_types, runtime.memory_pool);
|
||||
switch_core_hash_init_case(&runtime.ptimes, runtime.memory_pool, SWITCH_FALSE);
|
||||
switch_core_hash_init(&runtime.mime_types);
|
||||
switch_core_hash_init_case(&runtime.ptimes, SWITCH_FALSE);
|
||||
load_mime_types();
|
||||
runtime.flags |= flags;
|
||||
runtime.sps_total = 30;
|
||||
|
@ -34,50 +34,27 @@
|
||||
|
||||
#include <switch.h>
|
||||
#include "private/switch_core_pvt.h"
|
||||
#include <sqlite3.h>
|
||||
#include "../../../libs/sqlite/src/hash.h"
|
||||
#include "private/switch_hashtable_private.h"
|
||||
|
||||
struct switch_hash {
|
||||
Hash table;
|
||||
switch_memory_pool_t *pool;
|
||||
};
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(switch_hash_t **hash, switch_memory_pool_t *pool, switch_bool_t case_sensitive)
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(switch_hash_t **hash, switch_bool_t case_sensitive)
|
||||
{
|
||||
switch_hash_t *newhash;
|
||||
|
||||
if (pool) {
|
||||
newhash = switch_core_alloc(pool, sizeof(*newhash));
|
||||
newhash->pool = pool;
|
||||
} else {
|
||||
switch_zmalloc(newhash, sizeof(*newhash));
|
||||
}
|
||||
|
||||
switch_assert(newhash);
|
||||
|
||||
sqlite3HashInit(&newhash->table, case_sensitive ? SQLITE_HASH_BINARY : SQLITE_HASH_STRING, 1);
|
||||
*hash = newhash;
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
return switch_create_hashtable(hash, 16, case_sensitive ? switch_hash_default : switch_hash_default_ci, switch_hash_equalkeys);
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(switch_hash_t **hash)
|
||||
{
|
||||
switch_assert(hash != NULL && *hash != NULL);
|
||||
sqlite3HashClear(&(*hash)->table);
|
||||
|
||||
if (!(*hash)->pool) {
|
||||
free(*hash);
|
||||
}
|
||||
|
||||
*hash = NULL;
|
||||
switch_hashtable_destroy(hash);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert(switch_hash_t *hash, const char *key, const void *data)
|
||||
{
|
||||
sqlite3HashInsert(&hash->table, key, (int) strlen(key) + 1, (void *) data);
|
||||
switch_hashtable_insert(hash, strdup(key), (void *)data, HASHTABLE_FLAG_FREE_KEY);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -87,7 +64,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_locked(switch_hash_t *ha
|
||||
switch_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
sqlite3HashInsert(&hash->table, key, (int) strlen(key) + 1, (void *) data);
|
||||
switch_core_hash_insert(hash, key, data);
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_unlock(mutex);
|
||||
@ -102,7 +79,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_wrlock(switch_hash_t *ha
|
||||
switch_thread_rwlock_wrlock(rwlock);
|
||||
}
|
||||
|
||||
sqlite3HashInsert(&hash->table, key, (int) strlen(key) + 1, (void *) data);
|
||||
switch_core_hash_insert(hash, key, data);
|
||||
|
||||
if (rwlock) {
|
||||
switch_thread_rwlock_unlock(rwlock);
|
||||
@ -113,7 +90,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_wrlock(switch_hash_t *ha
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_delete(switch_hash_t *hash, const char *key)
|
||||
{
|
||||
sqlite3HashInsert(&hash->table, key, (int) strlen(key) + 1, NULL);
|
||||
switch_hashtable_remove(hash, (void *)key);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -123,7 +101,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_locked(switch_hash_t *ha
|
||||
switch_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
sqlite3HashInsert(&hash->table, key, (int) strlen(key) + 1, NULL);
|
||||
switch_core_hash_delete(hash, key);
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_unlock(mutex);
|
||||
@ -138,7 +116,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_wrlock(switch_hash_t *ha
|
||||
switch_thread_rwlock_wrlock(rwlock);
|
||||
}
|
||||
|
||||
sqlite3HashInsert(&hash->table, key, (int) strlen(key) + 1, NULL);
|
||||
switch_core_hash_delete(hash, key);
|
||||
|
||||
if (rwlock) {
|
||||
switch_thread_rwlock_unlock(rwlock);
|
||||
@ -161,10 +139,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
|
||||
When done, iterate through the list deleting hash entries
|
||||
*/
|
||||
|
||||
for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first(hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
if (!callback || callback(key, val, pData)) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delete", (const char *) key);
|
||||
}
|
||||
@ -185,7 +163,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
|
||||
|
||||
SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, const char *key)
|
||||
{
|
||||
return sqlite3HashFind(&hash->table, key, (int) strlen(key) + 1);
|
||||
return switch_hashtable_search(hash, (void *)key);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void *) switch_core_hash_find_locked(switch_hash_t *hash, const char *key, switch_mutex_t *mutex)
|
||||
@ -196,7 +174,8 @@ SWITCH_DECLARE(void *) switch_core_hash_find_locked(switch_hash_t *hash, const c
|
||||
switch_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
val = sqlite3HashFind(&hash->table, key, (int) strlen(key) + 1);
|
||||
val = switch_core_hash_find(hash, key);
|
||||
|
||||
|
||||
if (mutex) {
|
||||
switch_mutex_unlock(mutex);
|
||||
@ -213,7 +192,7 @@ SWITCH_DECLARE(void *) switch_core_hash_find_rdlock(switch_hash_t *hash, const c
|
||||
switch_thread_rwlock_rdlock(rwlock);
|
||||
}
|
||||
|
||||
val = sqlite3HashFind(&hash->table, key, (int) strlen(key) + 1);
|
||||
val = switch_core_hash_find(hash, key);
|
||||
|
||||
if (rwlock) {
|
||||
switch_thread_rwlock_unlock(rwlock);
|
||||
@ -224,44 +203,19 @@ SWITCH_DECLARE(void *) switch_core_hash_find_rdlock(switch_hash_t *hash, const c
|
||||
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_first(switch_hash_t *hash)
|
||||
{
|
||||
return (switch_hash_index_t *) sqliteHashFirst(&hash->table);
|
||||
return switch_hashtable_first(hash);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(switch_hash_index_t *hi)
|
||||
{
|
||||
return (switch_hash_index_t *) sqliteHashNext((HashElem *) hi);
|
||||
return switch_hashtable_next(hi);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_hash_this(switch_hash_index_t *hi, const void **key, switch_ssize_t *klen, void **val)
|
||||
{
|
||||
if (key) {
|
||||
*key = sqliteHashKey((HashElem *) hi);
|
||||
if (klen) {
|
||||
*klen = strlen((char *) *key) + 1;
|
||||
}
|
||||
}
|
||||
if (val) {
|
||||
*val = sqliteHashData((HashElem *) hi);
|
||||
}
|
||||
switch_hashtable_this(hi, key, klen, val);
|
||||
}
|
||||
|
||||
/* Deprecated */
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(char *deprecate_me, switch_hash_t *hash)
|
||||
{
|
||||
return switch_core_hash_first(hash);
|
||||
}
|
||||
|
||||
/* Deprecated */
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *hi)
|
||||
{
|
||||
return switch_core_hash_next(hi);
|
||||
}
|
||||
|
||||
/* Deprecated */
|
||||
SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t *hi, const void **key, switch_ssize_t *klen, void **val)
|
||||
{
|
||||
switch_core_hash_this(hi, key, klen, val);
|
||||
}
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
|
@ -222,8 +222,8 @@ SWITCH_DECLARE(uint32_t) switch_core_session_hupall_matching_var_ans(const char
|
||||
return r;
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if (val) {
|
||||
session = (switch_core_session_t *) val;
|
||||
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
|
||||
@ -275,8 +275,8 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_ma
|
||||
switch_core_new_memory_pool(&pool);
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if (val) {
|
||||
session = (switch_core_session_t *) val;
|
||||
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
|
||||
@ -319,8 +319,8 @@ SWITCH_DECLARE(void) switch_core_session_hupall_endpoint(const switch_endpoint_i
|
||||
switch_core_new_memory_pool(&pool);
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if (val) {
|
||||
session = (switch_core_session_t *) val;
|
||||
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
|
||||
@ -359,8 +359,8 @@ SWITCH_DECLARE(void) switch_core_session_hupall(switch_call_cause_t cause)
|
||||
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if (val) {
|
||||
session = (switch_core_session_t *) val;
|
||||
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
|
||||
@ -394,8 +394,8 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall(vo
|
||||
switch_console_callback_match_t *my_matches = NULL;
|
||||
|
||||
switch_mutex_lock(runtime.session_hash_mutex);
|
||||
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
if (val) {
|
||||
session = (switch_core_session_t *) val;
|
||||
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
|
||||
@ -2515,7 +2515,7 @@ void switch_core_session_init(switch_memory_pool_t *pool)
|
||||
session_manager.session_limit = 1000;
|
||||
session_manager.session_id = 1;
|
||||
session_manager.memory_pool = pool;
|
||||
switch_core_hash_init(&session_manager.session_table, session_manager.memory_pool);
|
||||
switch_core_hash_init(&session_manager.session_table);
|
||||
|
||||
if (switch_test_flag((&runtime), SCF_SESSION_THREAD_POOL)) {
|
||||
switch_threadattr_t *thd_attr;
|
||||
|
@ -576,9 +576,9 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (hi = switch_hash_first(NULL, CUSTOM_HASH); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first( CUSTOM_HASH); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_event_subclass_t *subclass;
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((subclass = (switch_event_subclass_t *) val)) {
|
||||
FREE(subclass->name);
|
||||
FREE(subclass->owner);
|
||||
@ -671,14 +671,14 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
|
||||
switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
||||
switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
||||
switch_mutex_init(&EVENT_QUEUE_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
||||
switch_core_hash_init(&CUSTOM_HASH, RUNTIME_POOL);
|
||||
switch_core_hash_init(&CUSTOM_HASH);
|
||||
|
||||
switch_core_hash_init(&event_channel_manager.lahash, RUNTIME_POOL);
|
||||
switch_core_hash_init(&event_channel_manager.lahash);
|
||||
switch_mutex_init(&event_channel_manager.lamutex, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
||||
|
||||
switch_thread_rwlock_create(&event_channel_manager.rwlock, RUNTIME_POOL);
|
||||
switch_core_hash_init(&event_channel_manager.hash, RUNTIME_POOL);
|
||||
switch_core_hash_init(&event_channel_manager.perm_hash, RUNTIME_POOL);
|
||||
switch_core_hash_init(&event_channel_manager.hash);
|
||||
switch_core_hash_init(&event_channel_manager.perm_hash);
|
||||
event_channel_manager.ID = 1;
|
||||
|
||||
switch_mutex_lock(EVENT_QUEUE_MUTEX);
|
||||
@ -2693,16 +2693,16 @@ static void unsub_all_switch_event_channel(void)
|
||||
|
||||
switch_thread_rwlock_wrlock(event_channel_manager.rwlock);
|
||||
|
||||
while ((hi = switch_hash_first(NULL, event_channel_manager.perm_hash))) {
|
||||
while ((hi = switch_core_hash_first( event_channel_manager.perm_hash))) {
|
||||
switch_event_t *vals = NULL;
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
vals = (switch_event_t *) val;
|
||||
switch_core_hash_delete(event_channel_manager.perm_hash, var);
|
||||
switch_event_destroy(&vals);
|
||||
}
|
||||
|
||||
while ((hi = switch_hash_first(NULL, event_channel_manager.hash))) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
while ((hi = switch_core_hash_first( event_channel_manager.hash))) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
head = (switch_event_channel_sub_node_head_t *) val;
|
||||
switch_event_channel_unsub_head(NULL, head);
|
||||
switch_core_hash_delete(event_channel_manager.hash, head->event_channel);
|
||||
@ -2724,8 +2724,8 @@ static uint32_t switch_event_channel_unsub_channel(switch_event_channel_func_t f
|
||||
switch_hash_index_t *hi;
|
||||
void *val;
|
||||
|
||||
for (hi = switch_hash_first(NULL, event_channel_manager.hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( event_channel_manager.hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
|
||||
if (val) {
|
||||
head = (switch_event_channel_sub_node_head_t *) val;
|
||||
@ -3357,7 +3357,7 @@ SWITCH_DECLARE(switch_status_t) switch_live_array_create(const char *event_chann
|
||||
la->key = key;
|
||||
la->new = SWITCH_TRUE;
|
||||
la->channel_id = channel_id;
|
||||
switch_core_hash_init(&la->hash, la->pool);
|
||||
switch_core_hash_init(&la->hash);
|
||||
switch_mutex_init(&la->mutex, SWITCH_MUTEX_NESTED, la->pool);
|
||||
|
||||
switch_mutex_lock(event_channel_manager.lamutex);
|
||||
|
@ -1930,7 +1930,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_new(switch_memory
|
||||
(*parser)->pool_auto_created = pool_auto_created;
|
||||
(*parser)->pool = pool;
|
||||
(*parser)->digit_timeout_ms = 1000;
|
||||
switch_core_hash_init(&(*parser)->hash, (*parser)->pool);
|
||||
switch_core_hash_init(&(*parser)->hash);
|
||||
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else {
|
||||
|
@ -146,7 +146,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_create(switch_ivr_dmachine_t
|
||||
dmachine->name = switch_core_strdup(dmachine->pool, name);
|
||||
switch_mutex_init(&dmachine->mutex, SWITCH_MUTEX_NESTED, dmachine->pool);
|
||||
|
||||
switch_core_hash_init(&dmachine->binding_hash, dmachine->pool);
|
||||
switch_core_hash_init(&dmachine->binding_hash);
|
||||
|
||||
if (match_callback) {
|
||||
dmachine->match_callback = match_callback;
|
||||
|
@ -2189,8 +2189,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||
}
|
||||
/*
|
||||
if ((hi = switch_channel_variable_first(caller_channel))) {
|
||||
for (; hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &vval);
|
||||
for (; hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &vval);
|
||||
if (vvar && vval) {
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (void *) vvar, (char *) vval);
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ static void switch_loadable_module_runtime(void)
|
||||
switch_loadable_module_t *module;
|
||||
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
module = (switch_loadable_module_t *) val;
|
||||
|
||||
if (module->switch_module_runtime) {
|
||||
@ -620,8 +620,8 @@ static switch_status_t do_chat_send(switch_event_t *message_event)
|
||||
|
||||
if (!switch_true(replying) && !switch_stristr("global", proto) && !switch_true(switch_event_get_header(message_event, "skip_global_process"))) {
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.chat_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( loadable_modules.chat_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
|
||||
if ((ci = (switch_chat_interface_t *) val)) {
|
||||
if (ci->chat_send && !strncasecmp(ci->interface_name, "GLOBAL_", 7)) {
|
||||
@ -1639,8 +1639,8 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_enumerate_loaded(switch_m
|
||||
switch_loadable_module_t *module;
|
||||
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
module = (switch_loadable_module_t *) val;
|
||||
|
||||
callback(user_data, module->module_interface->module_name);
|
||||
@ -1777,24 +1777,24 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autolo
|
||||
switch_loadable_module_path_init();
|
||||
#endif
|
||||
|
||||
switch_core_hash_init(&loadable_modules.module_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.endpoint_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.codec_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.timer_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.application_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.chat_application_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.api_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.json_api_hash, loadable_modules.pool);
|
||||
switch_core_hash_init(&loadable_modules.file_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.speech_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.asr_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.directory_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.chat_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.say_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.management_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.limit_hash, loadable_modules.pool);
|
||||
switch_core_hash_init_nocase(&loadable_modules.dialplan_hash, loadable_modules.pool);
|
||||
switch_core_hash_init(&loadable_modules.secondary_recover_hash, loadable_modules.pool);
|
||||
switch_core_hash_init(&loadable_modules.module_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.endpoint_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.codec_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.timer_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.application_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.chat_application_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.api_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.json_api_hash);
|
||||
switch_core_hash_init(&loadable_modules.file_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.speech_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.asr_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.directory_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.chat_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.say_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.management_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.limit_hash);
|
||||
switch_core_hash_init_nocase(&loadable_modules.dialplan_hash);
|
||||
switch_core_hash_init(&loadable_modules.secondary_recover_hash);
|
||||
switch_mutex_init(&loadable_modules.mutex, SWITCH_MUTEX_NESTED, loadable_modules.pool);
|
||||
|
||||
if (!autoload) return SWITCH_STATUS_SUCCESS;
|
||||
@ -1986,8 +1986,8 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
|
||||
}
|
||||
|
||||
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
module = (switch_loadable_module_t *) val;
|
||||
if (!module->perm) {
|
||||
do_shutdown(module, SWITCH_TRUE, SWITCH_FALSE, SWITCH_FALSE, NULL);
|
||||
@ -1996,8 +1996,8 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
|
||||
|
||||
switch_yield(1000000);
|
||||
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
module = (switch_loadable_module_t *) val;
|
||||
if (!module->perm) {
|
||||
do_shutdown(module, SWITCH_FALSE, SWITCH_TRUE, SWITCH_FALSE, NULL);
|
||||
@ -2196,8 +2196,8 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs(const switch_codec_impleme
|
||||
const switch_codec_implementation_t *imp;
|
||||
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.codec_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
for (hi = switch_core_hash_first( loadable_modules.codec_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
codec_interface = (switch_codec_interface_t *) val;
|
||||
|
||||
/* Look for the default ptime of the codec because it's the safest choice */
|
||||
|
@ -1356,7 +1356,7 @@ SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
|
||||
if (global_init) {
|
||||
return;
|
||||
}
|
||||
switch_core_hash_init(&alloc_hash, pool);
|
||||
switch_core_hash_init(&alloc_hash);
|
||||
#ifdef ENABLE_ZRTP
|
||||
if (zrtp_on) {
|
||||
uint32_t cache_len;
|
||||
@ -2022,8 +2022,8 @@ SWITCH_DECLARE(void) switch_rtp_shutdown(void)
|
||||
|
||||
switch_mutex_lock(port_lock);
|
||||
|
||||
for (hi = switch_hash_first(NULL, alloc_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
for (hi = switch_core_hash_first( alloc_hash); hi; hi = switch_core_hash_next(hi)) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
if ((alloc = (switch_core_port_allocator_t *) val)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroy port allocator for %s\n", (char *) var);
|
||||
switch_core_port_allocator_destroy(&alloc);
|
||||
|
@ -1342,7 +1342,7 @@ void switch_load_timezones(switch_bool_t reload)
|
||||
|
||||
memset(&TIMEZONES_LIST, 0, sizeof(TIMEZONES_LIST));
|
||||
switch_core_new_memory_pool(&TIMEZONES_LIST.pool);
|
||||
switch_core_hash_init(&TIMEZONES_LIST.hash, TIMEZONES_LIST.pool);
|
||||
switch_core_hash_init(&TIMEZONES_LIST.hash);
|
||||
|
||||
if ((xml = switch_xml_open_cfg("timezones.conf", &cfg, NULL))) {
|
||||
if ((x_lists = switch_xml_child(cfg, "timezones"))) {
|
||||
|
@ -1960,15 +1960,15 @@ SWITCH_DECLARE(uint32_t) switch_xml_clear_user_cache(const char *key, const char
|
||||
|
||||
} else {
|
||||
|
||||
while ((hi = switch_hash_first(NULL, CACHE_HASH))) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
while ((hi = switch_core_hash_first( CACHE_HASH))) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
switch_xml_free(val);
|
||||
switch_core_hash_delete(CACHE_HASH, var);
|
||||
r++;
|
||||
}
|
||||
|
||||
while ((hi = switch_hash_first(NULL, CACHE_EXPIRES_HASH))) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
while ((hi = switch_core_hash_first( CACHE_EXPIRES_HASH))) {
|
||||
switch_core_hash_this(hi, &var, NULL, &val);
|
||||
switch_safe_free(val);
|
||||
switch_core_hash_delete(CACHE_EXPIRES_HASH, var);
|
||||
}
|
||||
@ -2352,8 +2352,8 @@ SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, cons
|
||||
switch_mutex_init(&REFLOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL);
|
||||
switch_mutex_init(&FILE_LOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL);
|
||||
switch_mutex_init(&XML_GEN_LOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL);
|
||||
switch_core_hash_init(&CACHE_HASH, XML_MEMORY_POOL);
|
||||
switch_core_hash_init(&CACHE_EXPIRES_HASH, XML_MEMORY_POOL);
|
||||
switch_core_hash_init(&CACHE_HASH);
|
||||
switch_core_hash_init(&CACHE_EXPIRES_HASH);
|
||||
|
||||
switch_thread_rwlock_create(&B_RWLOCK, XML_MEMORY_POOL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user