[Freeswitch-svn] [commit] r13944 - in freeswitch/trunk/src: . mod/applications/mod_commands

FreeSWITCH SVN anthm at freeswitch.org
Wed Jun 24 17:03:41 PDT 2009


Author: anthm
Date: Wed Jun 24 19:03:41 2009
New Revision: 13944

Log:
add show distinct_channels (mix of show channels and show calls)

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/trunk/src/switch_core_sqldb.c
   freeswitch/trunk/src/switch_time.c

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Wed Jun 24 19:03:41 2009
@@ -2822,6 +2822,11 @@
 				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")) {

Modified: freeswitch/trunk/src/switch_core_sqldb.c
==============================================================================
--- freeswitch/trunk/src/switch_core_sqldb.c	(original)
+++ freeswitch/trunk/src/switch_core_sqldb.c	Wed Jun 24 19:03:41 2009
@@ -253,8 +253,11 @@
 		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 @@
 			");\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"

Modified: freeswitch/trunk/src/switch_time.c
==============================================================================
--- freeswitch/trunk/src/switch_time.c	(original)
+++ freeswitch/trunk/src/switch_time.c	Wed Jun 24 19:03:41 2009
@@ -193,7 +193,7 @@
 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);



More information about the Freeswitch-svn mailing list