Gabriel Ortiz Lour
2011-Feb-15 20:47 UTC
[asterisk-users] Dialplan end of pattern matching question
Hi, I've noticed an unusual behavior on the dialplan execution: assume this DP: exten => _6XXX,1,NoOp(test1) exten => _XXXX,1,NoOp(test2) exten => _XXXX,2,NoOp(test3) If I call 6000 then test1 and test3 NoOps get executed, even though the pattern is different. I've always thought that if I call 6000 it would match the 6XXX pattern, that only has 1 priority, that would get executed and will be the end. But it seams that it finds the 2nd priority on the other pattern, and since it matches the dialed number it carry on with the execution. Is there a way to make asterisk behave like I've thought it would? Not keep executing the DP when the first pattern matched ends? (I dont want to use Hangup(), since it would suppress BUSY,CONGESTION and other status...) Thanks in advance, Gabriel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110215/8be33b74/attachment.htm>
Danny Nicholas
2011-Feb-15 21:01 UTC
[asterisk-users] Dialplan end of pattern matching question
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Gabriel Ortiz Lour Sent: Tuesday, February 15, 2011 2:47 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Dialplan end of pattern matching question Hi, I've noticed an unusual behavior on the dialplan execution: assume this DP: exten => _6XXX,1,NoOp(test1) exten => _XXXX,1,NoOp(test2) exten => _XXXX,2,NoOp(test3) If I call 6000 then test1 and test3 NoOps get executed, even though the pattern is different. I've always thought that if I call 6000 it would match the 6XXX pattern, that only has 1 priority, that would get executed and will be the end. But it seams that it finds the 2nd priority on the other pattern, and since it matches the dialed number it carry on with the execution. Is there a way to make asterisk behave like I've thought it would? Not keep executing the DP when the first pattern matched ends? (I dont want to use Hangup(), since it would suppress BUSY,CONGESTION and other status...) Thanks in advance, Gabriel As I recall, the _XXXX pattern evaluates and runs before _6XXX because X [0-9]. Auto fall-through is the "culprit" in your example dialplan. If you want asterisk to "do one thing and stop" when you dial a number, you either have to hangup after the 1 command or set autofallthrough=no (default is yes if not there). -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110215/795cfee8/attachment.htm>
Doug Lytle
2011-Feb-15 21:03 UTC
[asterisk-users] Dialplan end of pattern matching question
Gabriel Ortiz Lour wrote:> exten => _6XXX,1,NoOp(test1) > > exten => _XXXX,1,NoOp(test2) > exten => _XXXX,2,NoOp(test3)Being in the same context, it would look for the next priority that would match. _XXXX,2 would be that priority. I would suggest: exten => _6XXX,1,NoOp(test1) exten => _6XXX,n,Hangup() Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."