Initial add of feature mobility user table:

- Add extra user fields and sccp_config entries
 - Create new buttonconfig table
 - Add PhoneCodepages like cp1251
This commit is contained in:
PhantomVl 2019-03-25 16:55:44 +03:00
parent c2b97fe3ee
commit f686274189
5 changed files with 42 additions and 22 deletions

View file

@ -514,12 +514,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
"buttons" => array(
"name" => _("Device Buttons"),
"page" => 'views/form.buttons.php'
),
"sccpcodec" => array(
"name" => _("Device SCCP Codec"),
"page" => 'views/server.codec.php'
),
);
));
if ($this->sccpvalues['sccp_compatible']['data'] < '433') {
$this->pagedata["sccpcodec"] = array(
"name" => _("Device SCCP Codec"),
"page" => 'views/server.codec.php'
);
}
break;
@ -1124,6 +1125,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
};
$value = implode(";", $save_codec);
break;
case 'phonecodepage':
$value = 'null';
if (!empty($get_settings[$hdr_prefix . 'devlang'])) {
$lang_data = $this->extconfigs->getextConfig('sccp_lang',$get_settings[$hdr_prefix . 'devlang']);
if (!empty($lang_data)) {
$value = $lang_data['codepage'];
}
}
break;
case '_hwlang':
if (empty($get_settings[$hdr_prefix . 'netlang']) || empty($get_settings[$hdr_prefix . 'devlang'])) {
$value = 'null';
@ -1197,7 +1207,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
if ($hw_id == 'new') {
$this->srvinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $name_dev));
} else {
$this->srvinterface->sccp_core_commands(array('cmd' => 'reload_phone', 'name' => $name_dev));
$this->srvinterface->sccp_core_commands(array('cmd' => 'restart_phone', 'name' => $name_dev));
}
return $save_settings;
@ -1966,8 +1976,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
case "permit":
$this->sccp_conf_init['general'][$key] = explode(';', $value['data']);
break;
case "devlang":
$lang_data = $this->extconfigs->getextConfig('sccp_lang',$value['data']);
if (!empty($lang_data)) {
$this->sccp_conf_init['general']['phonecodepage'] = $lang_data['codepage'];
}
break;
case "netlang": // Remove Key
case "devlang":
case "tftp_path":
case "sccp_compatible":
break;

View file

