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

Russell Bryant russell at digium.com
Tue Jan 4 13:04:51 CST 2011


On Tue, 2011-01-04 at 16:33 +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 "(!)".
> 
> 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.

A patch would be great.  Inheritance of a normal category (not just one
defined as a template only) is allowed by design.



-- 
Russell Bryant
Digium, Inc.  |  Engineering Manager, Open Source Software
445 Jan Davis Drive NW   -    Huntsville, AL 35806  -  USA
jabber: rbryant at digium.com    -=-    skype: russell-bryant
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org





More information about the asterisk-dev mailing list