[asterisk-users] Database and variables

Eric Wieling EWieling at nyigc.com
Tue Jul 8 09:07:39 CDT 2014

If you are executing "database put Agora modele/IVR/AstreinteNagios/1 ${ASTR_State}" while in the Asterisk CLI, that won't work.   You cannot access DIALPLAN variables from the CLI.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Administrator TOOTAI
Sent: Tuesday, July 08, 2014 11:02 AM
To: Asterisk-Users
Subject: [asterisk-users] Database and variables

Hi list,

question regarding the result of a DB query. I have

database put Agora modele/IVR/AstreinteNagios/1 ${ASTR_State}

i=1 and I read the DB with

exten => IVR,n,Set(__PlayMe=${DB(${ASTRSVC}/IVR/${IVR}/${i})})
exten => IVR,n,NoOp(We read ${PlayMe})


     -- Executing [IVR at Automates:8] Set("SIP/laotseu-00000001", 
"__PlayMe=${ASTR_State}") in new stack
     -- Executing [IVR at Automates:9] NoOp("SIP/laotseu-00000001", "Value 
of PlayMe is ${ASTR_State}") in new stack

This means that ${ASTR_State} is not considered as a variable but as a 
simple alphanumerical chain. What I would like is to display the value 
of ASTR_State wich was setted before the PlayMe affectation in the 
dialplan. I tried the ${${ASTR_State}} command, no more luck.

Is there a way to archieve what I want to do? A regexp ?

In any dialplan, if you make a NoOp( ${blabla} ) and blabla was not 
inizialized, the ${blabla} has an empty value. Why in my case above 
${ASTR_State} is not treated as a variable?

Thanks for any suggestion


-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:

More information about the asterisk-users mailing list