[asterisk-app-dev] How do I get variables from ARI Asterisk?
Oscar
scriviaoscar at yahoo.it
Thu Feb 19 12:49:04 CST 2015
How do I get variables from ARI Asterisk?
I've done:
$ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL,"http://192.168.56.12:8088/ari/channels"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERPWD, "asterisk:asterisk"); curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); curl_setopt($ch,CURLOPT_POST, true);
$variables = array("channelId"=>$data->channel->id); $queryParameter = array("endpoint" => "SIP/201", "extension" => "201", "context" => "oscar", "priority" => "1", "app" => "call-center", "variables" => $variables); curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($queryParameter));
$result=curl_exec($ch);
(where $data->channel->id is datas from "generate an outbound call")
the calling work fine, but in websocket/app "call-center" I haven't got the args, why?
I receive:
{ "type": "StasisStart", "timestamp": "2015-02-19T19:28:25.069+0100", "args": [], "channel": { "id": "asterisk_oscar-1424370499.121", "name": "SIP/201-0000003d", "state": "Up", "caller": { "name": "", "number": "" }, "connected": { "name": "", "number": "" }, "accountcode": "", "dialplan": { "context": "oscar", "exten": "", "priority": 1 }, "creationtime": "2015-02-19T19:28:19.527+0100" }, "application": "call-center"}
What do I mistake?thanks _______________________________________________________________________
Oscar OXY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20150219/a4125b7c/attachment.html>
More information about the asterisk-app-dev
mailing list