VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
phil-asterisk at tinsl... Guest
|
Posted: Mon Apr 27, 2015 4:01 pm Post subject: [asterisk-users] adding area code |
|
|
On 27 April 2015 21:32:42 BST, Motty Cruz <motty.cruz@gmail.com> wrote:
Quote: | 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 NXXXXXXX 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. |
|
Back to top |
|
|
motty.cruz at gmail.com Guest
|
Posted: Mon Apr 27, 2015 4:17 pm Post subject: [asterisk-users] adding area code |
|
|
Thanks for your reply,
[globals]
AREACODE=381
[outbound]
exten => _NXXXXXX,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:
Quote: |
On 27 April 2015 21:32:42 BST, Motty Cruz <motty.cruz@gmail.com> (motty.cruz@gmail.com) wrote:
Quote: | 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 NXXXXXXX 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.
|
|
|
Back to top |
|
|
BryantZ at zktech.com Guest
|
Posted: Mon Apr 27, 2015 4:20 pm Post subject: [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 => _9XXXXXXX,1,Set(l_HomeAreaCode=555)
exten => _9XXXXXXX,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 => _9XXXXXXX,n,Dial(SIP/${dialnumber},35)
Thanks Bryant Zimmerman (ZK Tech Inc.) 616-855-1030 Ext. 2003
From: "Motty Cruz" <motty.cruz@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 |
|
Back to top |
|
|
BryantZ at zktech.com Guest
|
Posted: Mon Apr 27, 2015 4:22 pm Post subject: [asterisk-users] adding area code |
|
|
Thanks for your reply, [globals] AREACODE=381 [outbound] exten => _9XXXXXX,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:
Quote: | On 27 April 2015 21:32:42 BST, Motty Cruz <motty.cruz@gmail.com> (motty.cruz@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 NXXXXXXX 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. |
|
|
Back to top |
|
|
asterisk.org at sedwar... Guest
|
Posted: Mon Apr 27, 2015 4:30 pm Post subject: [asterisk-users] adding area code |
|
|
On Mon, 27 Apr 2015, Bryant Zimmerman wrote:
Quote: | exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1})
|
Missing a colon?
${EXTEN:-1}
--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@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 |
|
Back to top |
|
|
motty.cruz at gmail.com Guest
|
Posted: Mon Apr 27, 2015 4:39 pm Post subject: [asterisk-users] adding area code |
|
|
here is what I have:
exten => _9XXXXXXX,1,Set(l_HomeAreaCode=381)
exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten => _9XXXXXXX,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:
Quote: | 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 => _9XXXXXXX,1,Set(l_HomeAreaCode=555)
exten => _9XXXXXXX,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 => _9XXXXXXX,n,Dial(SIP/${dialnumber},35)
Thanks
Bryant Zimmerman (ZK Tech Inc.)
616-855-1030 Ext. 2003
From: "Motty Cruz" <motty.cruz@gmail.com> (motty.cruz@gmail.com)
Sent: Monday, April 27, 2015 4:33 PM
To: asterisk-users@lists.digium.com (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
|
|
|
Back to top |
|
|
motty.cruz at gmail.com Guest
|
Posted: Mon Apr 27, 2015 4:40 pm Post subject: [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:
Quote: | here is what I have:
exten => _9XXXXXXX,1,Set(l_HomeAreaCode=381)
exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten => _9XXXXXXX,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:
Quote: | 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 => _9XXXXXXX,1,Set(l_HomeAreaCode=555)
exten => _9XXXXXXX,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 => _9XXXXXXX,n,Dial(SIP/${dialnumber},35)
Thanks
Bryant Zimmerman (ZK Tech Inc.)
616-855-1030 Ext. 2003
From: "Motty Cruz" <motty.cruz@gmail.com> (motty.cruz@gmail.com)
Sent: Monday, April 27, 2015 4:33 PM
To: asterisk-users@lists.digium.com (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
|
|
|
|
Back to top |
|
|
lists at venturevoip.com Guest
|
Posted: Mon Apr 27, 2015 4:56 pm Post subject: [asterisk-users] adding area code |
|
|
Quote: | On 27Apr, 2015, at 16:39, Motty Cruz <motty.cruz@gmail.com (motty.cruz@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:
Quote: | here is what I have:
exten => _9XXXXXXX,1,Set(l_HomeAreaCode=381)
exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten => _9XXXXXXX,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) |
|
Back to top |
|
|
cwallace at lodgingcom... Guest
|
Posted: Mon Apr 27, 2015 6:43 pm Post subject: [asterisk-users] adding area code |
|
|
On Mon, 27 Apr 2015 14:30:07 -0700 (PDT)
Steve Edwards <asterisk.org@sedwards.com> wrote:
Quote: | On Mon, 27 Apr 2015, Bryant Zimmerman wrote:
Quote: | exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1})
|
Missing a colon?
${EXTEN:-1}
|
Does that work? I've always seen it like this:
${EXTEN:1}
--
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 |
|
Back to top |
|
|
asterisk.org at sedwar... Guest
|
Posted: Mon Apr 27, 2015 7:46 pm Post subject: [asterisk-users] adding area code |
|
|
On Mon, 27 Apr 2015, Chad Wallace wrote:
Quote: | On Mon, 27 Apr 2015 14:30:07 -0700 (PDT)
Steve Edwards <asterisk.org@sedwards.com> wrote:
Quote: | On Mon, 27 Apr 2015, Bryant Zimmerman wrote:
Quote: | exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN-1})
|
Missing a colon?
${EXTEN:-1}
|
|
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 = _9nxxxxxx,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 sedwards@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 |
|
Back to top |
|
|
motty.cruz at gmail.com Guest
|
Posted: Tue Apr 28, 2015 9:21 am Post subject: [asterisk-users] adding area code |
|
|
this code worked for me,
here is what I did and worked for me:
exten => 1381+NXXXXXX,1,Set(CALLERID(number)=3817383444) exten => 1+NXXNXXXXXX,2,Dial(SIP/SIP-Provider/${EXTEN:1},80)
Thanks for you help!
On 04/27/2015 02:56 PM, Matt Riddell wrote:
Quote: | Quote: | On 27Apr, 2015, at 16:39, Motty Cruz <motty.cruz@gmail.com (motty.cruz@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:
Quote: | here is what I have:
exten => _9XXXXXXX,1,Set(l_HomeAreaCode=381)
exten => _9XXXXXXX,n,Set(dialnumber=${l_HomeAreaCode}${EXTEN:-1}) exten => _9XXXXXXX,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)
|
|
|
Back to top |
|
|
cwallace at lodgingcom... Guest
|
Posted: Tue Apr 28, 2015 1:54 pm Post subject: [asterisk-users] adding area code |
|
|
On Tue, 28 Apr 2015 07:21:12 -0700
Motty Cruz <motty.cruz@gmail.com> wrote:
Quote: | here is what I did and worked for me:
exten => 1381+NXXXXXX,1,Set(CALLERID(number)=3817383444)
exten => 1+NXXNXXXXXX,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 |
|
Back to top |
|
|
motty.cruz at gmail.com Guest
|
Posted: Tue Apr 28, 2015 2:27 pm Post subject: [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 => _9XXXXXXX,n,Set(CALLERID(all)= <3817383444>)
exten => _9XXXXXXX,n,Dial(SIP/intelepeer/1381${EXTEN:1},80)
Thanks,
motty
On 04/28/2015 11:54 AM, Chad Wallace wrote:
Quote: | Quote: | On Tue, 28 Apr 2015 07:21:12 -0700
Motty Cruz <motty.cruz@gmail.com> (motty.cruz@gmail.com) wrote:
Quote: | here is what I did and worked for me:
exten => 1381+NXXXXXX,1,Set(CALLERID(number)=3817383444)
exten => 1+NXXNXXXXXX,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.
| |
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|