This is a strange issue. There is no other statement in the file. I am just executing this with all the includes. There are no permission issues on files.
In my php code, whenever I call this constructor, the page goes to sleep and then the script times out.
asm=new AGI ();
After some effort and debugging, I have found that this code in the class phpagi keeps on executing. The loop does not end as it is unable to read the variables, what could be wrong ?
Hi there,
This is a strange issue. There is no other statement in the file. I am just executing this with all the includes. There are no permission issues on files.
In my php code, whenever I call this constructor, the page goes to sleep and then the script times out.
asm=new AGI ();
After some effort and debugging, I have found that this code in the class phpagi keeps on executing. The loop does not end as it is unable to read the variables, what could be wrong ?
// read the request
$str = fgets($this->in);
while($str != "\n")
{
$this->request = trim(substr($str, strpos($str, ':') + 1));
$str = fgets($this->in);
}
Here is my PHP code,
<?php
require("/var/www/html/phpagi/phpagi.php");
require("/var/www/html/phpagi/phpagi-asmanager.php");
ini_set('display_errors', 'On');
error_reporting(E_ALL);
echo " Checking asterisk Connectvity";
echo "<br />";
$asm = new AGI();
?>
Just look at this, why does it not work ……..
#!/usr/bin/php -q
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
require("/var/lib/asterisk/agi-bin/phpagi.php");
echo "<br />";
echo "AGI Instance Creation";
echo "<br />";
$agi = new AGI();
?>
How can you pass the variables to AGI ("","")
I know it takes a filename and an array. I am not sure what variables would it take in array. Can anyone help me with this ?