Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Toll free pattern matching


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
darcy at Vex.Net
Guest





PostPosted: Fri Aug 05, 2016 9:07 am    Post subject: [asterisk-users] Toll free pattern matching Reply with quote

I have this in my config:

exten => _800XXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
same => n,Dial(SIP/tollfree/1${EXTEN})
exten => _1800XXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
same => n,Dial(SIP/tollfree/${EXTEN})
exten => _NXXNXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
same => n,Dial(SIP/trunk/1${EXTEN})
exten => _1NXXNXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
same => n,Dial(SIP/trunk/${EXTEN})

I came across
http://stackoverflow.com/questions/7235291/asterisk-priorities-that-have-a-possibility-of-matching
which seems to imply that the above won't work and that all the calls
would go to the trunk. However, this is working as expected for me.
Did the behaviour change in the last four years or could I run into
problems with this setup? Perhaps I am misunderstanding the poster's
issue.

--
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:darcy@Vex.Net
VoIP: sip:darcy@Vex.Net

--
_____________________________________________________________________
-- 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
rmudgett at digium.com
Guest





PostPosted: Fri Aug 05, 2016 9:26 am    Post subject: [asterisk-users] Toll free pattern matching Reply with quote

On Fri, Aug 5, 2016 at 9:06 AM, D'Arcy J.M. Cain <darcy@vex.net (darcy@vex.net)> wrote:
Quote:
I have this in my config:

exten => _800XXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
  same => n,Dial(SIP/tollfree/1${EXTEN})
exten => _1800XXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
  same => n,Dial(SIP/tollfree/${EXTEN})
exten => _NXXNXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
  same => n,Dial(SIP/trunk/1${EXTEN})
exten => _1NXXNXXXXXX,1,Verbose(0,${CHANNEL(peername)} Calling ${EXTEN})
  same => n,Dial(SIP/trunk/${EXTEN})

I came across
http://stackoverflow.com/questions/7235291/asterisk-priorities-that-have-a-possibility-of-matching
which seems to imply that the above won't work and that all the calls
would go to the trunk.  However, this is working as expected for me.
Did the behaviour change in the last four years or could I run into
problems with this setup?  Perhaps I am misunderstanding the poster's
issue.


Dialplan will stay on the current series of extensions until it runs out.  If there isn't an explicit hangup

to stop execution it will look for the next priority match.  You can easily test this yourself by creating

some test dialplan to match your situation.



Given the below dialplan:



exten = _800XXXXXX,1,NoOp(Start of 800 series)

same = n,NoOp(Next in 800 series)


exten = _NXXNXXXX,1,NoOp(Generic series)

same = n,NoOp(next in generic series)

same = n,NoOp(third in generic series)


If you have an 800 number starting in dialplan then these are the priorities

executed:

1, Start of 800 series

2, Next in 800 series

Since we have run out of the 800 series Asterisk looks for a priority 3 that matches the extension

and finds priority 3 of the generic series.

3, third in generic series

There is no priority 4 so the call is hung up.


Richard




[1] https://wiki.asterisk.org/wiki/display/AST/Contexts%2C+Extensions%2C+and+Priorities
[2] https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching
Back to top
darcy at Vex.Net
Guest





PostPosted: Fri Aug 05, 2016 9:54 am    Post subject: [asterisk-users] Toll free pattern matching Reply with quote

On Fri, 5 Aug 2016 09:26:03 -0500
Richard Mudgett <rmudgett@digium.com> wrote:
Quote:
Dialplan will stay on the current series of extensions until it runs
out. If there isn't an explicit hangup

So glad I asked. I see now that it only worked because of the accident
that the specific 800 extension and the generic one just happened to
have the same number of priorities. I have added explicit hangups.

Thanks.

--
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:darcy@Vex.Net
VoIP: sip:darcy@Vex.Net

--
_____________________________________________________________________
-- 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
tim.strommen at gmail.com
Guest





PostPosted: Fri Aug 05, 2016 7:43 pm    Post subject: [asterisk-users] Toll free pattern matching Reply with quote

Don't forget to handle the other special extension cases in a [context].  What I find is a good practice is to write a root "catch-all" (template), then I tag that onto any new [context](template).



[Special-Extensions]

exten -> a,1,NoOp(Where a call jumps when the caller requests the assistant)
exten -> e,1,NoOp(Catchall where a call jumps with an exception on the call)
exten -> h,1,NoOp(Where a call jump with a hang up)
exten -> i,1,NoOp(Where a call jumps if an invalid extension is entered)
exten -> o,1,NoOp(Where a call jumps when a caller requests an operator)
exten -> s,1,NoOp(Where a call jumps to when a new call starts in a context if no extension is specified)
exten -> t,1,NoOp(Where a call jumps if the user did not enter a response to Background or WaitExten)
exten -> T,1,NoOp(Where a call jumps when it exceeds the absolute TIMEOUT value for a call).


[your-new-context](Special-Extensions)
...


-T


On Fri, Aug 5, 2016 at 7:53 AM, D'Arcy J.M. Cain <darcy@vex.net (darcy@vex.net)> wrote:
Quote:
On Fri, 5 Aug 2016 09:26:03 -0500
Richard Mudgett <rmudgett@digium.com (rmudgett@digium.com)> wrote:
Quote:
Dialplan will stay on the current series of extensions until it runs
out. If there isn't an explicit hangup

So glad I asked.  I see now that it only worked because of the accident
that the specific 800 extension and the generic one just happened to
have the same number of priorities.  I have added explicit hangups.

Thanks.

--
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:darcy@Vex.Net
VoIP: sip:darcy@Vex.Net

--
_____________________________________________________________________
-- 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
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

VoiceMeUp - Corporate & Wholesale VoIP Services