@ -1,9 +1,9 @@
<?php
/**
*
* Core Comsnd Interface
*
*
* Core Comsnd Interface
*
* https://www.voip-info.org/asterisk-manager-example-php/
*/
/* !TODO!: Re-Indent this file. -TODO-: What do you mean? coreaccessinterface ?? */
@ -31,7 +31,7 @@ class srvinterface {
/*
* Replace or dublicate to AMI interface
* Replace or dublicate to AMI interface
*/
public function sccp_core_commands($params = array()) {
@ -42,7 +42,8 @@ class srvinterface {
'get_dev_info' => array('cmd' => "sccp show device", 'param' => 'name'),
'get_hints' => array('cmd' => "core show hints", 'param' => ''),
'sccp_reload' => array('cmd' => "sccp reload force", 'param' => ''),
'reset_phone' => array('cmd' => "sccp reset ", 'param' => 'name'), // Жесткая перезагрузка
'reset_phone' => array('cmd' => "sccp reset ", 'param' => 'name'), // Жесткая перезагрузка
'restart_phone' => array('cmd' => "sccp restart ", 'param' => 'name'),
'reload_phone' => array('cmd' => "sccp reload device ", 'param' => 'name'),
'reset_token' => array('cmd' => "sccp tokenack ", 'param' => 'name'),
'get_realtime_status' => array('cmd' => "realtime mysql status", 'param' => ''),
@ -75,7 +76,7 @@ class srvinterface {
if (!empty($params['name'])) {
$astman->Command('sccp device ' . $params['name'] . ' ' . $msg);
} else {
}
break;
default:
@ -133,7 +134,7 @@ class srvinterface {
$hint_all = $this->sccp_list_all_hints();
foreach ($hint_all as $value) {
$res = $this->loc_after('@', $value);
// array_search($res, $hint_key)) != NULL)
// array_search($res, $hint_key)) != NULL)
if (!isset($hint_key[$res])) {
$hint_key[$res] = '@' . $res;
}
@ -185,7 +186,7 @@ class srvinterface {
return $ast_res;
}
// !TODO!: -TODO-: install.php is still using the other version number. This is actually where I use another method ?
// !TODO!: -TODO-: install.php is still using the other version number. This is actually where I use another method ?
public function get_compatible_sccp() {
@ -211,7 +212,7 @@ class srvinterface {
} else {
return 430;
}
*
*
*/
// return $res["vCode"];
}
@ -233,7 +234,7 @@ class srvinterface {
if (!empty($ast_out[1]) && $ast_out[1] == 'develop') {
$result["develop"] = $ast_out[1];
$res = 10;
// !TODO!: This does not work as you might expect
// !TODO!: This does not work as you might expect
if (base_convert($ast_out[3], 16, 10) == base_convert('702487a', 16, 10)) {
$result["vCode"] = 431;
}
@ -383,7 +384,7 @@ class srvinterface {
explode(";|", implode(";|", $line_arr));
list ($descr, $adress, $devname, $status, $token, $junk) = explode(";|", implode(";|", $line_arr));
// list ($descr, $adress, $devname, $status, $junk) = $line_arr;
// list ($descr, $adress, $devname, $status, $junk) = $line_arr;
// if (strlen($ast_key[$devname]) < 1) {
if (strlen($devname) > 1) {
$ast_key[$devname] = Array('name' => $devname, 'status' => $status, 'address' => $adress, 'descr' => $descr, 'token' => $token);
@ -396,7 +397,7 @@ class srvinterface {
} else {
$ast_key[$devname] = Array('name' => $devname, 'status' => $status, 'address' => $adress, 'descr' => $descr, 'token' => $token);
}
*
*
*/
}
}

View file

@ -343,6 +343,9 @@ class xmlinterface {
if (isset($lang_info[$lang])) {
$xml_node->name = $lang_info[$lang]['locale'];
$xml_node->langCode = $lang_info[$lang]['code'];
if ($key == 'userLocale') {
$xml_node->winCharSet = $lang_info[$lang]['codepage'];
}
$this->replaceSimpleXmlNode($xml_work->$key, $xml_node);
}
}

View file

@ -159,7 +159,7 @@ function Get_DB_config($sccp_compatible) {
'hwlang' => array('rename' => "_hwlang"),
'_hwlang' => array('create' => 'varchar(12) NULL DEFAULT NULL'),
'_loginname' => array('create' => 'varchar(20) NULL DEFAULT NULL AFTER `_hwlang`'),
'_profileid' => array('create' => 'varchar(20) NULL DEFAULT NULL AFTER `_loginname`'),
'_profileid' => array('create' => "INT(11) NOT NULL DEFAULT '0' AFTER `_loginname`"),
'useRedialMenu' => array('create' => "VARCHAR(5) NULL DEFAULT 'no' AFTER `_profileid`"),
//'dtmfmode' => array('create' => "VARCHAR(10) default 'outofband'", 'modify' => "VARCHAR(10)", 'def_modify'=> 'outofband'),
@ -241,7 +241,7 @@ function Get_DB_config($sccp_compatible) {
'hwlang' => array('rename' => "_hwlang"),
'_hwlang' => array('create' => 'varchar(12) NULL DEFAULT NULL'),
'_loginname' => array('create' => 'varchar(20) NULL DEFAULT NULL AFTER `_hwlang`'),
'_profileid' => array('create' => 'varchar(20) NULL DEFAULT NULL AFTER `_loginname`'),
'_profileid' => array('create' => "INT(11) NOT NULL DEFAULT '0' AFTER `_loginname`"),
'useRedialMenu' => array('create' => "VARCHAR(5) NULL DEFAULT 'no' AFTER `_profileid`"),
//'dtmfmode' => array('create' => "VARCHAR(10) default 'outofband'", 'modify' => "VARCHAR(10)", 'def_modify'=> 'outofband'),

View file

@ -15,6 +15,7 @@
<changelog>
* Version 13.0.0.1 * - Alfa Release tested on freepbx v.13.0.192.16, v.14.0.1.5
* Version 13.0.0.2 * - Release tested
* Version 14.0.0.1 * - Alfa Release new DB structure Add User mobility
</changelog>
<location></location>
<supported>