07-30-2013 02:04 PM - edited 03-14-2019 12:08 PM
I'm developing a phone tree with a get digit string step that can accept a variable length of digits. In the get digit string step I want the step to not retry if the user has entered some digits but not hit a confirmation trigger (max digits, termination digit entered, etc). I can do this by just setting the retries to 1 and then creating a if statement to check if the digit string is > 1 and if it is 0, play a prompt and then use goto label step, but I was wondering if I'm missing something and don't need to go through all that trouble.
07-30-2013 07:16 PM
It sounds like you're doing it right. Except I don't think you should set your retry to 1, but instead 0. You want to manage the retries with your own logic.
The Get Digit String step has two success branches really. The literal Successful branch and the Timeout branch. The reason I say that the Timeout branch is a success, is because of variable length input. This is how I handle variable length input with the Get Digit String step. The only real failure branch is the Unsuccesful one, in which case the caller entered nothing at all.
...
Set retry_counter = 0
Ask Caller for Input:
caller_input = Get Digit String (--Triggering Contact--)
Successful
Ask Caller for Input Validation:
Switch (caller_input.length())
Length is 3
/* Caller entered an area code */
Length is 5
/* Caller entered a zip code */
Default
/* Caller enter some other quantity of digits */
Goto Ask Caller for Input Failure:
Timeout
Goto Ask Caller for Input Validation
Unsuccessful
Ask Caller for Input Failure:
If (++retry_counter >= max_retries)
True
Goto Operator
False
Play Prompt (--Triggering Contact--, P[invalid_input.wav] + P[please_try_again.wav])
Goto Ask Caller for Input
Operator:
...
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide