[英]Where is intercom status of an extension stored in asterisk/freepbx?
I want to add a checkbox in the application/extensions section(in freepbx admin panel) which when checked enables intercom mode and when unchecked disables intercom mode. 我想在应用程序/扩展部分(在freepbx管理面板中)添加一个复选框,当选中它时启用内部通信模式,取消选中时禁用内部通信模式。 I want to do the same thing in another page too.I already did this much but I can't find where intercom mode value( or auto answer value) is stored/ how is it stored.
我也想在另一个页面做同样的事情。我已经做了这么多,但我找不到内部通信模式值(或自动应答值)的存储位置/存储方式。
I think nice page to start with is http://www.freepbx.org/development 我认为开始的好页面是http://www.freepbx.org/development
Also easy way to spot dialplan is do following: 点击拨号方案的简便方法如下:
asterisk -r
core set verbose 10
enable intercom, call
disable intercom, call
Most of values are in db or asterisk database. 大多数值都在db或星号数据库中。
I figured it out finally. 我终于明白了。 It s in the asterisk's SQLite Database.
它位于星号的SQLite数据库中。 The code for storing/reading this is located in /var/www/html/admin/modules/core/functions.inc.php.
存储/读取它的代码位于/var/www/html/admin/modules/core/functions.inc.php中。 This file includes a lot more stuffs and core functions.
该文件包含更多内容和核心功能。
I wrote two functions for setting and getting the intercom status 我写了两个用于设置和获取内部通信状态的函数
<?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";
}
}
}
?>
$status in set function may be 'intercom' or 'disabled' 设置功能中的$ status可以是“内部通信”或“禁用”
$astman is an instance of AGI_AsteriskManager in package phpAGI (located at /var/www/html/admin/libraries/php-asmanager.php). $ astman是phpAGI包中的AGI_AsteriskManager实例(位于/var/www/html/admin/libraries/php-asmanager.php)。 The intercom status for an extension is stored in database "AMPUSER" / extension_number / answermode.
扩展的内部通信状态存储在数据库“AMPUSER”/ extension_number / answermode中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.