简体   繁体   English

比平时更长的phpagi运行时间

[英]Longer than usual phpagi running time

I'm using some PHPAGI in asterisk that are working on some servers. 我在星号中使用了一些PHPAGI,它们正在某些服务器上运行。 But when I used them in my new server they worked like usual for only 3 days and now they take longer than expected. 但是当我在我的新服务器中使用它们时,它们像往常一样只工作了3天,现在它们的使用时间比预期的要长。 Here is a sample. 这是一个例子。
Any suggestion is appreciated. 任何建议表示赞赏。

#!/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);

?>

I got it. 我知道了。 Connecting to MySQL took more than usual and it was because of the dns set in elastix. 连接到MySQL的时间比平常多,这是因为elastix中设置了dns。 I removed it and now it's working as expected. 我删除它,现在它按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM