From: Gordon Henderson <[EMAIL PROTECTED]>

I define

[globals]
myvar = ${DB(store/myvar)}

---
But when I want to use ${myvar} in the dial plan, I found that the variable is null when Asterisk is restarted. Only a reload would force globals to read AstDB. Other variables in globals loads fine.

Any idea? (Asterisk 1.2.13)

The DB module isn't loaded at asterisk boot time when the extensions.conf is parsed... I have the same problem, tried to fix

That's right.

Feb 6 20:33:56 ERROR[6290]: pbx.c:1382 ast_func_read: Function DB not registered
 == Setting global variable 'myvar' to '0'

So I added this to modules.conf:

preload => pbx_functions.so

Asterisk starts with myvar loaded from AstDB.

Yuan Liu

it by forceloading the database modules, but either I didn't dully understand what it was doing, or it just didn't work, so my /etc/init.d script now has a wait for a couple of seconds after asterisk -p, then a asterisk -rx 'extensions reload' ...

Not perfect and probably an abuse of the dialplan, but ...

Gordon


_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to