Hi, When I setup a user, I give them an extension like 570xxxxxxx. This is fine and dandy while in one area code, but we've since gone to other area codes. I'd like the user's to retain the ability to dial 7 digits no matter what number they have. Any thoughts on how to do that? EXAMPLE: User has number 7175551212. I want that when they dial 3235555 it dials 717-323-5555. User has number 5705551212. I want that when they dial 3235555 it dials 570-323-5555. I'm thinking I need to do some chopping, splitting, and variable writing? Am I correct in thinking that if I do all of this before my current dialplan kicks in that I should be able to still use my routing? IE: User dials 3235555 and is from 717 area code. If I transform the number to be 7173235555 the dial-plan will now read it as if the user punched it in that way and process it?
Eric "ManxPower" Wieling
2006-Apr-27 05:39 UTC
[Asterisk-Users] Interesting Dial-Plan Question
Matt wrote:> Hi, > When I setup a user, I give them an extension like 570xxxxxxx. This > is fine and dandy while in one area code, but we've since gone to > other area codes. I'd like the user's to retain the ability to dial > 7 digits no matter what number they have. Any thoughts on how to do > that? > > EXAMPLE: User has number 7175551212. I want that when they dial > 3235555 it dials 717-323-5555. User has number 5705551212. I > want that when they dial 3235555 it dials 570-323-5555. > > I'm thinking I need to do some chopping, splitting, and variable > writing? Am I correct in thinking that if I do all of this before > my current dialplan kicks in that I should be able to still use my > routing? > > IE: User dials 3235555 and is from 717 area code. If I transform the > number to be 7173235555 the dial-plan will now read it as if the user > punched it in that way and process it?exten => _NXXXXXX,1,Dial(Zap/g1/${CALLERIDNUM::0:3}${EXTEN}) This assumes that you set the user's Caller*ID number to be their telephone number. It takes the first 3 digits of their CALLERIDNUM and prepends it to the number they dialed. See README.variables. -- Now accepting new clients in Birmingham, Atlanta, Huntsville, Chattanooga, and Montgomery.
Just appending the area code variable is not always going to be correct. You will need to lookup (google local calling guide) the proper NPA for the NXX you are dialing. For example, in Louisville, Ky if you dial 948-1592 you will actually reach 812-948-1592 instead of 502-948-1592 even though your callerid number would be 502-NXX-XXXX. I have a script I'm working on that does this via an agi script, it looks up the 7 digit dialing rules for a NPA-NXX combination and caches the results so you don't have to do a lookup for every call. I'll post it on the wiki when I'm done. It works but I still need to test it and document it a little better. It is based on some scripts by other people that I combined together. -Jonathan> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Matt > Sent: Thursday, April 27, 2006 8:54 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [Asterisk-Users] Interesting Dial-Plan Question > > Eric, > Yes.. I am setting calleridnum to be their phone number. And your > example is peachy... except for the fact that it assumes I want to go > out ZAP/g1!! > > My problem is I have a very intricite routing plan that routes that > call out several different carriers depending on what you dialed. > (Long Distance, international, local, etc). > > The way it works now is the dialplan just looks at the number you > dialed and routes based on that. I guess what I am asking is.... in > theory I should be able to do: > > Look at origination number. Take first 3 digits and put into > variable. So 5705551212 becomes 570 in ${AREACODE}. > > Now, look at the number we dialed. If it is (and this is where I am a > little unclear on what to do) 7 digits long then we append the > ${AREACODE} variable. Else, we send it through to the dialplan as > is. > > > exten => _NXXXXXX,1,Dial(Zap/g1/${CALLERIDNUM::0:3}${EXTEN}) > > > > This assumes that you set the user's Caller*ID number to be their > > telephone number. It takes the first 3 digits of their CALLERIDNUMand> > prepends it to the number they dialed. > > > > See README.variables. > > > > -- > > Now accepting new clients in Birmingham, Atlanta, Huntsville, > > Chattanooga, and Montgomery. > > _______________________________________________ > > --Bandwidth and Colocation provided by Easynews.com -- > > > > Asterisk-Users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users