mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-27 04:50:59 +00:00
ivr_play: preanswer before getting variables to avoid crash
This commit is contained in:
parent
b40804a5e3
commit
25fe16dfed
@ -916,6 +916,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||||||
int timeout_samples = 0;
|
int timeout_samples = 0;
|
||||||
const char *var;
|
const char *var;
|
||||||
|
|
||||||
|
if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
switch_core_session_get_read_impl(session, &read_impl);
|
switch_core_session_get_read_impl(session, &read_impl);
|
||||||
|
|
||||||
if ((var = switch_channel_get_variable(channel, "playback_timeout_sec"))) {
|
if ((var = switch_channel_get_variable(channel, "playback_timeout_sec"))) {
|
||||||
@ -936,10 +940,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
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");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user