diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 740a074..c097bbe 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -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; diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index a5ff79a..eaf5664 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -1,9 +1,9 @@ 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); } - * + * */ } } diff --git a/Sccp_manager.inc/xmlinterface.class.php b/Sccp_manager.inc/xmlinterface.class.php index 2adf974..66bfb8c 100644 --- a/Sccp_manager.inc/xmlinterface.class.php +++ b/Sccp_manager.inc/xmlinterface.class.php @@ -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); } } diff --git a/install.php b/install.php index aad3ef4..2d71dc9 100644 --- a/install.php +++ b/install.php @@ -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'), diff --git a/module.xml b/module.xml index 6c324cb..2aa6fd8 100644 --- a/module.xml +++ b/module.xml @@ -15,6 +15,7 @@ * 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