提交 860cb4af authored 作者: Anthony Minessale's avatar Anthony Minessale

add pre_answer calls to some funcs in the ivr lib to ensure media for obvious…

add pre_answer calls to some funcs in the ivr lib to ensure media for obvious situations that require it 

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7134 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 21da7429
...@@ -356,6 +356,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se ...@@ -356,6 +356,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL); switch_assert(channel != NULL);
switch_channel_pre_answer(channel);
read_codec = switch_core_session_get_read_codec(session); read_codec = switch_core_session_get_read_codec(session);
switch_assert(read_codec != NULL); switch_assert(read_codec != NULL);
...@@ -691,6 +693,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess ...@@ -691,6 +693,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL); switch_assert(channel != NULL);
switch_channel_pre_answer(channel);
prefix = switch_channel_get_variable(channel, "sound_prefix"); prefix = switch_channel_get_variable(channel, "sound_prefix");
timer_name = switch_channel_get_variable(channel, "timer_name"); timer_name = switch_channel_get_variable(channel, "timer_name");
...@@ -1130,7 +1134,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t ...@@ -1130,7 +1134,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
switch_assert(channel != NULL); switch_assert(channel != NULL);
//Answer the channel if it hasn't already been answered //Answer the channel if it hasn't already been answered
switch_channel_answer(channel); switch_channel_pre_answer(channel);
//Start pestering the user for input //Start pestering the user for input
for (; (switch_channel_get_state(channel) == CS_EXECUTE) && max_tries > 0; max_tries--) { for (; (switch_channel_get_state(channel) == CS_EXECUTE) && max_tries > 0; max_tries--) {
...@@ -1250,7 +1254,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session ...@@ -1250,7 +1254,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
switch_channel_answer(channel); switch_channel_pre_answer(channel);
write_frame.data = abuf; write_frame.data = abuf;
write_frame.buflen = sizeof(abuf); write_frame.buflen = sizeof(abuf);
...@@ -1531,6 +1535,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses ...@@ -1531,6 +1535,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL); switch_assert(channel != NULL);
switch_channel_pre_answer(channel);
sh = ↰ sh = ↰
codec = &lcodec; codec = &lcodec;
timer = &ltimer; timer = &ltimer;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论