提交 daee4781 authored 作者: Anthony Minessale's avatar Anthony Minessale

tweak api

上级 6b2c9e44
...@@ -264,11 +264,13 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_ma ...@@ -264,11 +264,13 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_ma
switch_memory_pool_t *pool; switch_memory_pool_t *pool;
struct str_node *head = NULL, *np; struct str_node *head = NULL, *np;
switch_console_callback_match_t *my_matches = NULL; switch_console_callback_match_t *my_matches = NULL;
const char *like = NULL;
switch_core_new_memory_pool(&pool); if (var_val && *var_val == '~') {
like = var_val + 1;
}
if (!var_val) switch_core_new_memory_pool(&pool);
return NULL;
switch_mutex_lock(runtime.session_hash_mutex); switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) { for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
...@@ -290,7 +292,8 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_ma ...@@ -290,7 +292,8 @@ SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_ma
if ((session = switch_core_session_locate(np->str))) { if ((session = switch_core_session_locate(np->str))) {
const char *this_val; const char *this_val;
if (switch_channel_up_nosig(session->channel) && if (switch_channel_up_nosig(session->channel) &&
(this_val = switch_channel_get_variable_dup(session->channel, var_name, SWITCH_FALSE, -1)) && (!strcmp(this_val, var_val))) { (this_val = switch_channel_get_variable_dup(session->channel, var_name, SWITCH_FALSE, -1)) &&
(!var_val || (like && switch_stristr(like, var_val)) || !strcmp(this_val, var_val))) {
switch_console_push_match(&my_matches, (const char *) np->str); switch_console_push_match(&my_matches, (const char *) np->str);
} }
switch_core_session_rwunlock(session); switch_core_session_rwunlock(session);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论