Receive channel as response of AMI Originate


Configuration :
Asterisk version :
Dahdi version :

I am using below code to generate Sip channel using AMI :

[code] <?php
$strUser = “test”;
$strSecret = “test”;
$strContext = “default”;

$strWaitTime = "30";
$strPriority = "1";
$strMaxRetry = "2";
$oSocket = fsockopen ("localhost", 5038, $errno, $errstr);
echo "$oSocket</br>";
if (!$oSocket) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: SIP/100\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: 1001\r\n");
fputs($oSocket, "Context: default\r\n");
fputs($oSocket, "Priority: 1\r\n\r\n");
fputs($oSocket, "Async: true\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
while (!feof($oSocket)) {
      $ans = fgets($oSocket, 128);
        echo "<br>$ans</br>";


While fire up above code in browser i receive below response

[quote] Response: Success
Message: Originate successfully queued

Does it possible to receive channel as response for example

[quote]Response: Success
Channel : SIP/100-00000001
Message: Originate successfully queued


Please suggest.

The information will be provided as an asynchronous event.

As i am new to asterisk , can you please explain it. … 48378.html

Thank you david for your quick reply.