Asterisk MANAGER Broken pipe ERROR! please help


#1

Hello mates,

ERROR:

== Manager ****** logged on from 127.0.0.1
[Oct 13 13:24:21] ERROR[26837]: utils.c:1178 ast_careful_fwrite: fwrite() returned error: Broken pipe
[Oct 13 13:24:21] ERROR[26837]: utils.c:1178 ast_careful_fwrite: fwrite() returned error: Broken pipe
[Oct 13 13:24:21] ERROR[26837]: utils.c:1178 ast_careful_fwrite: fwrite() returned error: Broken pipe
== Manager ****** logged off from 127.0.0.1

ASTERISK VERSION:

i get this error in both the 1.8 rc3 and the 1.6.1.6 versions.

MANAGER.CONF:

[general]
enabled = yes
webenabled = yes
port = 5038
bindaddr = 0.0.0.0
httptimeout = 60

[******]
secret=*********
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
displayconnects = yes
read = all
write = all

PHP SCRIPT:

<?php $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, 30); fwrite($socket, "Action: Login\r\n"); fwrite($socket, "UserName: ******\r\n"); fwrite($socket, "Secret: *****\r\n\r\n"); fwrite($socket, "Action: Command\r\n"); fwrite($socket, "Command: sip show peers\r\n\r\n"); fclose($socket); please advise on what to do to get rid of that error. Thanks

#2

I’m getting the same ERROR message on 1.8.5.0 while running Perl Agi script:

-- Launched AGI Script /var/lib/asterisk/agi-bin/getMSWithCalls.agi <SIP/DLGW03-0000003a>AGI Tx >> agi_request: getMSWithCalls.agi <SIP/DLGW03-0000003a>AGI Tx >> agi_channel: SIP/DLGW03-0000003a <SIP/DLGW03-0000003a>AGI Tx >> agi_language: sr <SIP/DLGW03-0000003a>AGI Tx >> agi_type: SIP <SIP/DLGW03-0000003a>AGI Tx >> agi_uniqueid: MS01-1315988014.100 <SIP/DLGW03-0000003a>AGI Tx >> agi_version: 1.8.5.0 <SIP/DLGW03-0000003a>AGI Tx >> agi_callerid: 112073000 <SIP/DLGW03-0000003a>AGI Tx >> agi_calleridname: unknown <SIP/DLGW03-0000003a>AGI Tx >> agi_callingpres: 0 <SIP/DLGW03-0000003a>AGI Tx >> agi_callingani2: 0 <SIP/DLGW03-0000003a>AGI Tx >> agi_callington: 0 <SIP/DLGW03-0000003a>AGI Tx >> agi_callingtns: 0 <SIP/DLGW03-0000003a>AGI Tx >> agi_dnid: 3704 <SIP/DLGW03-0000003a>AGI Tx >> agi_rdnis: unknown <SIP/DLGW03-0000003a>AGI Tx >> agi_context: macro-IVRMachineID-3 <SIP/DLGW03-0000003a>AGI Tx >> agi_extension: s <SIP/DLGW03-0000003a>AGI Tx >> agi_priority: 8 <SIP/DLGW03-0000003a>AGI Tx >> agi_enhanced: 0.0 <SIP/DLGW03-0000003a>AGI Tx >> agi_accountcode: <SIP/DLGW03-0000003a>AGI Tx >> agi_threadid: -1221280880 <SIP/DLGW03-0000003a>AGI Tx >> agi_arg_1: Q44103 <SIP/DLGW03-0000003a>AGI Tx >> <SIP/DLGW03-0000003a>AGI Rx << SET VARIABLE ServerIP "" <SIP/DLGW03-0000003a>AGI Tx >> 200 result=1 <SIP/DLGW03-0000003a>AGI Rx << SET VARIABLE Server "" <SIP/DLGW03-0000003a>AGI Tx >> 200 result=1 <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Looping, key is: MS03 " -- AGI Script Executing Application: (NOOP) Options: (Looping, key is: MS03 ) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 [b] == Manager 'astReader' logged on from 192.168.32.204[/b] <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Before connection " -- AGI Script Executing Application: (NOOP) Options: (Before connection ) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Reference taken...disconnect result is: 1" -- AGI Script Executing Application: (NOOP) Options: (Reference taken...disconnect result is: 1) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Looping, key is: MS02 " -- AGI Script Executing Application: (NOOP) Options: (Looping, key is: MS02 ) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Before connection " -- AGI Script Executing Application: (NOOP) Options: (Before connection ) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Reference taken...disconnect result is: 1" -- AGI Script Executing Application: (NOOP) Options: (Reference taken...disconnect result is: 1) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Looping, key is: MS01 " -- AGI Script Executing Application: (NOOP) Options: (Looping, key is: MS01 ) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 [b][Sep 14 10:13:37] ERROR[9575]: utils.c:1211 ast_careful_fwrite: fwrite() returned error: Broken pipe[/b] <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Before connection " -- AGI Script Executing Application: (NOOP) Options: (Before connection ) <SIP/DLGW03-0000003a>AGI Tx >> 200 result=0 [b][Sep 14 10:13:37] ERROR[9575]: utils.c:1211 ast_careful_fwrite: fwrite() returned error: Broken pipe[/b] [b] == Manager 'astReader' logged off from 192.168.32.204[/b] <SIP/DLGW03-0000003a>AGI Rx << EXEC NOOP "Reference taken...disconnect result is: 1" -- AGI Script Executing Application: (NOOP) Options: (Reference taken...disconnect result is: 1)

I tried to NoOp messages before and after calling Asterisk::AMI::Common queue_status() method to see when problem exists, and i see that Manager loggoff is delayed for some reason, after script starts connecting to next server.
Script is getting needed variables, everything is working fine, but log is getting filled with Error messages.

Does anyone know how to solve or at least mask this problem (I tried use warnings; no warnings qw(Asterisk::AMI), but than script is not working :/).

M


#3

For the AGI: wait for the response to the NOOP command before closing the AGI application.

For the AMI: logout and wait for the acknowledgement of the logout, before closing the connection.


#4

Thanks David for response.

Can you tell me how can i check response that manager logged off, I’m not sure how to catch that response. :confused:


#5

This is the code that generated the resonse to the Logoff:

static int action_logoff(struct mansession *s, const struct message *m) { astman_send_response(s, m, "Goodbye", "Thanks for all the fish."); return -1; }


#6

Thanks a lot, that resolved my problem, no more broken pipe :smile:

== Manager 'astReader' logged on from 192.168.32.204 == Manager 'astReader' logged off from 192.168.32.204 -- AGI Script Executing Application: (NOOP) Options: (response: Goodbye, message: Thanks for all the fish.)


#7

Hi gays, please help I have the same error, but I don’t know how to fix it.


#8

If you have the same error, the fix has already been posted above.