<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:13px"><div id="yui_3_16_0_1_1424248714213_91045"><span></span></div><div id="yui_3_16_0_1_1424248714213_91045"><span id="yui_3_16_0_1_1424248714213_91298">How do I get variables from ARI Asterisk?<br></span></div><div id="yui_3_16_0_1_1424248714213_91045"><span><br></span></div><div id="yui_3_16_0_1_1424248714213_91045" dir="ltr">I've done:</div><div id="yui_3_16_0_1_1424248714213_91045" dir="ltr"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91133">$ch = curl_init();</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91134"><span class="" style="">     </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, <span class="" style="" id="yui_3_16_0_1_1424248714213_91509">false</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91135"><span class="" style="">     </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_RETURNTRANSFER, <span class="" style="" id="yui_3_16_0_1_1424248714213_91508">true</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91137"><span class="" style="" id="yui_3_16_0_1_1424248714213_91136"><span class="" style="">    </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_URL,</span>"http://192.168.56.12:8088/ari/channels"<span class="" style="">);</span></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91297"><span class="" style="">       </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_RETURNTRANSFER, <span class="" style="">true</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91309"><span class="" style="">      </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91296"><span class="" style="">   </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_FOLLOWLOCATION, <span class="" style="">true</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91139"><span class="" style="">      </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch, CURLOPT_USERPWD, <span class="" style="" id="yui_3_16_0_1_1424248714213_91415">"asterisk:asterisk"</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91141"><span class="" style="">    </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt( $ch, CURLOPT_HTTPHEADER, <span class="" style="" id="yui_3_16_0_1_1424248714213_91492">array</span>(<span class="" style="" id="yui_3_16_0_1_1424248714213_91140">'Content-Type:application/json'</span>));</div><div class="" style=""><span class="" style="">        </span><span class="" style=""> </span><span class="" style=""> </span></div><div id="yui_3_16_0_1_1424248714213_91045" dir="ltr">



















</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91142"><span class="" style=""> </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch,CURLOPT_POST, <span class="" style="">true</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91142"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91178">$variables = <span class="" style="" id="yui_3_16_0_1_1424248714213_91332">array</span>(<span class="" style="" id="yui_3_16_0_1_1424248714213_91177">"channelId"</span>=>$data-><span class="" style="" id="yui_3_16_0_1_1424248714213_91200">channel</span>-><span class="" style="" id="yui_3_16_0_1_1424248714213_91497">id</span>);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91179"><span class="" style="" id="yui_3_16_0_1_1424248714213_91310"><span class="" style="">        </span><span class="" style=""> </span><span class="" style=""> </span>$queryParameter = </span><span class="" style="">array</span><span class="" style="">(</span>"endpoint" <span class="" style="">=> </span>"SIP/201"<span class="" style="">, </span>"extension" <span class="" style="" id="yui_3_16_0_1_1424248714213_91203">=> </span>"201"<span class="" style="" id="yui_3_16_0_1_1424248714213_91202">, </span>"context" <span class="" style="" id="yui_3_16_0_1_1424248714213_91204">=> </span>"oscar"<span class="" style="" id="yui_3_16_0_1_1424248714213_91201">, </span>"priority" <span class="" style="">=> </span>"1"<span class="" style="">, </span>"app" <span class="" style="">=> </span>"call-center"<span class="" style="">, </span>"variables" <span class="" style="" id="yui_3_16_0_1_1424248714213_91180">=> $variables);</span></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91142">









</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91181"><span class="" style=""> </span><span class="" style=""> </span><span class="" style=""> </span>curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($queryParameter));</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91181"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91181">







</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91257"><span class="" style=""> </span>$result=curl_exec($ch);</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91257"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91257" dir="ltr">(where $data-><span class="" id="yui_3_16_0_1_1424248714213_91200" style="">channel</span>-><span class="" id="yui_3_16_0_1_1424248714213_91497" style="">id is datas from "</span><span style="font-family: 'Courier New'; white-space: pre-wrap;" class="" id="yui_3_16_0_1_1424248714213_91539">generate an outbound call"</span>)</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91236"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr">the calling work fine, but in websocket/app "call-center" I haven't got the args, why?</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr">I receive:</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr"><br></div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">{</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">  "type": "StasisStart",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">  "timestamp": "2015-02-19T19:28:25.069+0100",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">  "args": [],</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">  "channel": {</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "id": "asterisk_oscar-1424370499.121",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "name": "SIP/201-0000003d",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "state": "Up",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "caller": {</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "name": "",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "number": ""</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    },</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "connected": {</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "name": "",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "number": ""</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    },</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "accountcode": "",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "dialplan": {</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "context": "oscar",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "exten": "",</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">      "priority": 1</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    },</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">    "creationtime": "2015-02-19T19:28:19.527+0100"</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">  },</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">  "application": "call-center"</div><div class="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr" style="">}</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91236" dir="ltr"><br></div>







<div class="" style="" id="yui_3_16_0_1_1424248714213_91219" dir="ltr"><br></div><div class="" style="" id="yui_3_16_0_1_1424248714213_91219" dir="ltr">What do I mistake?</div><div class="" style="" id="yui_3_16_0_1_1424248714213_91219" dir="ltr">thanks</div><div></div><div id="yui_3_16_0_1_1424248714213_91143"> </div><div class="signature" id="yui_3_16_0_1_1424248714213_91234"><div id="yui_3_16_0_1_1424248714213_91233"><span style="font-family:arial, helvetica, sans-serif;color:rgb(208, 208, 208);" id="yui_3_16_0_1_1424248714213_91232">_______________________________________________________________________</span><br style="font-family:arial, helvetica, sans-serif;color:rgb(208, 208, 208);"><span style="font-family:arial, helvetica, sans-serif;color:rgb(208, 208, 208);" id="yui_3_16_0_1_1424248714213_91235">Oscar OXY</span><br></div></div></div></body></html>