This error occurs when Asterisk tries to write some line to your AGI / FastAGI after the script is finished.
Stars usually send headers and then wait for commands. After each command, an asterisk send a response. But there is one exception, and he writes on a larger line
HANGUP
I think the string asterisk cannot write in your case. You can verify this by enabling agi debugging. Write in the console:
agi set debug on
and then the aster running your script, you should see something like this:
-- <SIP/XXXX-0000007c>AGI Script YOUR_AGI_NAME completed, returning 4 <SIP/XXXX-0000007c>AGI Tx >> HANGUP ERROR[1502]: utils.c:1232 ast_carefulwrite: write() returned error: Broken pipe
You can see that the asterisk is trying to send HANGUP after the script completes. You have nothing to worry about, but this is a library bug.
source share