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

Freeswitch SVN brian at freeswitch.org
Sat Sep 27 14:49:22 EDT 2008


Author: brian
Date: Sat Sep 27 14:49:21 2008
New Revision: 9680

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

Log:
part two of FSCORE-193

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	Sat Sep 27 14:49:21 2008
@@ -1421,9 +1421,17 @@
 	}
 
 	if (!strcasecmp(action, "start")) {
-		switch_ivr_record_session(rsession, path, limit, NULL);
+		if (switch_ivr_record_session(rsession, path, limit, NULL)!= SWITCH_STATUS_SUCCESS) {
+			stream->write_function(stream, "-ERR Cannot record session!\n"); 
+		} else {
+			stream->write_function(stream, "+OK Success\n");
+		}
 	} else if (!strcasecmp(action, "stop")) {
-		switch_ivr_stop_record_session(rsession, path);
+		if (switch_ivr_stop_record_session(rsession, path) != SWITCH_STATUS_SUCCESS) {
+			stream->write_function(stream, "-ERR Cannot stop record session!\n");
+		} else {
+			stream->write_function(stream, "+OK Success\n");
+		}
 	} else {
 		goto usage;
 	}
@@ -1481,9 +1489,17 @@
 	}
 
 	if (!strcasecmp(action, "start")) {
-		switch_ivr_displace_session(rsession, path, limit, flags);
+		if (switch_ivr_displace_session(rsession, path, limit, flags) != SWITCH_STATUS_SUCCESS) {
+			stream->write_function(stream, "-ERR Cannot displace session!\n");
+		} else {
+			stream->write_function(stream, "+OK Success\n");
+		}
 	} else if (!strcasecmp(action, "stop")) {
-		switch_ivr_stop_displace_session(rsession, path);
+		if (switch_ivr_stop_displace_session(rsession, path) != SWITCH_STATUS_SUCCESS) {
+			stream->write_function(stream, "-ERR Cannot stop displace session!\n");
+		} else {
+			stream->write_function(stream, "+OK Success\n"); 
+		}
 	} else {
 		goto usage;
 	}

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Sat Sep 27 14:49:21 2008
@@ -345,7 +345,7 @@
 
 	if (!switch_channel_media_ready(channel) || !switch_core_session_get_read_codec(session)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can not displace session.  Media not enabled on channel\n");
-		return status;
+		return SWITCH_STATUS_FALSE;
 	}
 
 	if ((bug = switch_channel_get_private(channel, file))) {
@@ -816,7 +816,7 @@
 
 	if (!switch_channel_media_ready(channel) || !switch_core_session_get_read_codec(session)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can not record session.  Media not enabled on channel\n");
-		return status;
+		return SWITCH_STATUS_FALSE;
 	}
 
 	channels = read_codec->implementation->number_of_channels;



More information about the Freeswitch-svn mailing list