[asterisk-dev] Bug or by design: Inheritance of templates and categories in config files.

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Jan 4 13:05:19 CST 2011


On Tue, Jan 04, 2011 at 04:33:53PM +0100, Michel Verbraak wrote:
> During testing of an application I'm developing I found that asterisk  
> does not load template categories in config files as specified in the  
> main/config.c file.
>
> In this file it is specified as following:
>
>          /* Actually parse the entry */
>         if (cur[0] == '[') { /* A category header */
>                 /* format is one of the following:
>                  * [foo]        define a new category named 'foo'
>                  * [foo](!)     define a new template category named 'foo'
>                  * [foo](+)     append to category 'foo', error if foo  
> does not exist.
>                  * [foo](a)     define a new category and inherit from  
> template a.
>                  *              You can put a comma-separated list of  
> templates and '!' and '+'
>                  *              between parentheses, with obvious meaning.
>                  */
>
>
> But if I configure this:
> [testA]
> exten => testA,1,NoOp(testA)
>
> [testB](testA)
> exten => testB,1,NoOp(testB)
>
> The end result is that category "testA" is inherited by category "testB"  
> without being defined as a template category "(!)".

Right. (!)  marks a category that should not be used on its own:

[people](!)
...


[michael](people)
...

[tzafrir](people)
...


This only creates the categories 'michael' and 'tzafrir'. But you might
as well write:

[michael]
...

[tzafrir](michael)
...


-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+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-dev mailing list