Receive channel as response of AMI Originate


Configuration :
Asterisk version :
Dahdi version :

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

$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

Does it possible to receive channel as response for example

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

Please suggest.

The channel will be reported as an asynchronous event.

This forum is a discussion forum, not a support forum.