add show distinct_channels (mix of show channels and show calls)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13944 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
135d0b73de
commit
b5f08ca5ce
|
@ -2822,6 +2822,11 @@ SWITCH_STANDARD_API(show_function)
|
|||
as = argv[3];
|
||||
}
|
||||
}
|
||||
} else if (!strcasecmp(command, "distinct_channels")) {
|
||||
sprintf(sql, "select * from channels left join calls on channels.uuid=calls.caller_uuid where uuid in (select caller_uuid from calls) or (uuid not in (select caller_uuid from calls) and uuid not in (select callee_uuid from calls)) order by created_epoch");
|
||||
if (argv[2] && !strcasecmp(argv[1], "as")) {
|
||||
as = argv[2];
|
||||
}
|
||||
} else if (!strcasecmp(command, "aliases")) {
|
||||
sprintf(sql, "select * from aliases order by alias");
|
||||
} else if (!strcasecmp(command, "complete")) {
|
||||
|
|
|
@ -253,8 +253,11 @@ static void core_event_handler(switch_event_t *event)
|
|||
sql = switch_mprintf("delete from tasks where task_id=%q", switch_event_get_header_nil(event, "task-id"));
|
||||
break;
|
||||
case SWITCH_EVENT_RE_SCHEDULE:
|
||||
sql = switch_mprintf("update tasks set task_sql_manager='%q' where task_id=%q",
|
||||
switch_event_get_header_nil(event, "task-sql_manager"), switch_event_get_header_nil(event, "task-id"));
|
||||
sql = switch_mprintf("update tasks set task_desc='%q',task_group='%q', task_sql_manager='%q' where task_id=%q",
|
||||
switch_event_get_header_nil(event, "task-desc"),
|
||||
switch_event_get_header_nil(event, "task-group"),
|
||||
switch_event_get_header_nil(event, "task-sql_manager"),
|
||||
switch_event_get_header_nil(event, "task-id"));
|
||||
break;
|
||||
case SWITCH_EVENT_CHANNEL_DESTROY:
|
||||
sql = switch_mprintf("delete from channels where uuid='%q'", switch_event_get_header_nil(event, "unique-id"));
|
||||
|
@ -471,8 +474,8 @@ void switch_core_sqldb_start(switch_memory_pool_t *pool)
|
|||
");\ncreate index uuindex on channels (uuid);\n";
|
||||
char create_calls_sql[] =
|
||||
"CREATE TABLE calls (\n"
|
||||
" created VARCHAR(255),\n"
|
||||
" created_epoch INTEGER,\n"
|
||||
" call_created VARCHAR(255),\n"
|
||||
" call_created_epoch INTEGER,\n"
|
||||
" function VARCHAR(255),\n"
|
||||
" caller_cid_name VARCHAR(255),\n"
|
||||
" caller_cid_num VARCHAR(255),\n"
|
||||
|
|
|
@ -193,7 +193,7 @@ SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
|
|||
SWITCH_DECLARE(void) switch_cond_next(void)
|
||||
{
|
||||
#ifdef DISABLE_1MS_COND
|
||||
do_sleep(10000);
|
||||
do_sleep(1000);
|
||||
#else
|
||||
if (globals.RUNNING != 1 || !runtime.timestamp || globals.use_cond_yield != 1) {
|
||||
do_sleep(1000);
|
||||
|
|
Loading…
Reference in New Issue