Summary:ASTERISK-18763: Different behaviour in case of usage of "#include file" instead of direct config pars
Reporter:reinerotto (reinerotto)Labels:
Date Opened:2011-10-28 03:51:20Date Closed:
Versions: 13.18.4 Frequency of
Description:In case of wrong configuration of chan_dahdi using "#include dahdi-channels.conf" the error messages are different to the same misconfiguration, but with explicitly edited commands.
The error messages because of wrong configuration using "#include ..." are not obvious.

;This is an excerpt from misconfigured chan_dahdi.conf:
; they mean or you know you should change them.
; Next line should be after [channels] instead, here it is misplaced.
#include dahdi-channels.conf

This will result in the following error messages from asterisk:

[Oct 28 10:20:24] WARNING[2836] loader.c: Error loading module 'chan_mgcp.so': /usr/lib/asterisk/modules/chan_mgcp.so: undefined symbol: ast_pktccops_gate_alloc
[Oct 28 10:20:24] WARNING[2836] loader.c: Module 'chan_mgcp.so' could not be loaded.
[Oct 28 10:20:24] WARNING[2836] config.c: parse error: No category context for line 11 of /etc/asterisk/dahdi-channels.conf
[Oct 28 10:20:24] WARNING[2836] chan_dahdi.c: Ignoring any changes to 'userbase' (on reload) at line 23.

So, in this case, a WARNING only, which is misleading to the casual user (like me).
Opposed to explicitly edited, misconfigured chan_dahdi:

;#include dahdi-channels.conf
;Instead of using include, all statements here
switchtype = euroisdn
signalling = bri_cpe_ptmp
channel => 1-2
context = default
group = 63


This results in a much more obvious error message:

[Oct 28 10:24:07] WARNING[2884] config.c: parse error: No category context for line 22 of /etc/asterisk/chan_dahdi.conf
[Oct 28 10:24:07] ERROR[2884] chan_dahdi.c: File chan_dahdi.conf cannot be parsed.  Aborting.

The behaviour of using an #include is different to explicitly typed config statements. Worrying ....