[Home]

Summary:ASTERISK-19887: Pattern matching broken on Local channels (ast 1.8)
Reporter:alexr1 (alexr1)Labels:
Date Opened:2012-05-17 20:22:54Date Closed:2012-05-18 11:00:17
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_local
Versions:1.8.11.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Centos, Asterisk 1.8Attachments:
Description:The workaround is simple, but this seems like a bug.

In the scenario where a local context is called from a regular one with a SINGLE DIGIT extension but a MULTI-DIGIT pattern, it fails.
[2012-05-18 11:18:43] NOTICE[16991]: chan_local.c:899 local_call: No such extension/context 5@context-local while calling Local channel

[context-normal]
exten => s,1,Dial(Local/5@context-local/n,60,gr)

[context-local]
exten => _X.,1,NoOp(${EXTEN})

If we add a single digit pattern, it works fine for both.
[context-local]
exten => _X.,1,NoOp(${EXTEN})
exten => _X,1,NoOp(${EXTEN})
Comments:By: Mark Petersen (roadkill) 2012-05-18 10:29:20.396-0500

well this is not a bug but as "." is matchin on 1 or more digits and with a X in from you need at least 2 digites to match
you must use _X! instead as "!" is matching on 0 or more digits
https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching

By: alexr1 (alexr1) 2012-05-18 19:26:45.324-0500

We had upgraded from 1.4 to 1.8. Is it possible that _X. in Local channels in 1.4 USED TO allow 1 or more digits instead of 2 or more?... Because this one little bit of code is the only thing that stopped working. And I had always presumed _X. was one or more characters... Amazed (and stupid). Thanks.