[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
Fri Jan 22 09:06:25 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-22 09:06 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/
====================================================================== 

---------------------------------------------------------------------- 
 (0117062) Marquis (reporter) - 2010-01-22 09:06
 https://issues.asterisk.org/view.php?id=14629#c117062 
---------------------------------------------------------------------- 
The code is currently written exactly as a regular assignment is in AEL,
which is to wrap it as an express (i.e., the observed $[] behavior).

The idea was to let expressions with math, etc., function directly in the
return line.  But that obviously has other problems I hadn't thought of.

Perhaps the right thing to do here is to NOT wrap it as an expression, but
document that you can't use expressions directly.  You'll have to assign
the expression's result to a variable and then return the variable.

So, assuming you wanted to perform math, this wouldn't work:
return 8-2;  <--- return value would be the literal string, not 6

But this would:
MATHRESULT=8-2;
return ${MATHRESULT};

The other option, though I haven't evaluated how difficult it would be to
code, is to make AEL support a return value in quotes as a string literal. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-22 09:06 Marquis        Note Added: 0117062                          
======================================================================




More information about the asterisk-bugs mailing list