[asterisk-users] Simple config question

Russell Bryant russell at digium.com
Fri Aug 4 18:21:34 MST 2006


On Fri, 2006-08-04 at 16:17 -0600, John Williams wrote:
> Is there anyway to access the settings in asterisk.conf from the dialplan?
> 
> Something like a global ${ASTVARLIBDIR} or something like that?

No, there is not a direct way to do that right now.  However, if you're
familiar with a scripting language, you could write a simple AGI script
to do it.

On my system, asterisk.conf contains the following line:

astvarlibdir => /var/lib/asterisk


Here is a simple AGI script that will set this variable.  Place it
in /var/lib/asterisk/agi-bin/

#!/bin/bash

echo -n "SET VARIABLE ASTVARLIBDIR "
echo "`grep astvarlibdir /etc/asterisk/asterisk.conf | cut -f3 -d' '`"


In extensions.conf:

exten => blah,1,AGI(getvarlibdir)
exten => blah,n,NoOp(ASTVARLIBDIR is ${ASTVARLIBDIR})

-- 
Russell Bryant
Software Developer
Digium, Inc.




More information about the asterisk-users mailing list