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

Michel Verbraak michel at verbraak.org
Tue Jan 4 09:33:53 CST 2011


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 "(!)".

If this is a Bug one line should be changed. For version 1.8.1.1
line 1010                                         base = 
category_get(cfg, cur, 1);
to    base = category_get(cfg, cur, 0)

Or if it is by design the comment on line 950 should be changed to 
"define a new category and inherit from category a" and line 948 can be 
deleted.

Should I report a bug and include the patch file? If so which of the two.

Regards,

Michel.





More information about the asterisk-dev mailing list