[Home]

Summary:ASTERISK-13275: Pattern matching for extensions with ranges is broken
Reporter:Dmitry Andrianov (dimas)Labels:
Date Opened:2008-12-25 14:56:04.000-0600Date Closed:2009-01-15 18:47:31.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:PBX/pbx_ael
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:It looks like something has broken in extension pattern matching since 1.4.21.2
My dialplans which used to work there do not work with latest 1.4 branch.
After spending some time I nailed problem down to:

context ctxa {

       _[1-7]XXX => {
               NoOp;
       };
};

context ctxb {

       includes {
               ctxa;
       }

       12 =>   jump 4012@ctxa;

};

This dialplan does not load producing:

voip1*CLI> ael reload
...
[Dec 25 23:47:14] ERROR[10868]: pbx_ael.c:1284 check_goto: Error: file /etc/asterisk/ael/local/test.ael, line 15-15: goto:  no label 4012|1 exists in the context ctxa or its inclusions!
[Dec 25 23:47:14] ERROR[10868]: pbx_ael.c:4498 pbx_load_module: Sorry, but 0 syntax errors and 1 semantic errors were detected. It doesn't make sense to compile.
voip1*CLI>

****** ADDITIONAL INFORMATION ******

If the dot appended to the pattern, the AEL actually loads but when executing jump Asterisk complaints that jump is made to invalid extension. That is for

       _[1-7]XXX. => {
               NoOp;
       };

I get:

   -- Executing [8812@default:1] Goto("IAX2/1001-4413", "ctxb|12|1") in new stack
   -- Goto (ctxb,12,1)
   -- Executing [12@ctxb:1] Goto("IAX2/1001-4413", "ctxa|4012|1") in new stack
   -- Goto (ctxa,4012,1)
[Dec 25 23:53:06] WARNING[12205]: pbx.c:2471 __ast_pbx_run: Channel 'IAX2/1001-4413' sent into invalid extension '4012' in context 'ctxa', but no invalid handler
   -- Hungup 'IAX2/1001-4413'

Because of this I assume it is not an AEL problem but rather an extension matching problem.
Comments:By: Dmitry Andrianov (dimas) 2009-01-07 10:31:34.000-0600

As I already wrote "... I assume it is not an AEL problem but rather an extension matching problem" so to my taste the category and assigned person are wrong. But I can be wong too....

By: Leif Madsen (lmadsen) 2009-01-07 11:55:34.000-0600

It would still be a Murf problem regardless actually.

By: Digium Subversion (svnbot) 2009-01-15 18:19:12.000-0600

Repository: asterisk
Revision: 168745

U   branches/1.4/pbx/pbx_ael.c

------------------------------------------------------------------------
r168745 | murf | 2009-01-15 18:19:12 -0600 (Thu, 15 Jan 2009) | 14 lines

This patch fixes a problem where a goto (or jump, in this case)
fails a consistency check because it can't find a matching
extension. The problem was a missing instruction to end
the range notation in the code where it converts the pattern
into a regex and uses the regex code to determine the match.

I tested using the AEL code the user supplied, and now,
the consistency check passes.


(closes issue ASTERISK-13275)
Reported by: dimas


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

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

By: Digium Subversion (svnbot) 2009-01-15 18:34:32.000-0600

Repository: asterisk
Revision: 168746

_U  trunk/
U   trunk/res/ael/pval.c

------------------------------------------------------------------------
r168746 | murf | 2009-01-15 18:34:31 -0600 (Thu, 15 Jan 2009) | 20 lines

Merged revisions 168745 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r168745 | murf | 2009-01-15 17:19:12 -0700 (Thu, 15 Jan 2009) | 14 lines
 
 This patch fixes a problem where a goto (or jump, in this case)
 fails a consistency check because it can't find a matching
 extension. The problem was a missing instruction to end
 the range notation in the code where it converts the pattern
 into a regex and uses the regex code to determine the match.
 
 I tested using the AEL code the user supplied, and now,
 the consistency check passes.
 
 
 (closes issue ASTERISK-13275)
 Reported by: dimas
........

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

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

By: Digium Subversion (svnbot) 2009-01-15 18:38:37.000-0600

Repository: asterisk
Revision: 168747

_U  branches/1.6.0/
U   branches/1.6.0/res/ael/pval.c

------------------------------------------------------------------------
r168747 | murf | 2009-01-15 18:38:36 -0600 (Thu, 15 Jan 2009) | 27 lines

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

................
 r168746 | murf | 2009-01-15 17:34:31 -0700 (Thu, 15 Jan 2009) | 20 lines
 
 Merged revisions 168745 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r168745 | murf | 2009-01-15 17:19:12 -0700 (Thu, 15 Jan 2009) | 14 lines
   
   This patch fixes a problem where a goto (or jump, in this case)
   fails a consistency check because it can't find a matching
   extension. The problem was a missing instruction to end
   the range notation in the code where it converts the pattern
   into a regex and uses the regex code to determine the match.
   
   I tested using the AEL code the user supplied, and now,
   the consistency check passes.
   
   
   (closes issue ASTERISK-13275)
   Reported by: dimas
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-01-15 18:47:30.000-0600

Repository: asterisk
Revision: 168748

_U  branches/1.6.1/
U   branches/1.6.1/res/ael/pval.c

------------------------------------------------------------------------
r168748 | murf | 2009-01-15 18:47:30 -0600 (Thu, 15 Jan 2009) | 27 lines

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

................
 r168746 | murf | 2009-01-15 17:34:31 -0700 (Thu, 15 Jan 2009) | 20 lines
 
 Merged revisions 168745 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r168745 | murf | 2009-01-15 17:19:12 -0700 (Thu, 15 Jan 2009) | 14 lines
   
   This patch fixes a problem where a goto (or jump, in this case)
   fails a consistency check because it can't find a matching
   extension. The problem was a missing instruction to end
   the range notation in the code where it converts the pattern
   into a regex and uses the regex code to determine the match.
   
   I tested using the AEL code the user supplied, and now,
   the consistency check passes.
   
   
   (closes issue ASTERISK-13275)
   Reported by: dimas
 ........
................

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

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