
ได้แล้วครับ บังเอิญเห็นใน Application command ใน CLI
asterisk1*CLI> show application Set
asterisk1*CLI>
-= Info about application 'Set' =-
[Synopsis]
Set channel variable(s) or function value(s)
[Description]
Set(name1=value1|name2=value2|..[|options])
This function can be used to set the value of channel variables or dialplan
functions. It will accept up to 24 name/value pairs. When setting variables,
if the variable name is prefixed with _, the variable will be inherited into
channels created from the current channel. If the variable name is prefixed
with __, the variable will be inherited into channels created from the current
channel and all children channels.
Options:
g - Set variable globally instead of on the channel
(applies only to variables, not functions)ผมใช้ $agi->exec("Set","MyVar=MyVar|g"); ครับ
สาเหตุเพราะใช้คนล่ะ context จึงต้องกำหนดให้เป็นตัวแปรแบบ Global