[Freeswitch-svn] [commit] r10093 - freeswitch/trunk/src/mod/applications/mod_commands

Freeswitch SVN anthm at freeswitch.org
Tue Oct 21 13:41:55 EDT 2008


Author: anthm
Date: Tue Oct 21 13:41:55 2008
New Revision: 10093

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

Log:
add all modifier to break command

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	Tue Oct 21 13:41:55 2008
@@ -1604,11 +1604,12 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-#define BREAK_SYNTAX "<uuid>"
+#define BREAK_SYNTAX "<uuid> [all]"
 SWITCH_STANDARD_API(break_function)
 {
 	switch_core_session_t *psession = NULL;
-
+	char *mycmd, *flag;
+	
 	if (session) {
 		return SWITCH_STATUS_FALSE;
 	}
@@ -1618,11 +1619,22 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-	if (!(psession = switch_core_session_locate(cmd))) {
+	mycmd = strdup(cmd);
+	switch_assert(mycmd);
+
+	if ((flag = strchr(mycmd, ' '))) {
+		*flag++ = '\0';
+	}
+
+	if (!(psession = switch_core_session_locate(mycmd))) {
 		stream->write_function(stream, "-ERR No Such Channel!\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
 
+	if (flag && !strcasecmp(flag, "all")) {
+		switch_core_session_flush_private_events(session);
+	}
+
 	switch_channel_set_flag(switch_core_session_get_channel(psession), CF_BREAK);
 	switch_core_session_rwunlock(psession);
 



More information about the Freeswitch-svn mailing list