[asterisk-users] clarification on gosub, macros and AEL

Brian J. Murrell brian at interlinx.bc.ca
Fri Oct 11 13:12:43 CDT 2019


I'm trying to clarify my understand of gosub, macros and AEL.

My understanding is that macros using the Macro() application, which is
defined in extensions.conf by:

[macro-foo]
...

and called in extensions.conf with

exten => _9NXXNXXXXXX.,n,Macro(fastbusy)

is deprecated in favour of Gosub().  True so far?

But then there are "macro"s defined in extensions.ael:

macro foo() { ... }

and called in extensions.ael with:

&foo(...)

These are not deprecated because they use Gosub() underneath and not
Macro()?  Still good so far?

So if macros in extensions.ael are not deprecated because they just use
Gosub() underneath them, when why, when I try to use Gosub() and
contexts in extensions.ael directly do I get warnings like:

[Oct 11 13:50:55] WARNING[10343]: ael/pval.c:2526 check_pval_item: Warning: file /etc/asterisk/extensions.ael, line 552-552: application call to Gosub affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!

but not with these Gosub() implemented "macros"?

Cheers,
b.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20191011/d9c0db4b/attachment.sig>


More information about the asterisk-users mailing list