比正常phpagi运行时间长

比正常phpagi运行时间长,php,mysql,asterisk,voip,elastix,Php,Mysql,Asterisk,Voip,Elastix,我正在使用asterisk中的一些PHPAGI,它们在一些服务器上工作。但当我在我的新服务器上使用它们时,它们像往常一样只工作了3天,现在比预期的要长。这是一个样品。任何建议都将不胜感激 #!/usr/bin/php -q <?php require('phpagi.php'); error_reporting(E_ALL); $agi = new AGI(); $_callerId = $agi->get_variable("CALLERID(num)"); if(strlen($

我正在使用asterisk中的一些PHPAGI,它们在一些服务器上工作。但当我在我的新服务器上使用它们时,它们像往常一样只工作了3天,现在比预期的要长。这是一个样品。
任何建议都将不胜感激

#!/usr/bin/php -q
<?php
require('phpagi.php');
error_reporting(E_ALL);
$agi = new AGI();
$_callerId = $agi->get_variable("CALLERID(num)");
if(strlen($_callerId)>4)
{
  $con=mysqli_connect(SomeServer);
  $result = mysqli_query($con,"Select caller_id,extention from record_call order by id desc limit 50");

  while($row = mysqli_fetch_array($result)) {
  $tempCallerId = $row['caller_id'] ;
  $tempExtention = $row['extention'] ;
  if($tempCallerId==$_callerId)
  {
    $agi->set_variable('exExtention',$tempExtention);
    mysqli_close($con);
    return;
  }
};
$agi->set_variable('exExtention','new');
mysqli_close($con);

?>
#/usr/bin/php-q

我明白了。连接到MySQL需要比平常更多的时间,这是因为elastix中设置了dns。我把它取下来了,现在它可以正常工作了