marcelog / PAMI

PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc

Home Page:http://marcelog.github.com/PAMI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getVariable with Pami

solehi opened this issue · comments

how can i getVariable from dialplan with PAMI?
$originateMsg = new OriginateAction('SIP/1001');
$originateMsg->setContext('queue');
$originateMsg->setPriority('1');
$originateMsg->setExtension(5555);
$originateMsg->setCallerId(5555);
$originateMsg->setAsync(true);
$originateMsg->setActionID(1);
$originateMsg->setVariable('id',987654321);
$orgresp = $client->send($originateMsg);
I can setVariable, but i need to getVariable. For example i want to get variable "a" or "b" from this dialplan
[my_context]
exten => _XXXX,1,NoOp(${id})
exten => _XXXX,n,Set(a=2)
exten => _XXXX,n,Playback(dollar)
exten => _XXXX,n,Read(b,1,,,10)
exten => _XXXX,n,AGI(queue.php,${id},${b})
exten => _XXXX,s,Hungup()