[asterisk-users] Replacement of Macro() with Gosub()

Leandro Tenorio leandro at fliadt.com
Wed Apr 29 13:21:40 CDT 2009


    A couple of days ago we decide to test 1.6 branch, we are using 1.4 
in our production environments, and to my surprise, when ported parts of 
our dialplan, I found that any macro declaration in the AEL dialplan, we 
use them a lot for subroutines, was ported as gosub when compiled.
    We are now checking the rest of the changes made in 1.6, but this 
one it quite useful if any of you do AEL.

LTenorio

Tilghman Lesher wrote:
> On Wednesday 29 April 2009 11:45:13 Steve Davies wrote:
>   
>> 2009/4/29 Tilghman Lesher <tilghman at mail.jeffandtilghman.com>:
>>     
>>> Let's also be clear about what Gosub is replacing.  Gosub replaces Macro
>>> for AEL2.  The side effects of this are relatively unfelt, unless you're
>>> doing something unusual like defining subroutines in AEL and calling them
>>> from extensions.conf.  The big gain in this is the ability to have
>>> infinite depths of subroutines, as opposed to a maximum of about 7 in
>>> 1.4's AEL.
>>>
>>> Macro is not going away.  If you want to continue to use Macro, it's
>>> there for you to use, warts and all.  Macro continues to have the depth
>>> limit of 7 levels deep, and that won't change.  It's a fundamental limit
>>> of the application, which is one of the reasons why its functionality has
>>> been replaced in AEL with Gosub.  Also, I think Gosub is a bit easier to
>>> learn, and its behavior is more straightforward.  There aren't corner
>>> cases and special behaviors that you have to learn about Gosub; it just
>>> works like a subroutine.
>>>       
>> Many thanks for the clarification - I do use both Macro() and Gosub()
>> at present, and understand the difference ( I try to tell myself I do
>> ;-) ). I do not use AEL dialplans.
>>
>> I had misunderstood the description on the changelog, and I had not
>> noticed that it was an AEL change, rather than a generic dialplan
>> change. There is clearly more of a difference between extensions.ael
>> usage and extensions.conf usage than I realised. I can see now that
>> AEL2 parses Macro (&) as a builtin, whereas extensions.conf will treat
>> it as an application, and they have little in common.
>>     
>
> Well, Macro is officially deprecated, but not in the "it's going away" sense
> of deprecated, merely in the way that we encourage new users to use
> Gosub, when they implement dialplan subroutines.
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090429/91f72692/attachment.htm 


More information about the asterisk-users mailing list