mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 22:54:18 +00:00
FS-6402 part 2
This commit is contained in:
1 parent
5110ee8008
commit
7151d6acea
47 files changed
+198
-154
No files matched your search
@@ -116,7 +116,7 @@ static switch_status_t do_config(switch_bool_t reload)
|
||||
{
|
||||
/* Load up blacklists */
|
||||
switch_xml_t xml, cfg, lists, list;
|
||||
switch_hash_index_t *hi;
|
||||
switch_hash_index_t *hi = NULL;
|
||||
|
||||
if (!(xml = switch_xml_open_cfg("mod_blacklist.conf", &cfg, NULL))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't load configuration section\n");
|
||||
@@ -126,7 +126,7 @@ static switch_status_t do_config(switch_bool_t reload)
|
||||
switch_mutex_lock(globals.lists_mutex);
|
||||
|
||||
/* Destroy any active lists */
|
||||
while ((hi = switch_core_hash_first( globals.lists))) {
|
||||
while ((hi = switch_core_hash_first_iter( globals.lists, hi))) {
|
||||
const void *key;
|
||||
void *val;
|
||||
switch_core_hash_this(hi, &key, NULL, &val);
|
||||
@@ -282,7 +282,7 @@ SWITCH_STANDARD_API(blacklist_api_function)
|
||||
switch_mutex_lock(globals.lists_mutex);
|
||||
if (switch_file_open(&fd, filename, SWITCH_FOPEN_WRITE | SWITCH_FOPEN_TRUNCATE | SWITCH_FOPEN_CREATE, SWITCH_FPROT_OS_DEFAULT, globals.pool)
|
||||
== SWITCH_STATUS_SUCCESS) {
|
||||
for (hi = switch_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);
|
||||
|
||||
@@ -3198,7 +3198,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||
switch_hash_index_t *hi;
|
||||
stream->write_function(stream, "%s", "name|strategy|moh_sound|time_base_score|tier_rules_apply|tier_rule_wait_second|tier_rule_wait_multiply_level|tier_rule_no_agent_no_wait|discard_abandoned_after|abandoned_resume_allowed|max_wait_time|max_wait_time_with_no_agent|max_wait_time_with_no_agent_time_reached|record_template\n");
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_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;
|
||||
@@ -3251,7 +3251,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||
switch_hash_index_t *hi;
|
||||
int queue_count = 0;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_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);
|
||||
@@ -3373,7 +3373,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load)
|
||||
Macro expands to: switch_status_t mod_callcenter_shutdown() */
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_callcenter_shutdown)
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
switch_hash_index_t *hi = NULL;
|
||||
cc_queue_t *queue;
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
@@ -3394,7 +3394,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_callcenter_shutdown)
|
||||
}
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
while ((hi = switch_core_hash_first( globals.queue_hash))) {
|
||||
while ((hi = switch_core_hash_first_iter( globals.queue_hash, hi))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
queue = (cc_queue_t *) val;
|
||||
|
||||
|
||||
@@ -5291,7 +5291,7 @@ static switch_status_t list_conferences(const char *line, const char *cursor, sw
|
||||
const void *vvar;
|
||||
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
for (hi = switch_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);
|
||||
}
|
||||
@@ -5783,7 +5783,7 @@ static switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_st
|
||||
|
||||
if (conference == NULL) {
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
for (hi = switch_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;
|
||||
@@ -6262,7 +6262,7 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc
|
||||
|
||||
if (conference == NULL) {
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
for (hi = switch_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;
|
||||
|
||||
|
||||
@@ -1070,7 +1070,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_directory_shutdown)
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
|
||||
while ((hi = switch_core_hash_first( globals.profile_hash))) {
|
||||
while ((hi = switch_core_hash_first(globals.profile_hash))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
profile = (dir_profile_t *) val;
|
||||
|
||||
|
||||
@@ -975,7 +975,7 @@ static int node_idle_consumers(fifo_node_t *node)
|
||||
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);
|
||||
@@ -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++);
|
||||
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;
|
||||
@@ -3987,7 +3987,7 @@ void dump_hash(switch_hash_t *hash, switch_stream_handle_t *stream)
|
||||
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);
|
||||
}
|
||||
@@ -4002,7 +4002,7 @@ void node_dump(switch_stream_handle_t *stream)
|
||||
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"
|
||||
@@ -4100,7 +4100,7 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
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;
|
||||
|
||||
@@ -4137,7 +4137,7 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
}
|
||||
} 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);
|
||||
@@ -4158,7 +4158,7 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
}
|
||||
} 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);
|
||||
@@ -4359,7 +4359,7 @@ static switch_status_t load_config(int reload, int del_all)
|
||||
fifo_node_t *node;
|
||||
void *val;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_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;
|
||||
|
||||
@@ -291,7 +291,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash)
|
||||
/* clear for uuid */
|
||||
if (realm == NULL && resource == NULL) {
|
||||
/* Loop through the channel's hashtable which contains mapping to all the limit_hash_item_t referenced by that channel */
|
||||
while ((hi = switch_core_hash_first( pvt->hash))) {
|
||||
while ((hi = switch_core_hash_first(pvt->hash))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -391,7 +391,7 @@ SWITCH_LIMIT_STATUS(limit_status_hash)
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.limit_hash_rwlock);
|
||||
|
||||
for (hi = switch_core_hash_first( globals.limit_hash); hi; switch_core_hash_next(hi)) {
|
||||
for (hi = switch_core_hash_first(globals.limit_hash); hi; switch_core_hash_next(hi)) {
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ SWITCH_STANDARD_API(hash_dump_function)
|
||||
|
||||
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;
|
||||
@@ -639,7 +639,7 @@ SWITCH_STANDARD_API(hash_dump_function)
|
||||
|
||||
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;
|
||||
@@ -679,7 +679,7 @@ SWITCH_STANDARD_API(hash_remote_function)
|
||||
stream->write_function(stream, "Remote connections:\nName\t\t\tState\n");
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
for (hi = switch_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;
|
||||
@@ -780,7 +780,7 @@ void limit_remote_destroy(limit_remote_t **r)
|
||||
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;
|
||||
@@ -803,7 +803,7 @@ static limit_hash_item_t get_remote_usage(const char *key) {
|
||||
switch_hash_index_t *hi;
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
for (hi = switch_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;
|
||||
@@ -1018,7 +1018,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_hash_load)
|
||||
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
switch_hash_index_t *hi = NULL;
|
||||
switch_bool_t remote_clean = SWITCH_TRUE;
|
||||
|
||||
switch_scheduler_del_task_group("mod_hash");
|
||||
@@ -1031,7 +1031,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
|
||||
limit_remote_t *item = NULL;
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.remote_hash_rwlock);
|
||||
if ((hi = switch_core_hash_first( globals.remote_hash))) {
|
||||
if ((hi = switch_core_hash_first(globals.remote_hash))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
item = (limit_remote_t *)val;
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
|
||||
switch_thread_rwlock_wrlock(globals.limit_hash_rwlock);
|
||||
switch_thread_rwlock_wrlock(globals.db_hash_rwlock);
|
||||
|
||||
while ((hi = switch_core_hash_first( globals.limit_hash))) {
|
||||
while ((hi = switch_core_hash_first_iter( globals.limit_hash, hi))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -1059,7 +1059,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
|
||||
switch_core_hash_delete(globals.limit_hash, key);
|
||||
}
|
||||
|
||||
while ((hi = switch_core_hash_first( globals.db_hash))) {
|
||||
while ((hi = switch_core_hash_first_iter( globals.db_hash, hi))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
|
||||
@@ -3088,7 +3088,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_httapi_shutdown)
|
||||
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);
|
||||
|
||||
@@ -2052,7 +2052,7 @@ SWITCH_STANDARD_API(dialplan_lcr_admin_function)
|
||||
}
|
||||
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;
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
|
||||
/* clear for uuid */
|
||||
if (realm == NULL && resource == NULL) {
|
||||
/* Loop through the channel's hashtable which contains mapping to all the limit_redis_item_t referenced by that channel */
|
||||
while ((hi = switch_core_hash_first( pvt->hash))) {
|
||||
while ((hi = switch_core_hash_first(pvt->hash))) {
|
||||
void *p_val = NULL;
|
||||
const void *p_key;
|
||||
char *p_uuid_key = NULL;
|
||||
|
||||
@@ -139,7 +139,7 @@ SWITCH_STANDARD_API(dump_hash)
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ static void do_unload(void) {
|
||||
|
||||
switch_mutex_lock(MUTEX);
|
||||
|
||||
while ((hi = switch_core_hash_first( globals.translate_profiles))) {
|
||||
while ((hi = switch_core_hash_first_iter( globals.translate_profiles, hi))) {
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
|
||||
@@ -105,7 +105,7 @@ static void check_timeouts(void)
|
||||
valet_lot_t *lot;
|
||||
switch_console_callback_match_t *matches = NULL;
|
||||
switch_console_callback_match_node_t *m;
|
||||
switch_hash_index_t *i_hi;
|
||||
switch_hash_index_t *i_hi = NULL;
|
||||
const void *i_var;
|
||||
void *i_val;
|
||||
char *i_ext;
|
||||
@@ -120,7 +120,7 @@ static void check_timeouts(void)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ static void check_timeouts(void)
|
||||
|
||||
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_iter( lot->hash, i_hi); 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;
|
||||
@@ -146,6 +146,7 @@ static void check_timeouts(void)
|
||||
goto top;
|
||||
}
|
||||
}
|
||||
switch_safe_free(i_hi);
|
||||
|
||||
switch_mutex_unlock(lot->mutex);
|
||||
}
|
||||
@@ -167,7 +168,7 @@ static int find_longest(valet_lot_t *lot, int min, int max)
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
|
||||
switch_mutex_lock(lot->mutex);
|
||||
for (i_hi = switch_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;
|
||||
@@ -257,7 +258,7 @@ static int valet_lot_count(valet_lot_t *lot)
|
||||
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)) {
|
||||
@@ -738,7 +739,7 @@ SWITCH_STANDARD_API(valet_info_function)
|
||||
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;
|
||||
@@ -754,7 +755,7 @@ SWITCH_STANDARD_API(valet_info_function)
|
||||
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);
|
||||
@@ -848,7 +849,7 @@ static void pres_event_handler(switch_event_t *event)
|
||||
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;
|
||||
|
||||
|
||||
@@ -3866,7 +3866,7 @@ SWITCH_STANDARD_API(boxcount_api_function)
|
||||
/* Kept for backwards-compatibility */
|
||||
switch_hash_index_t *hi;
|
||||
switch_mutex_lock(globals.mutex);
|
||||
if ((hi = switch_core_hash_first( globals.profile_hash))) {
|
||||
if ((hi = switch_core_hash_first(globals.profile_hash))) {
|
||||
void *val;
|
||||
switch_core_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
@@ -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);
|
||||
}
|
||||
} 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();
|
||||
@@ -4029,6 +4029,7 @@ static void actual_message_query_handler(switch_event_t *event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch_safe_free(hi);
|
||||
}
|
||||
|
||||
switch_safe_free(dup);
|
||||
@@ -4923,7 +4924,7 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
||||
} else if (!strcasecmp(argv[0], "status")) {
|
||||
stream->write_function(stream, "============================\n");
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_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);
|
||||
@@ -4958,7 +4959,7 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
||||
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) {
|
||||
@@ -4966,6 +4967,7 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch_safe_free(index);
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
}
|
||||
|
||||
@@ -6237,7 +6239,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voicemail_load)
|
||||
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_voicemail_shutdown)
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
switch_hash_index_t *hi = NULL;
|
||||
vm_profile_t *profile;
|
||||
void *val = NULL;
|
||||
const void *key;
|
||||
@@ -6261,7 +6263,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_voicemail_shutdown)
|
||||
}
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
while ((hi = switch_core_hash_first( globals.profile_hash))) {
|
||||
while ((hi = switch_core_hash_first_iter( globals.profile_hash, hi))) {
|
||||
switch_core_hash_this(hi, &key, &keylen, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
|
||||
|
||||
Reference in new issue
Block a user