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

Kevin P. Fleming kpfleming at digium.com
Mon Aug 1 15:40:09 CDT 2011


On 08/01/2011 03:35 PM, Paul Belanger wrote:
> 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.

Well, he's sending DBPut before reading the result of Login as well.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list