FS-6402 --resolve

This commit is contained in:
Anthony Minessale 2014-04-02 01:20:19 +05:00
parent 2c7c041f50
commit 5c0cff70b3
50 changed files with 161 additions and 149 deletions

View File

@ -5530,7 +5530,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_freetdm_shutdown)
void *val; void *val;
/* destroy ss7 configs */ /* destroy ss7 configs */
for (hi = switch_core_hash_first( globals.ss7_configs); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.ss7_configs); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
ftdm_conf_node_destroy(val); ftdm_conf_node_destroy(val);
} }

View File

@ -39,7 +39,6 @@ struct switch_hashtable {
unsigned int primeindex; unsigned int primeindex;
unsigned int (*hashfn) (void *k); unsigned int (*hashfn) (void *k);
int (*eqfn) (void *k1, void *k2); int (*eqfn) (void *k1, void *k2);
struct switch_hashtable_iterator iterator;
}; };
/*****************************************************************************/ /*****************************************************************************/

View File

@ -1466,7 +1466,7 @@ SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_first(_In_ switch_hash_t
\param hi The current element \param hi The current element
\return The next element, or NULL if there are no more \return The next element, or NULL if there are no more
*/ */
SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(_In_ switch_hash_index_t *hi); SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(_In_ switch_hash_index_t **hi);
/*! /*!
\brief Gets the key and value of the current hash element \brief Gets the key and value of the current hash element

View File

@ -191,7 +191,7 @@ SWITCH_DECLARE(void)
switch_hashtable_destroy(switch_hashtable_t **h); switch_hashtable_destroy(switch_hashtable_t **h);
SWITCH_DECLARE(switch_hashtable_iterator_t*) switch_hashtable_first(switch_hashtable_t *h); SWITCH_DECLARE(switch_hashtable_iterator_t*) switch_hashtable_first(switch_hashtable_t *h);
SWITCH_DECLARE(switch_hashtable_iterator_t*) switch_hashtable_next(switch_hashtable_iterator_t *i); SWITCH_DECLARE(switch_hashtable_iterator_t*) switch_hashtable_next(switch_hashtable_iterator_t **iP);
SWITCH_DECLARE(void) switch_hashtable_this(switch_hashtable_iterator_t *i, const void **key, switch_ssize_t *klen, void **val); SWITCH_DECLARE(void) switch_hashtable_this(switch_hashtable_iterator_t *i, const void **key, switch_ssize_t *klen, void **val);
static inline int switch_hash_equalkeys(void *k1, void *k2) static inline int switch_hash_equalkeys(void *k1, void *k2)

View File

@ -282,7 +282,7 @@ SWITCH_STANDARD_API(blacklist_api_function)
switch_mutex_lock(globals.lists_mutex); 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) if (switch_file_open(&fd, filename, SWITCH_FOPEN_WRITE | SWITCH_FOPEN_TRUNCATE | SWITCH_FOPEN_CREATE, SWITCH_FPROT_OS_DEFAULT, globals.pool)
== SWITCH_STATUS_SUCCESS) { == SWITCH_STATUS_SUCCESS) {
for (hi = switch_core_hash_first( bl->list); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( bl->list); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
switch_file_printf(fd, "%s\n", (char *)var); 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); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "adding %s to the dump file\n", (char *)var);

View File

@ -3198,7 +3198,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
switch_hash_index_t *hi; 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"); 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); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.queue_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.queue_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val = NULL; void *val = NULL;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -3251,7 +3251,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
switch_hash_index_t *hi; switch_hash_index_t *hi;
int queue_count = 0; int queue_count = 0;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.queue_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.queue_hash); hi; hi = switch_core_hash_next(&hi)) {
queue_count++; queue_count++;
} }
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);

View File

@ -5291,7 +5291,7 @@ static switch_status_t list_conferences(const char *line, const char *cursor, sw
const void *vvar; const void *vvar;
switch_mutex_lock(globals.hash_mutex); switch_mutex_lock(globals.hash_mutex);
for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(hi)) { 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_core_hash_this(hi, &vvar, NULL, &val);
switch_console_push_match(&my_matches, (const char *) vvar); switch_console_push_match(&my_matches, (const char *) vvar);
} }
@ -5783,7 +5783,7 @@ static switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_st
if (conference == NULL) { if (conference == NULL) {
switch_mutex_lock(globals.hash_mutex); switch_mutex_lock(globals.hash_mutex);
for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) {
int fcount = 0; int fcount = 0;
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
conference = (conference_obj_t *) val; conference = (conference_obj_t *) val;
@ -6262,7 +6262,7 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc
if (conference == NULL) { if (conference == NULL) {
switch_mutex_lock(globals.hash_mutex); switch_mutex_lock(globals.hash_mutex);
for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
conference = (conference_obj_t *) val; conference = (conference_obj_t *) val;

View File

@ -975,7 +975,7 @@ static int node_idle_consumers(fifo_node_t *node)
int total = 0; int total = 0;
switch_mutex_lock(node->mutex); switch_mutex_lock(node->mutex);
for (hi = switch_core_hash_first( node->consumer_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( node->consumer_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
@ -3802,7 +3802,7 @@ 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++); x_tmp = switch_xml_add_child_d(xml, container, cc_off++);
switch_assert(x_tmp); switch_assert(x_tmp);
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(&hi)) {
int c_off = 0, d_off = 0; int c_off = 0, d_off = 0;
const char *status; const char *status;
const char *ts; const char *ts;
@ -3987,7 +3987,7 @@ void dump_hash(switch_hash_t *hash, switch_stream_handle_t *stream)
const void *var; const void *var;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
stream->write_function(stream, " %s\n", (char *)var); stream->write_function(stream, " %s\n", (char *)var);
} }
@ -4002,7 +4002,7 @@ void node_dump(switch_stream_handle_t *stream)
fifo_node_t *node; fifo_node_t *node;
void *val; void *val;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
if ((node = (fifo_node_t *) val)) { if ((node = (fifo_node_t *) val)) {
stream->write_function(stream, "node: %s\n" stream->write_function(stream, "node: %s\n"
@ -4100,7 +4100,7 @@ SWITCH_STANDARD_API(fifo_api_function)
switch_assert(x_report); switch_assert(x_report);
if (argc < 2) { if (argc < 2) {
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
node = (fifo_node_t *) val; node = (fifo_node_t *) val;
@ -4137,7 +4137,7 @@ SWITCH_STANDARD_API(fifo_api_function)
} }
} else if (!strcasecmp(argv[0], "count")) { } else if (!strcasecmp(argv[0], "count")) {
if (argc < 2) { if (argc < 2) {
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
node = (fifo_node_t *) val; node = (fifo_node_t *) val;
switch_mutex_lock(node->update_mutex); switch_mutex_lock(node->update_mutex);
@ -4158,7 +4158,7 @@ SWITCH_STANDARD_API(fifo_api_function)
} }
} else if (!strcasecmp(argv[0], "has_outbound")) { } else if (!strcasecmp(argv[0], "has_outbound")) {
if (argc < 2) { if (argc < 2) {
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
node = (fifo_node_t *) val; node = (fifo_node_t *) val;
switch_mutex_lock(node->update_mutex); switch_mutex_lock(node->update_mutex);
@ -4359,7 +4359,7 @@ static switch_status_t load_config(int reload, int del_all)
fifo_node_t *node; fifo_node_t *node;
void *val; void *val;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fifo_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
if ((node = (fifo_node_t *) val) && node->is_static && node->ready == 1) { if ((node = (fifo_node_t *) val) && node->is_static && node->ready == 1) {
node->ready = -1; node->ready = -1;

View File

@ -623,7 +623,7 @@ SWITCH_STANDARD_API(hash_dump_function)
if (mode & 1) { if (mode & 1) {
switch_thread_rwlock_rdlock(globals.limit_hash_rwlock); switch_thread_rwlock_rdlock(globals.limit_hash_rwlock);
for (hi = switch_core_hash_first( globals.limit_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.limit_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val = NULL; void *val = NULL;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -639,7 +639,7 @@ SWITCH_STANDARD_API(hash_dump_function)
if (mode & 2) { if (mode & 2) {
switch_thread_rwlock_rdlock(globals.db_hash_rwlock); switch_thread_rwlock_rdlock(globals.db_hash_rwlock);
for (hi = switch_core_hash_first( globals.db_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.db_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val = NULL; void *val = NULL;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -679,7 +679,7 @@ SWITCH_STANDARD_API(hash_remote_function)
stream->write_function(stream, "Remote connections:\nName\t\t\tState\n"); stream->write_function(stream, "Remote connections:\nName\t\t\tState\n");
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock); switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
for (hi = switch_core_hash_first( globals.remote_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.remote_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -780,7 +780,7 @@ void limit_remote_destroy(limit_remote_t **r)
switch_thread_rwlock_wrlock((*r)->rwlock); switch_thread_rwlock_wrlock((*r)->rwlock);
/* Free hashtable data */ /* Free hashtable data */
for (hi = switch_core_hash_first( (*r)->index); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( (*r)->index); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -803,7 +803,7 @@ static limit_hash_item_t get_remote_usage(const char *key) {
switch_hash_index_t *hi; switch_hash_index_t *hi;
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock); switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
for (hi = switch_core_hash_first( globals.remote_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.remote_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *hashkey; const void *hashkey;
switch_ssize_t keylen; switch_ssize_t keylen;

View File

@ -3088,7 +3088,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_httapi_shutdown)
void *val; void *val;
const void *vvar; const void *vvar;
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &val); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (client_profile_t *) val; profile = (client_profile_t *) val;
switch_event_destroy(&profile->dial_params.app_list); switch_event_destroy(&profile->dial_params.app_list);

View File

@ -2052,7 +2052,7 @@ SWITCH_STANDARD_API(dialplan_lcr_admin_function)
} }
switch_assert(argv[0]); switch_assert(argv[0]);
if (!strcasecmp(argv[0], "show") && !strcasecmp(argv[1], "profiles")) { if (!strcasecmp(argv[0], "show") && !strcasecmp(argv[1], "profiles")) {
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (profile_t *) val; profile = (profile_t *) val;

View File

@ -139,7 +139,7 @@ SWITCH_STANDARD_API(dump_hash)
switch_thread_rwlock_rdlock(globals.spy_hash_lock); switch_thread_rwlock_rdlock(globals.spy_hash_lock);
for (hi = switch_core_hash_first( globals.spy_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.spy_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &key, NULL, &val); switch_core_hash_this(hi, &key, NULL, &val);
spy = (spy_t *) val; spy = (spy_t *) val;

View File

@ -120,7 +120,7 @@ static void check_timeouts(void)
} }
globals.last_timeout_check = now; globals.last_timeout_check = now;
for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
switch_console_push_match(&matches, (const char *) var); switch_console_push_match(&matches, (const char *) var);
} }
@ -135,7 +135,7 @@ static void check_timeouts(void)
top: top:
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_hash_next(i_hi)) { 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); switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
i_ext = (char *) i_var; i_ext = (char *) i_var;
token = (valet_token_t *) i_val; token = (valet_token_t *) i_val;
@ -167,7 +167,7 @@ static int find_longest(valet_lot_t *lot, int min, int max)
time_t now = switch_epoch_time_now(NULL); time_t now = switch_epoch_time_now(NULL);
switch_mutex_lock(lot->mutex); switch_mutex_lock(lot->mutex);
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_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; int i;
switch_core_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; token = (valet_token_t *) i_val;
@ -257,7 +257,7 @@ static int valet_lot_count(valet_lot_t *lot)
now = switch_epoch_time_now(NULL); now = switch_epoch_time_now(NULL);
switch_mutex_lock(lot->mutex); switch_mutex_lock(lot->mutex);
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_hash_next(i_hi)) { 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); switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
token = (valet_token_t *) i_val; token = (valet_token_t *) i_val;
if (token->timeout > 0 && (token->timeout < now || token->timeout == 1)) { if (token->timeout > 0 && (token->timeout < now || token->timeout == 1)) {
@ -738,7 +738,7 @@ SWITCH_STANDARD_API(valet_info_function)
stream->write_function(stream, "<lots>\n"); stream->write_function(stream, "<lots>\n");
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(&hi)) {
switch_hash_index_t *i_hi; switch_hash_index_t *i_hi;
const void *i_var; const void *i_var;
void *i_val; void *i_val;
@ -754,7 +754,7 @@ SWITCH_STANDARD_API(valet_info_function)
stream->write_function(stream, " <lot name=\"%s\">\n", name); stream->write_function(stream, " <lot name=\"%s\">\n", name);
switch_mutex_lock(lot->mutex); switch_mutex_lock(lot->mutex);
for (i_hi = switch_core_hash_first( lot->hash); i_hi; i_hi = switch_core_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; valet_token_t *token;
switch_core_hash_this(i_hi, &i_var, NULL, &i_val); switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
@ -848,7 +848,7 @@ static void pres_event_handler(switch_event_t *event)
const char *nvar; const char *nvar;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
nvar = (const char *) var; nvar = (const char *) var;

View File

@ -4020,7 +4020,7 @@ 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); "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 { } else {
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (vm_profile_t *) val; profile = (vm_profile_t *) val;
parse_profile(); parse_profile();
@ -4923,7 +4923,7 @@ SWITCH_STANDARD_API(voicemail_api_function)
} else if (!strcasecmp(argv[0], "status")) { } else if (!strcasecmp(argv[0], "status")) {
stream->write_function(stream, "============================\n"); stream->write_function(stream, "============================\n");
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (vm_profile_t *) val; profile = (vm_profile_t *) val;
stream->write_function(stream, "Profile: %s\n", profile->name); stream->write_function(stream, "Profile: %s\n", profile->name);
@ -4958,7 +4958,7 @@ SWITCH_STANDARD_API(voicemail_api_function)
void *value; void *value;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (index = switch_core_hash_first( globals.profile_hash); index; index = switch_core_hash_next(index)) { for (index = switch_core_hash_first( globals.profile_hash); index; index = switch_core_hash_next(&index)) {
switch_core_hash_this(index, NULL, NULL, &value); switch_core_hash_this(index, NULL, NULL, &value);
profile = (vm_profile_t *) value; profile = (vm_profile_t *) value;
if (profile) { if (profile) {

View File

@ -1158,7 +1158,7 @@ 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 */ /* loop through each param and add to synth header or vendor-specific-params */
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
for (hi = switch_core_hash_first( schannel->params); hi; hi = switch_core_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; char *param_name = NULL, *param_val = NULL;
const void *key; const void *key;
void *val; void *val;
@ -1633,7 +1633,7 @@ static switch_status_t synth_speech_open(switch_speech_handle_t *sh, const char
} }
/* Set default TTS params */ /* Set default TTS params */
for (hi = switch_core_hash_first( profile->default_synth_params); hi; hi = switch_core_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; char *param_name = NULL, *param_val = NULL;
const void *key; const void *key;
void *val; void *val;
@ -2195,7 +2195,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel)
r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false"); r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
/* count enabled grammars */ /* count enabled grammars */
for (egk = switch_core_hash_first( r->enabled_grammars); egk; egk = switch_core_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 // 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) if (grammar_uri_count == 1 && grammar->type != GRAMMAR_TYPE_URI)
goto no_grammar_alone; goto no_grammar_alone;
@ -2227,7 +2227,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel)
/* get the enabled grammars list */ /* get the enabled grammars list */
grammar_uri_list = switch_core_alloc(schannel->memory_pool, grammar_uri_list_len + 1); grammar_uri_list = switch_core_alloc(schannel->memory_pool, grammar_uri_list_len + 1);
grammar_uri_list_len = 0; grammar_uri_list_len = 0;
for (egk = switch_core_hash_first( r->enabled_grammars); egk; egk = switch_core_hash_next(egk)) { 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); switch_core_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
len = strlen(grammar->data); len = strlen(grammar->data);
if (!len) if (!len)
@ -2810,7 +2810,7 @@ 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 */ /* loop through each param and add to recog header or vendor-specific-params */
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
for (hi = switch_core_hash_first( schannel->params); hi; hi = switch_core_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; char *param_name = NULL, *param_val = NULL;
const void *key; const void *key;
void *val; void *val;
@ -3132,7 +3132,7 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
} }
/* Set default ASR params */ /* Set default ASR params */
for (hi = switch_core_hash_first( profile->default_recog_params); hi; hi = switch_core_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; char *param_name = NULL, *param_val = NULL;
const void *key; const void *key;
void *val; void *val;

View File

@ -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" #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, 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"); "Session", "Codec", "Enc", "Dec", "Enc Tx", "Enc Rx", "Dec Tx", "Dec Rx", "Enc Lost", "Dec Lost", "Enc AvgRxMs", "Dec AvgRxMs");
for (hi = switch_core_hash_first( g_sessions_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( g_sessions_hash); hi; hi = switch_core_hash_next(&hi)) {
struct sangoma_transcoding_session *sess; struct sangoma_transcoding_session *sess;
char sessid_str[25]; char sessid_str[25];
char encoder_tx_str[25]; char encoder_tx_str[25];

View File

@ -569,7 +569,7 @@ 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, 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); from);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val; profile = (mdl_profile_t *) val;
@ -701,7 +701,7 @@ static void roster_event_handler(switch_event_t *event)
sql = switch_mprintf("select *,'%q' from jabber_subscriptions", status ? status : ""); sql = switch_mprintf("select *,'%q' from jabber_subscriptions", status ? status : "");
} }
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val; profile = (mdl_profile_t *) val;
@ -738,7 +738,7 @@ static void ipchanged_event_handler(switch_event_t *event)
mdl_profile_t *profile; mdl_profile_t *profile;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s]\n", old_ip4, new_ip4); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s]\n", old_ip4, new_ip4);
if (globals.profile_hash) { if (globals.profile_hash) {
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val; profile = (mdl_profile_t *) val;
if (old_ip4 && profile->extip && !strcmp(profile->extip, old_ip4)) { if (old_ip4 && profile->extip && !strcmp(profile->extip, old_ip4)) {
@ -799,7 +799,7 @@ static void sign_off(void)
sql = switch_mprintf("select * from jabber_subscriptions"); sql = switch_mprintf("select * from jabber_subscriptions");
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val; profile = (mdl_profile_t *) val;
@ -2684,7 +2684,7 @@ static switch_status_t list_profiles(const char *line, const char *cursor, switc
switch_console_callback_match_t *my_matches = NULL; switch_console_callback_match_t *my_matches = NULL;
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &val); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (mdl_profile_t *) val; profile = (mdl_profile_t *) val;
if (!strncmp("dl_logout", line, 9)) { if (!strncmp("dl_logout", line, 9)) {
@ -3090,7 +3090,7 @@ SWITCH_STANDARD_API(dingaling)
if (argv[0] && !strncasecmp(argv[0], "status", 6)) { if (argv[0] && !strncasecmp(argv[0], "status", 6)) {
stream->write_function(stream, "--DingaLing status--\n"); stream->write_function(stream, "--DingaLing status--\n");
stream->write_function(stream, "login | connected\n"); stream->write_function(stream, "login | connected\n");
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val; profile = (mdl_profile_t *) val;
stream->write_function(stream, "%s | ", profile->login); stream->write_function(stream, "%s | ", profile->login);
@ -3345,7 +3345,7 @@ static switch_status_t soft_reload(void)
switch_xml_free(xml); switch_xml_free(xml);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &data); switch_core_hash_this(hi, NULL, NULL, &data);
profile = (mdl_profile_t *) data; profile = (mdl_profile_t *) data;
@ -3356,7 +3356,7 @@ static switch_status_t soft_reload(void)
} }
} }
for (hi = switch_core_hash_first( name_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( name_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &data); switch_core_hash_this(hi, NULL, NULL, &data);
if ((profile = switch_core_hash_find(globals.profile_hash, (char *) data))) { if ((profile = switch_core_hash_find(globals.profile_hash, (char *) data))) {

View File

@ -2491,7 +2491,7 @@ static switch_status_t list_shared_streams(char **argv, int argc, switch_stream_
{ {
switch_hash_index_t *hi; switch_hash_index_t *hi;
int cnt = 0; int cnt = 0;
for (hi = switch_core_hash_first( globals.sh_streams); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.sh_streams); hi; hi = switch_core_hash_next(&hi)) {
const void *var; const void *var;
void *val; void *val;
shared_audio_stream_t *s = NULL; shared_audio_stream_t *s = NULL;
@ -2509,7 +2509,7 @@ static switch_status_t list_endpoints(char **argv, int argc, switch_stream_handl
{ {
switch_hash_index_t *hi; switch_hash_index_t *hi;
int cnt = 0; int cnt = 0;
for (hi = switch_core_hash_first( globals.endpoints); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.endpoints); hi; hi = switch_core_hash_next(&hi)) {
const void *var; const void *var;
void *val; void *val;
audio_endpoint_t *e = NULL; audio_endpoint_t *e = NULL;

View File

@ -827,7 +827,7 @@ static void rtmp_garbage_colletor(void)
top: top:
for (hi = switch_core_hash_first( rtmp_globals.session_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( rtmp_globals.session_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -868,7 +868,7 @@ switch_status_t rtmp_real_session_destroy(rtmp_session_t **rsession)
int sess = 0; int sess = 0;
switch_thread_rwlock_rdlock((*rsession)->session_rwlock); switch_thread_rwlock_rdlock((*rsession)->session_rwlock);
for (hi = switch_core_hash_first( (*rsession)->session_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( (*rsession)->session_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -1633,7 +1633,7 @@ SWITCH_STANDARD_API(rtmp_function)
stream->write_function(stream, "\nSessions:\n"); stream->write_function(stream, "\nSessions:\n");
stream->write_function(stream, "uuid,address,user,domain,flashVer,state\n"); stream->write_function(stream, "uuid,address,user,domain,flashVer,state\n");
switch_thread_rwlock_rdlock(profile->session_rwlock); switch_thread_rwlock_rdlock(profile->session_rwlock);
for (hi = switch_core_hash_first( profile->session_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( profile->session_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -1655,7 +1655,7 @@ SWITCH_STANDARD_API(rtmp_function)
stream->write_function(stream, "user,nickname,uuid\n"); stream->write_function(stream, "user,nickname,uuid\n");
switch_thread_rwlock_rdlock(profile->reg_rwlock); switch_thread_rwlock_rdlock(profile->reg_rwlock);
for (hi = switch_core_hash_first( profile->reg_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( profile->reg_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -1681,7 +1681,7 @@ SWITCH_STANDARD_API(rtmp_function)
} else { } else {
switch_hash_index_t *hi; switch_hash_index_t *hi;
switch_thread_rwlock_rdlock(rtmp_globals.profile_rwlock); switch_thread_rwlock_rdlock(rtmp_globals.profile_rwlock);
for (hi = switch_core_hash_first( rtmp_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( rtmp_globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;
@ -1805,7 +1805,7 @@ static switch_status_t console_complete_hashtable(switch_hash_t *hash, const cha
switch_console_callback_match_t *my_matches = NULL; switch_console_callback_match_t *my_matches = NULL;
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &val); switch_core_hash_this(hi, &vvar, NULL, &val);
switch_console_push_match(&my_matches, (const char *) vvar); switch_console_push_match(&my_matches, (const char *) vvar);
} }

View File

@ -243,7 +243,7 @@ switch_status_t rtmp_check_auth(rtmp_session_t *rsession, const char *user, cons
if (disallow_multiple_registration) { if (disallow_multiple_registration) {
switch_hash_index_t *hi; switch_hash_index_t *hi;
switch_thread_rwlock_rdlock(rsession->profile->session_rwlock); switch_thread_rwlock_rdlock(rsession->profile->session_rwlock);
for (hi = switch_core_hash_first( rsession->profile->session_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( rsession->profile->session_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
const void *key; const void *key;
switch_ssize_t keylen; switch_ssize_t keylen;

View File

@ -197,7 +197,7 @@ skinny_profile_t *skinny_find_profile_by_domain(const char *domain_name)
skinny_profile_t *profile = NULL, *tmp_profile; skinny_profile_t *profile = NULL, *tmp_profile;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
tmp_profile = (skinny_profile_t *) val; tmp_profile = (skinny_profile_t *) val;
@ -1401,7 +1401,7 @@ static void walk_listeners(skinny_listener_callback_func_t callback, void *pvt)
/* walk listeners */ /* walk listeners */
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (skinny_profile_t *) val; profile = (skinny_profile_t *) val;
@ -2441,7 +2441,7 @@ static void skinny_trap_event_handler(switch_event_t *event)
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
if (globals.profile_hash) { if (globals.profile_hash) {
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (skinny_profile_t *) val) && profile->auto_restart) { if ((profile = (skinny_profile_t *) val) && profile->auto_restart) {
if (!strcmp(profile->ip, old_ip4)) { if (!strcmp(profile->ip, old_ip4)) {
@ -2540,7 +2540,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
/* launch listeners */ /* launch listeners */
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
void *val; void *val;
skinny_profile_t *profile; skinny_profile_t *profile;
@ -2587,7 +2587,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown)
/* close sockets */ /* close sockets */
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
skinny_profile_t *profile; skinny_profile_t *profile;
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (skinny_profile_t *) val; profile = (skinny_profile_t *) val;

View File

@ -49,7 +49,7 @@ static switch_status_t skinny_api_list_profiles(const char *line, const char *cu
/* walk profiles */ /* walk profiles */
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (skinny_profile_t *) val; profile = (skinny_profile_t *) val;

View File

@ -2474,7 +2474,7 @@ 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, "%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); stream->write_function(stream, "%s\n", line);
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val; profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) { if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
@ -2707,7 +2707,7 @@ 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, "%25s\t%s\t %40s\t%s\n", "Name", " Type", "Data", "State");
stream->write_function(stream, "%s\n", line); stream->write_function(stream, "%s\n", line);
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val; profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) { if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
@ -2819,7 +2819,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
stream->write_function(stream, "<gateways>\n", header); stream->write_function(stream, "<gateways>\n", header);
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val; profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) { if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
@ -2991,7 +2991,7 @@ 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, "%s\n", header);
stream->write_function(stream, "<profiles>\n"); stream->write_function(stream, "<profiles>\n");
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val; profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) { if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
@ -3654,7 +3654,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
const void *var; const void *var;
void *val; void *val;
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) { if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) {
select_from_profile(profile, user, domain, concat, exclude_contact, &mystream, SWITCH_TRUE); select_from_profile(profile, user, domain, concat, exclude_contact, &mystream, SWITCH_TRUE);
@ -3839,7 +3839,7 @@ SWITCH_STANDARD_API(sofia_presence_data_function)
const void *var; const void *var;
void *val; void *val;
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) { if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) {
get_presence_data(profile, user, domain, search, stream); get_presence_data(profile, user, domain, search, stream);
@ -5230,7 +5230,7 @@ static void general_event_handler(switch_event_t *event)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash && !zstr(old_ip4) && !zstr(new_ip4)) { if (mod_sofia_globals.profile_hash && !zstr(old_ip4) && !zstr(new_ip4)) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (sofia_profile_t *) val)) { if ((profile = (sofia_profile_t *) val)) {
@ -5259,7 +5259,7 @@ static void general_event_handler(switch_event_t *event)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
int rb = 0; int rb = 0;
uint32_t x = 0; uint32_t x = 0;
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
@ -5372,7 +5372,7 @@ switch_status_t list_profiles_full(const char *line, const char *cursor, switch_
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val; profile = (sofia_profile_t *) val;
@ -5410,7 +5410,7 @@ static switch_status_t list_gateways(const char *line, const char *cursor, switc
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val; profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) { if (sofia_test_pflag(profile, PFLAG_RUNNING)) {

View File

@ -7196,7 +7196,7 @@ nua_handle_t *sofia_global_nua_handle_by_replaces(sip_replaces_t *replaces)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (sofia_profile_t *) val)) { if ((profile = (sofia_profile_t *) val)) {
if (!(nh = nua_handle_by_replaces(profile->nua, replaces))) { if (!(nh = nua_handle_by_replaces(profile->nua, replaces))) {

View File

@ -1653,7 +1653,7 @@ void sofia_glue_restart_all_profiles(void)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) { if ((pptr = (sofia_profile_t *) val)) {
int rsec = 10; int rsec = 10;
@ -1688,7 +1688,7 @@ void sofia_glue_global_siptrace(switch_bool_t on)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) { if ((pptr = (sofia_profile_t *) val)) {
nua_set_params(pptr->nua, TPTAG_LOG(on), TAG_END()); nua_set_params(pptr->nua, TPTAG_LOG(on), TAG_END());
@ -1708,7 +1708,7 @@ void sofia_glue_global_standby(switch_bool_t on)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) { if ((pptr = (sofia_profile_t *) val)) {
if (on) { if (on) {
@ -1732,7 +1732,7 @@ void sofia_glue_global_capture(switch_bool_t on)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) { if ((pptr = (sofia_profile_t *) val)) {
nua_set_params(pptr->nua, TPTAG_CAPT(on ? mod_sofia_globals.capture_server : NULL), TAG_END()); nua_set_params(pptr->nua, TPTAG_CAPT(on ? mod_sofia_globals.capture_server : NULL), TAG_END());
@ -1753,7 +1753,7 @@ void sofia_glue_global_watchdog(switch_bool_t on)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) { if ((pptr = (sofia_profile_t *) val)) {
pptr->watchdog_enabled = (on ? 1 : 0); pptr->watchdog_enabled = (on ? 1 : 0);
@ -1776,7 +1776,7 @@ void sofia_glue_del_profile(sofia_profile_t *profile)
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) { if (mod_sofia_globals.profile_hash) {
for (hi = switch_core_hash_first( mod_sofia_globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val) && pptr == profile) { if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
aliases[i++] = strdup((char *) var); aliases[i++] = strdup((char *) var);

View File

@ -1109,7 +1109,7 @@ void sofia_reg_close_handles(sofia_profile_t *profile)
switch_mutex_lock(profile->flag_mutex); switch_mutex_lock(profile->flag_mutex);
if (profile->reg_nh_hash) { if (profile->reg_nh_hash) {
top: top:
for (hi = switch_core_hash_first( profile->reg_nh_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((nh = (nua_handle_t *) val)) { if ((nh = (nua_handle_t *) val)) {
nua_handle_unref(nh); nua_handle_unref(nh);
@ -3155,7 +3155,7 @@ sofia_gateway_t *sofia_reg_find_gateway_by_realm__(const char *file, const char
void *val; void *val;
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_core_hash_first( mod_sofia_globals.gateway_hash); hi; hi = switch_core_hash_next(hi)) { 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); 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)) { if (key && (gateway = (sofia_gateway_t *) val) && !gateway->deleted && gateway->register_realm && !strcasecmp(gateway->register_realm, key)) {
break; break;

View File

@ -279,7 +279,7 @@ static void do_rotate_all()
} }
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
fd = (cdr_fd_t *) val; fd = (cdr_fd_t *) val;
switch_mutex_lock(fd->mutex); switch_mutex_lock(fd->mutex);
@ -296,7 +296,7 @@ static void do_teardown()
void *val; void *val;
cdr_fd_t *fd; cdr_fd_t *fd;
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
fd = (cdr_fd_t *) val; fd = (cdr_fd_t *) val;
switch_mutex_lock(fd->mutex); switch_mutex_lock(fd->mutex);

View File

@ -401,7 +401,7 @@ static void event_handler(switch_event_t *event)
} }
if (sig && !strcmp(sig, "HUP")) { if (sig && !strcmp(sig, "HUP")) {
for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.fd_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
fd = (cdr_fd_t *) val; fd = (cdr_fd_t *) val;
switch_mutex_lock(fd->mutex); switch_mutex_lock(fd->mutex);

View File

@ -1132,7 +1132,7 @@ 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_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hashed ref to %s\n", hash);
switch_thread_rwlock_rdlock(listener->session_rwlock); switch_thread_rwlock_rdlock(listener->session_rwlock);
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(&iter)) {
switch_core_hash_this(iter, &key, NULL, &val); switch_core_hash_this(iter, &key, NULL, &val);
se = (session_elem_t*)val; se = (session_elem_t*)val;
if (se->spawn_reply && !strncmp(se->spawn_reply->hash, hash, 100)) { if (se->spawn_reply && !strncmp(se->spawn_reply->hash, hash, 100)) {

View File

@ -364,7 +364,7 @@ session_elem_t *find_session_elem_by_pid(listener_t *listener, erlang_pid *pid)
session_elem_t *session = NULL; session_elem_t *session = NULL;
switch_thread_rwlock_rdlock(listener->session_rwlock); switch_thread_rwlock_rdlock(listener->session_rwlock);
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(&iter)) {
switch_core_hash_this(iter, &key, NULL, &val); 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)) { if (((session_elem_t*)val)->process.type == ERLANG_PID && !ei_compare_pids(pid, &((session_elem_t*)val)->process.pid)) {
@ -644,7 +644,7 @@ static switch_status_t check_attached_sessions(listener_t *listener, int *msgs_s
/* TODO try to minimize critical section */ /* TODO try to minimize critical section */
switch_thread_rwlock_rdlock(listener->session_rwlock); switch_thread_rwlock_rdlock(listener->session_rwlock);
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(&iter)) {
switch_core_hash_this(iter, &key, NULL, &value); switch_core_hash_this(iter, &key, NULL, &value);
sp = (session_elem_t*)value; sp = (session_elem_t*)value;
if (switch_test_flag(sp, LFLAG_WAITING_FOR_PID)) { if (switch_test_flag(sp, LFLAG_WAITING_FOR_PID)) {
@ -1333,7 +1333,7 @@ void destroy_listener(listener_t * listener)
/* clean up all the attached sessions */ /* clean up all the attached sessions */
switch_thread_rwlock_wrlock(listener->session_rwlock); switch_thread_rwlock_wrlock(listener->session_rwlock);
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(&iter)) {
switch_core_hash_this(iter, &key, NULL, &value); switch_core_hash_this(iter, &key, NULL, &value);
s = (session_elem_t*)value; s = (session_elem_t*)value;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Orphaning call %s\n", s->uuid_str); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Orphaning call %s\n", s->uuid_str);
@ -1529,7 +1529,7 @@ int count_listener_sessions(listener_t *listener)
switch_hash_index_t *iter; switch_hash_index_t *iter;
switch_thread_rwlock_rdlock(listener->session_rwlock); switch_thread_rwlock_rdlock(listener->session_rwlock);
for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( listener->sessions); iter; iter = switch_core_hash_next(&iter)) {
count++; count++;
} }
switch_thread_rwlock_unlock(listener->session_rwlock); switch_thread_rwlock_unlock(listener->session_rwlock);
@ -1750,7 +1750,7 @@ SWITCH_STANDARD_API(erlang_cmd)
found = 1; found = 1;
switch_thread_rwlock_rdlock(l->session_rwlock); switch_thread_rwlock_rdlock(l->session_rwlock);
for (iter = switch_core_hash_first( l->sessions); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( l->sessions); iter; iter = switch_core_hash_next(&iter)) {
empty = 0; empty = 0;
switch_core_hash_this(iter, &key, NULL, &value); switch_core_hash_this(iter, &key, NULL, &value);
sp = (session_elem_t*)value; sp = (session_elem_t*)value;
@ -1791,7 +1791,7 @@ SWITCH_STANDARD_API(erlang_cmd)
} }
stream->write_function(stream, "CUSTOM:\n", switch_event_name(x)); stream->write_function(stream, "CUSTOM:\n", switch_event_name(x));
for (iter = switch_core_hash_first( l->event_hash); iter; iter = switch_core_hash_next(iter)) { for (iter = switch_core_hash_first( l->event_hash); iter; iter = switch_core_hash_next(&iter)) {
switch_core_hash_this(iter, &key, NULL, &val); switch_core_hash_this(iter, &key, NULL, &val);
stream->write_function(stream, "\t%s\n", (char *)key); stream->write_function(stream, "\t%s\n", (char *)key);
} }

View File

@ -247,7 +247,7 @@ static void event_handler(switch_event_t *event)
struct peer_status *last; struct peer_status *last;
char *host; char *host;
for (cur = switch_core_hash_first( globals.peer_hash); cur; cur = switch_core_hash_next(cur)) { for (cur = switch_core_hash_first( globals.peer_hash); cur; cur = switch_core_hash_next(&cur)) {
switch_core_hash_this(cur, &key, &keylen, &value); switch_core_hash_this(cur, &key, &keylen, &value);
host = (char *) key; host = (char *) key;
last = (struct peer_status *) value; last = (struct peer_status *) value;
@ -351,7 +351,7 @@ SWITCH_STANDARD_API(multicast_peers)
char *host; char *host;
int i = 0; int i = 0;
for (cur = switch_core_hash_first( globals.peer_hash); cur; cur = switch_core_hash_next(cur)) { for (cur = switch_core_hash_first( globals.peer_hash); cur; cur = switch_core_hash_next(&cur)) {
switch_core_hash_this(cur, &key, &keylen, &value); switch_core_hash_this(cur, &key, &keylen, &value);
host = (char *) key; host = (char *) key;
last = (struct peer_status *) value; last = (struct peer_status *) value;

View File

@ -495,7 +495,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
status = SWITCH_STATUS_SUCCESS; status = SWITCH_STATUS_SUCCESS;
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
cdr_profile_t *profile; cdr_profile_t *profile;
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (cdr_profile_t *) val; profile = (cdr_profile_t *) val;
@ -518,7 +518,7 @@ static void event_handler(switch_event_t *event)
const char *sig = switch_event_get_header(event, "Trapped-Signal"); const char *sig = switch_event_get_header(event, "Trapped-Signal");
if (sig && !strcmp(sig, "HUP")) { if (sig && !strcmp(sig, "HUP")) {
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
cdr_profile_t *profile; cdr_profile_t *profile;
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (cdr_profile_t *) val; profile = (cdr_profile_t *) val;
@ -785,7 +785,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_format_cdr_shutdown)
switch_event_unbind(&globals.node); switch_event_unbind(&globals.node);
switch_core_remove_state_handler(&state_handlers); switch_core_remove_state_handler(&state_handlers);
for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
cdr_profile_t *profile; cdr_profile_t *profile;
switch_core_hash_this(hi, NULL, NULL, &val); switch_core_hash_this(hi, NULL, NULL, &val);
profile = (cdr_profile_t *) val; profile = (cdr_profile_t *) val;

View File

@ -498,7 +498,7 @@ static void pause_when_offline(void)
switch_mutex_lock(globals.clients_mutex); switch_mutex_lock(globals.clients_mutex);
for (hi = switch_core_hash_first(globals.clients_roster); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.clients_roster); hi; hi = switch_core_hash_next(&hi)) {
const void *key; const void *key;
void *client; void *client;
switch_core_hash_this(hi, &key, NULL, &client); switch_core_hash_this(hi, &key, NULL, &client);
@ -529,7 +529,7 @@ static void broadcast_event(struct rayo_actor *from, iks *rayo_event, int online
{ {
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
switch_mutex_lock(globals.clients_mutex); switch_mutex_lock(globals.clients_mutex);
for (hi = switch_core_hash_first(globals.clients_roster); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.clients_roster); hi; hi = switch_core_hash_next(&hi)) {
struct rayo_client *rclient; struct rayo_client *rclient;
const void *key; const void *key;
void *val; void *val;
@ -572,7 +572,7 @@ static struct dial_gateway *dial_gateway_find(const char *uri)
/* find longest prefix match */ /* find longest prefix match */
switch_mutex_lock(globals.dial_gateways_mutex); switch_mutex_lock(globals.dial_gateways_mutex);
for (hi = switch_core_hash_first(globals.dial_gateways); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.dial_gateways); hi; hi = switch_core_hash_next(&hi)) {
struct dial_gateway *candidate = NULL; struct dial_gateway *candidate = NULL;
const void *prefix; const void *prefix;
int prefix_len = 0; int prefix_len = 0;
@ -1111,7 +1111,7 @@ static void rayo_call_cleanup(struct rayo_actor *actor)
} }
/* send <end> to all offered clients */ /* send <end> to all offered clients */
for (hi = switch_core_hash_first(call->pcps); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(call->pcps); hi; hi = switch_core_hash_next(&hi)) {
const void *key; const void *key;
void *val; void *val;
const char *client_jid = NULL; const char *client_jid = NULL;
@ -2898,7 +2898,7 @@ static void broadcast_mixer_event(struct rayo_mixer *mixer, iks *rayo_event)
{ {
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
switch_mutex_lock(RAYO_ACTOR(mixer)->mutex); switch_mutex_lock(RAYO_ACTOR(mixer)->mutex);
for (hi = switch_core_hash_first(mixer->subscribers); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(mixer->subscribers); hi; hi = switch_core_hash_next(&hi)) {
const void *key; const void *key;
void *val; void *val;
struct rayo_mixer_subscriber *subscriber; struct rayo_mixer_subscriber *subscriber;
@ -3615,7 +3615,7 @@ SWITCH_STANDARD_APP(rayo_app)
/* Offer call to all ONLINE clients */ /* Offer call to all ONLINE clients */
/* TODO load balance offers so first session doesn't always get offer first? */ /* TODO load balance offers so first session doesn't always get offer first? */
switch_mutex_lock(globals.clients_mutex); switch_mutex_lock(globals.clients_mutex);
for (hi = switch_core_hash_first(globals.clients_roster); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.clients_roster); hi; hi = switch_core_hash_next(&hi)) {
struct rayo_client *rclient; struct rayo_client *rclient;
const void *key; const void *key;
void *val; void *val;
@ -4059,7 +4059,7 @@ static int dump_api(const char *cmd, switch_stream_handle_t *stream)
stream->write_function(stream, "\nENTITIES\n"); stream->write_function(stream, "\nENTITIES\n");
switch_mutex_lock(globals.actors_mutex); switch_mutex_lock(globals.actors_mutex);
for (hi = switch_core_hash_first(globals.actors); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.actors); hi; hi = switch_core_hash_next(&hi)) {
struct rayo_actor *actor = NULL; struct rayo_actor *actor = NULL;
const void *key; const void *key;
void *val; void *val;
@ -4071,7 +4071,7 @@ static int dump_api(const char *cmd, switch_stream_handle_t *stream)
stream->write_function(stream, "\n"); stream->write_function(stream, "\n");
} }
for (hi = switch_core_hash_first(globals.destroy_actors); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.destroy_actors); hi; hi = switch_core_hash_next(&hi)) {
struct rayo_actor *actor = NULL; struct rayo_actor *actor = NULL;
const void *key; const void *key;
void *val; void *val;
@ -4370,7 +4370,7 @@ static switch_status_t list_actors(const char *line, const char *cursor, switch_
struct rayo_actor *actor; struct rayo_actor *actor;
switch_mutex_lock(globals.actors_mutex); switch_mutex_lock(globals.actors_mutex);
for (hi = switch_core_hash_first(globals.actors); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.actors); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &val); switch_core_hash_this(hi, &vvar, NULL, &val);
actor = (struct rayo_actor *) val; actor = (struct rayo_actor *) val;

View File

@ -133,7 +133,7 @@ static void subscriber_execute(const char *uuid, const char *signal_type, subscr
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
switch_hash_t *signal_subscribers = switch_core_hash_find(globals.subscribers, key); switch_hash_t *signal_subscribers = switch_core_hash_find(globals.subscribers, key);
if (signal_subscribers) { if (signal_subscribers) {
for (hi = switch_core_hash_first(signal_subscribers); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(signal_subscribers); hi; hi = switch_core_hash_next(&hi)) {
const void *jid; const void *jid;
void *dont_care; void *dont_care;
switch_core_hash_this(hi, &jid, NULL, &dont_care); switch_core_hash_this(hi, &jid, NULL, &dont_care);
@ -161,7 +161,7 @@ static void stop_cpa_detectors(struct cpa_component *cpa)
{ {
if (cpa->signals) { if (cpa->signals) {
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
for (hi = switch_core_hash_first(cpa->signals); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(cpa->signals); hi; hi = switch_core_hash_next(&hi)) {
const void *signal_type; const void *signal_type;
void *cpa_signal = NULL; void *cpa_signal = NULL;
switch_core_hash_this(hi, &signal_type, NULL, &cpa_signal); switch_core_hash_this(hi, &signal_type, NULL, &cpa_signal);

View File

@ -393,7 +393,7 @@ static switch_status_t rayo_cpa_detector_signal_types(const char *line, const ch
switch_console_callback_match_t *my_matches = NULL; switch_console_callback_match_t *my_matches = NULL;
switch_mutex_lock(globals.detectors_mutex); switch_mutex_lock(globals.detectors_mutex);
for (hi = switch_core_hash_first(globals.detectors); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.detectors); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &val); switch_core_hash_this(hi, &vvar, NULL, &val);
switch_console_push_match(&my_matches, (const char *) vvar); switch_console_push_match(&my_matches, (const char *) vvar);
} }

View File

@ -282,7 +282,7 @@ static switch_status_t input_handler_on_dtmf(switch_core_session_t *session, con
switch_mutex_lock(handler->mutex); switch_mutex_lock(handler->mutex);
/* check input on each component */ /* check input on each component */
for (hi = switch_core_hash_first(handler->dtmf_components); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(handler->dtmf_components); hi; hi = switch_core_hash_next(&hi)) {
const void *jid; const void *jid;
void *component; void *component;
switch_core_hash_this(hi, &jid, NULL, &component); switch_core_hash_this(hi, &jid, NULL, &component);
@ -330,7 +330,7 @@ static switch_bool_t input_handler_bug_callback(switch_media_bug_t *bug, void *u
switch_event_t *components_to_remove = NULL; switch_event_t *components_to_remove = NULL;
/* check timeout/stop on each component */ /* check timeout/stop on each component */
for (hi = switch_core_hash_first(handler->dtmf_components); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(handler->dtmf_components); hi; hi = switch_core_hash_next(&hi)) {
const void *jid; const void *jid;
void *component; void *component;
switch_core_hash_this(hi, &jid, NULL, &component); switch_core_hash_this(hi, &jid, NULL, &component);
@ -356,7 +356,7 @@ static switch_bool_t input_handler_bug_callback(switch_media_bug_t *bug, void *u
} }
case SWITCH_ABC_TYPE_CLOSE: case SWITCH_ABC_TYPE_CLOSE:
/* complete all components */ /* complete all components */
for (hi = switch_core_hash_first(handler->dtmf_components); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(handler->dtmf_components); hi; hi = switch_core_hash_next(&hi)) {
const void *jid; const void *jid;
void *component; void *component;
switch_core_hash_this(hi, &jid, NULL, &component); switch_core_hash_this(hi, &jid, NULL, &component);

View File

@ -872,7 +872,7 @@ void srgs_parser_destroy(struct srgs_parser *parser)
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
/* clean up all cached grammars */ /* clean up all cached grammars */
for (hi = switch_core_hash_first(parser->cache); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(parser->cache); hi; hi = switch_core_hash_next(&hi)) {
struct srgs_grammar *grammar = NULL; struct srgs_grammar *grammar = NULL;
const void *key; const void *key;
void *val; void *val;

View File

@ -1729,7 +1729,7 @@ void xmpp_stream_context_dump(struct xmpp_stream_context *context, switch_stream
switch_hash_index_t *hi; switch_hash_index_t *hi;
switch_mutex_lock(context->streams_mutex); switch_mutex_lock(context->streams_mutex);
stream->write_function(stream, "\nACTIVE STREAMS\n"); stream->write_function(stream, "\nACTIVE STREAMS\n");
for (hi = switch_core_hash_first(context->streams); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(context->streams); hi; hi = switch_core_hash_next(&hi)) {
struct xmpp_stream *s = NULL; struct xmpp_stream *s = NULL;
const void *key; const void *key;
void *val; void *val;

View File

@ -810,7 +810,7 @@ SWITCH_STANDARD_API(show_local_stream_function)
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
if (zstr(cmd)) { if (zstr(cmd)) {
for (hi = switch_core_hash_first( globals.source_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( globals.source_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
if ((source = (local_stream_source_t *) val)) { if ((source = (local_stream_source_t *) val)) {
stream->write_function(stream, "%s,%s\n", source->name, source->location); stream->write_function(stream, "%s,%s\n", source->name, source->location);

View File

@ -343,7 +343,7 @@ static struct voice *find_voice(struct ssml_node *cur_node, switch_hash_t *map,
} }
/* find best language, name, gender match */ /* find best language, name, gender match */
for (hi = switch_core_hash_first(map); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(map); hi; hi = switch_core_hash_next(&hi)) {
const void *key; const void *key;
void *val; void *val;
struct voice *candidate; struct voice *candidate;
@ -1160,7 +1160,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_ssml_shutdown)
switch_core_hash_destroy(&globals.language_map); switch_core_hash_destroy(&globals.language_map);
{ {
switch_hash_index_t *hi = NULL; switch_hash_index_t *hi = NULL;
for (hi = switch_core_hash_first(globals.tag_defs); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(globals.tag_defs); hi; hi = switch_core_hash_next(&hi)) {
const void *key; const void *key;
struct tag_def *def; struct tag_def *def;
switch_core_hash_this(hi, &key, NULL, (void *)&def); switch_core_hash_this(hi, &key, NULL, (void *)&def);

View File

@ -198,7 +198,7 @@ void FSXML::DestroyHash()
} }
/* First destroy all objects in the hash */ /* First destroy all objects in the hash */
for (hi = switch_core_hash_first( tmp); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( tmp); hi; hi = switch_core_hash_next(&hi)) {
const void *var = NULL; const void *var = NULL;
void *val = NULL; void *val = NULL;
FSXML *obj; FSXML *obj;

View File

@ -264,7 +264,7 @@ static switch_status_t process_node(const switch_log_node_t *node, switch_log_le
const void *var; const void *var;
logfile_profile_t *profile; logfile_profile_t *profile;
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(&hi)) {
size_t mask = 0; size_t mask = 0;
size_t ok = 0; size_t ok = 0;
@ -380,14 +380,14 @@ static void event_handler(switch_event_t *event)
if (sig && !strcmp(sig, "HUP")) { if (sig && !strcmp(sig, "HUP")) {
if (globals.rotate) { if (globals.rotate) {
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
profile = val; profile = val;
mod_logfile_rotate(profile); mod_logfile_rotate(profile);
} }
} else { } else {
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
profile = val; profile = val;
switch_file_close(profile->log_afd); switch_file_close(profile->log_afd);
@ -461,7 +461,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_logfile_shutdown)
switch_log_unbind_logger(mod_logfile_logger); switch_log_unbind_logger(mod_logfile_logger);
switch_event_unbind(&globals.node); switch_event_unbind(&globals.node);
for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( profile_hash); hi; hi = switch_core_hash_next(&hi)) {
logfile_profile_t *profile; logfile_profile_t *profile;
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (logfile_profile_t *) val)) { if ((profile = (logfile_profile_t *) val)) {

View File

@ -1196,7 +1196,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
MIMETypeInit(); MIMETypeInit();
for (hi = switch_core_mime_index(); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_mime_index(); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
if (var && val) { if (var && val) {
MIMETypeAdd((char *) val, (char *) var); MIMETypeAdd((char *) val, (char *) var);

View File

@ -143,7 +143,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
When done, iterate through the list deleting hash entries When done, iterate through the list deleting hash entries
*/ */
for (hi = switch_core_hash_first(hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first(hash); hi; hi = switch_core_hash_next(&hi)) {
const void *key; const void *key;
void *val; void *val;
switch_core_hash_this(hi, &key, NULL, &val); switch_core_hash_this(hi, &key, NULL, &val);
@ -210,7 +210,7 @@ SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_first(switch_hash_t *hash
return switch_hashtable_first(hash); return switch_hashtable_first(hash);
} }
SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(switch_hash_index_t *hi) SWITCH_DECLARE(switch_hash_index_t *) switch_core_hash_next(switch_hash_index_t **hi)
{ {
return switch_hashtable_next(hi); return switch_hashtable_next(hi);
} }

View File

@ -222,7 +222,7 @@ SWITCH_DECLARE(uint32_t) switch_core_session_hupall_matching_var_ans(const char
return r; return r;
switch_mutex_lock(runtime.session_hash_mutex); switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
if (val) { if (val) {
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;
@ -275,7 +275,7 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_ma
switch_core_new_memory_pool(&pool); switch_core_new_memory_pool(&pool);
switch_mutex_lock(runtime.session_hash_mutex); switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
if (val) { if (val) {
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;
@ -319,7 +319,7 @@ SWITCH_DECLARE(void) switch_core_session_hupall_endpoint(const switch_endpoint_i
switch_core_new_memory_pool(&pool); switch_core_new_memory_pool(&pool);
switch_mutex_lock(runtime.session_hash_mutex); switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
if (val) { if (val) {
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;
@ -359,7 +359,7 @@ SWITCH_DECLARE(void) switch_core_session_hupall(switch_call_cause_t cause)
switch_mutex_lock(runtime.session_hash_mutex); switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
if (val) { if (val) {
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;
@ -394,7 +394,7 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall(vo
switch_console_callback_match_t *my_matches = NULL; switch_console_callback_match_t *my_matches = NULL;
switch_mutex_lock(runtime.session_hash_mutex); switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first( session_manager.session_table); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
if (val) { if (val) {
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;

View File

@ -576,7 +576,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
} }
} }
for (hi = switch_core_hash_first( CUSTOM_HASH); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( CUSTOM_HASH); hi; hi = switch_core_hash_next(&hi)) {
switch_event_subclass_t *subclass; switch_event_subclass_t *subclass;
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
if ((subclass = (switch_event_subclass_t *) val)) { if ((subclass = (switch_event_subclass_t *) val)) {
@ -2724,7 +2724,7 @@ static uint32_t switch_event_channel_unsub_channel(switch_event_channel_func_t f
switch_hash_index_t *hi; switch_hash_index_t *hi;
void *val; void *val;
for (hi = switch_core_hash_first( event_channel_manager.hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
if (val) { if (val) {

View File

@ -261,9 +261,11 @@ switch_hashtable_destroy(switch_hashtable_t **h)
*h = NULL; *h = NULL;
} }
SWITCH_DECLARE(switch_hashtable_iterator_t *) switch_hashtable_next(switch_hashtable_iterator_t *i) SWITCH_DECLARE(switch_hashtable_iterator_t *) switch_hashtable_next(switch_hashtable_iterator_t **iP)
{ {
switch_hashtable_iterator_t *i = *iP;
if (i->e) { if (i->e) {
if ((i->e = i->e->next) != 0) { if ((i->e = i->e->next) != 0) {
return i; return i;
@ -277,22 +279,33 @@ SWITCH_DECLARE(switch_hashtable_iterator_t *) switch_hashtable_next(switch_hasht
} }
if (i->pos >= i->h->tablelength) { if (i->pos >= i->h->tablelength) {
return NULL; goto end;
} }
if ((i->e = i->h->table[i->pos]) != 0) { if ((i->e = i->h->table[i->pos]) != 0) {
return i; return i;
} }
end:
free(i);
*iP = NULL;
return NULL; return NULL;
} }
SWITCH_DECLARE(switch_hashtable_iterator_t *) switch_hashtable_first(switch_hashtable_t *h) SWITCH_DECLARE(switch_hashtable_iterator_t *) switch_hashtable_first(switch_hashtable_t *h)
{ {
h->iterator.pos = 0; switch_hashtable_iterator_t *iterator;
h->iterator.e = NULL;
h->iterator.h = h; switch_zmalloc(iterator, sizeof(*iterator));
return switch_hashtable_next(&h->iterator); switch_assert(iterator);
iterator->pos = 0;
iterator->e = NULL;
iterator->h = h;
return switch_hashtable_next(&iterator);
} }

View File

@ -2189,7 +2189,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
} }
/* /*
if ((hi = switch_channel_variable_first(caller_channel))) { if ((hi = switch_channel_variable_first(caller_channel))) {
for (; hi; hi = switch_core_hash_next(hi)) { for (; hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &vvar, NULL, &vval); switch_core_hash_this(hi, &vvar, NULL, &vval);
if (vvar && vval) { if (vvar && vval) {
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (void *) vvar, (char *) vval); switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (void *) vvar, (char *) vval);

View File

@ -118,7 +118,7 @@ static void switch_loadable_module_runtime(void)
switch_loadable_module_t *module; switch_loadable_module_t *module;
switch_mutex_lock(loadable_modules.mutex); switch_mutex_lock(loadable_modules.mutex);
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
module = (switch_loadable_module_t *) val; module = (switch_loadable_module_t *) val;
@ -620,7 +620,7 @@ 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"))) { 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); switch_mutex_lock(loadable_modules.mutex);
for (hi = switch_core_hash_first( loadable_modules.chat_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, &var, NULL, &val);
if ((ci = (switch_chat_interface_t *) val)) { if ((ci = (switch_chat_interface_t *) val)) {
@ -1639,7 +1639,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_enumerate_loaded(switch_m
switch_loadable_module_t *module; switch_loadable_module_t *module;
switch_mutex_lock(loadable_modules.mutex); switch_mutex_lock(loadable_modules.mutex);
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
module = (switch_loadable_module_t *) val; module = (switch_loadable_module_t *) val;
@ -1986,7 +1986,7 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
} }
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
module = (switch_loadable_module_t *) val; module = (switch_loadable_module_t *) val;
if (!module->perm) { if (!module->perm) {
@ -1996,7 +1996,7 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
switch_yield(1000000); switch_yield(1000000);
for (hi = switch_core_hash_first( loadable_modules.module_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
module = (switch_loadable_module_t *) val; module = (switch_loadable_module_t *) val;
if (!module->perm) { if (!module->perm) {
@ -2196,7 +2196,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs(const switch_codec_impleme
const switch_codec_implementation_t *imp; const switch_codec_implementation_t *imp;
switch_mutex_lock(loadable_modules.mutex); switch_mutex_lock(loadable_modules.mutex);
for (hi = switch_core_hash_first( loadable_modules.codec_hash); hi; hi = switch_core_hash_next(hi)) { 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); switch_core_hash_this(hi, NULL, NULL, &val);
codec_interface = (switch_codec_interface_t *) val; codec_interface = (switch_codec_interface_t *) val;

View File

@ -2017,7 +2017,7 @@ SWITCH_DECLARE(void) switch_rtp_shutdown(void)
switch_mutex_lock(port_lock); switch_mutex_lock(port_lock);
for (hi = switch_core_hash_first( alloc_hash); hi; hi = switch_core_hash_next(hi)) { for (hi = switch_core_hash_first( alloc_hash); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val); switch_core_hash_this(hi, &var, NULL, &val);
if ((alloc = (switch_core_port_allocator_t *) 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_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroy port allocator for %s\n", (char *) var);