From c1d643900d6fd6f06753e3470a3d814e3f100fb1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 11 May 2009 20:20:11 +0000 Subject: [PATCH] use menu-timeout instead of menu-inter-digit-timeout when no digits have been entered git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13279 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_menu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/switch_ivr_menu.c b/src/switch_ivr_menu.c index ba2c9746d7..31e566fc19 100644 --- a/src/switch_ivr_menu.c +++ b/src/switch_ivr_menu.c @@ -292,6 +292,7 @@ static switch_status_t play_and_collect(switch_core_session_t *session, switch_i switch_input_args_t args = { 0 }; switch_channel_t *channel; char *sound_expanded = sound; + switch_size_t menu_buf_len = 0; if (!session || !menu || switch_strlen_zero(sound)) { return status; @@ -324,12 +325,14 @@ static switch_status_t play_and_collect(switch_core_session_t *session, switch_i return status; } - menu->ptr += strlen(menu->buf); - if (strlen(menu->buf) < need) { + menu_buf_len = strlen(menu->buf); + + menu->ptr += menu_buf_len; + if (menu_buf_len < need) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "waiting for %u/%u digits t/o %d\n", (uint32_t)(menu->inlen - strlen(menu->buf)), (uint32_t)need, menu->inter_timeout); status = switch_ivr_collect_digits_count(session, menu->ptr, menu->inlen - strlen(menu->buf), - need, "#", &terminator, menu->inter_timeout, 0, 0); + need, "#", &terminator, menu_buf_len ? menu->inter_timeout : menu->timeout, 0, 0); } if (menu->confirm_macro && status == SWITCH_STATUS_SUCCESS && *menu->buf != '\0') {