提交 c4d43fbf authored 作者: Brian West's avatar Brian West

part two of FSCORE-193

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9680 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 1bd4fa61
...@@ -1421,9 +1421,17 @@ SWITCH_STANDARD_API(session_record_function) ...@@ -1421,9 +1421,17 @@ SWITCH_STANDARD_API(session_record_function)
} }
if (!strcasecmp(action, "start")) { 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")) { } 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 { } else {
goto usage; goto usage;
} }
...@@ -1481,9 +1489,17 @@ SWITCH_STANDARD_API(session_displace_function) ...@@ -1481,9 +1489,17 @@ SWITCH_STANDARD_API(session_displace_function)
} }
if (!strcasecmp(action, "start")) { 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")) { } 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 { } else {
goto usage; goto usage;
} }
......
...@@ -345,7 +345,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_ ...@@ -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)) { 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"); 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 ((bug = switch_channel_get_private(channel, file))) {
...@@ -816,7 +816,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t ...@@ -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)) { 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"); 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; channels = read_codec->implementation->number_of_channels;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论