[Home]

Summary:ASTERISK-23805: Dialplan pattern matching error
Reporter:Andres Mazzocchi (andrescm)Labels:
Date Opened:2014-05-29 10:39:37Date Closed:2014-05-29 11:18:25
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Dial
Versions:11.4.0 11.9.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 6.5Attachments:
Description:There's a little flaw in the pattern matching algorythm. This pattern is pretty straighforward:

{code}
exten => _9XZ.,1,Answer()
{code}

It means one should be able to dial 9(0-9)(1-9). numbers, unlimited length.

However, if the dialed number begins with 920., Asterisk returns the following error:

{code}
---
Call from '2801' to extension '920256666' rejected because extension not found in context 'xxxxxxxx'.
---
{code}

A simple workaround is to add an additional entry tailored for these specific numbers:

{code}
exten => _920.,1,Answer()
{code}

Furthermore, the pattern recognizes correctly numbers 921 to 929. The only one that is not recognized is 920.

I've discovered this while using Asterisk 11.4.0, then I upgraded to 11.9.0 and the error is still present. I don't know about the versions in between.
Comments:By: Matt Jordan (mjordan) 2014-05-29 11:18:25.738-0500

A pattern match character of {{Z}} matches {{1-9}}. It shouldn't match 0 - hence, your pattern of:

{code}
_9XZ.
{code}

Should only match characters {{9[0-9][1-9].}}. If it matched {{920}}, something would be horribly wrong.

By: Rusty Newton (rnewton) 2014-05-29 11:20:46.466-0500

Try this one!
{noformat}
_9XX.
{noformat}

By: Andres Mazzocchi (andrescm) 2014-05-29 11:31:03.815-0500

Oh, I realize now. The Z is there because I don't want people to be able to dial 00 (international prefix). In my mind somehow that first X was completely omitted so I was matching 20 to Z. instead of XZ.

Sorry for the inconvenience, I'll close the issue.