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

sean darcy seandarcy2 at gmail.com
Thu Feb 11 17:48:57 CST 2010


Olle E. Johansson wrote:
> 11 feb 2010 kl. 08.49 skrev Ron Arts:
> 
>> Op 11-02-10 03:42, sean darcy schreef:
>>> Kevin P. Fleming wrote:
>>>> sean darcy wrote:
>>>>> I found out that the [globals] section in extensions.conf is ignored if
>>>>> an #include 'd file has a [globals] section. Is this intended?
>>>>>
>>>>> In this particular case, the #include 'd file has a number of contexts
>>>>> for googlevoice.  I'd put various googlevoice variables in there to use
>>>>> in all those contexts. Once I did that all of the global variables set
>>>>> in extensions.conf were ignored.
>>>> Context names cannot be duplicated, unless you suffix them with (+) to
>>>> allow them to be added together. It does not matter whether it is the
>>>> 'global' context or any other context.
>>>>
>>>   Well
>>> Dialplan reloaded.
>>>    == Parsing '/etc/asterisk/extensions.conf':   == Found
>>> ..................
>>>    == Parsing '/etc/asterisk/exts/gvoice.exten.conf':   == Found
>>>
>>> cat exts/gvoice.exten.conf
>>> [+globals]
>>> test-global =>  need-a-plus-sign
>>> .........
>>>
>>> but no test-global in dialplan show globals :(
>>>
>>> sean
>>>
>>>
>> suffix means 'append to the end'...
>> so try [globals+]
> Read the docs, especially before answering and trying to help another user...
> 
> doc/tex/configuration.tex or the pdf in a tar ball:
> 
> 
> 
> The syntax is:
> 
>  [section](options)
>         label = value
> 
> Adding to an existing section:
> 
>  [section]
>         label = value
> 
>         [section](+)
>         label2 = value2
> 
> 
> 
> In this case, the plus sign indicates that the second section (with the
> same name) is an addition to the first section. The second section can
> be in another file (by using the #include statement). If the section
> name referred to before the plus is missing, the configuration will fail
> to load.
> ----
> [globals](+)
> 
> is the syntax you want.
> 
> /O
> 

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

sean




More information about the asterisk-users mailing list