[Asterisk-Users] call a peer over the asterisk manager with a php script

Guy Boehm dendengens at yahoo.de
Tue Apr 26 23:58:49 MST 2005


Hello,
 
I want to call a peer over the Asterisk Manager with this php-script:
 
 
<html>
<body>
<PRE>
<?
$socket = fsockopen("192.168.204.44","5038", $errno, $errstr, 
$timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: test\r\n");
fputs($socket, "Secret: test\r\n\r\n");
//fputs($socket, "Action: ListCommands\r\n\r\n");

fputs($socket, "Action: Originate\r\n");
fputs($socket, "Channel: 6159bfb47b9\r\n\r\n");
fputs($socket, "Exten: 1009\r\n\r\n");
fputs($socket, "Context: test\r\n\r\n");
fputs($socket, "Priority: 1\r\n\r\n");


fputs($socket, "Action: Logoff\r\n\r\n");
while (!feof($socket)) {
$wrets .= fread($socket, 8192);
}
fclose($socket);
echo <<<ASTERISKMANAGEREND
ASTERISK MANAGER OUTPUT:
$wrets
ASTERISKMANAGEREND;
?>
</pre>

 
 
 
I got this resulat: 
 

ASTERISK MANAGER OUTPUT:Asterisk Call Manager/1.0Response: SuccessMessage: Authentication acceptedResponse: ErrorMessage: Invalid channelResponse: ErrorMessage: Missing action in requestResponse: ErrorMessage: Missing action in requestResponse: ErrorMessage: Missing action in requestResponse: GoodbyeMessage: Thanks for all the fish.I tried many diffrent SIP/Channels but nothing works

 
THX

		
---------------------------------
Gesendet von Yahoo! Mail - Jetzt mit 250MB kostenlosem Speicher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050427/69466c77/attachment.htm


More information about the asterisk-users mailing list