[asterisk-dev] Behaviour in trunk's pbx_config.c, app_stack.c and users.conf

Octavio Ruiz tacvbo at tacvbo.net
Fri Aug 31 16:48:08 CDT 2012


> The configuration parameter does open up a way to implement the
> stdexten behavior differently if you still feel the need to do so.

Being the configuration parameter named 'stdexten' sounds reasonable
that, even if Gosub has always used the current context if a context
is not provided, to explicitly call a context named 'stdexten' it in
pbx_config.c?

This is what I mean:

-  snprintf(tmp, sizeof(tmp), "%s,stdexten(${HINT})", cat);
+ snprintf(tmp, sizeof(tmp), "stdexten,%s,1,(${HINT})", cat);

Right now, due the nature of Gosub and more precisely the way is
invoked in pbx_config.c  'stdexten' can be _any_ context with a
priority label (stdexten) meanwhile is included in the context where
it's called and its written in extensions.conf syntax.

I do agree that documentation at asterisk.conf is clear with "How to
invoke the extensions.conf stdexten (...) using a gosub as documented
in extensions.conf.sample"  but, does that implicitly means that
stdexten can only be written in extensions.conf and not in AEL2 nor
LUA? Does it have to invoke Gosub exactly as the examples instead of
the full set of options to Gosub (extension,label(args) vs.
context,extension,priority(args))?

Why not make it in a way that stdexten subroutine can be coded in any
Asterisk supported language using Gosub instead of Macro knowing that
Gosub nest more efficiently? I'm sure that's the reason why the
implementation changed to Gosub.

I can imagine two approaches to this, one is keep it as it does right
now but be even more clear on documentation, not assuming that
dialplan code in extensions.conf express the limitations of the
feature.

The suggestion would be to document the need to include the
stdexten-or-whatever-name context with a stdexten label in order to
make it work and also to declare that when using Macro you are calling
a Macro as an small, limited context named with a macro- prefix and
can be written in AEL, LUA or extensions.conf and when using Gosub you
are actually calling a label within the same context where you are
calling it, not a context even if it name is stdexten and for sanity
it can only be written in extensions.conf being the only language able
to define arbitrary priorities (like the 50000 or 60000 in the
extensions.conf.sample).

The other  approach is the one I've already suggested that is to write
the dialplan when generating extensions from users.conf using the full
set of options to the Gosub application eliminating the need to do the
include described before and adding the possibility to rewrite
stdexten in AEL2 or LUA.

Sorry for being fatuous on this, as you may notice I found it relevant.

Thank you for your answer, Richard.



More information about the asterisk-dev mailing list