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 <[email protected]>:
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.

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to