Will this work to match any number from the 770,404, or 678 area codes? _[404|770|678]NXXXXXX If this won't work, is there a pattern that will do this? Yours, Michael Munger, dCAP 404-438-2128 michael at highpoweredhelp.com <mailto:michael at highpoweredhelp.com> Attachment encrypted? click here <http://www.highpoweredhelp.com/tutorials/wincrypt/> . -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080221/a0b7b3fc/attachment-0001.htm
On Thu, 2008-02-21 at 12:44 -0500, Michael Munger wrote:> Will this work to match any number from the 770,404, or 678 area > codes? > > > > _[404|770|678]NXXXXXX > > > > If this won?t work, is there a pattern that will do this? > >No, it won't work, there's no '|' for alternative matches, and no parens available for grouping, either. And your usage of char sets is off. Try something like this: _404NXXXXXX _770NXXXXXX _678NXXXXXX as three separate extensions. If you REALLY want to keep that as one extension, then you could: _NXXNXXXXXX => { Set(areacode=${EXTEN:0:3}) if ('${areacode}' = '404') { <things to do here> } else if ('${areacode}' = '770') { <things to do here> } else if ('${areacode}' = '678') { <things to do here> } OR, you could do it this way, also: _NXXNXXXXXX => { Set(areacode=${EXTEN:0:3}) switch(${areacode}) { case 404: <things to do here> break; case 770: <things to do here> break; case 678: <things to do here> break; } This is, of course AEL code, and this stuff would be inside a context construct... murf> > > Yours, > > Michael Munger, dCAP > > 404-438-2128 > > michael at highpoweredhelp.com > > > > Attachment encrypted? click here. > > > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- Steve Murphy Software Developer Digium -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3227 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080221/d3cb268a/attachment.bin
No that will not work. You would want three exten => lines, one for each area code. Michael Munger wrote:> Will this work to match any number from the 770,404, or 678 area codes? > > > > _[404|770|678]NXXXXXX > > > > If this won't work, is there a pattern that will do this? > > > > Yours, > > Michael Munger, dCAP > > 404-438-2128 > > michael at highpoweredhelp.com <mailto:michael at highpoweredhelp.com> > > > > Attachment encrypted? click here > <http://www.highpoweredhelp.com/tutorials/wincrypt/> . > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- Consulting for Asterisk, Polycom, Sangoma, Digium, Cisco, LAN, WAN, QoS, T-1, PRI, Frame Relay, Linux, and network design. Based near Birmingham, AL. Now accepting clients worldwide.
That's what I figured, and the way I've always done it. I was just *hoping* someone knew of a better way that I didn't know about. Yours, Michael Munger, dCAP 404-438-2128 michael at highpoweredhelp.com -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jared Smith Sent: Thursday, February 21, 2008 1:46 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Pattern matching.... On Thu, 2008-02-21 at 13:34 -0500, Mike Trest - Personal wrote:> [746][704][048]Nope, that's not going to do exactly what you want either... that pattern would match a lot of area codes besides the ones you're looking for. (For example, you could have 7 as the first digit and 0 as the second digit and 0 as the third digit.) You really need to have three separate patters; one for each area code. -- Jared Smith Community Relations Manager Digium, Inc. _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users