diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c old mode 100755 new mode 100644 index f33720b25a..fa94ad7190 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -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); } diff --git a/patches/FS-2746.diff b/patches/FS-2746.diff index ce22bcfb57..28652625b7 100644 --- a/patches/FS-2746.diff +++ b/patches/FS-2746.diff @@ -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"); diff --git a/src/include/switch_apr.h b/src/include/switch_apr.h index dc6769d267..fee9ed1924 100644 --- a/src/include/switch_apr.h +++ b/src/include/switch_apr.h @@ -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); diff --git a/src/include/switch_core.h b/src/include/switch_core.h index db4c4f34ca..564694dbac 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -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); ///\} diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 338b4c4956..c373804c08 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -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; diff --git a/src/mod/applications/mod_blacklist/mod_blacklist.c b/src/mod/applications/mod_blacklist/mod_blacklist.c index 850be619af..f1a5b72a48 100644 --- a/src/mod/applications/mod_blacklist/mod_blacklist.c +++ b/src/mod/applications/mod_blacklist/mod_blacklist.c @@ -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); diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 3a357a10d9..44a675addb 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -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); diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 947415a7d8..f94547b7e9 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -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); diff --git a/src/mod/applications/mod_db/mod_db.c b/src/mod/applications/mod_db/mod_db.c index 46eee6b36d..0a5e9fe61d 100644 --- a/src/mod/applications/mod_db/mod_db.c +++ b/src/mod/applications/mod_db/mod_db.c @@ -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) { diff --git a/src/mod/applications/mod_directory/mod_directory.c b/src/mod/applications/mod_directory/mod_directory.c index 22768bcf5f..5a1d056881 100644 --- a/src/mod/applications/mod_directory/mod_directory.c +++ b/src/mod/applications/mod_directory/mod_directory.c @@ -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); diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c old mode 100755 new mode 100644 index 2311633c55..6dabb403b6 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -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 */ diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 7408c74444..e5eb2bf4f5 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -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); diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 5b5020181e..66c285730a 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -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); } diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 2c025b521c..b0f84737e4 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -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); diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.c b/src/mod/applications/mod_http_cache/mod_http_cache.c index 3648f97e80..fd003ade80 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.c +++ b/src/mod/applications/mod_http_cache/mod_http_cache.c @@ -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); diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index 37b3e431d7..042525a3dd 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -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); diff --git a/src/mod/applications/mod_redis/mod_redis.c b/src/mod/applications/mod_redis/mod_redis.c old mode 100755 new mode 100644 index b7038a6878..2d48075b42 --- a/src/mod/applications/mod_redis/mod_redis.c +++ b/src/mod/applications/mod_redis/mod_redis.c @@ -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); diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index 41d7212601..be7711aeb4 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -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"; diff --git a/src/mod/applications/mod_spy/mod_spy.c b/src/mod/applications/mod_spy/mod_spy.c index 80cacec402..b19b634a23 100644 --- a/src/mod/applications/mod_spy/mod_spy.c +++ b/src/mod/applications/mod_spy/mod_spy.c @@ -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; diff --git a/src/mod/applications/mod_translate/mod_translate.c b/src/mod/applications/mod_translate/mod_translate.c index 87f0a14e3d..469d0ba2d3 100644 --- a/src/mod/applications/mod_translate/mod_translate.c +++ b/src/mod/applications/mod_translate/mod_translate.c @@ -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(); diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index 2ead3186c9..a7947cf2c6 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -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, "\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, " \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 */ diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 7b19974bcb..bfc2fdd891 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -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); diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index 600ce37fe5..90faa63057 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -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); diff --git a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c index 416eb17b82..187732e25f 100644 --- a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c +++ b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c @@ -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); diff --git a/src/mod/endpoints/mod_alsa/mod_alsa.c b/src/mod/endpoints/mod_alsa/mod_alsa.c index 884b5da17c..61f2e38d97 100644 --- a/src/mod/endpoints/mod_alsa/mod_alsa.c +++ b/src/mod/endpoints/mod_alsa/mod_alsa.c @@ -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); diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index ab4e647032..4743a5c515 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -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); diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index 244129117c..4ded89dfcd 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -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)", diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.c b/src/mod/endpoints/mod_rtmp/mod_rtmp.c index 37ebdd27f5..3e4d5c0bf8 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.c +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.c @@ -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; diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c index cebcec244d..5e9c67428c 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp.c @@ -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) { diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 9ca5362b78..2d243fdc02 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -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); diff --git a/src/mod/endpoints/mod_skinny/skinny_api.c b/src/mod/endpoints/mod_skinny/skinny_api.c index f4c9560352..e56c9a33a1 100644 --- a/src/mod/endpoints/mod_skinny/skinny_api.c +++ b/src/mod/endpoints/mod_skinny/skinny_api.c @@ -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); diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 3dd4977ec8..06925863f0 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -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, "\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, "\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); diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 413fe83d15..fe3dd14463 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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); diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 450b7e71d6..f2fec6254a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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) { diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 868bf5ff64..b00284df32 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -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' " diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 159f7c7520..4ebb4055b4 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -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 { diff --git a/src/mod/endpoints/mod_unicall/mod_unicall.c b/src/mod/endpoints/mod_unicall/mod_unicall.c index 35c3cde286..aecf967996 100644 --- a/src/mod/endpoints/mod_unicall/mod_unicall.c +++ b/src/mod/endpoints/mod_unicall/mod_unicall.c @@ -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); diff --git a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c index b6e08cf8fc..ae29aa4a13 100644 --- a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c +++ b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c @@ -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; diff --git a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c index c0c9bf58e1..b6ae8f762e 100644 --- a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c +++ b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c @@ -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; diff --git a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c index 44defd1805..63bd95622e 100644 --- a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c +++ b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.c @@ -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; diff --git a/src/mod/event_handlers/mod_erlang_event/handle_msg.c b/src/mod/event_handlers/mod_erlang_event/handle_msg.c index dfd2864eb3..46c745efee 100644 --- a/src/mod/event_handlers/mod_erlang_event/handle_msg.c +++ b/src/mod/event_handlers/mod_erlang_event/handle_msg.c @@ -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)) { diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c index 0113a0e593..12c5fe2b48 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c @@ -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); diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index 3c352b1942..9d85d941b8 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -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; diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index f8eb1fd337..3ad1b0c966 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -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); diff --git a/src/mod/event_handlers/mod_format_cdr/mod_format_cdr.c b/src/mod/event_handlers/mod_format_cdr/mod_format_cdr.c index df9688ee54..ca6dbe83a5 100644 --- a/src/mod/event_handlers/mod_format_cdr/mod_format_cdr.c +++ b/src/mod/event_handlers/mod_format_cdr/mod_format_cdr.c @@ -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 ) { diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index 8c47c7162c..f6ea6b717b 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -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 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); diff --git a/src/mod/event_handlers/mod_rayo/nlsml.c b/src/mod/event_handlers/mod_rayo/nlsml.c index b050565071..867b31b5c1 100644 --- a/src/mod/event_handlers/mod_rayo/nlsml.c +++ b/src/mod/event_handlers/mod_rayo/nlsml.c @@ -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"); diff --git a/src/mod/event_handlers/mod_rayo/rayo_cpa_component.c b/src/mod/event_handlers/mod_rayo/rayo_cpa_component.c index a73bb0daf8..c349e2df41 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_cpa_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_cpa_component.c @@ -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); diff --git a/src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c b/src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c index ed1d87d152..1f4cbb58ee 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c +++ b/src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c @@ -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; } diff --git a/src/mod/event_handlers/mod_rayo/rayo_input_component.c b/src/mod/event_handlers/mod_rayo/rayo_input_component.c index eda4db3591..dcd0999758 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_input_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_input_component.c @@ -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 = ""; diff --git a/src/mod/event_handlers/mod_rayo/rayo_output_component.c b/src/mod/event_handlers/mod_rayo/rayo_output_component.c index c713450fd1..25ca3d4545 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_output_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_output_component.c @@ -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"; diff --git a/src/mod/event_handlers/mod_rayo/srgs.c b/src/mod/event_handlers/mod_rayo/srgs.c index 86cf825635..111ff4ab18 100644 --- a/src/mod/event_handlers/mod_rayo/srgs.c +++ b/src/mod/event_handlers/mod_rayo/srgs.c @@ -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, ""); diff --git a/src/mod/event_handlers/mod_rayo/xmpp_streams.c b/src/mod/event_handlers/mod_rayo/xmpp_streams.c index 033fdb8fb4..d0317fdba6 100644 --- a/src/mod/event_handlers/mod_rayo/xmpp_streams.c +++ b/src/mod/event_handlers/mod_rayo/xmpp_streams.c @@ -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; } diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.c b/src/mod/formats/mod_local_stream/mod_local_stream.c index 6b72cb3f16..b75e69ec01 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -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; } diff --git a/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c b/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c index b5c8c5d878..005a9cbb6e 100644 --- a/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c +++ b/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c @@ -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 */ diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.c b/src/mod/formats/mod_sndfile/mod_sndfile.c index 6043115555..5d8d0865b5 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.c +++ b/src/mod/formats/mod_sndfile/mod_sndfile.c @@ -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; diff --git a/src/mod/formats/mod_ssml/mod_ssml.c b/src/mod/formats/mod_ssml/mod_ssml.c index ae2670a74c..eb227cbad4 100644 --- a/src/mod/formats/mod_ssml/mod_ssml.c +++ b/src/mod/formats/mod_ssml/mod_ssml.c @@ -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"); diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index ec672e735f..bf8fd2311b 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -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); } diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index af537fa7d9..30df93944b 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -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; diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index 04ccdce448..3875d6625f 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -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); diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index f164570914..fd76c84342 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -2068,99 +2068,83 @@ public class freeswitch { return ret; } - public static switch_status_t switch_core_hash_init_case(SWIGTYPE_p_p_switch_hash hash, SWIGTYPE_p_apr_pool_t pool, switch_bool_t case_sensitive) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_init_case(SWIGTYPE_p_p_switch_hash.getCPtr(hash), SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)case_sensitive); + public static switch_status_t switch_core_hash_init_case(SWIGTYPE_p_p_switch_hashtable hash, switch_bool_t case_sensitive) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_init_case(SWIGTYPE_p_p_switch_hashtable.getCPtr(hash), (int)case_sensitive); return ret; } - public static switch_status_t switch_core_hash_destroy(SWIGTYPE_p_p_switch_hash hash) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_destroy(SWIGTYPE_p_p_switch_hash.getCPtr(hash)); + public static switch_status_t switch_core_hash_destroy(SWIGTYPE_p_p_switch_hashtable hash) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_destroy(SWIGTYPE_p_p_switch_hashtable.getCPtr(hash)); return ret; } - public static switch_status_t switch_core_hash_insert(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_void data) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data)); + public static switch_status_t switch_core_hash_insert(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_void data) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data)); return ret; } - public static switch_status_t switch_core_hash_insert_locked(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_void data, SWIGTYPE_p_switch_mutex_t mutex) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert_locked(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data), SWIGTYPE_p_switch_mutex_t.getCPtr(mutex)); + public static switch_status_t switch_core_hash_insert_locked(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_void data, SWIGTYPE_p_switch_mutex_t mutex) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert_locked(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data), SWIGTYPE_p_switch_mutex_t.getCPtr(mutex)); return ret; } - public static switch_status_t switch_core_hash_insert_wrlock(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_void data, SWIGTYPE_p_switch_thread_rwlock_t rwlock) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert_wrlock(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data), SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(rwlock)); + public static switch_status_t switch_core_hash_insert_wrlock(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_void data, SWIGTYPE_p_switch_thread_rwlock_t rwlock) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert_wrlock(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data), SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(rwlock)); return ret; } - public static switch_status_t switch_core_hash_delete(SWIGTYPE_p_switch_hash hash, string key) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete(SWIGTYPE_p_switch_hash.getCPtr(hash), key); + public static switch_status_t switch_core_hash_delete(SWIGTYPE_p_switch_hashtable hash, string key) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key); return ret; } - public static switch_status_t switch_core_hash_delete_locked(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_switch_mutex_t mutex) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete_locked(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_switch_mutex_t.getCPtr(mutex)); + public static switch_status_t switch_core_hash_delete_locked(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_switch_mutex_t mutex) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete_locked(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_switch_mutex_t.getCPtr(mutex)); return ret; } - public static switch_status_t switch_core_hash_delete_wrlock(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_switch_thread_rwlock_t rwlock) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete_wrlock(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(rwlock)); + public static switch_status_t switch_core_hash_delete_wrlock(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_switch_thread_rwlock_t rwlock) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete_wrlock(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(rwlock)); return ret; } - public static switch_status_t switch_core_hash_delete_multi(SWIGTYPE_p_switch_hash hash, SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t callback, SWIGTYPE_p_void pData) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete_multi(SWIGTYPE_p_switch_hash.getCPtr(hash), SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t.getCPtr(callback), SWIGTYPE_p_void.getCPtr(pData)); + public static switch_status_t switch_core_hash_delete_multi(SWIGTYPE_p_switch_hashtable hash, SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t callback, SWIGTYPE_p_void pData) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_delete_multi(SWIGTYPE_p_switch_hashtable.getCPtr(hash), SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t.getCPtr(callback), SWIGTYPE_p_void.getCPtr(pData)); return ret; } - public static SWIGTYPE_p_void switch_core_hash_find(SWIGTYPE_p_switch_hash hash, string key) { - IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_find(SWIGTYPE_p_switch_hash.getCPtr(hash), key); + public static SWIGTYPE_p_void switch_core_hash_find(SWIGTYPE_p_switch_hashtable hash, string key) { + IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_find(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key); SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); return ret; } - public static SWIGTYPE_p_void switch_core_hash_find_locked(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_switch_mutex_t mutex) { - IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_find_locked(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_switch_mutex_t.getCPtr(mutex)); + public static SWIGTYPE_p_void switch_core_hash_find_locked(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_switch_mutex_t mutex) { + IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_find_locked(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_switch_mutex_t.getCPtr(mutex)); SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); return ret; } - public static SWIGTYPE_p_void switch_core_hash_find_rdlock(SWIGTYPE_p_switch_hash hash, string key, SWIGTYPE_p_switch_thread_rwlock_t rwlock) { - IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_find_rdlock(SWIGTYPE_p_switch_hash.getCPtr(hash), key, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(rwlock)); + public static SWIGTYPE_p_void switch_core_hash_find_rdlock(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_switch_thread_rwlock_t rwlock) { + IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_find_rdlock(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(rwlock)); SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); return ret; } - public static SWIGTYPE_p_HashElem switch_core_hash_first(SWIGTYPE_p_switch_hash hash) { - IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_first(SWIGTYPE_p_switch_hash.getCPtr(hash)); - SWIGTYPE_p_HashElem ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_HashElem(cPtr, false); + public static SWIGTYPE_p_switch_hashtable_iterator switch_core_hash_first(SWIGTYPE_p_switch_hashtable hash) { + IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_first(SWIGTYPE_p_switch_hashtable.getCPtr(hash)); + SWIGTYPE_p_switch_hashtable_iterator ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_hashtable_iterator(cPtr, false); return ret; } - 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); + public static SWIGTYPE_p_switch_hashtable_iterator switch_core_hash_next(SWIGTYPE_p_switch_hashtable_iterator hi) { + IntPtr cPtr = freeswitchPINVOKE.switch_core_hash_next(SWIGTYPE_p_switch_hashtable_iterator.getCPtr(hi)); + SWIGTYPE_p_switch_hashtable_iterator ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_hashtable_iterator(cPtr, false); return ret; } - 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 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)); - 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)); - 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_switch_hashtable_iterator hi, SWIGTYPE_p_p_void key, SWIGTYPE_p_switch_ssize_t klen, SWIGTYPE_p_p_void val) { + freeswitchPINVOKE.switch_core_hash_this(SWIGTYPE_p_switch_hashtable_iterator.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) { @@ -2661,9 +2645,9 @@ public class freeswitch { return ret; } - public static SWIGTYPE_p_HashElem switch_core_mime_index() { + public static SWIGTYPE_p_switch_hashtable_iterator switch_core_mime_index() { IntPtr cPtr = freeswitchPINVOKE.switch_core_mime_index(); - SWIGTYPE_p_HashElem ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_HashElem(cPtr, false); + SWIGTYPE_p_switch_hashtable_iterator ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_hashtable_iterator(cPtr, false); return ret; } @@ -5087,8 +5071,8 @@ public class freeswitch { freeswitchPINVOKE.switch_event_deliver(SWIGTYPE_p_p_switch_event.getCPtr(arg0)); } - public static string switch_event_build_param_string(switch_event arg0, string prefix, SWIGTYPE_p_switch_hash vars_map) { - string ret = freeswitchPINVOKE.switch_event_build_param_string(switch_event.getCPtr(arg0), prefix, SWIGTYPE_p_switch_hash.getCPtr(vars_map)); + public static string switch_event_build_param_string(switch_event arg0, string prefix, SWIGTYPE_p_switch_hashtable vars_map) { + string ret = freeswitchPINVOKE.switch_event_build_param_string(switch_event.getCPtr(arg0), prefix, SWIGTYPE_p_switch_hashtable.getCPtr(vars_map)); return ret; } @@ -6120,9 +6104,8 @@ public class freeswitch { freeswitchPINVOKE.switch_rtp_destroy(SWIGTYPE_p_p_switch_rtp.getCPtr(rtp_session)); } - public static switch_status_t switch_rtp_activate_ice(SWIGTYPE_p_switch_rtp rtp_session, string login, string rlogin, string password, string rpassword, ice_proto_t proto, SWIGTYPE_p_switch_core_media_ice_type_t type, ice_t ice_params) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_ice(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), login, rlogin, password, rpassword, (int)proto, SWIGTYPE_p_switch_core_media_ice_type_t.getCPtr(type), ice_t.getCPtr(ice_params)); - if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + public static switch_status_t switch_rtp_activate_ice(SWIGTYPE_p_switch_rtp rtp_session, string login, string rlogin, string password, string rpassword, ice_proto_t proto, switch_core_media_ice_type_t type, ice_t ice_params) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_ice(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), login, rlogin, password, rpassword, (int)proto, (int)type, ice_t.getCPtr(ice_params)); return ret; } @@ -6297,8 +6280,8 @@ public class freeswitch { return ret; } - public static switch_status_t switch_rtp_set_payload_map(SWIGTYPE_p_switch_rtp rtp_session, SWIGTYPE_p_p_payload_map_t pmap) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_set_payload_map(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), SWIGTYPE_p_p_payload_map_t.getCPtr(pmap)); + public static switch_status_t switch_rtp_set_payload_map(SWIGTYPE_p_switch_rtp rtp_session, SWIGTYPE_p_p_payload_map_s pmap) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_set_payload_map(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), SWIGTYPE_p_p_payload_map_s.getCPtr(pmap)); return ret; } @@ -7113,8 +7096,6 @@ public class freeswitch { public static readonly int SWITCH_RTCP_MAX_BUF_LEN = freeswitchPINVOKE.SWITCH_RTCP_MAX_BUF_LEN_get(); public static readonly int SWITCH_RTP_MAX_BUF_LEN_WORDS = freeswitchPINVOKE.SWITCH_RTP_MAX_BUF_LEN_WORDS_get(); public static readonly int SWITCH_RTP_MAX_CRYPTO_LEN = freeswitchPINVOKE.SWITCH_RTP_MAX_CRYPTO_LEN_get(); - public static readonly int SWITCH_RTP_KEY_LEN = freeswitchPINVOKE.SWITCH_RTP_KEY_LEN_get(); - public static readonly string SWITCH_RTP_CRYPTO_KEY_32 = freeswitchPINVOKE.SWITCH_RTP_CRYPTO_KEY_32_get(); public static readonly string SWITCH_RTP_CRYPTO_KEY_80 = freeswitchPINVOKE.SWITCH_RTP_CRYPTO_KEY_80_get(); public static readonly int MAX_CAND = freeswitchPINVOKE.MAX_CAND_get(); public static readonly int SWITCH_XML_BUFSIZE = freeswitchPINVOKE.SWITCH_XML_BUFSIZE_get(); @@ -8765,6 +8746,156 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_loadable_module_function_table_t")] public static extern void delete_switch_loadable_module_function_table_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_type_set")] + public static extern void payload_map_t_type_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_type_get")] + public static extern int payload_map_t_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_sdp_type_set")] + public static extern void payload_map_t_sdp_type_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_sdp_type_get")] + public static extern int payload_map_t_sdp_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_ptime_set")] + public static extern void payload_map_t_ptime_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_ptime_get")] + public static extern uint payload_map_t_ptime_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rate_set")] + public static extern void payload_map_t_rate_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rate_get")] + public static extern uint payload_map_t_rate_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_allocated_set")] + public static extern void payload_map_t_allocated_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_allocated_get")] + public static extern byte payload_map_t_allocated_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_negotiated_set")] + public static extern void payload_map_t_negotiated_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_negotiated_get")] + public static extern byte payload_map_t_negotiated_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_current_set")] + public static extern void payload_map_t_current_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_current_get")] + public static extern byte payload_map_t_current_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_hash_set")] + public static extern void payload_map_t_hash_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_hash_get")] + public static extern uint payload_map_t_hash_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rm_encoding_set")] + public static extern void payload_map_t_rm_encoding_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rm_encoding_get")] + public static extern string payload_map_t_rm_encoding_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_iananame_set")] + public static extern void payload_map_t_iananame_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_iananame_get")] + public static extern string payload_map_t_iananame_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_pt_set")] + public static extern void payload_map_t_pt_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_pt_get")] + public static extern byte payload_map_t_pt_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rm_rate_set")] + public static extern void payload_map_t_rm_rate_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rm_rate_get")] + public static extern uint payload_map_t_rm_rate_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_adv_rm_rate_set")] + public static extern void payload_map_t_adv_rm_rate_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_adv_rm_rate_get")] + public static extern uint payload_map_t_adv_rm_rate_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_codec_ms_set")] + public static extern void payload_map_t_codec_ms_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_codec_ms_get")] + public static extern uint payload_map_t_codec_ms_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_bitrate_set")] + public static extern void payload_map_t_bitrate_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_bitrate_get")] + public static extern uint payload_map_t_bitrate_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rm_fmtp_set")] + public static extern void payload_map_t_rm_fmtp_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_rm_fmtp_get")] + public static extern string payload_map_t_rm_fmtp_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_agreed_pt_set")] + public static extern void payload_map_t_agreed_pt_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_agreed_pt_get")] + public static extern byte payload_map_t_agreed_pt_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_recv_pt_set")] + public static extern void payload_map_t_recv_pt_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_recv_pt_get")] + public static extern byte payload_map_t_recv_pt_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_fmtp_out_set")] + public static extern void payload_map_t_fmtp_out_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_fmtp_out_get")] + public static extern string payload_map_t_fmtp_out_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_remote_sdp_ip_set")] + public static extern void payload_map_t_remote_sdp_ip_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_remote_sdp_ip_get")] + public static extern string payload_map_t_remote_sdp_ip_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_remote_sdp_port_set")] + public static extern void payload_map_t_remote_sdp_port_set(HandleRef jarg1, ushort jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_remote_sdp_port_get")] + public static extern ushort payload_map_t_remote_sdp_port_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_channels_set")] + public static extern void payload_map_t_channels_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_channels_get")] + public static extern int payload_map_t_channels_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_adv_channels_set")] + public static extern void payload_map_t_adv_channels_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_adv_channels_get")] + public static extern int payload_map_t_adv_channels_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_next_set")] + public static extern void payload_map_t_next_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_payload_map_t_next_get")] + public static extern IntPtr payload_map_t_next_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_payload_map_t")] + public static extern IntPtr new_payload_map_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_payload_map_t")] + public static extern void delete_payload_map_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_db_close")] public static extern int switch_core_db_close(HandleRef jarg1); @@ -10131,7 +10262,7 @@ class freeswitchPINVOKE { public static extern int switch_core_session_recv_dtmf(HandleRef jarg1, HandleRef jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_hash_init_case")] - public static extern int switch_core_hash_init_case(HandleRef jarg1, HandleRef jarg2, int jarg3); + public static extern int switch_core_hash_init_case(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_hash_destroy")] public static extern int switch_core_hash_destroy(HandleRef jarg1); @@ -10175,15 +10306,6 @@ 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_hash_next")] - public static extern IntPtr switch_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_timer_init")] public static extern int switch_core_timer_init(HandleRef jarg1, string jarg2, int jarg3, int jarg4, HandleRef jarg5); @@ -15914,15 +16036,33 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get")] public static extern int SWITCH_RTP_MAX_CRYPTO_LEN_get(); - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_KEY_LEN_get")] - public static extern int SWITCH_RTP_KEY_LEN_get(); - - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_CRYPTO_KEY_32_get")] - public static extern string SWITCH_RTP_CRYPTO_KEY_32_get(); - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_CRYPTO_KEY_80_get")] public static extern string SWITCH_RTP_CRYPTO_KEY_80_get(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_name_set")] + public static extern void switch_srtp_crypto_suite_t_name_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_name_get")] + public static extern string switch_srtp_crypto_suite_t_name_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_type_set")] + public static extern void switch_srtp_crypto_suite_t_type_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_type_get")] + public static extern int switch_srtp_crypto_suite_t_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_keylen_set")] + public static extern void switch_srtp_crypto_suite_t_keylen_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_keylen_get")] + public static extern int switch_srtp_crypto_suite_t_keylen_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_srtp_crypto_suite_t")] + public static extern IntPtr new_switch_srtp_crypto_suite_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_srtp_crypto_suite_t")] + public static extern void delete_switch_srtp_crypto_suite_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_index_set")] public static extern void switch_rtp_crypto_key_index_set(HandleRef jarg1, uint jarg2); @@ -16155,7 +16295,7 @@ class freeswitchPINVOKE { public static extern void switch_rtp_destroy(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_ice")] - public static extern int switch_rtp_activate_ice(HandleRef jarg1, string jarg2, string jarg3, string jarg4, string jarg5, int jarg6, HandleRef jarg7, HandleRef jarg8); + public static extern int switch_rtp_activate_ice(HandleRef jarg1, string jarg2, string jarg3, string jarg4, string jarg5, int jarg6, int jarg7, HandleRef jarg8); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_rtcp")] public static extern int switch_rtp_activate_rtcp(HandleRef jarg1, int jarg2, ushort jarg3, int jarg4); @@ -18169,6 +18309,296 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class payload_map_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal payload_map_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(payload_map_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~payload_map_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_payload_map_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public switch_media_type_t type { + set { + freeswitchPINVOKE.payload_map_t_type_set(swigCPtr, (int)value); + } + get { + switch_media_type_t ret = (switch_media_type_t)freeswitchPINVOKE.payload_map_t_type_get(swigCPtr); + return ret; + } + } + + public switch_sdp_type_t sdp_type { + set { + freeswitchPINVOKE.payload_map_t_sdp_type_set(swigCPtr, (int)value); + } + get { + switch_sdp_type_t ret = (switch_sdp_type_t)freeswitchPINVOKE.payload_map_t_sdp_type_get(swigCPtr); + return ret; + } + } + + public uint ptime { + set { + freeswitchPINVOKE.payload_map_t_ptime_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_ptime_get(swigCPtr); + return ret; + } + } + + public uint rate { + set { + freeswitchPINVOKE.payload_map_t_rate_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_rate_get(swigCPtr); + return ret; + } + } + + public byte allocated { + set { + freeswitchPINVOKE.payload_map_t_allocated_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.payload_map_t_allocated_get(swigCPtr); + return ret; + } + } + + public byte negotiated { + set { + freeswitchPINVOKE.payload_map_t_negotiated_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.payload_map_t_negotiated_get(swigCPtr); + return ret; + } + } + + public byte current { + set { + freeswitchPINVOKE.payload_map_t_current_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.payload_map_t_current_get(swigCPtr); + return ret; + } + } + + public uint hash { + set { + freeswitchPINVOKE.payload_map_t_hash_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_hash_get(swigCPtr); + return ret; + } + } + + public string rm_encoding { + set { + freeswitchPINVOKE.payload_map_t_rm_encoding_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.payload_map_t_rm_encoding_get(swigCPtr); + return ret; + } + } + + public string iananame { + set { + freeswitchPINVOKE.payload_map_t_iananame_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.payload_map_t_iananame_get(swigCPtr); + return ret; + } + } + + public byte pt { + set { + freeswitchPINVOKE.payload_map_t_pt_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.payload_map_t_pt_get(swigCPtr); + return ret; + } + } + + public uint rm_rate { + set { + freeswitchPINVOKE.payload_map_t_rm_rate_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_rm_rate_get(swigCPtr); + return ret; + } + } + + public uint adv_rm_rate { + set { + freeswitchPINVOKE.payload_map_t_adv_rm_rate_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_adv_rm_rate_get(swigCPtr); + return ret; + } + } + + public uint codec_ms { + set { + freeswitchPINVOKE.payload_map_t_codec_ms_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_codec_ms_get(swigCPtr); + return ret; + } + } + + public uint bitrate { + set { + freeswitchPINVOKE.payload_map_t_bitrate_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.payload_map_t_bitrate_get(swigCPtr); + return ret; + } + } + + public string rm_fmtp { + set { + freeswitchPINVOKE.payload_map_t_rm_fmtp_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.payload_map_t_rm_fmtp_get(swigCPtr); + return ret; + } + } + + public byte agreed_pt { + set { + freeswitchPINVOKE.payload_map_t_agreed_pt_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.payload_map_t_agreed_pt_get(swigCPtr); + return ret; + } + } + + public byte recv_pt { + set { + freeswitchPINVOKE.payload_map_t_recv_pt_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.payload_map_t_recv_pt_get(swigCPtr); + return ret; + } + } + + public string fmtp_out { + set { + freeswitchPINVOKE.payload_map_t_fmtp_out_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.payload_map_t_fmtp_out_get(swigCPtr); + return ret; + } + } + + public string remote_sdp_ip { + set { + freeswitchPINVOKE.payload_map_t_remote_sdp_ip_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.payload_map_t_remote_sdp_ip_get(swigCPtr); + return ret; + } + } + + public ushort remote_sdp_port { + set { + freeswitchPINVOKE.payload_map_t_remote_sdp_port_set(swigCPtr, value); + } + get { + ushort ret = freeswitchPINVOKE.payload_map_t_remote_sdp_port_get(swigCPtr); + return ret; + } + } + + public int channels { + set { + freeswitchPINVOKE.payload_map_t_channels_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.payload_map_t_channels_get(swigCPtr); + return ret; + } + } + + public int adv_channels { + set { + freeswitchPINVOKE.payload_map_t_adv_channels_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.payload_map_t_adv_channels_get(swigCPtr); + return ret; + } + } + + public payload_map_t next { + set { + freeswitchPINVOKE.payload_map_t_next_set(swigCPtr, payload_map_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.payload_map_t_next_get(swigCPtr); + payload_map_t ret = (cPtr == IntPtr.Zero) ? null : new payload_map_t(cPtr, false); + return ret; + } + } + + public payload_map_t() : this(freeswitchPINVOKE.new_payload_map_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class profile_node_t : IDisposable { private HandleRef swigCPtr; protected bool swigCMemOwn; @@ -21237,36 +21667,6 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_HashElem { - private HandleRef swigCPtr; - - internal SWIGTYPE_p_HashElem(IntPtr cPtr, bool futureUse) { - swigCPtr = new HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_HashElem() { - swigCPtr = new HandleRef(null, IntPtr.Zero); - } - - internal static HandleRef getCPtr(SWIGTYPE_p_HashElem obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } -} - -} -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.7 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -namespace FreeSWITCH.Native { - -using System; -using System.Runtime.InteropServices; - public class SWIGTYPE_p_in6_addr { private HandleRef swigCPtr; @@ -21357,36 +21757,6 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_payload_map_t { - private HandleRef swigCPtr; - - internal SWIGTYPE_p_payload_map_t(IntPtr cPtr, bool futureUse) { - swigCPtr = new HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_payload_map_t() { - swigCPtr = new HandleRef(null, IntPtr.Zero); - } - - internal static HandleRef getCPtr(SWIGTYPE_p_payload_map_t obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } -} - -} -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.7 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -namespace FreeSWITCH.Native { - -using System; -using System.Runtime.InteropServices; - public class SWIGTYPE_p_p_char { private HandleRef swigCPtr; @@ -21477,18 +21847,18 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_p_payload_map_t { +public class SWIGTYPE_p_p_payload_map_s { private HandleRef swigCPtr; - internal SWIGTYPE_p_p_payload_map_t(IntPtr cPtr, bool futureUse) { + internal SWIGTYPE_p_p_payload_map_s(IntPtr cPtr, bool futureUse) { swigCPtr = new HandleRef(this, cPtr); } - protected SWIGTYPE_p_p_payload_map_t() { + protected SWIGTYPE_p_p_payload_map_s() { swigCPtr = new HandleRef(null, IntPtr.Zero); } - internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_t obj) { + internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_s obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } } @@ -22077,18 +22447,18 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_p_switch_hash { +public class SWIGTYPE_p_p_switch_hashtable { private HandleRef swigCPtr; - internal SWIGTYPE_p_p_switch_hash(IntPtr cPtr, bool futureUse) { + internal SWIGTYPE_p_p_switch_hashtable(IntPtr cPtr, bool futureUse) { swigCPtr = new HandleRef(this, cPtr); } - protected SWIGTYPE_p_p_switch_hash() { + protected SWIGTYPE_p_p_switch_hashtable() { swigCPtr = new HandleRef(null, IntPtr.Zero); } - internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hash obj) { + internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } } @@ -22977,36 +23347,6 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_switch_core_media_ice_type_t { - private HandleRef swigCPtr; - - internal SWIGTYPE_p_switch_core_media_ice_type_t(IntPtr cPtr, bool futureUse) { - swigCPtr = new HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_switch_core_media_ice_type_t() { - swigCPtr = new HandleRef(null, IntPtr.Zero); - } - - internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_media_ice_type_t obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } -} - -} -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.7 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -namespace FreeSWITCH.Native { - -using System; -using System.Runtime.InteropServices; - public class SWIGTYPE_p_switch_core_port_allocator { private HandleRef swigCPtr; @@ -23127,18 +23467,48 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_switch_hash { +public class SWIGTYPE_p_switch_hashtable { private HandleRef swigCPtr; - internal SWIGTYPE_p_switch_hash(IntPtr cPtr, bool futureUse) { + internal SWIGTYPE_p_switch_hashtable(IntPtr cPtr, bool futureUse) { swigCPtr = new HandleRef(this, cPtr); } - protected SWIGTYPE_p_switch_hash() { + protected SWIGTYPE_p_switch_hashtable() { swigCPtr = new HandleRef(null, IntPtr.Zero); } - internal static HandleRef getCPtr(SWIGTYPE_p_switch_hash obj) { + internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + +public class SWIGTYPE_p_switch_hashtable_iterator { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_switch_hashtable_iterator() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable_iterator obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } } @@ -26943,6 +27313,8 @@ public enum switch_channel_flag_t { CF_AUDIO_PAUSE, CF_VIDEO_PAUSE, CF_BYPASS_MEDIA_AFTER_HOLD, + CF_HANGUP_HELD, + CF_CONFERENCE_RESET_MEDIA, CF_FLAG_MAX } @@ -28587,6 +28959,23 @@ namespace FreeSWITCH.Native { namespace FreeSWITCH.Native { +public enum switch_core_media_ice_type_t { + ICE_GOOGLE_JINGLE = (1 << 0), + ICE_VANILLA = (1 << 1), + ICE_CONTROLLED = (1 << 2) +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + using System; using System.Runtime.InteropServices; @@ -28892,6 +29281,7 @@ public enum switch_core_session_message_types_t { SWITCH_MESSAGE_ANSWER_EVENT, SWITCH_MESSAGE_PROGRESS_EVENT, SWITCH_MESSAGE_RING_EVENT, + SWITCH_MESSAGE_RESAMPLE_EVENT, SWITCH_MESSAGE_INVALID } @@ -32188,13 +32578,13 @@ public class switch_frame : IDisposable { } } - public SWIGTYPE_p_payload_map_t pmap { + public payload_map_t pmap { set { - freeswitchPINVOKE.switch_frame_pmap_set(swigCPtr, SWIGTYPE_p_payload_map_t.getCPtr(value)); + freeswitchPINVOKE.switch_frame_pmap_set(swigCPtr, payload_map_t.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_frame_pmap_get(swigCPtr); - SWIGTYPE_p_payload_map_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_payload_map_t(cPtr, false); + payload_map_t ret = (cPtr == IntPtr.Zero) ? null : new payload_map_t(cPtr, false); return ret; } } @@ -35470,11 +35860,16 @@ public class switch_rtp_crypto_key : IDisposable { namespace FreeSWITCH.Native { public enum switch_rtp_crypto_key_type_t { - NO_CRYPTO, - AES_CM_128_HMAC_SHA1_80, - AES_CM_128_HMAC_SHA1_32, + AEAD_AES_256_GCM_8, + AEAD_AES_128_GCM_8, AES_CM_256_HMAC_SHA1_80, - AES_CM_128_NULL_AUTH + AES_CM_192_HMAC_SHA1_80, + AES_CM_128_HMAC_SHA1_80, + AES_CM_256_HMAC_SHA1_32, + AES_CM_192_HMAC_SHA1_32, + AES_CM_128_HMAC_SHA1_32, + AES_CM_128_NULL_AUTH, + CRYPTO_INVALID } } @@ -35527,6 +35922,7 @@ public enum switch_rtp_flag_t { SWITCH_RTP_FLAG_PAUSE, SWITCH_RTP_FLAG_FIR, SWITCH_RTP_FLAG_PLI, + SWITCH_RTP_FLAG_RESET, SWITCH_RTP_FLAG_INVALID } @@ -36676,6 +37072,22 @@ public class switch_scheduler_task : IDisposable { namespace FreeSWITCH.Native { +public enum switch_sdp_type_t { + SDP_TYPE_REQUEST, + SDP_TYPE_RESPONSE +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + using System; using System.Runtime.InteropServices; @@ -37470,6 +37882,85 @@ public class switch_speech_interface : IDisposable { namespace FreeSWITCH.Native { +using System; +using System.Runtime.InteropServices; + +public class switch_srtp_crypto_suite_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_srtp_crypto_suite_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_srtp_crypto_suite_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_srtp_crypto_suite_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_srtp_crypto_suite_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public string name { + set { + freeswitchPINVOKE.switch_srtp_crypto_suite_t_name_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_name_get(swigCPtr); + return ret; + } + } + + public switch_rtp_crypto_key_type_t type { + set { + freeswitchPINVOKE.switch_srtp_crypto_suite_t_type_set(swigCPtr, (int)value); + } + get { + switch_rtp_crypto_key_type_t ret = (switch_rtp_crypto_key_type_t)freeswitchPINVOKE.switch_srtp_crypto_suite_t_type_get(swigCPtr); + return ret; + } + } + + public int keylen { + set { + freeswitchPINVOKE.switch_srtp_crypto_suite_t_keylen_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_keylen_get(swigCPtr); + return ret; + } + } + + public switch_srtp_crypto_suite_t() : this(freeswitchPINVOKE.new_switch_srtp_crypto_suite_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + public enum switch_stack_t { SWITCH_STACK_BOTTOM = (1 << 0), SWITCH_STACK_TOP = (1 << 1), diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 47baa2df79..20fc464420 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -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; diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp index c59a1746fb..822957825b 100644 --- a/src/mod/languages/mod_v8/mod_v8.cpp +++ b/src/mod/languages/mod_v8/mod_v8.cpp @@ -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; diff --git a/src/mod/languages/mod_v8/src/fseventhandler.cpp b/src/mod/languages/mod_v8/src/fseventhandler.cpp index a60d583d7d..f72cf2bb97 100644 --- a/src/mod/languages/mod_v8/src/fseventhandler.cpp +++ b/src/mod/languages/mod_v8/src/fseventhandler.cpp @@ -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; diff --git a/src/mod/languages/mod_v8/src/fsxml.cpp b/src/mod/languages/mod_v8/src/fsxml.cpp index e9f09ca1f1..2d96f80eb7 100644 --- a/src/mod/languages/mod_v8/src/fsxml.cpp +++ b/src/mod/languages/mod_v8/src/fsxml.cpp @@ -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(val); diff --git a/src/mod/loggers/mod_console/mod_console.c b/src/mod/loggers/mod_console/mod_console.c index a44fc47f0b..a01d1c9b7d 100644 --- a/src/mod/loggers/mod_console/mod_console.c +++ b/src/mod/loggers/mod_console/mod_console.c @@ -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) { diff --git a/src/mod/loggers/mod_logfile/mod_logfile.c b/src/mod/loggers/mod_logfile/mod_logfile.c index ab85dc5f16..da5850c9cc 100644 --- a/src/mod/loggers/mod_logfile/mod_logfile.c +++ b/src/mod/loggers/mod_logfile/mod_logfile.c @@ -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); diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c index 7202d0d83a..d55ae9989e 100644 --- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c +++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c @@ -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; diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 39235cc833..cb3c041a1e 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -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); } diff --git a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c index 786a591410..981543ab53 100644 --- a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c +++ b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c @@ -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; diff --git a/src/switch_channel.c b/src/switch_channel.c index 8c338cf8cb..9adb2a7d9f 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -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) diff --git a/src/switch_console.c b/src/switch_console.c index be6852c83d..b5b79debdc 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -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); diff --git a/src/switch_core.c b/src/switch_core.c index 160af2838b..df8db29717 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -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; diff --git a/src/switch_core_hash.c b/src/switch_core_hash.c index ebbfce065e..56aee60620 100644 --- a/src/switch_core_hash.c +++ b/src/switch_core_hash.c @@ -34,50 +34,27 @@ #include #include "private/switch_core_pvt.h" -#include -#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: diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 03b57fd788..37b4bf7654 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -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; diff --git a/src/switch_event.c b/src/switch_event.c index bf67d404a8..18cab00728 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -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); diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 87ea8af4b5..4c1ada013b 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -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 { diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index c8ea1cf964..9a69776380 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -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; diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index a32574ee99..cf623d88d3 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -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); } diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 6c360623a3..1ce0ada021 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -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 */ diff --git a/src/switch_rtp.c b/src/switch_rtp.c index adc110c81c..3fac018e19 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -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); diff --git a/src/switch_time.c b/src/switch_time.c index 42c864d8da..ec4e9d48b7 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -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"))) { diff --git a/src/switch_xml.c b/src/switch_xml.c index 9fcbd44eb2..c052cf9975 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -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);