[Home]

Summary:ASTERISK-12942: Dial with M(macro) doesn't work with AEL macros
Reporter:Vadim Mikhnevych (vmikhnevych)Labels:
Date Opened:2008-10-21 04:59:25Date Closed:2011-06-07 14:08:18
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_macro
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Whenever we use smth like this (with or without '&'):
Dial(SIP/number@context||M(&setMOH|MUSICONHOLD_1))

With an AEL macro like this:
macro setMOH(mohClass) {
Set(CHANNEL(musicclass)=${mohClass});
return;
};

We get:
WARNING[30765]: app_macro.c:201 _macro_exec: No such context macro-&setMOH' for macro '&setMOH'
And the macro is not executed.

Dialplan macro, defined in extensions.conf, works ok.
Comments:By: Steve Murphy (murf) 2008-10-21 09:00:49

Sorry, but in 1.6 and on, we have changed how AEL performs a macro call.
Instead of using the Macro() app, we now compile in the Gosub() app.

You have 2 options:

1. You'll have to change the Dial() calls in your dialplan to use the  U(x[^arg]) option instead of the  M(x[^arg]) option.

2. Or, move your Macro definition back into extensions.conf.

I advise the #1 choice; Change the M in your Dial() options to U. Using the Macro() app in your dialplan is not optimal. Gosub is a better mechanism. Less
memory, faster execution, fewer problems. Change that AEL macro to have a return in it in all the appropriate places. AEL will add one automatically where it thinks they should be, but it's best to be clear.



By: Steve Murphy (murf) 2008-10-21 09:05:39

I'm going to close this bug report; if changing the M option to U
doesn't work, then re-open this issue. Asterisk-users mailing list
is an excellent resource for dialplan and upgrade questions, btw.