comtech
(Com Tech)
January 26, 2024, 10:02pm
1
I have a dynamic route where I am prompting the caller to collect 10 digits OR press 1 or 0 to connect to x or y.
My question is: Is there a way to set the validation REGEX so that if the caller presses 1 or 0 it immediately moves on the routing?
Otherwise it’s the normal timeout (five seconds) while I wait for the caller to input their DTMF.
The 10-digit input will never start with a 1 or 0, so I know as soon as I get that digit, its time evaluate. Is this possible? @lgaetz do you know?
Thanks!
comtech
(Com Tech)
January 27, 2024, 1:02am
2
Tried
{[0,1]|[2-9]XXXXXXXXX}
That did not seem to do it, but maybe I am off on my regex, or maybe validation on dynamic routes wont let me avoid the timeout.
comtech
(Com Tech)
January 27, 2024, 1:09am
3
Getting
func_strings.c: Malformed input REGEX(): Invalid preceding regular expression
So, I am likely missing something. @dicko a penny for your thoughts?
dicko
(dicko)
January 27, 2024, 1:58am
4
IMPE Asterisks’ implementation of regexes has never been reliable past the basics.
Try .adding routes so you don’t need “curlies”
1 Like
comtech
(Com Tech)
January 27, 2024, 8:08am
6
Some progress
^([0-1]{1}|[2-9]{1}[0-9]{9})$
This will validate that the input is either one digit (a 1 or 0) or 10 digits with the first number starting between 2-9.
I am still trying to figure out how to make pressing 0 or 1 instantly advance instead of waiting for the timeout to time out. Any ideas are welcome.
heybrodes
(HeyBrodes)
January 29, 2024, 5:32am
7
can you chain two dynamic routes so the first one deals with the 1 or 0 with a timeout of zero then that forwards onto the second dynamic route to deal with the rest.
comtech
(Com Tech)
January 29, 2024, 5:39pm
8
Good idea. I considered this, but I don’t want to prompt them for input twice.
comtech
(Com Tech)
January 29, 2024, 5:43pm
9
I think I am barking up the wrong tree unfortunately. To do what I want (instant time out if 1 or 0 is pressed, otherwise collect the full 10 digits) I think I need Asterisk extension patterns, which Dynamic Routes does not have. I wonder if it could be a feature enhancement at some point, but it is what it is for now. For future readers, my REGEX above will block anything that not a 1, 0 or NXXXXXXXXX
system
(system)
Closed
February 5, 2024, 5:43pm
10
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.