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

Daniel - Asterisk earohuanca at gmail.com
Mon Aug 1 15:24:30 CDT 2011


Hi guys, I hope you could help me.

I am trying to get connected through AMI but something is not working. Both
php code and manager.conf were working well in asterisk 1.4

 1. Sometimes it gets connected and sometimes it doesn't:

 == Connect attempt from '192.168.25.241' unable to authenticate
 == Connect attempt from '192.168.25.241' unable to authenticate
 == Manager 'mark' logged on from 192.168.25.241


2. When connected there's a message that appears just before the connection
crashes:

== Manager 'mark' logged on from 192.168.25.241
[Jul 26 16:29:14] ERROR[1579]: utils.c:1178 ast_careful_fwrite: fwrite()
returned error: Broken pipe
[Jul 26 16:29:14] ERROR[1579]: utils.c:1178 ast_careful_fwrite: fwrite()
returned error: Broken pipe
 == Manager 'mark' logged off from 192.168.25.241


*This is my manager.conf:*

[general]

enabled = yes

port = 5038

bindaddr = 0.0.0.0

webenabled = no


[mark]

secret = mysecret
permit=0.0.0.0/255.255.255.0

read = system,call,log,verbose,command,agent,user,originate

write = system,call,log,verbose,command,agent,user,originate


*This is my code in PHP*:

<?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();

?>


*These are the software I am running:*


Sistema operativo
à                Debian 6.0  squeeze       2.6.32-5-686

Version de asterisk
à               Asterisk 1.8.3.2

Version de Php
à                    php 5.3.3-7+squeeze1



Thanks ins advance.


Elder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110801/e0f7a621/attachment.htm>


More information about the asterisk-users mailing list