[asterisk-dev] AEL macro backward compatibility for 1.6

Dmitry Andrianov dimas at dataart.com
Mon Jan 19 05:03:06 CST 2009

Playing with AEL in 1.6 I discovered incompatibility with configs I used for 1.4. I filled issue for that (http://bugs.digium.com/view.php?id=14267) but it was closed because "bug tracker is not a discussion forum". So I'm mailing the same stuff here as it was suggested.

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 deprecated and AEL generates Gosub instead and does NOT generate macro- prefix. The problem is that if you call AEL macros from regular dialplan - it will not work because AEL-generated macros do NOT have macro- prefix anymore while Macro application will add it. For the same reason features like

        myfeature => #,self,Macro,feature1

will not work either if feature1 is defined in the AEL. Even if you manually add "macro-" prefix to your AEL macro it will not work because Asterisk will complaint there is return without Gosub.

This may break things for lots of people.

My suggestion to fix the issue is:
1. When Macro(xxx) is called, it checks it can find "macro-xxx".
2. If macro-xxx exists, it is called in "traditional macro way"
3. If macro-xxx does not exist, the application checks if just "xxx" exist and if it does - application Gosubs there.


Dmitry Andrianov

PS: if you guys deprecate Macro stuff, it would be good idea to remove all macros from sample dialplans too. Currently - it is full of macros.

More information about the asterisk-dev mailing list