[Asterisk-Users] extensions and regular expressions ( probably an easy question )

Rich Adamson radamson at routers.com
Sun Dec 11 06:01:42 MST 2005


> It's kind of tough to truly understand what you are trying to accomplish
> 
> Ack, sorry!  It's hard to post to the list on a saturday when my 2year old is wanting 
to play with the keyboard as
> well.  Best I can do is half a mind, most of the time that's enough. 
> 
> Not always, however.  :)
> 
> (or ask for). Apparently you've got something more in mind that words are making it 
through the list.
> Reading between the lines, it would appear from the 800-in that calls are coming in 
from some external
> source, and you trying to do something with them. Can you be a little more explicit
> 
> I have an 800 number from teliax.  When my "local" users dial it, they will dial 
1866... instead of the 866 I have in
> my dial plan.  I do not want the call to use one of my external sources to terminate 
the call ( in essence, dialing out
> via voicepulse, and recieving the call via teliax ).  I know I can do two seperate 
exten patterns, but I was hoping
> for a single pattern.  To that end, I was wondering if there was a way of saying 
"Match this 0 or 1 times",
> something I'm used to in perl and the like.
> 
> If there isn't, there isn't.  Won't kill me to add the second exten match.

That makes more sense. As far as the pattern matching portion, I'd stick
with what was suggested previously...
    exten => 18661234567,1,
    exten => 8661234567,1,
unless you have a need for a large number of these.

>From a self-documenting perspective, the above is very easy to understand
(months later) by anyone, and probably burns fewer cycles then trying to
match and insert a digit, etc.

Personal preference is the KISS method to the extent possible. ;)





More information about the asterisk-users mailing list