[asterisk-users] 1.6.2 : global vars not read/set after #include w/ globals

sean darcy seandarcy2 at gmail.com
Thu Feb 11 19:56:23 CST 2010


Kevin P. Fleming wrote:
> sean darcy wrote:
> 
>> OK, now clear on suffix v. prefix ( Doh! ) and having RTFM,
>>
>> I have extensions.conf:
>>
>> [general]
>> ................
>> #include  exts/gvoice.exten.conf
>>
>>
>> static=yes
>> writeprotect=no
>> autofallthrough=yes
>>
>> [globals]
>> pstnline => DAHDI/4
>> ...........
>>
>> and exts/gvoice.exten.conf:
>>
>> [globals](+)
>> test-global => need-a-plus-sign
>> .........
>>
>> But now:
>>
>> dialplan reload
>> Dialplan reloaded.
>>    == Parsing '/etc/asterisk/extensions.conf':   == Found
>> ....................
>>    == Parsing '/etc/asterisk/exts/gvoice.exten.conf':   == Found
>> [Feb 11 18:39:52] WARNING[7443]: config.c:993 process_text_line: 
>> Category addition requested, but category 'globals' does not exist, line 
>> 1 of /etc/asterisk/exts/gvoice.exten.conf
> 
> The #include is being processed before the [globals] is seen in
> extensions.conf, so the [globals](+) in gvoice.exten.conf is the first
> time the parser sees 'globals'. The simple fix for this is to put an
> empty [globals] at the very top of extensions.conf, then in any included
> files (and later in extensions.conf), use the (+) syntax.
> 

At the "very top" is key. If the empty  [globals] follows [general] it 
won't work. You need to put [globals] as the first line. In fact that's 
all you need to do. You don't need [globals](+) in extensions.conf. Just 
move [globals] before [general}. Then all the #include 'd files that 
have [globals](+) will add their global vars to the dialplan.

Thanks for all the help.

sean




More information about the asterisk-users mailing list