[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 17:06:16 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:                     feedback
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 17: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/
====================================================================== 

---------------------------------------------------------------------- 
 (0117091) crjw (reporter) - 2010-01-22 17:06
 https://issues.asterisk.org/view.php?id=14629#c117091 
---------------------------------------------------------------------- 
I tried using:
Set(foo=${IF($[${GOSUB_RETVAL:0:1}${GOSUB_RETVAL:-1}=""]?${CUT(GOSUB_RETVAL,\",2)}:${GOSUB_RETVAL})})
This works.  But... it is not at all pretty.

The purpose of a macro is presumably to reduce repetitive code and make
the dialplan more legible.
If I were to reference a partiular macro from 100 different extensions
then I would have to insert this kludge code 100 times.
If we need to repeat the same lines of code each time we call a macro,
then we are defeating the purpose of the macro.

I think the macro should be flexible enough to directly return any type of
data without making assumptions about the data.
If somebody wants to do mathematics inside the macro, that is fine; it
could be done with one or two lines inside the macro.
If a macro ends up being twenty lines instead of eighteen does it matter? 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-22 17:06 crjw           Note Added: 0117091                          
======================================================================




More information about the asterisk-bugs mailing list