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

Freeswitch SVN mikej at freeswitch.org
Tue Jan 29 13:28:32 EST 2008


Author: mikej
Date: Tue Jan 29 13:28:32 2008
New Revision: 7423

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

Log:
cleanup

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 Jan 29 13:28:32 2008
@@ -1274,16 +1274,17 @@
 
 	if (switch_strlen_zero(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX);
-	} else {
-		if ((psession = switch_core_session_locate(cmd))) {
-			switch_channel_t *channel = switch_core_session_get_channel(psession);
-			switch_channel_set_flag(channel, CF_BREAK);
-			switch_core_session_rwunlock(psession);
-		} else {
-			stream->write_function(stream, "-ERR No Such Channel!\n");
-		}
+		return SWITCH_STATUS_SUCCESS;
 	}
 
+	if (!(psession = switch_core_session_locate(cmd))) {
+		stream->write_function(stream, "-ERR No Such Channel!\n");
+		return SWITCH_STATUS_SUCCESS;
+	}
+
+	switch_channel_set_flag(switch_core_session_get_channel(psession), CF_BREAK);
+	switch_core_session_rwunlock(psession);
+
 	return SWITCH_STATUS_SUCCESS;
 }
 



More information about the Freeswitch-svn mailing list