[asterisk-users] Database and variables

Administrator TOOTAI admin at tootai.net
Tue Jul 8 09:02:10 CDT 2014


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})

Result:

     -- 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

-- 
Daniel



More information about the asterisk-users mailing list