[asterisk-dev] Gosub and Macro

Atis Lezdins atis at iq-labs.net
Mon May 26 12:25:38 CDT 2008


Hi,

In my way to trying out 1.6 i noticed that Macro's are replaced with
GoSub, however there is one problem with this:

AEL parser processes all macro definitions and converts them to
contexts, adding Return at end.
So it does with all "&mymacro" calls, replacing them with GoSub's.
This all works fine, until Macro() is called from realtime. It fails,
because there is no context "macro-mymacro".

So, i suggest one following solutions:

* create app_macro_wrapper which provides the same apps as app_macro
but uses GoSub internally. This could be selected in menuselect by
default to force new users use GoSub instead, but anybody could
disable it and use old app_macro as before.
* ael parser could still generate macro-mymacro contexts without
Return, so that macros can be called. However i see that then there
would be troubles with accidentally having them mixed.
* add option for AEL parser to not replace Macro with GoSub - for
transitional period
* issue big warning in UPGRADE.txt mentioning realtime. However this
could create similar complains as it was recently with commas and
pipes.

I see the point behind migration from Macro to GoSub, however this
should be smooth for users :)

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-dev mailing list