[asterisk-users] carefulwrite: write() returned error: Brokenpipe

Danny Nicholas danny at debsinc.com
Thu Oct 22 11:09:00 CDT 2009


I have some simple PERL scripts that worked fine with 1.4 SVN, but returned
this error when I went to 1.4.26.2.  It seemed easier to change the ERROR to
a NOTIFY than try to "Fix my bad code".

Here is the "failing" code
#!/usr/local/bin/perl
use strict;
use warnings;

sub setvar {
   my ($var, $val) = @_;
   print STDOUT "SET VARIABLE $var \"$val\" \r\n";
   my $rv=<STDIN>;
   return;
   }

# turn off I/O buffering
$| = 1;

# get trunk information
$SIG{'PIPE'} = 'IGNORE';
my $images='TRUE';
my $checks='TRUE';
&setvar("TEST_RETURN", "OK");
&setvar("CHECKS", $checks);
&setvar("IMAGES", $images);
exit;

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tilghman
Lesher
Sent: Thursday, October 22, 2009 9:58 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] carefulwrite: write() returned error:
Brokenpipe

On Thursday 22 October 2009 09:30:58 Josip Djuricic wrote:
> I am getting this in CLI on release candidate version of Asterisk. Any
> ideas, or points where to look?
>
>     -- Launched AGI Script /var/lib/asterisk/agi-bin/rad-auth.agi
> [Oct 22 18:21:45] ERROR[9853]: utils.c:1126 ast_carefulwrite: write()
> returned error: Broken pipe
>     -- <SIP/916-fc001968>AGI Script rad-auth.agi completed, returning 0

Generally, that means that your AGI exited early, before the AGI controller
had a chance to output responses.  You could ignore the error, or you could
fix your AGI script to ensure that it receives full responses before
exiting.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list