2013-12-18 21 views

回答

1

我終於明白了。它位於星號的SQLite數據庫中。存儲/讀取的代碼位於/var/www/html/admin/modules/core/functions.inc.php。這個文件包含更多的東西和核心功能。

我寫了兩個函數用於設置和獲取通話狀態中設定的功能

<?php 

function setIntercomStatus($extension,$status) 
{ 
    global $db; 
    global $amp_conf; 
    global $astman; 



    if($extension!='') 
    { 

     if($astman) 
     { 

     $result = $astman->database_put("AMPUSER",$extension."/answermode","\"" 
      . (isset($status) ? $status : '') 
      . "\""); 

     } 
     else 
      { 
       die("Error connecting to database"); 
      } 

    } 
} 
function getIntercomStatus($extension) 
{ 
    global $db; 
    global $amp_conf; 
    global $astman; 

    if($extension != '' and $astman) 
    { 


      $answermode=$astman->database_get("AMPUSER",$extension."/answermode"); 

      if($answermode) 
      { 
      return (trim($answermode) == '') ? 'disabled' : $answermode;; 
      } 
      else { 
       return "Extension Not Found"; 
      } 


    } 


} 

?> 

$狀態可能是「對講」或「禁用」

$ astman是包phpAGI的AGI_AsteriskManager實例(位於/var/www/html/admin/libraries/php-asmanager.php)。擴展的內部通信狀態存儲在數據庫「AMPUSER」/ extension_number/answermode中。

1

我覺得不錯的頁面下手是http://www.freepbx.org/development

而且簡單的方法來發現撥號規則是做以下:

asterisk -r 
core set verbose 10 

enable intercom, call 

disable intercom, call 

最值的是db或星號數據庫。