lists65 at gmail.com
2012-Apr-05 17:35 UTC
[asterisk-users] Dial Plan - Routing via Caller ID
I am running Asterisk 1.8.10.1. I am trying to set up some routing in my dial plans and having some issues (the issue being that I don't quite understand all of the syntax and patterns that can be used: Examples: DID1 = 6140000000 DID2 = 6140000001 CNAME1 = 6149999999 CNAME2 = 6149999998 CNAME3 = 6149999997 context1 context2 context3 I have looked at several examples (patterns) and I am a little confused and am looking to the list for guidance. Assuming I have (2) two DIDs and I want to route incoming calls according to the DID called and as well as the Caller ID various contexts. If I wanted to route a call from a particular DID and the CALLERID from a specific A/C this doesn't seem to work for me: exten => 6140000000/_702XXXXXXX,n,Goto(context1,s,1) exten => 6140000000/6149999999,n,Goto(context2,s,1) exten => 6140000000/6149999998,n,Goto(context3,s,1) exten => 6140000000/6149999997,n,Dial(SIP/7777,25) I have seen examples where I could use a pattern like (not specifying a Caller ID info, and that works fine): exten => _X!,n,Goto(context1,s,1) exten => _X!,n,Goto(context2,s,1) exten => _X!,n,Goto(context3,s,1) I am confused on how to use patterns. I would like to learn how I can take either DID and route the calls to various contexts via the CallerID (which couild be the entire DID number, an NPA only or an NPANXX. Could someone please give me an example on how to do this? TIA
On Thu, Apr 5, 2012 at 10:35 AM, <lists65 at gmail.com> wrote:> > If I wanted to route a call from a particular DID and the CALLERID from a > specific A/C this doesn't seem to work for me: > > exten => 6140000000/_702XXXXXXX,n,Goto(context1,s,1) > exten => 6140000000/6149999999,n,Goto(context2,s,1) > exten => 6140000000/6149999998,n,Goto(context3,s,1) > exten => 6140000000/6149999997,n,Dial(SIP/7777,25) > >You are pretty close, I think it's your priorities that are the problem. When I use "Ex Girl Friend Logic" I write my extensions this way: exten => 6140000000/6149999999,1,Goto(context2,s,1) exten => 6140000000/6149999998,1,Goto(context3,s,1) exten => 6140000000,1,Dial(SIP/7777,25) I have never used a wildcard match like you are attempting to do with the 702 prefix but according to voip-info.org it should work -- A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. ---Heinlein -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120405/92b1b58b/attachment.htm>
On Thu, 5 Apr 2012 13:35:51 -0400 <lists65 at gmail.com> wrote:> If I wanted to route a call from a particular DID and the CALLERID > from a specific A/C this doesn't seem to work for me: > > exten => 6140000000/_702XXXXXXX,n,Goto(context1,s,1) > exten => 6140000000/6149999999,n,Goto(context2,s,1) > exten => 6140000000/6149999998,n,Goto(context3,s,1) > exten => 6140000000/6149999997,n,Dial(SIP/7777,25)I think the n's should all be 1's, like so: exten => 6140000000/_702XXXXXXX,1,Goto(context1,s,1) exten => 6140000000/6149999999,1,Goto(context2,s,1) exten => 6140000000/6149999998,1,Goto(context3,s,1) exten => 6140000000/6149999997,1,Dial(SIP/7777,25) The 'n' priority is used for subsequent lines (after the first) in the same extension, but the first one for each extension should be 1.> I have seen examples where I could use a pattern like (not specifying > a Caller ID info, and that works fine): > > exten => _X!,n,Goto(context1,s,1) > exten => _X!,n,Goto(context2,s,1) > exten => _X!,n,Goto(context3,s,1)I suggest you don't use _X! or _X. as a pattern, until you fully understand the security risks. In the asterisk-1.8 tarball, there's a file called README-SERIOUSLY.bestpractices.txt that explains it all. You should read that before you do anything.> I am confused on how to use patterns. > > I would like to learn how I can take either DID and route the calls to > various contexts via the CallerID (which couild be the entire DID > number, an NPA only or an NPANXX.You have an example for NPA only in the line that handles area code 702. Similar for NPANXX: exten => 6140000000/_614999XXXX,1,Goto(context,s,1) This is all covered quite well on the voip-info wiki: http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf -- C. Chad Wallace, B.Sc. The Lodging Company http://www.lodgingcompany.com/ OpenPGP Public Key ID: 0x262208A0
lists65 at gmail.com
2012-Apr-12 19:16 UTC
[asterisk-users] Dial Plan - Routing via Caller ID
Ok thanks. It seems when I add the /number it quits working and I didn?t know if it would be a 1.8 issue. I will give it another try. Thanks again. From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Warren Selby Sent: Thursday, April 12, 2012 11:18 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID On Apr 11, 2012, at 5:40 PM, <lists65 at gmail.com> wrote: And your examples should work for 1.8.10 correct? I just typed those out really quick, so there may be some syntax errors, but generally yes they should all work with 1.8.x. -- Thanks, Warren Selby, dCAP -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120412/4e3c88e2/attachment.htm>