Randy Bush wrote:> i have extensions in locations across a number of telco area codes. > when someone in seattle picks up and dials 91234567, it would be > nice to transform it to 92061234567. i would prefer not to have > an extension context per area code. it would be cool to be able > to set a variable in the sip.conf bit for each phone with it's > geographic default area code. > > or other folk may have a better hack. please clue me. the wiki > did not help. thanks.You set their context as the area, so based on your example... in sip.conf/iax.conf [1234567] username=whatever secret=whatever context=seattle then in extensions.conf [seattle] exten => 1NXXNXXXXXX,1,goto(mail,${EXTEN},1) exten => NXXNXXXXXX,1,goto(main,1${EXTEN},1) exten => NXXXXXX,1,goto(main,1920${EXTEN},1) [newyork] exten => 1NXXNXXXXXX,1,goto(mail,${EXTEN},1) exten => NXXNXXXXXX,1,goto(main,1${EXTEN},1) exten => NXXXXXX,1,goto(main,1212${EXTEN},1) then just have whatever under the main context... -- Best regards, Duane http://www.cacert.org - Free Security Certificates http://www.nodedb.com - Think globally, network locally http://www.sydneywireless.com - Telecommunications Freedom http://happysnapper.com.au - Sell your photos over the net! http://e164.org - Using Enum.164 to interconnect asterisk servers
i have extensions in locations across a number of telco area codes. when someone in seattle picks up and dials 91234567, it would be nice to transform it to 92061234567. i would prefer not to have an extension context per area code. it would be cool to be able to set a variable in the sip.conf bit for each phone with it's geographic default area code. or other folk may have a better hack. please clue me. the wiki did not help. thanks. randy
On Tue, 2004-05-18 at 23:26, Randy Bush wrote:> i have extensions in locations across a number of telco area codes. > when someone in seattle picks up and dials 91234567, it would be > nice to transform it to 92061234567. i would prefer not to have > an extension context per area code. it would be cool to be able > to set a variable in the sip.conf bit for each phone with it's > geographic default area code.I assume that each SIP phone will have Caller*ID that includes their area code? If so it would be pretty trivial to use an AGI script to extract the area code from the Caller*ID of the phone making the call and use app_goto to jump to $AreaCode . $Exten or something like that. -- Eric Wieling * BTEL Consulting * 504-899-1387 x2111 "In a related story, the IRS has recently ruled that the cost of Windows upgrades can NOT be deducted as a gambling loss."
You could be kinky and use accountcode= for that purpose then dial(blah/${ACCOUNTCODE}${EXTEN}) bkw ----- Original Message ----- From: "Randy Bush" <randy@psg.com> To: "splatters" <asterisk-users@lists.digium.com> Sent: Tuesday, May 18, 2004 10:26 PM Subject: [Asterisk-Users] want to set a var in sip.conf> i have extensions in locations across a number of telco area codes. > when someone in seattle picks up and dials 91234567, it would be > nice to transform it to 92061234567. i would prefer not to have > an extension context per area code. it would be cool to be able > to set a variable in the sip.conf bit for each phone with it's > geographic default area code. > > or other folk may have a better hack. please clue me. the wiki > did not help. thanks. > > randy > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Hi,> -----Original Message----- > i have extensions in locations across a number of telco area codes. > when someone in seattle picks up and dials 91234567, it would > be nice to transform it to 92061234567. i would prefer not > to have an extension context per area code. it would be cool > to be able to set a variable in the sip.conf bit for each > phone with it's geographic default area code. > > or other folk may have a better hack. please clue me. the > wiki did not help. thanks.I am currently dropping each user into his own context, which rewrites numbers to a standard format and then includes a couple of globalized contexts to do the routing. The individual contexts are generated from a database, but if the number of accounts is limited, you could do it by hand. Florian
Just as a better example of how to use accountcode for this ... maybe we could add areacode= to sip.conf and pull that into a var instead of wasting the accountcode for this.... hrm... [1234567] username=whatever secret=whatever context=phones accountcode=920 then in extensions.conf [outbound] exten => NXXXXXX,1,goto(1${ACCOUNTCODE}${EXTEN},1) [phones] include => outbound