From bb199aabde271886b7929bc5c18065d0cea68ceb Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 3 Jan 2017 13:15:03 -0600 Subject: [PATCH] FS-9860 --- src/switch_ivr_play_say.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index c83f2451a3..f034f80a97 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1194,6 +1194,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess uint32_t test_native = 0, last_native = 0; uint32_t buflen = 0; int flags; + int cumulative = 0; if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_FALSE; @@ -1201,7 +1202,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess 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_cumulative"))) { + int tmp = atoi(var); + if (tmp > 1) { + timeout_samples = read_impl.actual_samples_per_second * tmp; + cumulative = 1; + } + + } else if ((var = switch_channel_get_variable(channel, "playback_timeout_sec"))) { int tmp = atoi(var); if (tmp > 1) { timeout_samples = read_impl.actual_samples_per_second * tmp; @@ -1970,8 +1978,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess arg_recursion_check_stop(args); - if (timeout_samples && switch_channel_var_true(channel, "playback_timeout_cumulative")) { - switch_channel_set_variable_printf(channel, "playback_timeout_sec", "%d", timeout_samples / read_impl.actual_samples_per_second); + if (timeout_samples && cumulative) { + switch_channel_set_variable_printf(channel, "playback_timeout_sec_cumulative", "%d", timeout_samples / read_impl.actual_samples_per_second); }