These variables live in the channel Asterisk creates when you pickup a phone and as such they are both local and temporary. Variables created in one channel can not be accessed by another channel. When you hang up the phone, the channel is deleted and any variables in that channel are deleted as well.
Just like get variable, this works for writing to functions too.
Returns:
200 result=1
Using Asterisk Version 1.12.1 you should use the escape characters to set the variable correct. Something like: “SET VARIABLE TEST \”hello again\” \n”);
Passing variables as a value of another variable
Variables such as channel variables set as a value for another variable should be replaced by the actual value for it will be read as a string.
This example won’t work if issued to Dial command
SET VARIABLE MY_DIALSTRING "ZaP/g1/${EXTEN}"
The ${EXTEN} variable should be replaced by the actual dialed number. eg 12345678
SET VARIABLE MY_DIALSTRING "ZaP/g1/12345678"
in extensions.conf
exten => s,1,Dial(${MY_DIALSTRING})
Go back to Asterisk AGI