我在星号中使用了一些正在某些服务器上工作的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);
?>
答案 0 :(得分:2)
我明白了。连接到MySQL的时间比平常多,这是因为elastix中设置了dns。我删除了它,现在它按预期工作了。