[asterisk-users] dialplan pattern matching

Philip A. Prindeville philipp_subx at redfish-solutions.com
Thu Nov 5 00:36:17 CST 2009


Andrew Hakman wrote:
> Hi
>
> Is there anyway to add logic to dialplan pattern matching? I would
> like to match all toll free numbers with one pattern, so 1800, 1877,
> 1866, 1855, etc. I can't figure out how to do this in dialplan syntax.
> As a programmer, I want to say 18[00 or 77 or 66 or 55 etc]. Can't
> figure out if this is even possible with dialplan pattern matching
> (though I suspect it is somehow).
>
> Andrew
>   

exten => _18XXXXXXXX,1,GotoIf($["${EXTEN:1:3}" : "8(00|55|66|77|88)"] ? tollfree:)
exten => _18XXXXXXXX,n,NoOp(not toll-free)
...
exten => _18XXXXXXXX,n(tollfree),NoOp(toll-free)



At least in 1.6.  Can't speak for 1.4.

-Philip




More information about the asterisk-users mailing list