[asterisk-users] extensions.conf #include behaviour

Tzafrir Cohen tzafrir.cohen at xorcom.com
Thu Apr 19 04:20:02 MST 2007


On Thu, Apr 19, 2007 at 11:56:18AM +0100, Chris Bagnall wrote:
> Greetings list,
> 
> A quick question regarding extensions.conf #include behaviour if I may. I'm sure someone will know the answer off the top of their head...
> 
> How does asterisk handle "overloading" of contexts. For example, say an extension exists in extensions.conf as follows:
> 
> [incoming]
> <some stuff>
> 
> Then one includes a, b and c.conf, each of which also contains:
> 
> [incoming]
> <more stuff - but none identical to the other incoming sections>
> 
> Would the last #include overwrite the whole [incoming] context, or would it simply append the new directives to it?

Generally you should not have the same section name twice in an asterisk
configuration file. This creates an undefined behaviour. See
http://svn.digium.com/svn/asterisk/branches/1.4/doc/configuration.txt

Technically both will be in memory, and only the first one will be used,
IIRC.

You can use the (+) syntax to add to a context:

[incomming]
some stuff
#include other.conf


in other.conf:

[incoming](+)
more stuff

Not to mention:

[context-base](!)
some-stuff

[context1](context-base)
other-stuff


[context2](context-base)
diffrent-stuff

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-users mailing list