[asterisk-bugs] [Asterisk 0012777]: [patch] Pattern matching treats 'x' differently than 'X'

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Jun 6 14:49:28 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12777 
====================================================================== 
Reported By:                jsmith
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   12777
Category:                   PBX/pbx_config
Reproducibility:            always
Severity:                   minor
Priority:                   high
Status:                     closed
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 117582 
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             06-02-2008 21:50 CDT
Last Modified:              06-06-2008 14:49 CDT
====================================================================== 
Summary:                    [patch] Pattern matching treats 'x' differently than
'X'
Description: 
Steve Edwards reported
[http://lists.digium.com/pipermail/asterisk-users/2008-June/212956.html]
that the pattern _2xxx is evaluated before _2[1-4]00.  I went to reply that
it shouldn't be that way, but in my testing, I found he was right.

I think this is a pretty serious bug in the pattern matching code.

As I understand it, Asterisk should be evaluating the patterns one digit
at a time, from left to right.  Whenever more than one pattern could
possibly match, the *most constrained* digit should match first.  In other
words, given these two patterns, if I dialed 1234, the first one should
match before the second, as it's a more constrained match in the third
digit (it matches two possible values, while the other matches three).

_12[3-4]X
_12[3-5]X

The problem arises in that Asterisk seems to be treating the wildcard 'X'
differently than 'x', and I can't figure out why.  Both of them should mean
"any digit 0 through 9", but apparently they don't.  See below for more
details:
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 06-06-08 14:49  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 121011

_U  branches/1.6.0/
U   branches/1.6.0/main/pbx.c

------------------------------------------------------------------------
r121011 | tilghman | 2008-06-06 14:49:27 -0500 (Fri, 06 Jun 2008) | 14
lines

Merged revisions 121010 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r121010 | tilghman | 2008-06-06 14:55:08 -0500 (Fri, 06 Jun 2008) | 6
lines

Make extension match characters case-insensitive.
(closes issue http://bugs.digium.com/view.php?id=12777)
 Reported by: jsmith
 Patches: 
       lower_case_patterns-trunk-v1.patch uploaded by jsmith (license 15)

........

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

http://svn.digium.com/view/asterisk?view=rev&revision=121011 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-06-08 14:49  svnbot         Note Added: 0087910                          
======================================================================




More information about the asterisk-bugs mailing list