[Home]

Summary:ASTERISK-22684: extenpatternmatchnew doesn't match extensions that contain '-'
Reporter:Patrick Maille (patrickm)Labels:
Date Opened:2013-10-11 12:42:29Date Closed:2019-04-12 08:34:45
Priority:MinorRegression?
Status:Closed/CompleteComponents:Core/PBX
Versions:11.5.1 13.18.4 Frequency of
Occurrence
Constant
Related
Issues:
duplicatesASTERISK-16751 macro does not match Goto extension s-NOANSWER when extenpatternmatchnew=yes
Environment:Attachments:
Description:When extenpatternmatchnew=yes, unable to match extensions that work with extenpatternmatchnew=no.

\[Edit: updated by mjordan from comments\]

Using the following dialplan:

{noformat}
[dialin]
exten => _NXXNXXXXXX,1,NoOp(Incoming call from ANI: ${CALLERID(ani)} - CID: ${CALLERID(name)} <${CALLERID(num)}> to ${EXTEN})
exten => _NXXNXXXXXX,n,Dial(SIP/${EXTEN},6)                             ;; Dial endpoint with ringtime - default 6 seconds for testing
exten => _NXXNXXXXXX,n,Goto(dialin,${EXTEN}-${DIALSTATUS},1)            ;; Handle Dial Status
exten => _NXXNXXXXXX,n,Hangup(16)                                       ;; Safety net hangup

exten => _NXXNXXXXXX-BUSY,1,NoOp(${EXTEN:0:10} returns BUSY)
exten => _NXXNXXXXXX-BUSY,n,Busy(6)

exten => _NXXNXXXXXX-[N]OA[N]SWER,1,NoOp(${EXTEN:0:10} returns NOANSWER)
exten => _NXXNXXXXXX-[N]OA[N]SWER,n,Hangup(20)
{noformat}

When a call comes in for extension 3456789999, we start at dialin,3456789999,1.
We ring the endpoint for 6 seconds, if it's busy(dnd) we jump to {noformat}dialin,${EXTEN}-${DIALSTATUS},1{noformat} , which in this case would be dialin,3456789999-BUSY,1

But with externpatternmatchnew=yes, we get:
[Nov  1 14:44:09] WARNING[16393][C-00000007]: pbx.c:6390 __ast_pbx_run: Channel 'SIP/TESTINGTRUNK-0000000c' sent to invalid extension but no invalid handler: context,exten,priority=dialin,3456789999-BUSY,1

If I set externpatternmatchnew=no, then it jumps to the right extension (dialin,3456789999-BUSY,1). The same occurs with no-answer and probably other dialstatus conditions.
Comments:By: Patrick Maille (patrickm) 2013-10-11 12:49:22.637-0500

I have a piece of dialplan like:
{noformat}
exten => _NXXNXXXXXX,n,Dial(SIP/${EXTEN},27,t)
exten => _NXXNXXXXXX,n,Goto(dialin,${EXTEN}-${DIALSTATUS},1)
{noformat}

if there's no answer, it'd jump to _NXXNXXXXXX-[N]OA[N]SWER , if it's busy, _NXXNXXXXXX-BUSY , and so on ...

This works correctly when using extenpatternmatchnew=no

If I set extenpatternmatchnew=yes, then the console shows:
sent to invalid extension but no invalid handler: context,exten,priority=dialin,NXXNXXXXXX-NOANSWER,1

But if I do dialplan show NXXNXXXXXX-NOANSWER@dialin, it returns the correct section of dialplan:

{noformat}
[ Context 'dialin' created by 'pbx_config' ]
 '_NXXNXXXXXX-[N]OA[N]SWER' => 1. NoOp(${EXTEN:0:10} returns NOANSWER)       [pbx_config]
{noformat}


By: Matt Jordan (mjordan) 2013-11-01 10:31:07.678-0500

Can you attach the full dialplan used for this test? I'd like to verify how the extensions are constructed when {{extenpatternmatchnew=yes}}. Thanks!

By: Patrick Maille (patrickm) 2013-11-01 13:53:49.362-0500

Ok here is the piece of dialplan:

{noformat}
[dialin]
exten => _NXXNXXXXXX,1,NoOp(Incoming call from ANI: ${CALLERID(ani)} - CID: ${CALLERID(name)} <${CALLERID(num)}> to ${EXTEN})
exten => _NXXNXXXXXX,n,Dial(SIP/${EXTEN},6)                             ;; Dial endpoint with ringtime - default 6 seconds for testing
exten => _NXXNXXXXXX,n,Goto(dialin,${EXTEN}-${DIALSTATUS},1)            ;; Handle Dial Status
exten => _NXXNXXXXXX,n,Hangup(16)                                       ;; Safety net hangup

exten => _NXXNXXXXXX-BUSY,1,NoOp(${EXTEN:0:10} returns BUSY)
exten => _NXXNXXXXXX-BUSY,n,Busy(6)

exten => _NXXNXXXXXX-[N]OA[N]SWER,1,NoOp(${EXTEN:0:10} returns NOANSWER)
exten => _NXXNXXXXXX-[N]OA[N]SWER,n,Hangup(20)
{noformat}

When a call comes in for extension 3456789999, we start at dialin,3456789999,1.
We ring the endpoint for 6 seconds, if it's busy(dnd) we jump to {noformat}dialin,${EXTEN}-${DIALSTATUS},1{noformat} , which in this case would be dialin,3456789999-BUSY,1

But with externpatternmatchnew=yes, we get:
[Nov  1 14:44:09] WARNING[16393][C-00000007]: pbx.c:6390 __ast_pbx_run: Channel 'SIP/TESTINGTRUNK-0000000c' sent to invalid extension but no invalid handler: context,exten,priority=dialin,3456789999-BUSY,1

If I set externpatternmatchnew=no, then it jumps to the right extension (dialin,3456789999-BUSY,1). The same occurs with no-answer and probably other dialstatus conditions.