[Asterisk-Users] Using regular expression in dialplan

Kevin Walsh kevin at cursor.biz
Wed Sep 1 06:34:49 MST 2004


Selim [selimbh at gmail.com] wrote:
> Did anyone manage to make the GotoIf command work with regular expression
>
Does re-posting the same question lots of times usually work for you?
I suppose it generated a response in this case.  I usually just delete
duplicates, along with the original.

> 
> I've tried the follwoing syntax but it is alway going to 2 whatever
> the value of DTMFSeq:
> 
> exten => s,1,GotoIf($[${DTMFSeq} : 123]?s|4:s|2)
> 
Clue: 123 is 123.  It's not a regular expression that would match 1, 2
or 3.  123 will match 123, and nothing else.  [Perhaps something is
missing from your expression.]

>
> The only way I managed to make it work is the following :
>
> exten => s,1,GotoIf($[${DTMFSeq} : 1|2|3]?s|4:s|2)
>
Clue: 1|2|3 is a regular expression that would match 1, 2 or 3.  That's
why it works.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/




More information about the asterisk-users mailing list