[asterisk-users] accessing dialplan global variables in agi
Steve Edwards
asterisk.org at sedwards.com
Sun Jul 30 07:51:44 MST 2006
Works fine for me with 1.2.10...
In fact, I've just started using environment variables set when Asterisk
is started, setting global variables and using them in my AGI's (written
in c).
Here's a snippet from my /etc/init.d/asterisk:
source /etc/asterisk/environment.sh
nice --adjustment=-20\
env --ignore-environment\
DATABASE-DATABASE=$DATABASE_DATABASE\
DATABASE-PASSWORD=$DATABASE_PASSWORD\
DATABASE-SERVER=$DATABASE_SERVER\
DATABASE-USER=$DATABASE_USER\
PATH=/usr/local/bin/:/bin/\
$ASTERISK $START_OPTIONS
And from my extensions.conf:
[globals]
DATABASE-DATABASE = ${ENV(DATABASE-DATABASE)}
DATABASE-PASSWORD = ${ENV(DATABASE-PASSWORD)}
DATABASE-SERVER = ${ENV(DATABASE-SERVER)}
DATABASE-USER = ${ENV(DATABASE-USER)}
And I have no problems reading the variables in my AGI's -- I'd know real
quick since they couldn't access the database without them :)
On Fri, 28 Jul 2006, Simon Austin wrote:
> I have confirmed that GET VARIABLE doesn't return global variables in
> version 1.2.10 and submitted the following bug report:
> http://bugs.digium.com/view.php?id=7609
>
> Cheers,
>
> On 7/27/06, Russell Bryant <russell at digium.com> wrote:
>>
>> On Thu, 2006-07-27 at 19:02 -0400, Simon Austin wrote:
>> > Is it possible to access dialplan global variables from the AGI?
>>
>> It certainly should be.
>>
>> > voip-info.org indicates that the GET VARIABLE
>> > (http://www.voip-info.org/wiki/view/get+variable) command can't get
>> them.
>>
>> If you try it out and this does not work, I would consider that a bug.
>> Feel free to report it on bugs.digium.com if that is the case.
>>
>> --
>> Russell Bryant
>> Software Developer
>> Digium, Inc.
>>
>> _______________________________________________
>> --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
>>
>
Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
More information about the asterisk-users
mailing list