From 84cd461bb29d70e2222fde7445110e87e286338b Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthm@freeswitch.org>
Date: Mon, 8 Apr 2013 15:54:44 -0500
Subject: [PATCH] FS-5285 --resolve

---
 src/mod/applications/mod_commands/mod_commands.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c
index 82c4baf7e2..a6422785a8 100644
--- a/src/mod/applications/mod_commands/mod_commands.c
+++ b/src/mod/applications/mod_commands/mod_commands.c
@@ -3776,6 +3776,7 @@ SWITCH_STANDARD_API(session_audio_function)
 	switch_core_session_t *u_session = NULL;
 	char *mycmd = NULL;
 	int fail = 0;
+	int nochannel = 0;
 	int argc = 0;
 	char *argv[5] = { 0 };
 	int level;
@@ -3794,7 +3795,7 @@ SWITCH_STANDARD_API(session_audio_function)
 	}
 
 	if (!(u_session = switch_core_session_locate(argv[0]))) {
-		stream->write_function(stream, "-ERR No such channel!\n");
+		nochannel++;
 		goto done;
 	}
 
@@ -3826,7 +3827,9 @@ SWITCH_STANDARD_API(session_audio_function)
 
 	switch_safe_free(mycmd);
 
-	if (fail) {
+	if (nochannel) {
+		stream->write_function(stream, "-ERR No such channel!\n");
+	} else if (fail) {
 		stream->write_function(stream, "-USAGE: %s\n", AUDIO_SYNTAX);
 	} else {
 		stream->write_function(stream, "+OK\n");