How do I get variables from ARI Asterisk?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev

[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux