[Home]

Summary:ASTERISK-17695: 1.8.3.2 extenpatternmatchnew=yes cannot find extensions with '-' in them
Reporter:test011 (test011)Labels:
Date Opened:2011-04-14 20:03:45Date Closed:2019-04-12 08:34:36
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Tests/NewFeature
Versions:1.8.3 13.18.4 Frequency of
Occurrence
Related
Issues:
duplicatesASTERISK-16751 macro does not match Goto extension s-NOANSWER when extenpatternmatchnew=yes
Environment:Attachments:
Description:1.8.3.2 extenpatternmatchnew=yes cannot find extensions with '-' in them.

ex) exten => _ASTERISK-5.,n,Goto(9-${DIALSTATUS},1)
ex) exten => s,2,Goto(1-out,1)

I believe something like "Goto(1-${DIALSTATUS},1)" is widely used, but extenpatternmatchnew=yes has some parsing problem and can't find it.

with extenpatternmatchnew=no works fine.
Comments:By: Leif Madsen (lmadsen) 2011-04-18 17:13:50

The pattern match you've shown makes no sense to me. Your example I would not expect to work.

Please provide some additional dialplan and the console output showing what happens when you dial.

exten => _ASTERISK-5. would not match 9-${DIALSTATUS}

By: test011 (test011) 2011-04-19 08:35:06

Those patterns are just two separate examples. They are not meant to be working dialplans. I was simply representing some examples with '-' in them.

"9-${DIALSTATUS}" is the part that I am talking about.
It seems '-'(dash) character is causing some trouble with pattern matching, Asterisk simply can't see them.

[testing]
exten => _ASTERISK-5.,1,NoOp("YESIAMINTHISCONTEXTALRIGHT")
...some dialing...
exten => _ASTERISK-5.,n,Goto(9-${DIALSTATUS},1)
...and something else....

exten => 9-BUSY,1,something()

When extenpatternmatchnew=yes, Asterisk reports that it can't find 9-BUSY extension. (of course, I made sure that the extension I am testing was busy)

When I changed '-' with '_' like 9_${DIALSTATUS} and 9_BUSY in above example, they work fine.

With extenpatternmatchnew=no, it finds 9-BUSY alright.
This does not have anything to do with ${DIALSTATUS} or Dial application, so as the second example also doesn't find 1-out extionsion (Yes, there is 1-out extension, I was foolishly tested this option on my production server)



By: Leif Madsen (lmadsen) 2011-04-19 08:48:18

OK, I follow now, but you weren't particularly clear. A lot of issues have been resolved due to pointing out the obvious.

Can you provide the console output showing this?

By: test011 (test011) 2011-04-19 08:49:38

And sorry, I do admit that I wasn't very clear.

By: test011 (test011) 2011-04-19 09:10:41

{noformat}
[skb106-dial]
exten => s,1,NoOp()
exten => s,n,Set(DEST2=skb1_pstn)
exten => s,n,Set(DIALSTATUS=UNKNOWN)
exten => s,n,Goto(skb1_${DIALSTATUS},1)    ; note '_'
exten => skb1_pstn,1,Gosub(dial-failover,s,1(${ARG1},${TRUNK6},${TRUNK7},,${LONGTIMEOUT},,))
exten => skb1_pstn,n,Set(DEST2=skb2_pstn)
exten => skb1_pstn,n,Goto(skb1-${DIALSTATUS},1)
exten => skb2_pstn,1,Gosub(dial-failover,s,1(106,${TRUNK4},${TRUNK1},${TRUNK3},${LONGTIMEOUT},,))
exten => skb1_UNKNOWN,1,Goto(${DEST2},1)
exten => skb1-CONGESTION,1,Goto(${DEST2},1)
exten => skb1-BUSY,1,Goto(${DEST2},1)
exten => skb1-CHANUNAVAIL,1,Goto(${DEST2},1)
{noformat}

above works fine.

{noformat}
[skb106-dial]
exten => s,1,NoOp()
exten => s,n,Set(DEST2=skb1_pstn)
exten => s,n,Set(DIALSTATUS=UNKNOWN)
exten => s,n,Goto(skb1-${DIALSTATUS},1)     ; note '-'
exten => skb1_pstn,1,Gosub(dial-failover,s,1(${ARG1},${TRUNK6},${TRUNK7},,${LONGTIMEOUT},,))
exten => skb1_pstn,n,Set(DEST2=skb2_pstn)
exten => skb1_pstn,n,Goto(skb1-${DIALSTATUS},1)
exten => skb2_pstn,1,Gosub(dial-failover,s,1(106,${TRUNK4},${TRUNK1},${TRUNK3},${LONGTIMEOUT},,))

