[asterisk-bugs] [JIRA] (ASTERISK-23838) Can't read responses from AGI - 'Broken Pipe' errors from utils.c - astcarefulwrite when writing to STDIN

Rusty Newton (JIRA) noreply at issues.asterisk.org
Mon Jun 9 15:44:56 CDT 2014


Rusty Newton created ASTERISK-23838:
---------------------------------------

             Summary: Can't read responses from AGI - 'Broken Pipe' errors from utils.c - astcarefulwrite when writing to STDIN
                 Key: ASTERISK-23838
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23838
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/General, Utilities/General
    Affects Versions: 11.10.0, 12.3.0
            Reporter: Rusty Newton
            Severity: Minor


When looking into an unrelated issue, I saw the following:

{noformat}
<SIP/6001-00000004>AGI Rx << ANSWER
       > 0xb7523800 -- Probation passed - setting RTP source address to 10.24.18.16:4042
<SIP/6001-00000004>AGI Tx >> 200 result=0
[Jun  9 13:05:02] ERROR[13442][C-00000004]: utils.c:1328 ast_carefulwrite: write() returned error: Broken pipe
<SIP/6001-00000004>AGI Rx << RECORD FILE recordfiletest wav 9 60000 0 0 demo-congrats
    -- <SIP/6001-00000004> Playing 'beep.gsm' (language 'en')
<SIP/6001-00000004>AGI Tx >> 200 result=-1 (hangup) endpos=8000
[Jun  9 13:05:04] ERROR[13442][C-00000004]: utils.c:1328 ast_carefulwrite: write() returned error: Broken pipe
    -- <SIP/6001-00000004>AGI Script ASTERISK23772.sh completed, returning 4
  == Spawn extension (from-internal, 101, 1) exited non-zero on 'SIP/6001-00000004'
{noformat}

It appears that the Broken Pipe errors come after Asterisk attempts to write out AGI responses to STDIN.

I'm not great with AGI or bash, but I tried redirecting the output of the read commands to a file to see if I could verify what the script was receiving or not receiving.

{code}
#!/bin/bash

while read VAR && [ -n ${VAR} ] ; do : ; done

echo 'ANSWER'
read RESPONSE >> /tmp/responses.txt

echo 'RECORD FILE recordfiletest wav 9 60000 0 0 demo-congrats'
read RESPONSE >> /tmp/responses.txt

exit 0
{code}

The responses.txt file gets created, but remains blank.

The AGI actions called work fine and the call behaves as expected.

Other issues with Broken Pipe symptoms have been filed, but I don't think they are the same.

ASTERISK-23549
ASTERISK-20087

Asterisk has permissions to read,write and execute the script. SElinux is not involved. I'm not sure why Asterisk can't write to STDIN.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list