[asterisk-users] broken pipe question

Dale Noll dnoll at wi.rr.com
Tue Dec 16 19:09:31 CST 2014

On Tue, Dec 16, 2014 at 1:04 PM, Jerry Geis <geisj at pagestation.com> wrote:
> I am running a heartbeat... Asterisk 11.15.0 - same behaviour is noticed
> on 1.4.43 also
> I issue a call through the API that does the below. just UserEvent and
> Hangup
>    -- Executing [s at heartbeat:1] UserEvent("Local/s at heartbeat-0000000f;2",
> "HeartBeat, Noop") in new stack
>     -- Executing [s at heartbeat:2] Hangup("Local/s at heartbeat-0000000f;2",
> "") in new stack
>   == Spawn extension (heartbeat, s, 2) exited non-zero on
> 'Local/s at heartbeat-0000000f;2'
> [Dec 16 13:57:01] ERROR[1956]: utils.c:1440 ast_careful_fwrite: fwrite()
> returned error: Broken pipe
> I get "many" broken pipes (last line above) in the
> /var/log/asterisk/messages file.
> Is there a way to more correctly close and not get that message?
Assuming you are talking about the Asterisk Management Interface (AMI).

I have seen many broken pipe messages cause by the AMI client closing the
connection before reading the response from the server.  Some of the
Asterisk Munin-Node plugins suffered from this problem.

After you issue your command, you need to read the response.  You should
get a line that says '--END COMMNAD--' or an error response. Since the
dialplan is executing, I doubt you will get an error.

Your client should issue a Logoff action, then read all the responses until
it gets the 'Thanks for all the fish.' response.  Then close the socket.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20141216/0366beaf/attachment.html>

More information about the asterisk-users mailing list