[asterisk-dev] Depth of macros limited to 7 in app_macro.c

Kaloyan Kovachev kkovachev at varna.net
Sat Apr 1 08:32:13 MST 2006


On Fri, 31 Mar 2006 08:03:18 -0600, Kevin P. Fleming wrote
> Ramon Peek wrote:
> 
> > Now I know I'm really not doing anything really out of this world, I'm
> > just using a large macro.
> > So a maximum macro-depth of 7 is quite shallow to me, is there any
> > special reason why this depth is set to 7?
> 
> Macro depth of more than 6 is certainly 'out of this world' :-)
> 
> The reason the limit is in place is that going any deeper than that will
> usually cause the call thread to run out of stack space.
> 
> A better solution for you would be to use Gosub/Return, since they don't
> use stack space at all.

Just to note that it is not possible to mix Macro and Gosub/Return, because 
Gosub is jumping out of the macro. Not sure if this is by design or it is a 
bug, but because of this for me it was necessary to store the macro args to 
channel variables or to rewrite Gosub/Returns as Macros, which in turn may 
lead in depth to be more than 6 :(

> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list