[asterisk-bugs] [Asterisk 0013752]: Dial with M(macro) doesn't work with AEL macros

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Oct 21 09:00:49 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13752 
====================================================================== 
Reported By:                vmikhnevych
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   13752
Category:                   Applications/app_macro
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.6.0 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-21 04:59 CDT
Last Modified:              2008-10-21 09:00 CDT
====================================================================== 
Summary:                    Dial with M(macro) doesn't work with AEL macros
Description: 
Whenever we use smth like this (with or without '&'):
Dial(SIP/number at 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0094029) murf (administrator) - 2008-10-21 09:00
 http://bugs.digium.com/view.php?id=13752#c94029 
---------------------------------------------------------------------- 
Sorry, but in 1.6 and on, we have changed how AEL performs a macro call.
Instead of using the Macro() app, we now compiles 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 http://bugs.digium.com/view.php?id=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. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-21 09:00 murf           Note Added: 0094029                          
======================================================================




More information about the asterisk-bugs mailing list