[Home]

Summary:ASTERISK-18216: Global variables not set after restart. Must reload everytime.
Reporter:Alisio Cordeiro (alisio)Labels:
Date Opened:2011-08-01 11:43:32Date Closed:2011-09-08 11:52:41
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_dial
Versions:1.8.3 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 5.5 asterisk 1.8.3 Dahdi 2.4.1 Libpri 1.4.11.5Attachments:( 0) dialplan.txt
( 1) globals_after_reload.txt
( 2) globals_before_reload.txt
( 3) globals.conf
( 4) module_show_after.txt
( 5) module_show_before.txt
Description:Some global variables are empty to the dialplan unless I issue a reload command after a restart.

Example:

OPERADORA-1 = DAHDI/g1

Command: Dial(${OPERADORA-1}/040040001)

"Dial("SIP/4643-00000000", "/040040001,300,M(setmusic^MUSICA-EM-ESPERA)") in new stack"

And after a 'reload' everything is fine:
"Dial("SIP/4643-00000000", "DAHDI/g1/040040001,300,M(setmusic^MUSICA-EM-ESPERA)") in new stack"
Comments:By: Leif Madsen (lmadsen) 2011-08-30 15:00:57.416-0500

I'm not able to reproduce this. Can you provide a dialplan that shows this not working? Also please provide the output of 'module show' before and after the 'reload'.

I'd also like to see the output of "dialplan show globals" before and after the reload.

I use globals all the time, and I've never run into this issue on any version of Asterisk.

By: Alisio Cordeiro (alisio) 2011-08-31 12:09:33.259-0500

* globals_before_reload.txt

"dialplan show globals" soon after a restart and before reloading the dialplan

* globals_after_reload.txt

"dialplan show globals" soon after a restart followed by a 'dialplan reload'



* module_show_before.txt

"module show" soon after a restart and before reloading the dialplan


* module_show_after.txt

"module show" soon after a restart and after reloading the dialplan.


* globals.conf

Global variables conf file.


* dialplan.txt

The 'macro-dialout-trunk' used in my freepbx 2.5

By: Alisio Cordeiro (alisio) 2011-08-31 12:11:50.105-0500

Here's the diff between the two files before and after a 'dialplan reload'.

[machine ~]#diff globals_before_reload.txt globals_after_reload.txt

86c86
<    OUT_37=AMP:/$OUTNUM$
---
>    OUT_37=AMP:DAHDI/g2/$OUTNUM$
90c90
<    OUT_36=AMP:/$OUTNUM$
---
>    OUT_36=AMP:DAHDI/g1/$OUTNUM$
199c199
<    OUT_4=AMP:/$OUTNUM$
---
>    OUT_4=AMP:DAHDI/g3/$OUTNUM$
206c206
<    OUT_3=AMP:/$OUTNUM$
---
>    OUT_3=AMP:DAHDI/g2/$OUTNUM$
328c328
<    OUT_2=AMP:/$OUTNUM$
---
>    OUT_2=AMP:DAHDI/g1/$OUTNUM$


By: Leif Madsen (lmadsen) 2011-09-08 11:47:55.707-0500

You're not showing me how you're loading the files from the, I presume, included file.

By: Leif Madsen (lmadsen) 2011-09-08 11:52:41.716-0500

Oh I know why now, so I'm closing this.

The reason is because the func_global.so is loading after pbx_config.so.

In order to make sure the GLOBAL() dialplan function is available when the dialplan loads (which is loaded into memory by pbx_config.so) you need to configure modules.conf to preload => func_global.so

Alternatively you could use the cli.conf file to cause the 'dialplan reload' command to be executed after start up.