我在 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);
?>
最佳答案
我明白了。连接到 MySQL 比平时花费更多,这是因为 elastix 中设置的 dns。我删除了它,现在它按预期工作了。
关于php - 比通常的 phpagi 运行时间更长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41938074/