[Home]

Summary:ASTERISK-04753: [PATCH] AEL builds statement that won't execute on if with : operator using character classes
Reporter:Terry Wilson (twilson)Labels:
Date Opened:2005-08-01 18:20:20Date Closed:2008-01-15 15:45:47.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:PBX/pbx_ael
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) pbx_ael.c.patch.txt
Description:AEL code of:
if ("${MACRO_EXTEN}" : "1[0-9]{10}") {
 NoOp(1 + number);
};

produces statments:
3. Goto(${IF($[ "${MACRO_EXTEN}" : "1[0-9]{10}" ]?4:5)})
4. NoOp(1 + number)
5. NoOp(Finish if-sw-handle-call-1-nuvio-customers-3)

which results in:
Aug  1 17:50:53 NOTICE[7673] pbx.c: Error in extension logic (missing ']')
Aug  1 17:50:53 WARNING[7673] ast_expr2.fl: ast_yyerror(): syntax error: syntax error, unexpected TOKEN, expecting $end; Input:
"15555551212" : "1[0-9]{1
                   ^
Aug  1 17:50:53 WARNING[7673] ast_expr2.fl: If you have questions, please refer to doc/README.variables in the asterisk source.

The attached patch works around this bug (since I know nothing of flex) by instead converting the Goto($[IF( statments to GotoIf($[ statements which seems to fix the problem.

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

Tried using both flex 2.5.4 and 2.5.31 with no luck.  Even if a change is made to the flex stuff, the GotoIfs are a bit easier on the eyes than the embedded function version.
Comments:By: Kevin P. Fleming (kpfleming) 2005-08-26 16:08:46

Committed to CVS HEAD, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:45:47.000-0600

Repository: asterisk
Revision: 6425

U   trunk/pbx/pbx_ael.c

------------------------------------------------------------------------
r6425 | kpfleming | 2008-01-15 15:45:47 -0600 (Tue, 15 Jan 2008) | 2 lines

work around parsing problem by using GotoIf() (issue ASTERISK-4753)

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

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