[asterisk-users] Database and variables

Administrator TOOTAI admin at tootai.net
Wed Jul 9 03:42:11 CDT 2014


Le 08/07/2014 16:07, Eric Wieling a écrit :
> 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.

I didn't know that, thanks. Will try another way.

Regards

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



More information about the asterisk-users mailing list