[RESOLVED] Evalute variable in a string

Hi There,

I am passing some variables from an application making a call through asterisk. I pass a string which holds the names of another two variables. However the variables are not evaluated and instead are read literally. Is there a way to pass variables in a string so they are evaluted by asterisk?

value of variables:
${testvar1} = “variable1”
${testvar2} = “variable2”
${stringmsg} = “${testvar1} ${testvar2}”

exten => _message.,1,Answer()
exten => _message.,n,Wait(0.5)
exten => _message.,n,NoOp(${testvar1} - ${testvar2} - ${stringmsg} )

Result in cli output:
NoOp(“SIP/XXXXXXXXXXX-000350c2”, "variable1 - variable2 - ${testvar2} ${testvar2} ")


Asterisk | Single Server

Sorry i just realised my answer was in the question…

Asterisk has the function EVAL() which evaluates variables within a literal string. This works if I pass the string into this function.