FSCORE-244 ivr menu max_failures and max_timeouts now default to 3 if not specified or invalid (less than 1) values are specified

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10633 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-12-05 21:50:45 +00:00
parent 2811e8d005
commit a7aaf9dd12
1 changed files with 12 additions and 4 deletions

View File

@ -167,9 +167,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t ** new_me
menu->inlen = digit_len;
menu->max_failures = max_failures;
if (max_failures > 0) {
menu->max_failures = max_failures;
} else {
menu->max_failures = 3;
}
menu->max_timeouts = max_timeouts;
if (max_timeouts > 0) {
menu->max_timeouts = max_timeouts;
} else {
menu->max_timeouts = 3;
}
menu->timeout = timeout;
@ -736,8 +744,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_
atoi(inter_timeout),
atoi(digit_len),
atoi(timeout),
strlen(max_failures)? atoi(max_failures): 1,
strlen(max_timeouts)? atoi(max_timeouts): 1,
strlen(max_failures)? atoi(max_failures): 0,
strlen(max_timeouts)? atoi(max_timeouts): 0,
xml_menu_ctx->pool);
/* set the menu_stack for the caller */
if (status == SWITCH_STATUS_SUCCESS && *menu_stack == NULL) {