[asterisk-bugs] [Asterisk 0015354]: MixMonitor - utils.c: write() returned error: Broken pipe

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jul 20 17:41:16 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15354 
====================================================================== 
Reported By:                astvikas
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   15354
Category:                   Applications/app_mixmonitor
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.0.10 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-06-18 08:06 CDT
Last Modified:              2009-07-20 17:41 CDT
====================================================================== 
Summary:                    MixMonitor - utils.c: write() returned error: Broken
pipe
Description: 
Whenever i use mixmonitor or call AGI in dialplan following error comes on
asterisk CLI and i think because of this my D-Channel goes down and calls
are getting disocnnected.
====================================================================== 

---------------------------------------------------------------------- 
 (0107998) adam_pchl (reporter) - 2009-07-20 17:41
 https://issues.asterisk.org/view.php?id=15354#c107998 
---------------------------------------------------------------------- 
#!/usr/bin/php -q
<?php

$debug="1";

ob_implicit_flush(true);
 set_time_limit(6);
 $in = fopen("php://stdin","r");
 $stdlog = fopen("/var/log/asterisk/agi.log", "w");

function read() {
   global $in, $debug, $stdlog;
   $input = str_replace("\n", "", fgets($in, 4096));
   if ($debug) fputs($stdlog, "read: $input\n");
   return $input;
 }

        $database = "";
        $username = "";
        $password = "";

        mysql_connect("",$username,$password);
        mysql_select_db($database) or die( "Unable to select database");

        //log all this good stuff into mysql

        if($argv[1] == 'start') {

                $sql = 'INSERT INTO `pending_calls` (`status`, `timein`,
`queue`, `code`, `cid`, `details`,`unique_id`) VALUES(';
                $sql .= '"' .$argv[2]. '",';
                $sql .= '"' .$argv[3]. '",';
                $sql .= '"' .$argv[4]. '",';
                $sql .= '"' .$argv[5]. '",';
                $sql .= '"' .$argv[6]. '",';
		$sql .= '"' .$argv[7]. '",';
                $sql .= '"' .$argv[8]. '"';
                $sql .= ')';
	
	echo "VERBOSE \"SQL: ".$sql." \" ";

        mysql_query($sql) or die(mysql_error()); }
	

        if($argv[1] == 'end') {

             $sql = "UPDATE pending_calls SET status = '0' WHERE unique_id
= ".$argv[3]."";

        echo "VERBOSE \"SQL: ".$sql." \" ";

        mysql_query($sql) or die(mysql_error()); }


        if($argv[1] == 'out') {

                $sql = 'INSERT INTO `pending_calls` (`status`, `queue`,
`code`, `cid`, `details`,`unique_id`,`pickuptime`) VALUES(';
                $sql .= '"4",';
                $sql .= '"Outbound",';
                $sql .= '"' .$argv[7]. '",';
                $sql .= '"' .$argv[4]. '",';
                $sql .= '"' .$argv[2]. '",';
                $sql .= '"' .$argv[3]. '",';
                $sql .= '"' .$argv[5]. '"';
                $sql .= ')';

        echo "VERBOSE \"SQL: ".$sql." \" ";

        mysql_query($sql) or die(mysql_error()); }


        mysql_close();


// toggle debugging output (more verbose)  $debug = true;


 function write($line) {
   global $debug, $stdlog;
   if ($debug) fputs($stdlog, "write: $line\n");
   echo $line."\n";
 }


 function errlog($line) {
   global $err;
   echo "VERBOSE \"$line\"\n";
 }


echo "VERBOSE \"Ive logged all this good stuff into mysql\" ";


?> 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-07-20 17:41 adam_pchl      Note Added: 0107998                          
======================================================================




More information about the asterisk-bugs mailing list