On 4/27/05, Guy Boehm <[EMAIL PROTECTED]> wrote:
> 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.0
Response:
> Success
Message: Authentication accepted

Response: Error
Message: Invalid
> channel


Response: Error
Message: Missing action in request

Response:
> Error
Message: Missing action in request

Response: Error
Message: Missing
> action in request

Response: Goodbye
Message: Thanks for all the fish.

I
> tried many diffrent SIP/Channels but nothing works
>  
> THX





On top of what Richard mentioned, you have too many \r\n in the
Originate action parameters. Only the final one should have two sets,
the others hould have only one.
--
Dana
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to