[asterisk-users] Problems with AMI connections (Asterisk 1.8.3.2)

Paul Belanger pabelanger at digium.com
Mon Aug 1 15:35:52 CDT 2011


On 11-08-01 04:24 PM, Daniel - Asterisk wrote:
> <?php
> function ast_claves(){
>
>                  $socket =
> fsockopen('192.168.25.18','5038',$errno,$errstr,10);
>
>
> fwrite($socket,"Action: Login\r\n");
>
>                  fwrite($socket,"UserName: mark\r\n");
>
>                  fwrite($socket,"Secret: mysecret\r\n\r\n");
>
>                  fwrite($socket,"Action: DBPut\r\n");
>
>                  fwrite($socket,"Family: authenticate/jorge\r\n");
>
>                  fwrite($socket,"Key: 123456\r\n");
>
>                  fwrite($socket,"Value: pbx-a\r\n");
>
>                  fwrite($socket,"Action: Logoff\r\n\r\n");
>
>
> fclose($socket);
>
>          }
>
> ast_claves();
>
> ?>
>
You are closing the socket before reading the result of 'Logoff' and 
Asterisk is complaining.

-- 
Paul Belanger
Digium, Inc. | Software Developer
twitter: pabelanger | IRC: pabelanger (Freenode)
Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-users mailing list