Re: [asterisk-users] adding area code
this code worked for me, here is what I did and worked for me: exten = 1381+NXX,1,Set(CALLERID(number)=3817383444) exten = 1+NXXNXX,2,Dial(SIP/SIP-Provider/${EXTEN:1},80) Thanks for you help! On 04/27/2015 02:56 PM, Matt Riddell wrote: On 27Apr, 2015, at 16:39, Motty Cruz motty.c...@gmail.com mailto:motty.c...@gmail.com wrote: forgot to mentioned I am running Asterisk 1.8.22.0 on CentOS. Thanks, On 04/27/2015 02:38 PM, Motty Cruz wrote: here is what I have: exten = _9XXX,1,Set(l_HomeAreaCode=381) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten = _9XXX,n,Dial(SIP/SIP-Provider/${dialnumber},80) not having success; Got SIP reponse 503 Service Unavailableā Can you send us the console output when you make the call? -- Cheers, Matt Riddell ___ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/pabx_on_disk.php (PABX on a Disk) http://www.venturevoip.com/exchange.php (Full ITSP Solution) http://www.venturevoip.com/cc.php (Call Centre Solutions) -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
On Tue, 28 Apr 2015 07:21:12 -0700 Motty Cruz motty.c...@gmail.com wrote: here is what I did and worked for me: exten = 1381+NXX,1,Set(CALLERID(number)=3817383444) exten = 1+NXXNXX,2,Dial(SIP/SIP-Provider/${EXTEN:1},80) I find it hard to believe this is working. First, you don't have a leading underscore on your patterns. Your users aren't literally dialing the N's and X's are they? Second, what's with the plus in the extension? You want your users to dial that? Third, that's two different extensions, one with priority 1 and one with priority 2. The first one will set a variable and hangup, and the second there's no priority 1 for that extension... I've never tried that... I'm assuming it just won't work. -- C. Chad Wallace, B.Sc. The Lodging Company http://www.lodgingcompany.com/ OpenPGP Public Key ID: 0x262208A0 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
I apologize, I coppied the wrong code, here is the code I am using: ; Adding Area code and striping 9 for local numbers exten = _9XXX,n,Set(CALLERID(all)= 3817383444) exten = _9XXX,n,Dial(SIP/intelepeer/1381${EXTEN:1},80) Thanks, motty On 04/28/2015 11:54 AM, Chad Wallace wrote: On Tue, 28 Apr 2015 07:21:12 -0700 Motty Cruz motty.c...@gmail.com wrote: here is what I did and worked for me: exten = 1381+NXX,1,Set(CALLERID(number)=3817383444) exten = 1+NXXNXX,2,Dial(SIP/SIP-Provider/${EXTEN:1},80) I find it hard to believe this is working. First, you don't have a leading underscore on your patterns. Your users aren't literally dialing the N's and X's are they? Second, what's with the plus in the extension? You want your users to dial that? Third, that's two different extensions, one with priority 1 and one with priority 2. The first one will set a variable and hangup, and the second there's no priority 1 for that extension... I've never tried that... I'm assuming it just won't work. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
Thanks for your reply, [globals] AREACODE=381 [outbound] exten = _NXX,1,Dial(SIP/SIP-Provider/1${AREACODE}${EXTEN},80) did not work for me, any ideas? Thanks, On 04/27/2015 01:59 PM, Phil Reynolds wrote: On 27 April 2015 21:32:42 BST, Motty Cruz motty.c...@gmail.com wrote: Hello, I would like to add area code if clients dial 7 digits, it that possible? currently clients dial prefix 9 plus local number, however my SIP provider is requiring to dial 10 digits. is it possible to add area code?r Quite simple - you need to match on NXXX and when passing it to the SIP provider, present ${AREACODE}${EXTEN}, having first defined AREACODE in [globals]. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
here is what I have: exten = _9XXX,1,Set(l_HomeAreaCode=381) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten = _9XXX,n,Dial(SIP/SIP-Provider/${dialnumber},80) not having success; Got SIP reponse 503 Service Unavailable On 04/27/2015 02:19 PM, Bryant Zimmerman wrote: Motty Yes From your dial plan accept 9 + 7 digits then concat your dialed number together with your areacode. This s a brief example. exten = _9XXX,1,Set(l_HomeAreaCode=555) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1}) ;; This line should combine your area code and the last 7 digits of your dialed phone number exten = _9XXX,n,Dial(SIP/${dialnumber},35) Thanks Bryant Zimmerman (ZK Tech Inc.) 616-855-1030 Ext. 2003 *From*: Motty Cruz motty.c...@gmail.com *Sent*: Monday, April 27, 2015 4:33 PM *To*: asterisk-users@lists.digium.com *Subject*: [asterisk-users] adding area code Hello, I would like to add area code if clients dial 7 digits, it that possible? currently clients dial prefix 9 plus local number, however my SIP provider is requiring to dial 10 digits. is it possible to add area code? Thanks, Motty -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
On 27 April 2015 21:32:42 BST, Motty Cruz motty.c...@gmail.com wrote: Hello, I would like to add area code if clients dial 7 digits, it that possible? currently clients dial prefix 9 plus local number, however my SIP provider is requiring to dial 10 digits. is it possible to add area code?r Quite simple - you need to match on NXXX and when passing it to the SIP provider, present ${AREACODE}${EXTEN}, having first defined AREACODE in [globals]. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.-- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
On Mon, 27 Apr 2015, Bryant Zimmerman wrote: exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1}) Missing a colon? ${EXTEN:-1} -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
On 27Apr, 2015, at 16:39, Motty Cruz motty.c...@gmail.com wrote: forgot to mentioned I am running Asterisk 1.8.22.0 on CentOS. Thanks, On 04/27/2015 02:38 PM, Motty Cruz wrote: here is what I have: exten = _9XXX,1,Set(l_HomeAreaCode=381) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten = _9XXX,n,Dial(SIP/SIP-Provider/${dialnumber},80) not having success; Got SIP reponse 503 Service Unavailableā Can you send us the console output when you make the call? -- Cheers, Matt Riddell ___ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/pabx_on_disk.php (PABX on a Disk) http://www.venturevoip.com/exchange.php (Full ITSP Solution) http://www.venturevoip.com/cc.php (Call Centre Solutions) -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
Thanks for your reply, [globals] AREACODE=381 [outbound] exten = _9XX,1,Dial(SIP/SIP-Provider/1${AREACODE}${EXTEN-1},80) did not work for me, any ideas? Thanks, On 04/27/2015 01:59 PM, Phil Reynolds wrote: On 27 April 2015 21:32:42 BST, Motty Cruz motty.c...@gmail.com wrote: Hello, I would like to add area code if clients dial 7 digits, it that possible? currently clients dial prefix 9 plus local number, however my SIP provider is requiring to dial 10 digits. is it possible to add area code?r Quite simple - you need to match on NXXX and when passing it to the SIP provider, present ${AREACODE}${EXTEN}, having first defined AREACODE in [globals]. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
Motty Yes From your dial plan accept 9 + 7 digits then concat your dialed number together with your areacode. This s a brief example. exten = _9XXX,1,Set(l_HomeAreaCode=555) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1}) ;; This line should combine your area code and the last 7 digits of your dialed phone number exten = _9XXX,n,Dial(SIP/${dialnumber},35) Thanks Bryant Zimmerman (ZK Tech Inc.) 616-855-1030 Ext. 2003 From: Motty Cruz motty.c...@gmail.com Sent: Monday, April 27, 2015 4:33 PM To: asterisk-users@lists.digium.com Subject: [asterisk-users] adding area code Hello, I would like to add area code if clients dial 7 digits, it that possible? currently clients dial prefix 9 plus local number, however my SIP provider is requiring to dial 10 digits. is it possible to add area code? Thanks, Motty -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
forgot to mentioned I am running Asterisk 1.8.22.0 on CentOS. Thanks, On 04/27/2015 02:38 PM, Motty Cruz wrote: here is what I have: exten = _9XXX,1,Set(l_HomeAreaCode=381) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten = _9XXX,n,Dial(SIP/SIP-Provider/${dialnumber},80) not having success; Got SIP reponse 503 Service Unavailable On 04/27/2015 02:19 PM, Bryant Zimmerman wrote: Motty Yes From your dial plan accept 9 + 7 digits then concat your dialed number together with your areacode. This s a brief example. exten = _9XXX,1,Set(l_HomeAreaCode=555) exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1}) ;; This line should combine your area code and the last 7 digits of your dialed phone number exten = _9XXX,n,Dial(SIP/${dialnumber},35) Thanks Bryant Zimmerman (ZK Tech Inc.) 616-855-1030 Ext. 2003 *From*: Motty Cruz motty.c...@gmail.com *Sent*: Monday, April 27, 2015 4:33 PM *To*: asterisk-users@lists.digium.com *Subject*: [asterisk-users] adding area code Hello, I would like to add area code if clients dial 7 digits, it that possible? currently clients dial prefix 9 plus local number, however my SIP provider is requiring to dial 10 digits. is it possible to add area code? Thanks, Motty -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] adding area code
On Mon, 27 Apr 2015, Chad Wallace wrote: On Mon, 27 Apr 2015 14:30:07 -0700 (PDT) Steve Edwards asterisk@sedwards.com wrote: On Mon, 27 Apr 2015, Bryant Zimmerman wrote: exten = _9XXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1}) Missing a colon? ${EXTEN:-1} Does that work? No. I was so focused on the tree, I missed the forest :) ${EXTEN:-x} means 'return the last x digits' ${EXTEN:x} means 'return all but the first x digits' So, ${EXTEN:1} is correct for this use. Something like (tested!): exten = _9nxx,1,verbose(The 'raw' exten is ${EXTEN}) same = n, set(MY-AREA-CODE=760) same = n, set(DNIS=${MY-AREA-CODE}${EXTEN:1}) same = n, verbose(The full DNIS is ${DNIS}) same = n, dial(sip/1${DNIS}@vitel-outbound,60,r) same = n, hangup() is closer to what the OP needs. Note the 'n' in the pattern. -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users