[asterisk-bugs] [Asterisk 0014267]: macro compatibility

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Oct 18 16:49:14 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14267 
====================================================================== 
Reported By:                dimas
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   14267
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 169153 
Request Review:              
====================================================================== 
Date Submitted:             2009-01-18 16:27 CST
Last Modified:              2010-10-18 16:49 CDT
====================================================================== 
Summary:                    macro compatibility
Description: 
In 1.4 AEL used to generate macro- prefix for all macro contexts and
transform &m1() calls to Macro(m1). Now 1.6 Macro is deprcated and AEL
generates Gosub instead and does NOT generate macro- prefix.

The problem is that if your dialplan calls AEL macros from regular
dialplan - it will not work because AEL-generated macros do NOT have macro-
prefix while Macro application will add it. For the same reason features
like

myfeature => #,self,Macro,feature1

will not work anymore if feature1 is defined in the AEL.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0016646 [patch] Its not possible to pass more t...
====================================================================== 

---------------------------------------------------------------------- 
 (0128176) tilghman (administrator) - 2010-10-18 16:49
 https://issues.asterisk.org/view.php?id=14267#c128176 
---------------------------------------------------------------------- 
Yes, you're correct, the Macro application does not actually exit
immediately; instead, it runs a separate PBX loop on the channel.

What it comes down to is that something might have worked prior to 1.6.2
as a happy accident, but it was not an intended feature.  The problem with
Macro is that it takes up a large amount of stack, so subroutines in AEL,
if implemented with Macro, could behave very badly, in that they could only
go a certain depth before they either a) refused to go any deeper, or b)
crashed Asterisk.  Obviously, for a higher-level language like AEL, neither
of those outcomes are workable.

While I understand that you have a desire for a subroutine to run within
the applicationmap, the fact is that you'll have to write the subroutine in
traditional dialplan, instead of using AEL.  This, obviously, still works
fine, and although Macro is deprecated, mainly due to the architectural
problem in the previous paragraph, it is unlikely to ever be removed.  So,
while we won't recommend that people use Macro in this way in the future,
you can be reasonably certain that it will not disappear. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-10-18 16:49 tilghman       Note Added: 0128176                          
======================================================================




More information about the asterisk-bugs mailing list