Stefan-Michael Guenther
2010-Jan-11 07:16 UTC
[asterisk-users] PHP-Script (AGI) doesn't finish after upgrading to 1.6.0.15
Hi, I recently upgraded our asterisk server from some 1.4 version to version 1.6.0.15. From this point on my AGI scripts aren't working anymore, here is a simple example: [isdin] exten => 83086921,1,AGI(test.php) exten => 83086921,2,NOOP("MARKE1") exten => 83086921,3,WAIT(2) exten => 83086921,4,Hangup() /var/lib/asterisk/agi-bin/test.php ----------------------------------- #! /usr/bin/php -q <?php ob_implicit_flush(true); set_time_limit(6); error_reporting(0); $stdin=fopen("php://stdin","r"); while(!feof($stdin)){ $temp = fgets($stdin); if (preg_match("/agi_/",$temp)){ $temp = str_replace("\n","",$temp); $s = explode(":",$temp); if ($s[0]=="agi_callerid"){ $caller=trim($s[1]); } if ($s[0]=="agi_uniqueid"){ $uniqueid=trim($s[1]); } } } fclose($stdin); system("echo END > /tmp/agi.debug"); ?> The script never reaches the system command at the end of the script. It seems as if STDIN always sends data. Has there been a change in how AGI scripts are called? I haven't found a note in the CHANGES file. PHP is version 5.2.6 Thanks for any suggestions/hints, Stefan -- ******************************************** in-put GbR - Das Linux-Systemhaus Stefan-Michael Guenther Geschaeftsfuehrer Moltkestrasse 49 D-76133 Karlsruhe Tel./Fax : +49 (0)721 / 83044 - 98/93 http://www.in-put.de ******************************************** Schulungen Installationen Beratung Support Voice-over-IP-Loesungen ********************************************