void *val;
/* 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);
ftdm_conf_node_destroy(val);
}
unsigned int primeindex;
unsigned int (*hashfn) (void *k);
int (*eqfn) (void *k1, void *k2);
- struct switch_hashtable_iterator iterator;
};
/*****************************************************************************/
\param hi The current element
\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
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_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);
static inline int switch_hash_equalkeys(void *k1, void *k2)
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_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_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_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_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;
const void *key;
switch_ssize_t keylen;
switch_hash_index_t *hi;
int queue_count = 0;
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++;
}
switch_mutex_unlock(globals.mutex);
const void *vvar;
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_console_push_match(&my_matches, (const char *) vvar);
}
if (conference == NULL) {
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;
switch_core_hash_this(hi, NULL, NULL, &val);
conference = (conference_obj_t *) val;
if (conference == NULL) {
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);
conference = (conference_obj_t *) val;
int total = 0;
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);
session = (switch_core_session_t *) val;
channel = switch_core_session_get_channel(session);
x_tmp = switch_xml_add_child_d(xml, container, cc_off++);
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;
const char *status;
const char *ts;
const void *var;
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);
stream->write_function(stream, " %s\n", (char *)var);
}
fifo_node_t *node;
void *val;
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);
if ((node = (fifo_node_t *) val)) {
stream->write_function(stream, "node: %s\n"
switch_assert(x_report);
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);
node = (fifo_node_t *) val;
}
} else if (!strcasecmp(argv[0], "count")) {
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);
node = (fifo_node_t *) val;
switch_mutex_lock(node->update_mutex);
}
} else if (!strcasecmp(argv[0], "has_outbound")) {
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);
node = (fifo_node_t *) val;
switch_mutex_lock(node->update_mutex);
fifo_node_t *node;
void *val;
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);
if ((node = (fifo_node_t *) val) && node->is_static && node->ready == 1) {
node->ready = -1;
if (mode & 1) {
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;
const void *key;
switch_ssize_t keylen;
if (mode & 2) {
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;
const void *key;
switch_ssize_t keylen;
stream->write_function(stream, "Remote connections:\nName\t\t\tState\n");
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;
const void *key;
switch_ssize_t keylen;
switch_thread_rwlock_wrlock((*r)->rwlock);
/* 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;
const void *key;
switch_ssize_t keylen;
switch_hash_index_t *hi;
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;
const void *hashkey;
switch_ssize_t keylen;
void *val;
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);
profile = (client_profile_t *) val;
switch_event_destroy(&profile->dial_params.app_list);
}
switch_assert(argv[0]);
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);
profile = (profile_t *) val;
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);
spy = (spy_t *) val;
}
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_console_push_match(&matches, (const char *) var);
}
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);
i_ext = (char *) i_var;
token = (valet_token_t *) i_val;
time_t now = switch_epoch_time_now(NULL);
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;
switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
token = (valet_token_t *) i_val;
now = switch_epoch_time_now(NULL);
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);
token = (valet_token_t *) i_val;
if (token->timeout > 0 && (token->timeout < now || token->timeout == 1)) {
stream->write_function(stream, "<lots>\n");
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;
const void *i_var;
void *i_val;
stream->write_function(stream, " <lot name=\"%s\">\n", name);
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;
switch_core_hash_this(i_hi, &i_var, NULL, &i_val);
const char *nvar;
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);
nvar = (const char *) var;
"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_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);
profile = (vm_profile_t *) val;
parse_profile();
} else if (!strcasecmp(argv[0], "status")) {
stream->write_function(stream, "============================\n");
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);
profile = (vm_profile_t *) val;
stream->write_function(stream, "Profile: %s\n", profile->name);
void *value;
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);
profile = (vm_profile_t *) value;
if (profile) {
{
/* loop through each param and add to synth header or vendor-specific-params */
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;
const void *key;
void *val;
}
/* 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;
const void *key;
void *val;
r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
/* 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
if (grammar_uri_count == 1 && grammar->type != GRAMMAR_TYPE_URI)
goto no_grammar_alone;
/* 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_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);
len = strlen(grammar->data);
if (!len)
{
/* loop through each param and add to recog header or vendor-specific-params */
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;
const void *key;
void *val;
}
/* 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;
const void *key;
void *val;
#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_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;
char sessid_str[25];
char encoder_tx_str[25];
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_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);
profile = (mdl_profile_t *) val;
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);
profile = (mdl_profile_t *) val;
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_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);
profile = (mdl_profile_t *) val;
if (old_ip4 && profile->extip && !strcmp(profile->extip, old_ip4)) {
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);
profile = (mdl_profile_t *) val;
switch_console_callback_match_t *my_matches = NULL;
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);
profile = (mdl_profile_t *) val;
if (!strncmp("dl_logout", line, 9)) {
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_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);
profile = (mdl_profile_t *) val;
stream->write_function(stream, "%s | ", profile->login);
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);
profile = (mdl_profile_t *) data;
}
}
- 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);
if ((profile = switch_core_hash_find(globals.profile_hash, (char *) data))) {
{
switch_hash_index_t *hi;
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;
void *val;
shared_audio_stream_t *s = NULL;
{
switch_hash_index_t *hi;
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;
void *val;
audio_endpoint_t *e = NULL;
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;
const void *key;
switch_ssize_t keylen;
int sess = 0;
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;
const void *key;
switch_ssize_t keylen;
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_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;
const void *key;
switch_ssize_t keylen;
stream->write_function(stream, "user,nickname,uuid\n");
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;
const void *key;
switch_ssize_t keylen;
} else {
switch_hash_index_t *hi;
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;
const void *key;
switch_ssize_t keylen;
switch_console_callback_match_t *my_matches = NULL;
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_console_push_match(&my_matches, (const char *) vvar);
}
if (disallow_multiple_registration) {
switch_hash_index_t *hi;
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;
const void *key;
switch_ssize_t keylen;
skinny_profile_t *profile = NULL, *tmp_profile;
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);
tmp_profile = (skinny_profile_t *) val;
/* walk listeners */
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);
profile = (skinny_profile_t *) val;
switch_mutex_lock(globals.mutex);
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);
if ((profile = (skinny_profile_t *) val) && profile->auto_restart) {
if (!strcmp(profile->ip, old_ip4)) {
/* launch listeners */
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;
skinny_profile_t *profile;
/* close sockets */
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;
switch_core_hash_this(hi, NULL, NULL, &val);
profile = (skinny_profile_t *) val;
/* walk profiles */
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);
profile = (skinny_profile_t *) val;
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_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);
profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
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_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);
profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
stream->write_function(stream, "<gateways>\n", header);
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);
profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
stream->write_function(stream, "%s\n", header);
stream->write_function(stream, "<profiles>\n");
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);
profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
const void *var;
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);
if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) {
select_from_profile(profile, user, domain, concat, exclude_contact, &mystream, SWITCH_TRUE);
const void *var;
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);
if ((profile = (sofia_profile_t *) val) && !strcmp((char *)var, profile->name)) {
get_presence_data(profile, user, domain, search, stream);
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((profile = (sofia_profile_t *) val)) {
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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;
uint32_t x = 0;
switch_core_hash_this(hi, &var, NULL, &val);
switch_status_t status = SWITCH_STATUS_FALSE;
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);
profile = (sofia_profile_t *) val;
switch_status_t status = SWITCH_STATUS_FALSE;
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);
profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((profile = (sofia_profile_t *) val)) {
if (!(nh = nua_handle_by_replaces(profile->nua, replaces))) {
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((pptr = (sofia_profile_t *) val)) {
int rsec = 10;
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((pptr = (sofia_profile_t *) val)) {
nua_set_params(pptr->nua, TPTAG_LOG(on), TAG_END());
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((pptr = (sofia_profile_t *) val)) {
if (on) {
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((pptr = (sofia_profile_t *) val)) {
nua_set_params(pptr->nua, TPTAG_CAPT(on ? mod_sofia_globals.capture_server : NULL), TAG_END());
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((pptr = (sofia_profile_t *) val)) {
pptr->watchdog_enabled = (on ? 1 : 0);
switch_mutex_lock(mod_sofia_globals.hash_mutex);
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);
if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
aliases[i++] = strdup((char *) var);
switch_mutex_lock(profile->flag_mutex);
if (profile->reg_nh_hash) {
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);
if ((nh = (nua_handle_t *) val)) {
nua_handle_unref(nh);
void *val;
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);
if (key && (gateway = (sofia_gateway_t *) val) && !gateway->deleted && gateway->register_realm && !strcasecmp(gateway->register_realm, key)) {
break;
}
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);
fd = (cdr_fd_t *) val;
switch_mutex_lock(fd->mutex);
void *val;
cdr_fd_t *fd;
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);
fd = (cdr_fd_t *) val;
switch_mutex_lock(fd->mutex);
}
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);
fd = (cdr_fd_t *) val;
switch_mutex_lock(fd->mutex);
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_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);
se = (session_elem_t*)val;
if (se->spawn_reply && !strncmp(se->spawn_reply->hash, hash, 100)) {
session_elem_t *session = NULL;
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);
if (((session_elem_t*)val)->process.type == ERLANG_PID && !ei_compare_pids(pid, &((session_elem_t*)val)->process.pid)) {
/* TODO try to minimize critical section */
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);
sp = (session_elem_t*)value;
if (switch_test_flag(sp, LFLAG_WAITING_FOR_PID)) {
/* clean up all the attached sessions */
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);
s = (session_elem_t*)value;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Orphaning call %s\n", s->uuid_str);
switch_hash_index_t *iter;
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++;
}
switch_thread_rwlock_unlock(listener->session_rwlock);
found = 1;
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;
switch_core_hash_this(iter, &key, NULL, &value);
sp = (session_elem_t*)value;
}
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);
stream->write_function(stream, "\t%s\n", (char *)key);
}
struct peer_status *last;
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);
host = (char *) key;
last = (struct peer_status *) value;
char *host;
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);
host = (char *) key;
last = (struct peer_status *) value;
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;
switch_core_hash_this(hi, NULL, NULL, &val);
profile = (cdr_profile_t *) val;
const char *sig = switch_event_get_header(event, "Trapped-Signal");
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;
switch_core_hash_this(hi, NULL, NULL, &val);
profile = (cdr_profile_t *) val;
switch_event_unbind(&globals.node);
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;
switch_core_hash_this(hi, NULL, NULL, &val);
profile = (cdr_profile_t *) val;
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;
void *client;
switch_core_hash_this(hi, &key, NULL, &client);
{
switch_hash_index_t *hi = NULL;
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;
const void *key;
void *val;
/* find longest prefix match */
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;
const void *prefix;
int prefix_len = 0;
}
/* 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;
void *val;
const char *client_jid = NULL;
{
switch_hash_index_t *hi = NULL;
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;
void *val;
struct rayo_mixer_subscriber *subscriber;
/* 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_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;
const void *key;
void *val;
stream->write_function(stream, "\nENTITIES\n");
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;
const void *key;
void *val;
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;
const void *key;
void *val;
struct rayo_actor *actor;
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);
actor = (struct rayo_actor *) val;
switch_hash_index_t *hi = NULL;
switch_hash_t *signal_subscribers = switch_core_hash_find(globals.subscribers, key);
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;
void *dont_care;
switch_core_hash_this(hi, &jid, NULL, &dont_care);
{
if (cpa->signals) {
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;
void *cpa_signal = NULL;
switch_core_hash_this(hi, &signal_type, NULL, &cpa_signal);
switch_console_callback_match_t *my_matches = NULL;
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_console_push_match(&my_matches, (const char *) vvar);
}
switch_mutex_lock(handler->mutex);
/* 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;
void *component;
switch_core_hash_this(hi, &jid, NULL, &component);
switch_event_t *components_to_remove = NULL;
/* 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;
void *component;
switch_core_hash_this(hi, &jid, NULL, &component);
}
case SWITCH_ABC_TYPE_CLOSE:
/* 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;
void *component;
switch_core_hash_this(hi, &jid, NULL, &component);
switch_hash_index_t *hi = NULL;
/* 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;
const void *key;
void *val;
switch_hash_index_t *hi;
switch_mutex_lock(context->streams_mutex);
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;
const void *key;
void *val;
switch_mutex_lock(globals.mutex);
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);
if ((source = (local_stream_source_t *) val)) {
stream->write_function(stream, "%s,%s\n", source->name, source->location);
}
/* 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;
void *val;
struct voice *candidate;
switch_core_hash_destroy(&globals.language_map);
{
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;
struct tag_def *def;
switch_core_hash_this(hi, &key, NULL, (void *)&def);
}
/* 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;
void *val = NULL;
FSXML *obj;
const void *var;
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 ok = 0;
if (sig && !strcmp(sig, "HUP")) {
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);
profile = val;
mod_logfile_rotate(profile);
}
} else {
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);
profile = val;
switch_file_close(profile->log_afd);
switch_log_unbind_logger(mod_logfile_logger);
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;
switch_core_hash_this(hi, &var, NULL, &val);
if ((profile = (logfile_profile_t *) val)) {
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);
if (var && val) {
MIMETypeAdd((char *) val, (char *) var);
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;
void *val;
switch_core_hash_this(hi, &key, NULL, &val);
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 r;
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);
if (val) {
session = (switch_core_session_t *) val;
switch_core_new_memory_pool(&pool);
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);
if (val) {
session = (switch_core_session_t *) val;
switch_core_new_memory_pool(&pool);
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);
if (val) {
session = (switch_core_session_t *) val;
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);
if (val) {
session = (switch_core_session_t *) val;
switch_console_callback_match_t *my_matches = NULL;
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);
if (val) {
session = (switch_core_session_t *) val;
}
}
- 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_core_hash_this(hi, &var, NULL, &val);
if ((subclass = (switch_event_subclass_t *) val)) {
switch_hash_index_t *hi;
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);
if (val) {
*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 = i->e->next) != 0) {
return i;
}
if (i->pos >= i->h->tablelength) {
- return NULL;
+ goto end;
}
if ((i->e = i->h->table[i->pos]) != 0) {
return i;
}
+ end:
+
+ free(i);
+ *iP = NULL;
+
return NULL;
}
SWITCH_DECLARE(switch_hashtable_iterator_t *) switch_hashtable_first(switch_hashtable_t *h)
{
- h->iterator.pos = 0;
- h->iterator.e = NULL;
- h->iterator.h = h;
- return switch_hashtable_next(&h->iterator);
+ switch_hashtable_iterator_t *iterator;
+
+ switch_zmalloc(iterator, sizeof(*iterator));
+ switch_assert(iterator);
+
+ iterator->pos = 0;
+ iterator->e = NULL;
+ iterator->h = h;
+
+ return switch_hashtable_next(&iterator);
}
}
/*
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);
if (vvar && vval) {
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (void *) vvar, (char *) vval);
switch_loadable_module_t *module;
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);
module = (switch_loadable_module_t *) val;
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_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);
if ((ci = (switch_chat_interface_t *) val)) {
switch_loadable_module_t *module;
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);
module = (switch_loadable_module_t *) val;
}
- 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);
module = (switch_loadable_module_t *) val;
if (!module->perm) {
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);
module = (switch_loadable_module_t *) val;
if (!module->perm) {
const switch_codec_implementation_t *imp;
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);
codec_interface = (switch_codec_interface_t *) val;
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);
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);