Understanding Loop

Status
Not open for further replies.

Expressoft

Forum User
Joined
Dec 18, 2023
Messages
9
Reaction score
0
Hello,
I have some problem with Loop functionality. I have a short menu (1, 2, 3, 9 valid inputs) and works fine. What I need is to use loop if invalid key is pressed and return to menu (only once). If timeout than end call. I have set the messages for invalid input and timeout, but the message is looping forever, even max retries vale was reached.

1702906497555.png

Thank you,
Andrei
 
The Menu component will automatically repeat the prompt if the entered digit is not valid. You don't need a loop for that. If what you need is going to an upper level menu, then please check this:
https://www.3cx.com/docs/cfd-navigate-upwards/
 
  • Like
Reactions: Evolute IT
Hello,
I have removed the loop, but somehow I still have the same problem:
- timeout works well - plays audio message and end the call
- invalid input - have the same behaviour - plays audio message and ends call. But I need to return to menu not to end call.

Thank you,
Andrei
 
The counter for invalid digit and timeout is the same. So if you need to exit immediately for timeout, but play the menu again for invalid digit, you will need to configure the menu with 1 attempt only, and then use a Condition inside the "Timeout or Invalid Option" branch to detect if the menu exited due to timeout or invalid digit. Then, you need to add a Loop all around this menu, so you can go back to the top in case of invalid digit.
 
Hello,
Can you be more explicit on "and then use a Condition inside the "Timeout or Invalid Option" branch to detect if the menu exited due to timeout or invalid digit. Then, you need to add a Loop all around this menu, so you can go back to the top in case of invalid digit."?

Thnak you,
Andrei
 
Something like this:
1703065619214.png

In the Timeout branch you can use the condition:
EQUAL(menuMenu.Result,MenuResult.Timeout)

The condition for Invalid is left empty. There you increment a counter. The Menu should be surrounded by a Loop component, so you can check the counter, and when it reaches the number you want, you transfer the call somewhere else....
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,842
Messages
589,320
Members
164,677
Latest member
skander