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? Is it possible to change the behaviour at all? Thanks in advance. Regards, Chris -- C.M. Bagnall, Director, Minotaur I.T. Limited For full contact details visit http://www.minotaur.it/chris.html This email is made from 100% recycled electrons
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@jabber.org +972-50-7952406 mailto:tzafrir.cohen@xorcom.com http://www.xorcom.com iax:guest@local.xorcom.com/tzafrir
Tony Mountifield
2007-Apr-19 06:37 UTC
[asterisk-users] Re: extensions.conf #include behaviour
In article <021801c78271$5db02a10$19107e30$@cc>, Chris Bagnall <lists@minotaur.cc> wrote:> > 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?If Asterisk accepts it without error, then you can see how it has interpreted it by using the CLI command "show dialplan". Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org