exten => skb1-UNKNOWN,1,Goto(${DEST2},1)
exten => skb1-CONGESTION,1,Goto(${DEST2},1)
exten => skb1-BUSY,1,Goto(${DEST2},1)
exten => skb1-CHANUNAVAIL,1,Goto(${DEST2},1)
{noformat}

above does not.

These two lines are different

{noformat}
exten => s,n,Goto(skb1-${DIALSTATUS},1)
....
exten => skb1-UNKNOWN,1,Goto(${DEST2},1)
{noformat}


-----------------------------
Console output bellow,

{noformat}
-- Executing [106@default:1] Gosub("SIP/353-00000004", "skb106-dial,s,1(106)") in new stack
-- Executing [s@skb106-dial:1] NoOp("SIP/353-00000004", "") in new stack
-- Executing [s@skb106-dial:2] Set("SIP/353-00000004", "DEST2=skb1_pstn") in new stack
-- Executing [s@skb106-dial:3] Set("SIP/353-00000004", "DIALSTATUS=UNKNOWN") in new stack
-- Executing [s@skb106-dial:4] Goto("SIP/353-00000004", "skb1-UNKNOWN,1") in new stack
-- Goto (skb106-dial,skb1-UNKNOWN,1)
[Apr 19 23:06:06] WARNING[6043]: pbx.c:4812 __ast_pbx_run: Channel 'SIP/353-00000004' sent into invalid extension 'skb1-UNKNOWN' in context 'skb106-dial', but no invalid handler
{noformat}

---------------

{noformat}
-- Executing [106@default:1] Gosub("SIP/353-00000005", "skb106-dial,s,1(106)") in new stack
-- Executing [s@skb106-dial:1] NoOp("SIP/353-00000005", "") in new stack
-- Executing [s@skb106-dial:2] Set("SIP/353-00000005", "DEST2=skb1_pstn") in new stack
-- Executing [s@skb106-dial:3] Set("SIP/353-00000005", "DIALSTATUS=UNKNOWN") in new stack
-- Executing [s@skb106-dial:4] Goto("SIP/353-00000005", "skb1_UNKNOWN,1") in new stack
-- Goto (skb106-dial,skb1_UNKNOWN,1)
-- Executing [skb1_UNKNOWN@skb106-dial:1] Goto("SIP/353-00000005", "skb1_pstn,1") in new stack
-- Goto (skb106-dial,skb1_pstn,1)
-- Executing [skb1_pstn@skb106-dial:1] Gosub("SIP/353-00000005", "dial-failover,s,1(106,SIP/SKB_1,SIP/SKB_2,,55,,)") in new stack
-- Executing [s@dial-failover:1] NoOp("SIP/353-00000005", ""Initiate fail-over procedure"") in new stack
{noformat}

.....goes on......
------------------

1. The original dialplan does not have exten => s,n,Set(DIALSTATUS=UNKNOWN) of course.
2. "but no invalid handler" seems puzzling. shouldn't be "no valid handler"



By: Friendly Automation (friendly-automation) 2019-04-16 11:40:45.121-0500

Change 11277 merged by Friendly Automation:
pbx.c: Ignore dashes in extensions when using extenpatternmatchnew

[https://gerrit.asterisk.org/c/asterisk/+/11277|https://gerrit.asterisk.org/c/asterisk/+/11277]

By: Friendly Automation (friendly-automation) 2019-04-16 12:11:17.226-0500

Change 11275 merged by Friendly Automation:
pbx.c: Ignore dashes in extensions when using extenpatternmatchnew

[https://gerrit.asterisk.org/c/asterisk/+/11275|https://gerrit.asterisk.org/c/asterisk/+/11275]

By: Friendly Automation (friendly-automation) 2019-04-16 12:18:23.436-0500

Change 11276 merged by Friendly Automation:
pbx.c: Ignore dashes in extensions when using extenpatternmatchnew

[https://gerrit.asterisk.org/c/asterisk/+/11276|https://gerrit.asterisk.org/c/asterisk/+/11276]