]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add show distinct_channels (mix of show channels and show calls)
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Jun 2009 00:03:41 +0000 (00:03 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Jun 2009 00:03:41 +0000 (00:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13944 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c
src/switch_core_sqldb.c
src/switch_time.c

index 8288fa6f242b0c9f57e6aa17354ecdb7a5aded5d..a1af9b4a1434098914231a009efbc54f20500f62 100644 (file)
@@ -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")) {
index 79fa4b6e51efd4837f684df04368be191db89a73..ae7e4f34ece7ac9c624d62b17d236445ce7f6167 100644 (file)
@@ -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"
index d9070579e0cab26071caf2c6afb036e9e4a99b17..8779e2e714e5c3604c470476bdffa1a6d10d3b96 100644 (file)
@@ -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);