[asterisk-bugs] [Asterisk 0014710]: error/warnings for difficult if() statement in AEL

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 26 02:58:37 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14710 
====================================================================== 
Reported By:                caspy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14710
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0.6 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-03-20 09:40 CDT
Last Modified:              2009-03-26 02:58 CDT
====================================================================== 
Summary:                    error/warnings for difficult if() statement in AEL
Description: 
I have such code in AEL config:
if ($[${LEN(${var})} = 0] | $[${LEN(${var})} = 4] | $["${var}" = "value"])
{

It is successfully converted into dialplan command, that's work like
expected:
GotoIf($[$[${LEN(${var})} = 0] | $[${LEN(${var})} = 4] | $["${var}" =
"value"]]?6:8)


But error messages are produced in log:
[Mar 20 17:30:45] WARNING[2638] ast_expr2.fl: ast_yyerror(): file
/etc/asterisk/extensions.ael, line 57, columns 7-7, if expr
'$[${LEN(${var})} = 0] | $[${LEN(${var})} = 4] | $["${var}" = "value"]':
syntax error: syntax error, unexpected '<token>', expecting $end; Input:
$[${LEN(${var})} = 0] | $[${LEN(${var})} = 4] | $["${var}" = "value"]
  ^
[Mar 20 17:30:45] WARNING[2638] ast_expr2.fl: If you have questions,
please refer to doc/tex/channelvariables.tex in the asterisk source.
[Mar 20 17:30:45] WARNING[2638] ael/pval.c: Warning: file
/etc/asterisk/extensions.ael, line 57-59: The expression '$[${LEN(${var})}
= 0] | $[${LEN(${var})} = 4] | $["${var}" = "value"]' is redundantly
wrapped in '$[ ]'.

seems like AEL parser can not to produce an error messages in such cases.
====================================================================== 

---------------------------------------------------------------------- 
 (0102214) caspy (reporter) - 2009-03-26 02:58
 http://bugs.digium.com/view.php?id=14710#c102214 
---------------------------------------------------------------------- 
dimas,
where did you find out any docs about usage of "||" expression in
if-statements?
In descripton of GotoIf() there is nothing about "||", only "|". 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-26 02:58 caspy          Note Added: 0102214                          
======================================================================




More information about the asterisk-bugs mailing list