2017-01-30 11 views
2

일부 서버에서 작동하는 별표 (*)에 PHPAGI를 사용하고 있습니다. 그러나 새 서버에서 사용했을 때 그들은 보통 3 일 동안처럼 일했으며 이제 예상보다 오래 걸립니다. 다음은 샘플입니다.
제안 사항에 감사드립니다.보통 phpagi 실행 시간보다 길음

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

?> 

답변

2

내가 얻었습니다. MySQL에 연결하는 것은 평소보다 더 많이 걸렸습니다. 그리고 그것은 elastix에 설정된 DNS 때문이었습니다. 제거한 후 예상대로 작동합니다.