]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
part two of FSCORE-193
authorBrian West <brian@freeswitch.org>
Sat, 27 Sep 2008 18:49:21 +0000 (18:49 +0000)
committerBrian West <brian@freeswitch.org>
Sat, 27 Sep 2008 18:49:21 +0000 (18:49 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9680 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c
src/switch_ivr_async.c

index 139a72ec3f2a5dd8a4419ce138fbf9721d38a6d7..69f4bac15f5f290c12c25ab216998f9510b90a34 100644 (file)
@@ -1421,9 +1421,17 @@ SWITCH_STANDARD_API(session_record_function)
        }
 
        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 @@ SWITCH_STANDARD_API(session_displace_function)
        }
 
        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;
        }
index a15b1a119f7df5bb3a215d2f1edefb986444991e..ca21b92b15408beaabe45eb56526dfb948ffd2cb 100644 (file)
@@ -345,7 +345,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_
 
        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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
 
        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;