}
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;
}
}
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;
}
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))) {
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;