[asterisk-bugs] [Asterisk 0014629]: [patch] Add support in AEL for macro return values and direct assignment of them to variables and functions.

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jan 21 21:27:07 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14629 
====================================================================== 
Reported By:                Marquis
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14629
Category:                   PBX/pbx_ael
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     ready for review
Asterisk Version:           SVN 
JIRA:                       SWP-282 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-03-09 06:03 CDT
Last Modified:              2010-01-21 21:27 CST
====================================================================== 
Summary:                    [patch] Add support in AEL for macro return values
and direct assignment of them to variables and functions.
Description: 
This patch adds macro return value and simple assignment support to AEL.

This is the bug report for review request 114 as per Russell Bryant.
http://reviewboard.digium.com/r/114/
====================================================================== 

---------------------------------------------------------------------- 
 (0117054) crjw (reporter) - 2010-01-21 21:27
 https://issues.asterisk.org/view.php?id=14629#c117054 
---------------------------------------------------------------------- 
Okay, I applied both patches:
 "macro_assignment.patch"
 AND
 "20100121__issue14629.diff.txt"

Things are better but there are still problems.

I no longer get a syntax error when I pass an argument to "return".
e.g. This parses without error:
 macro returnmacro() {
   MYVAR=10;
   return ${MYVAR};
 }

But direct assignment of the variable gives an error.
e.g.
  401 =>{
    FOO=&returnmacro();
  }
generates the following error: 
ast_expr2.fl:468 ast_yyerror: ast_yyerror(): file
/apps/asterisk/etc/extensions.ael, line 209, columns 16-36, variable
declaration expr '&returnmacro()': syntax error: syntax error, unexpected
'&', expecting $end; Input:
&returnmacro()
^

I can work around the problem by doing this:
401 =>{
  &returnmacro();
  FOO=${GOSUB_RETVAL};
}
... but this work around seems a little kludgey. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-21 21:27 crjw           Note Added: 0117054                          
======================================================================




More information about the asterisk-bugs mailing list