Asterisk Web Call

I have the following PHP code that initiates a web call to an extension. The source extension displayings Calling [number]. However, below it the display on the phone shows Unknown. Any ideas How I can add value to that so that it doesnt display Unknown?

Thanks


	$strHost = "127.0.0.1";
	$strUser = "admin";
	$strSecret = "secret";
	$strChannel = "SIP/".$_REQUEST['from']; 
	$strContext = "from-internal";
	$strWaitTime = "30"; 
	$strPriority = "1"; 
	$strMaxRetry = "1"; 

	$number=$_REQUEST['number'];


	$strCallerId = "Calling $number";

	$oSocket = fsockopen ($strHost, 5038, &$errno, &$errstr, 20);

	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: $strChannel\r\n");
		fputs($oSocket, "WaitTime: $strWaitTime\r\n");
		fputs($oSocket, "CallerId: $strCallerId\r\n");
		fputs($oSocket, "Exten: $number\r\n");
		fputs($oSocket, "Context: $strContext\r\n");
		fputs($oSocket, "Priority: $strPriority\r\n\r\n");
		fputs($oSocket, "Action: Logoff\r\n\r\n");
		sleep(2); 
		fclose($oSocket);
		echo "Extension $strChannel should be calling $number." ;
	}

Probably the normal cure for all things Originate: use a local channel to actually set up the call.

Sorry, not sure I understand what you mean ? :blush:

Make the channel a local channel. Google local channel if you don’t understand. In the local channel set the callerid and then dial the actual target.