From 2d57895fc156c8de75f34064c2cd3413e389db4a Mon Sep 17 00:00:00 2001 From: PhantomVl Date: Thu, 16 Apr 2020 20:35:50 +0300 Subject: [PATCH] -- Added new features for the future (now disabled) -- Changed time zone settings -- Changed the list of supported codecs -- Added the ability to specify the DNS name as the server interface -- Bug Fix -- Add Vendor Config Options --- Sccp_manager.class.php | 15 +- Sccp_manager.inc/dbinterface.class.php | 14 + Sccp_manager.inc/srvinterface.class.php | 73 ++--- Sccp_manager.inc/xmlinterface.class.php | 81 +++-- conf/SEP0000000000.cnf.xml_7925_sip_template | 237 ++++++++++++++ conf/SEP0000000000.cnf.xml_7925_template | 237 ++++++++++++++ conf/SEP0000000000.cnf.xml_797x_template | 163 ++++++++++ conf/Sccp.class.php | 325 +++++++++---------- conf/Sccp.class.php.v433 | 2 +- conf/sccpgeneral.xml.v433 | 231 ++++++++++++- i18n/ru_RU/LC_MESSAGES/sccp_manager.po | 6 +- install.php | 6 +- views/formShow.php | 23 +- views/server.advanced.php | 1 + views/server.device.php | 13 +- views/server.url.php | 14 + 16 files changed, 1163 insertions(+), 278 deletions(-) create mode 100644 conf/SEP0000000000.cnf.xml_7925_sip_template create mode 100644 conf/SEP0000000000.cnf.xml_7925_template create mode 100644 conf/SEP0000000000.cnf.xml_797x_template create mode 100644 views/server.url.php diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 803efff..ce73e9c 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -382,6 +382,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO "name" => _("SCCP Device"), "page" => 'views/server.device.php' ), + "sccpurl" => array( + "name" => _("SCCP Device URL"), + "page" => 'views/server.url.php' + ), "sccpinfo" => array( "name" => _("SCCP info"), "page" => 'views/server.info.php' @@ -401,6 +405,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO "name" => _("SCCP Device"), "page" => 'views/server.device.php' ), + "sccpurl" => array( + "name" => _("SCCP Device URL"), + "page" => 'views/server.url.php' + ), "sccpntp" => array( "name" => _("SCCP Time"), "page" => 'views/server.datetime.php' @@ -1298,7 +1306,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $save_settings[] = array('keyword' => $this->sccpvalues[$key1]['keyword'], 'data' => $value, 'seq' => $this->sccpvalues[$key1]['seq'], 'type' => $this->sccpvalues[$key1]['type']); } - } + } } $pos = strpos($key, $hdr_arprefix); if ($pos !== false) { @@ -1512,7 +1520,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO public function getCodecs($type, $showDefaults = false) { $allSupported = array(); - $Sccp_Codec = array('alaw', 'ulaw', 'g722', 'g723', 'g726', 'g729', 'gsm', 'ilbc', 'h264', 'h263', 'h261'); + $Sccp_Codec = array('alaw', 'ulaw', 'g722', 'g723', 'g726', 'g729', 'gsm', 'h264', 'h263', 'h261'); switch ($type) { case 'audio': $lcodecs = $this->getMyConfig('voicecodecs'); @@ -1861,10 +1869,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO global $amp_conf; $save_settings = array(); - if (empty($save_value)) { foreach ($this->sccpvalues as $key => $val) { - if (!trim($val['data']) == '') { + if ((trim($val['data']) !== '') or ($val['data'] == '0') ) { $save_settings[] = array($key, $db->escapeSimple($val['data']), $val['seq'], $val['type']); } } diff --git a/Sccp_manager.inc/dbinterface.class.php b/Sccp_manager.inc/dbinterface.class.php index 9d5eaf5..6dde6c2 100644 --- a/Sccp_manager.inc/dbinterface.class.php +++ b/Sccp_manager.inc/dbinterface.class.php @@ -250,6 +250,20 @@ class dbinterface switch ($db_name) { case 'sccpsettings': + foreach ($save_value as $key_v => $data) { + if (!empty($data)) { + if (isset($data[1])) { + if ($data[1] == $this->val_null) { + unset($save_value[$key_v]); + } + } + if (isset($data['data'])) { + if ($data['data'] == $this->val_null) { + unset($save_value[$key_v]); + } + } + } + } if ($mode == 'clear') { $sql = 'truncate `sccpsettings`'; $stmt = $db->prepare($sql); diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index 14e4d4a..9e38267 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -10,15 +10,13 @@ namespace FreePBX\modules\Sccp_manager; -class srvinterface -{ +class srvinterface { var $error; var $_info; var $ami_mode; - public function __construct($parent_class = null) - { + public function __construct($parent_class = null) { $this->paren_class = $parent_class; if ($this->paren_class == null) { $this->paren_class = $this; @@ -43,6 +41,13 @@ class srvinterface } else { throw new \Exception("Invalid Class inside in the include folder" . $freepbx); } + } else { + if (is_null($this->$key)) { + if (class_exists($class, false)) { + $this->$key = new $class($this->paren_class); + $this->_info [] = $this->$key->info(); + } + } } } if ($this->aminterface->status()) { @@ -51,8 +56,7 @@ class srvinterface $this->ami_mode = $this->aminterface->status(); } - public function info() - { + public function info() { $Ver = '14.0.1'; $info = ''; foreach ($this->_info as $key => $value) { @@ -62,8 +66,7 @@ class srvinterface 'about' => 'Server interface data ver: ' . $Ver . "\n " . $info); } - public function sccpDeviceReset($id = '') - { + public function sccpDeviceReset($id = '') { if ($this->ami_mode) { return $this->aminterface->sccpDeviceReset($id, 'reset'); } else { @@ -71,8 +74,7 @@ class srvinterface } } - public function sccpDeviceRestart($id = '') - { + public function sccpDeviceRestart($id = '') { if ($this->ami_mode) { return $this->aminterface->sccpDeviceReset($id, 'restart'); } else { @@ -80,8 +82,7 @@ class srvinterface } } - public function sccp_device_reload($id = '') - { + public function sccp_device_reload($id = '') { if ($this->ami_mode) { return $this->aminterface->sccpDeviceReset($id, 'full'); } else { @@ -89,8 +90,7 @@ class srvinterface } } - public function sccp_reset_token($id = '') - { + public function sccp_reset_token($id = '') { if ($this->ami_mode) { return $this->aminterface->sccpDeviceReset($id, 'tokenack'); } else { @@ -98,8 +98,7 @@ class srvinterface } } - public function sccp_reload() - { + public function sccp_reload() { if ($this->ami_mode) { return $this->aminterface->core_sccp_reload(); // return $this->oldinterface->sccp_core_commands(array('cmd' => 'sccp_reload')); // !!!!!!!!!!!!!!!!!!!!!!!!!--------------------------- Remove @@ -108,8 +107,7 @@ class srvinterface } } - public function sccp_line_reload($id = '') - { + public function sccp_line_reload($id = '') { if ($this->ami_mode) { return $this->oldinterface->sccp_core_commands(array('cmd' => 'reload_line', 'name' => $id)); } else { @@ -117,8 +115,7 @@ class srvinterface } } - private function sccp_core_commands($params = array()) - { + private function sccp_core_commands($params = array()) { if ($this->ami_mode) { if (!empty($params['cmd'])) { @@ -164,8 +161,7 @@ class srvinterface } } - public function sccp_getdevice_info($dev_id) - { + public function sccp_getdevice_info($dev_id) { if (empty($dev_id)) { return array(); } @@ -176,8 +172,7 @@ class srvinterface } } - public function sccp_list_hints() - { + public function sccp_list_hints() { if ($this->ami_mode) { return $this->aminterface->core_list_hints(); } else { @@ -185,8 +180,7 @@ class srvinterface } } - public function sccp_list_all_hints() - { + public function sccp_list_all_hints() { if ($this->ami_mode) { return $this->aminterface->core_list_all_hints(); @@ -195,8 +189,7 @@ class srvinterface } } - public function sccp_realtime_status() - { + public function sccp_realtime_status() { if (!$this->ami_mode) { return $this->oldinterface->sccp_realtime_status(); } else { @@ -213,8 +206,7 @@ class srvinterface } } - public function get_compatible_sccp() - { + public function get_compatible_sccp() { $res = $this->getSCCPVersion(); if (empty($res)) { @@ -245,8 +237,7 @@ class srvinterface // return $res["vCode"]; } - public function getSCCPVersion() - { + public function getSCCPVersion() { $res = $this->getChanSCCPVersion(); if (empty($res)) { $res = $this->oldinterface->getCoreSCCPVersion(); @@ -254,8 +245,7 @@ class srvinterface return $res; } - public function sccp_list_keysets() - { + public function sccp_list_keysets() { if ($this->ami_mode) { return $this->aminterface->sccp_list_keysets(); @@ -264,8 +254,7 @@ class srvinterface } } - public function sccp_get_active_device() - { + public function sccp_get_active_device() { if ($this->ami_mode) { return $this->aminterface->sccp_get_active_device(); } else { @@ -273,8 +262,7 @@ class srvinterface } } - function getChanSCCPVersion() - { + function getChanSCCPVersion() { if (!$this->ami_mode) { return $this->oldinterface->getChanSCCPVersion(); } else { @@ -337,8 +325,7 @@ class srvinterface } // ---------------------------- Debug Data ------------------------------------------- - function t_get_ami_data() - { + function t_get_ami_data() { global $amp_conf; $fp = fsockopen("127.0.0.1", "5038", $errno, $errstr, 10); if (!$fp) { @@ -354,7 +341,6 @@ class srvinterface // fputs($fp, "Action: SCCPShowDevice\r\n"); // fputs($fp,"Segment: general\r\n"); // fputs($fp,"DeviceName: SEP00070E36555C\r\n"); - // fputs ($fp,"Action: DeviceStateList\r\n"); fputs($fp, "Action: SCCPShowDevices\r\n"); fputs($fp, "Segment: general\r\n"); @@ -396,14 +382,14 @@ class srvinterface */ fputs($fp, "Action: logoff\r\n\r\n"); $time_logoff = microtime_float(); - + // print_r(fgets($fp)); $resp = ''; while (!feof($fp)) { $resp .= fgets($fp); } $time_resp = microtime_float(); - $resp .= "\r\n\r\n Connect :".($time_send - $time_connect). " Logoff :".($time_logoff- $time_send). " Response :".($time_resp-$time_logoff)."\r\n\r\n "; + $resp .= "\r\n\r\n Connect :" . ($time_send - $time_connect) . " Logoff :" . ($time_logoff - $time_send) . " Response :" . ($time_resp - $time_logoff) . "\r\n\r\n "; // print_r(fgets($fp)); // print_r('
'); // echo fgets($fp, 128); @@ -411,4 +397,5 @@ class srvinterface fclose($fp); return $resp; } + } diff --git a/Sccp_manager.inc/xmlinterface.class.php b/Sccp_manager.inc/xmlinterface.class.php index d6954b3..a836a12 100644 --- a/Sccp_manager.inc/xmlinterface.class.php +++ b/Sccp_manager.inc/xmlinterface.class.php @@ -36,7 +36,9 @@ class xmlinterface if (empty($store_path) || empty($data_path) || empty($data_values)) { return; } - $def_xml_fields = array('authenticationURL', 'informationURL', 'messagesURL', 'servicesURL', 'directoryURL', 'proxyServerURL', 'idleTimeout', 'idleURL'); + $def_xml_fields = array('authenticationURL', 'informationURL', 'messagesURL', 'servicesURL', 'directoryURL', + 'secureauthenticationURL', 'secureinformationURL', 'securemessagesURL', 'secureservicesURL', 'securedirectoryURL', 'secureidleURL', + 'proxyServerURL', 'idleTimeout', 'idleURL'); $def_xml_locale = array('userLocale', 'networkLocaleInfo', 'networkLocale'); $xml_name = $store_path . '/XMLDefault.cnf.xml'; $xml_template = $data_values['tftp_path'] . '/templates/XMLDefault.cnf.xml_template'; @@ -67,9 +69,10 @@ class xmlinterface if (!empty($data_values['dev_' . $value])) { $xml_work->$value = trim($data_values['dev_' . $value]); } else { -// $xml_work->$value = ''; $node = $xml_work->$value; - unset($node[0][0]); + if (!empty($node)) { + unset($node[0][0]); + } } } foreach ($def_xml_locale as $key) { @@ -118,11 +121,14 @@ class xmlinterface function create_SEP_XML($store_path = '', $data_values = array(), $dev_config = array(), $dev_id = '', $lang_info = array()) { - - $var_xml_general_fields = array('authenticationURL' => 'dev_authenticationURL', 'informationURL' => 'dev_informationURL', 'messagesURL' => 'dev_messagesURL', - 'servicesURL' => 'dev_servicesURL', 'directoryURL' => 'dev_directoryURL', 'proxyServerURL' => 'dev_proxyServerURL', 'idleTimeout' => 'dev_idleTimeout', - 'idleURL' => 'dev_idleURL', 'sshUserId' => 'dev_sshUserId', 'sshPassword' => 'dev_sshPassword', 'deviceProtocol' => 'dev_deviceProtocol', - 'phonePersonalization' => 'phonePersonalization' + $var_xml_general_fields = array('authenticationurl' => 'dev_authenticationURL', 'informationurl' => 'dev_informationURL', 'messagesurl' => 'dev_messagesURL', + 'servicesurl' => 'dev_servicesURL', 'directoryurl' => 'dev_directoryURL', 'idleurl' => 'dev_idleURL', + 'secureauthenticationurl' => 'dev_secureauthenticationURL', + 'secureinformationurl' => 'dev_secureinformationURL', 'securemessagesurl'=>'dev_securemessagesURL', + 'secureservicesurl'=>'dev_secureservicesURL', 'securedirectoryurl'=>'dev_securedirectoryURL', 'secureidleurl' => 'dev_secureidleURL', + 'proxyserverurl' => 'dev_proxyServerURL', 'idletimeout' => 'dev_idleTimeout', + 'sshuserid' => 'dev_sshUserId', 'sshpassword' => 'dev_sshPassword', 'deviceprotocol' => 'dev_deviceProtocol', + 'phonepersonalization' => 'phonePersonalization' ); $var_xml_general_vars = array('capfAuthMode' => 'null', 'capfList' => 'null', 'mobility' => 'null', 'phoneServices' => 'null', 'certHash' => 'null', @@ -161,17 +167,18 @@ class xmlinterface foreach ($xml_work as $key => $data) { // Set System global Values - if (!empty($var_xml_general_fields[$key])) { - $xml_work->$key = $data_values[$var_xml_general_fields[$key]]; + $key_l = strtolower($key); + if (!empty($var_xml_general_fields[$key_l])) { + $xml_work->$key = $data_values[$var_xml_general_fields[$key_l]]; } // Set section Values $xml_node = $xml_work->$key; - switch ($key) { - case 'devicePool': + switch ($key_l) { + case 'devicepool': $xml_node = $xml_work->$key; foreach ($xml_work->$key->children() as $dkey => $ddata) { - switch ($dkey) { - case 'dateTimeSetting': + switch (strtolower($dkey)) { + case 'datetimesetting': $xnode = &$xml_node->$dkey; $tz_id = $data_values['ntp_timezone']; $TZdata = $data_values['ntp_timezone_id']; @@ -191,7 +198,7 @@ class xmlinterface } // Ntp Config break; - case 'srstInfo': + case 'srstinfo': if ($data_values['srst_Option'] == 'user') { break; } @@ -224,10 +231,10 @@ class xmlinterface } } break; - case 'connectionMonitorDuration': + case 'connectionmonitorduration': $xml_node->$dkey = strval(intval(intval($data_values['keepalive']) * 0.75)); break; - case 'callManagerGroup': + case 'callmanagergroup': $xnode = &$xml_node->$dkey->members; $bind_tmp = $this->get_server_sccp_bind($data_values); $ifc = 0; @@ -235,8 +242,15 @@ class xmlinterface $xnode_obj = clone $xnode->member; $xnode_obj['priority'] = $ifc; $xnode_obj->callManager->name = $data_values['servername']; + if (!is_null($xnode_obj->callManager->description)) { + $xnode_obj->callManager->description = $data_values['servername']; + } $xnode_obj->callManager->ports->ethernetPhonePort = $bind_value['port']; $xnode_obj->callManager->processNodeName = $bind_value['ip']; + if (!empty($xnode_obj->callManager->ports->mgcpPorts)) { + unset($xnode_obj->callManager->ports->mgcpPorts); + } + if ($ifc === 0) { $this->replaceSimpleXmlNode($xnode->member, $xnode_obj); } else { @@ -292,10 +306,25 @@ class xmlinterface } $this->replaceSimpleXmlNode($xml_work->$key, $xml_node); break; - case 'versionStamp': + case 'vendorconfig': + $xml_node = $xml_work->$key; + foreach ($xml_work->$key->children() as $dkey => $ddata) { + $dkey_l = strtolower($dkey); + $vtmp_key = $key_l.'_'.$dkey_l; + if (isset($data_values[$vtmp_key])) { + $vtmp_data = $data_values[$vtmp_key]; + if ((!empty($vtmp_data)) || ($vtmp_data == "0")) { + $xml_node->$dkey = $vtmp_data; + } + } + } + $this->replaceSimpleXmlNode($xml_work->$key, $xml_node); + break; + + case 'versionstamp': $xml_work->$key = time(); break; - case 'loadInformation': + case 'loadinformation': // Set Path Image ???? if (isset($dev_config["tftp_firmware"])) { $xml_work->$key = (isset($dev_config["loadimage"])) ? $dev_config["tftp_firmware"] . $dev_config["loadimage"] : ''; @@ -320,33 +349,33 @@ class xmlinterface // $this->appendSimpleXmlNode($xml_work , $xnode_obj); } break; - case 'commonProfile': + case 'commonprofile': $xml_node->phonePassword = $data_values['dev_sshPassword']; $xml_node->backgroundImageAccess = (($data_values['backgroundImageAccess'] == 'on') || ($data_values['backgroundImageAccess'] == 'true') ) ? 'true' : 'false'; $xml_node->callLogBlfEnabled = $data_values['callLogBlfEnabled']; break; - case 'userLocale': - case 'networkLocaleInfo': - case 'networkLocale': + case 'userlocale': + case 'networklocaleinfo': + case 'networklocale': $hwlang = ''; $lang = ''; if (!empty($dev_config["_hwlang"])) { $hwlang = explode(':', $dev_config["_hwlang"]); } - if (($key == 'networkLocaleInfo') || ($key == 'networkLocale')) { + if (($key_l == 'networklocaleinfo') || ($key_l == 'networklocale')) { $lang = (empty($hwlang[0])) ? $data_values['netlang'] : $hwlang[0]; } else { $lang = (empty($hwlang[1])) ? $data_values['devlang'] : $hwlang[1]; } if (($lang != 'null') && (!empty($lang))) { - if ($key == 'networkLocale') { + if ($key_l == 'networklocale') { $xml_work->$key = $lang; } else { if (isset($lang_info[$lang])) { $xml_node->name = $lang_info[$lang]['locale']; $xml_node->langCode = $lang_info[$lang]['code']; - if ($key == 'userLocale') { + if ($key_l == 'userlocale') { $xml_node->winCharSet = $lang_info[$lang]['codepage']; } $this->replaceSimpleXmlNode($xml_work->$key, $xml_node); diff --git a/conf/SEP0000000000.cnf.xml_7925_sip_template b/conf/SEP0000000000.cnf.xml_7925_sip_template new file mode 100644 index 0000000..2e85211 --- /dev/null +++ b/conf/SEP0000000000.cnf.xml_7925_sip_template @@ -0,0 +1,237 @@ + + + true + x.x.x.x + SCCP + + + 0 + true + true + false + false + 0 + 0 + + 2016g + tzupdater.jar + + 000000 + Off + Disabled + false + + 0 + MyDeviceName + + timezone name + M-D-Y + + Europe/Amsterdam + + + x.x.x.x + Directed Broadcast + + + + + MyGroupName + false + + + + My CM1 name + My CM Description + + 2000 + 5060 + 5061 + + 2427 + 2428 + + + y.y.y.y + + + + + + Disable + Disable + false + + 2000 + + 2000 + + 2000 + + 5060 + + 5060 + + 5060 + false + + 120 + + + + true + 3 + + CP7925G-1.4.8.4 + + false + 0 + 2 + 0 + 0 + 0 + 0 + MyAdminUsername + MyPassword#$%^! + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + + + 1 + 0 + http://z.z.z.z/pictures/%%sAMAccountName%%.jpg + + + + + + 1 + MyaAdminUsername + MyPassword#$%^! + 0 + http://z.z.z.z/pictures/%%sAMAccountName%%.jpg + + + + + 1234562241-013d4ba4-5b51-4be6-9792-b7165fff6d37 + + English_United_States + 1 + en_US + 10.0.0.0(1) + iso-8859-1 + + United_States + + United_States + 64 + 10.0.0.0(1) + + 1 + 0 + http://z.z.z.z:8080/sccp/authenticate.php + http://z.z.z.z:8080/sccp/xmldirectory.php + + http://z.z.z.z:8080/sccp/helptext.php + + + http://z.z.z.z:8080/sccp/servicesmenu.php + https://z.z.z.z:8443/sccp/authenticate.php + https://z.z.z.z:8443/sccp/xmldirectory.php + + https://z.z.z.z:8443/sccp/helptext.php + + https://z.z.z.z:8443/sccp/servicesmenu.php + 96 + 0 + 96 + 1 + 5 + 0 + 0 + 0 + 0 + false + 0 + 0 + 0 + + + 3804 + y.y.y.y + + + + false + 0 + + + + + *81 + *82 + *83 + *84 + *85 + + 3600 + + + + 2 + + Missed Calls + Application:Cisco/MissedCalls + + + + + Voicemail + Application:Cisco/Voicemail + + + + + Received Calls + Application:Cisco/ReceivedCalls + + + + + Placed Calls + Application:Cisco/PlacedCalls + + + + + Personal Directory + Application:Cisco/PersonalDirectory + + + + + Corporate Directory + Application:Cisco/CorporateDirectory + + + + + diff --git a/conf/SEP0000000000.cnf.xml_7925_template b/conf/SEP0000000000.cnf.xml_7925_template new file mode 100644 index 0000000..aeb4201 --- /dev/null +++ b/conf/SEP0000000000.cnf.xml_7925_template @@ -0,0 +1,237 @@ + + + true + x.x.x.x + SCCP + + + 0 + true + true + false + false + 0 + 0 + + 2016g + tzupdater.jar + + 000000 + Off + Disabled + false + + 0 + MyDeviceName + + timezone name + M-D-Y + + Europe/Amsterdam + + + x.x.x.x + Directed Broadcast + + + + + MyGroupName + false + + + + My CM1 name + My CM Description + + 2000 + 5060 + 5061 + + 2427 + 2428 + + + y.y.y.y + + + + + + Disable + Disable + false + + 2000 + + 2000 + + 2000 + + 5060 + + 5060 + + 5060 + false + + 120 + + + + true + 3 + + CP7925G-1.4.8.4 + + false + 0 + 2 + 0 + 0 + 0 + 0 + MyAdminUsername + MyPassword#$%^! + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + + + 1 + 0 + http://z.z.z.z/pictures/%%sAMAccountName%%.jpg + + + + + + 1 + MyaAdminUsername + MyPassword#$%^! + 0 + http://z.z.z.z/pictures/%%sAMAccountName%%.jpg + + + + + 1234562241-013d4ba4-5b51-4be6-9792-b7165fff6d37 + + English_United_States + 1 + en_US + 10.0.0.0(1) + iso-8859-1 + + United_States + + United_States + 64 + 10.0.0.0(1) + + 1 + 0 + http://z.z.z.z:8080/sccp/authenticate.php + http://z.z.z.z:8080/sccp/xmldirectory.php + + http://z.z.z.z:8080/sccp/helptext.php + + + http://z.z.z.z:8080/sccp/servicesmenu.php + https://z.z.z.z:8443/sccp/authenticate.php + https://z.z.z.z:8443/sccp/xmldirectory.php + + https://z.z.z.z:8443/sccp/helptext.php + + https://z.z.z.z:8443/sccp/servicesmenu.php + 96 + 0 + 96 + 1 + 5 + 0 + 0 + 0 + 0 + false + 0 + 0 + 0 + + + 3804 + y.y.y.y + + + + false + 0 + + + + + *81 + *82 + *83 + *84 + *85 + + 3600 + + + + 2 + + Missed Calls + Application:Cisco/MissedCalls + + + + + Voicemail + Application:Cisco/Voicemail + + + + + Received Calls + Application:Cisco/ReceivedCalls + + + + + Placed Calls + Application:Cisco/PlacedCalls + + + + + Personal Directory + Application:Cisco/PersonalDirectory + + + + + Corporate Directory + Application:Cisco/CorporateDirectory + + + + + diff --git a/conf/SEP0000000000.cnf.xml_797x_template b/conf/SEP0000000000.cnf.xml_797x_template new file mode 100644 index 0000000..f530769 --- /dev/null +++ b/conf/SEP0000000000.cnf.xml_797x_template @@ -0,0 +1,163 @@ + + + true + cisco + cisco + 2 + 1 + true + + 1 + + M/D/YA + Eastern Standard/Daylight Time + + + 213.109.127.195 + Unicast + + + + + + + + pbxserver1 + + 2000 + + x.x.x.x + + + + + + Disable + x.x.x.x + 2443 + + + false + + 60 + + 1b1b9eb6-7803-11d3-bdf0-00108302ead1 + + 1234 + http://x.x.x.x/Chan-SCCP-b.png + true + 3 + + + false + false + 1 + 1 + 1 + 0 + 0 + 1,7 + 08:30 + 11:30 + 01:00 + 1 + 1 + 0 + x.x.x.x:9001 + 1 + 1 + 1 + 1 + Cisco Phone + 1 + 0 + 2 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + + + English_United_States + 39 + en_US + 9.3(2.9902)US + utf-8 + + United_States + + United_States + 64 + 4.0(1) + + http://x.x.x.x/shiftkey/handle_shift.php + http://x.x.x.x/authenticate.php + + http://x.x.x.x/CiscoDirectory/phonebook.php + + + 5 + 60 + 0 + 0 + 1 + 1 + true + 1 + 1 + 1 + dkgroot + 2 + 1 + 96 + 0 + 184 + + 0 + + Missed Calls + Application:Cisco/MissedCalls + + + + + Received Calls + Application:Cisco/ReceivedCalls + + + + + Placed Calls + Application:Cisco/PlacedCalls + + + + + Personal Directory + Application:Cisco/PersonalDirectory + + + + + Voicemail + Application:Cisco/Voicemail + + + + + Services + http://x.x.x.x/cisco/service.php?emmcmode=#EMCC# + + + + + Login + http://x.x.x.x/cisco/service.php?name=#DEVICENAME#&emmcmode=#EMCC#&action=loginform + + + + + diff --git a/conf/Sccp.class.php b/conf/Sccp.class.php index 7252336..224eb3b 100644 --- a/conf/Sccp.class.php +++ b/conf/Sccp.class.php @@ -1,13 +1,11 @@ 'pin', "label" => 'label', "accountcode" => 'account', "context" =>'lcontext',"incominglimit"=>'incominglimit', "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup', @@ -16,23 +14,22 @@ class Sccp extends \FreePBX\modules\Core\Driver "cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'description', "musicclass" => 'musicclass', "dnd" => 'dnd', "silencesuppression" => 'silencesuppression', - "secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone', + "secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone', 'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup' ); - public function getInfo() - { - return array( - "rawName" => "sccp", - "hardware" => "sccp_custom", - "prettyName" => _("Sccp Custom Driver"), - "shortName" => "SCCP", - "description" => _("Sccp Device"), - "Version" => "11.3", - "about" => "Sccp mysql class Base ver: 11.3, Sccp ver: default" + public function getInfo() { + return array( + "rawName" => "sccp", + "hardware" => "sccp_custom", + "prettyName" => _("Sccp Custom Driver"), + "shortName" => "SCCP", + "description" => _("Sccp Device"), + "Version" => "11.3", + "about" => "Sccp mysql class Base ver: 11.3, Sccp ver: default" - ); - } + ); + } /* public function addDevice1($id, $settings) { $sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)'; @@ -44,176 +41,170 @@ class Sccp extends \FreePBX\modules\Core\Driver return true; } */ - public function addDevice($id, $settings) - { + public function addDevice($id, $settings) { $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description'); - // print_r($_REQUEST); - // echo '

'; - // die(print_r($settings)); +// print_r($_REQUEST); +// echo '

'; +// die(print_r($settings)); $settings['cid_num']['value']=''; - if (isset($_REQUEST)) { - foreach ($add_fld as $key => $val) { - if (!empty($_REQUEST[$key])) { - $settings[$val]['value'] = $_REQUEST[$key]; + if (isset($_REQUEST)){ + foreach($add_fld as $key => $val) { + if (!empty($_REQUEST[$key])){ + $settings[$val]['value'] = $_REQUEST[$key]; + } } } - } - if (empty($settings['cid_num']['value'])) { - $settings['cid_num']['value']= $id; - } + if (empty($settings['cid_num']['value'])) { + $settings['cid_num']['value']= $id; + } $sql = 'INSERT INTO sccpline (name'; $sqlv = 'values ("'.$id.'"'; - foreach ($this->data_fld as $key => $val) { - if (!empty($settings[$val])) { - if (!empty($settings[$val]['value'])) { - $sql .= ', '.$key; - $sqlv .= ", '".$settings[$val]['value']."' "; + foreach($this->data_fld as $key => $val) { + if (!empty($settings[$val]) ) { + if (!empty($settings[$val]['value'])){ + $sql .= ', '.$key; + $sqlv .= ", '".$settings[$val]['value']."' "; + } } } - } - $sql .= ") ".$sqlv.");"; - $sth = $this->database->prepare($sql); + $sql .= ") ".$sqlv.");"; + $sth = $this->database->prepare($sql); $sth->execute(); - return true; + return true; } - public function delDevice($id) - { - $sql = "DELETE FROM sccpline WHERE name = ?"; - $sth = $this->database->prepare($sql); - $sth->execute(array($id)); - return true; - } + public function delDevice($id) { + $sql = "DELETE FROM sccpline WHERE name = ?"; + $sth = $this->database->prepare($sql); + $sth->execute(array($id)); + return true; + } - public function getDevice($id) - { + public function getDevice($id) { $sccp_line = array(); - // $sql = "SELECT name as id, name as name"; - $sql = "SELECT name as id, name as name "; - foreach ($this->data_fld as $key => $val) { +// $sql = "SELECT name as id, name as name"; + $sql = "SELECT name as id, name as name "; + foreach($this->data_fld as $key => $val) { $sql .= ',`'. $key .'` as '.$val; - } - $sql .= " FROM sccpline WHERE name = ?"; - $sth = $this->database->prepare($sql); - $result = array(); - $tech = array(); - try { - $sth->execute(array($id)); - $result = $sth->fetch(\PDO::FETCH_ASSOC); + } + $sql .= " FROM sccpline WHERE name = ?"; + $sth = $this->database->prepare($sql); + $result = array(); + $tech = array(); + try { + $sth->execute(array($id)); + $result = $sth->fetch(\PDO::FETCH_ASSOC); $tech = $result; $tech['dial']='SCCP/'.$id; - } catch (\Exception $e) { - } + } catch(\Exception $e) {} - return $tech; - } + return $tech; + } - public function getDefaultDeviceSettings($id, $displayname, &$flag) - { - $dial = 'SCCP'; - $settings = array( - "pin" => array( - "value" => "", - "flag" => $flag++ - ), - "incominglimit" => array( - "value" => "", - "flag" => $flag++ - ), - "lcontext" => array( - "value" => "from-internal", - "flag" => $flag++ - ), - "callgroup" => array( - "value" => "", - "flag" => $flag++ - ), - "namedcallgroup" => array( - "value" => "", - "flag" => $flag++ - ), - "pickupgroup" => array( - "value" => "", - "flag" => $flag++ - ), - "namedpickupgroup" => array( - "value" => "", - "flag" => $flag++ - ), - "transfer" => array( - "value" => "yes", - "flag" => $flag++ - ), - "adhocNumber" => array( - "value" => "", - "flag" => $flag++ - ), - "echocancel" => array( - "value" => "no", - "flag" => $flag++ - ), - "dnd" => array( - "value" => "UserDefined", - "flag" => $flag++ - ), - "silencesuppression" => array( - "value" => "no", - "flag" => $flag++ - ), - "secondary_dialtone_digits" => array( - "value" => "9", - "flag" => $flag++ - ), - "secondary_dialtone_tone" => array( - "value" => "0x22", - "flag" => $flag++ - ), - "musicclass" => array( - "value" => "default", - "flag" => $flag++ - ), - ); - return array( - "dial" => $dial, - "settings" => $settings - ); - } + public function getDefaultDeviceSettings($id, $displayname, &$flag) { + $dial = 'SCCP'; + $settings = array( + "pin" => array( + "value" => "", + "flag" => $flag++ + ), + "incominglimit" => array( + "value" => "", + "flag" => $flag++ + ), + "lcontext" => array( + "value" => "from-internal", + "flag" => $flag++ + ), + "callgroup" => array( + "value" => "", + "flag" => $flag++ + ), + "namedcallgroup" => array( + "value" => "", + "flag" => $flag++ + ), + "pickupgroup" => array( + "value" => "", + "flag" => $flag++ + ), + "namedpickupgroup" => array( + "value" => "", + "flag" => $flag++ + ), + "transfer" => array( + "value" => "yes", + "flag" => $flag++ + ), + "adhocNumber" => array( + "value" => "", + "flag" => $flag++ + ), + "echocancel" => array( + "value" => "no", + "flag" => $flag++ + ), + "dnd" => array( + "value" => "UserDefined", + "flag" => $flag++ + ), + "silencesuppression" => array( + "value" => "no", + "flag" => $flag++ + ), + "secondary_dialtone_digits" => array( + "value" => "9", + "flag" => $flag++ + ), + "secondary_dialtone_tone" => array( + "value" => "0x22", + "flag" => $flag++ + ), + "musicclass" => array( + "value" => "default", + "flag" => $flag++ + ), + ); + return array( + "dial" => $dial, + "settings" => $settings + ); + } # !TODO!: -TODO-: Would it not be better to put this part in the view directory (MVC) ? No, This is a template for Freepbx. - public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) - { - $section = _("Settings"); - $category = "general"; - $tmparr = array(); - $tt = _("The maximum number of incoming calls on this line."); - // $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel); - // !TODO!: Please change the default value for incominglimit to '6' or higher - $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 1); + public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) { + $section = _("Settings"); + $category = "general"; + $tmparr = array(); + $tt = _("The maximum number of incoming calls on this line."); +// $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel); +// !TODO!: Please change the default value for incominglimit to '6' or higher + $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 1); $tt = _("Asterisk context which this line will use to send and receive calls (Note: Only change this is you know what you are doing)."); - $tmparr['lcontext'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1); + $tmparr['lcontext'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1); - // !TODO!: -TODO-: Maybe completely remove support for old numberic callgroup/pickupgroup in favor of the named version ? See Sccp.class.php.v431 +// !TODO!: -TODO-: Maybe completely remove support for old numberic callgroup/pickupgroup in favor of the named version ? See Sccp.class.php.v431 $tt = _("Phone call group (numeric only, example:1,3-4)"); - $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1); + $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1); - // !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431 +// !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431 $tt = _("Phone named call group (>asterisk-11)"); - $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1); + $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1); $tt = _("Sets the pickup group (numeric only, example:1,3-4) this line is a member of. Allows this line to pickup calls from remote phones which are in this callhroup."); $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1); - // !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431 +// !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431 $tt = _("Sets the named pickup name group this line is a member of. Allows this line to pickup calls from remote phones which are in this name callgroup (>asterisk-11)."); - $tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1); + $tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1); $tt = _("Phone pincode (Note used)"); - $tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1); + $tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1); $tt = _("Digits to indicate an external line to user (secondary dialtone) Sample 9 or 8 (max 9 digits)"); - $tmparr['secondary_dialtone_digits'] = array('prompttext' => _('Secondary dialtone digits'), 'value' => '', 'tt' => $tt, 'level' => 1); + $tmparr['secondary_dialtone_digits'] = array('prompttext' => _('Secondary dialtone digits'), 'value' => '', 'tt' => $tt, 'level' => 1); unset($select); $select[] = array( 'value' => '0x21', 'text' => 'Inside Dial Tone'); @@ -258,8 +249,8 @@ class Sccp extends \FreePBX\modules\Core\Driver $select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa'); $select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea'); $select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa'); - /* !TODO!: +TODO+: I would remove the values below this line, except for 'No Tone' */ - // $select[] = array( 'value' => '0x7F', 'text' => 'No Tone'); +/* !TODO!: +TODO+: I would remove the values below this line, except for 'No Tone' */ +// $select[] = array( 'value' => '0x7F', 'text' => 'No Tone'); $select[] = array( 'value' => '0x80', 'text' => 'Meetme Greeting Tone'); $select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone'); $select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone'); @@ -276,7 +267,7 @@ class Sccp extends \FreePBX\modules\Core\Driver $tt = _("Outside dialtone frequency (defaul 0x22)"); $tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select'); - # !TODO!: -TODO-: is there no easier way to specify a boolean radio group ? No. +# !TODO!: -TODO-: is there no easier way to specify a boolean radio group ? No. unset($select); $select[] = array('value' => 'yes', 'text' => 'Yes'); $select[] = array('value' => 'no', 'text' => 'No'); @@ -294,8 +285,8 @@ class Sccp extends \FreePBX\modules\Core\Driver $select[] = array('value' => 'reject', 'text' => 'Reject'); $select[] = array('value' => 'silent', 'text' => 'Silent'); $select[] = array('value' => 'UserDefined', 'text' => 'UserDefined'); - # !TODO!: -TODO-: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour - # !TODO!: -TODO-: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think). See Sccp.class.php.v431, See Sccp.class.php - Old Style +# !TODO!: -TODO-: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour +# !TODO!: -TODO-: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think). See Sccp.class.php.v431, See Sccp.class.php - Old Style $tt = _("DND: How will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'
'. _("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'
'. _("Reject - Usesr can only switch off and on (in reject/busy mode)").'
'. @@ -310,19 +301,19 @@ class Sccp extends \FreePBX\modules\Core\Driver unset($select); $select[] = array('value' => 'default', 'text' => _('default')); - if (function_exists('music_list')) { - $moh_list = music_list(); - } else { - $moh_list = array('default'); - } - foreach ($moh_list as $value) { - $select[] = array('value' => $value, 'text' => _($value)); - } + if (function_exists('music_list')){ + $moh_list = music_list(); + } else { + $moh_list = array('default'); + } + foreach ($moh_list as $value) { + $select[] = array('value' => $value, 'text' => _($value)); + } $tt = _("Music on hold"); $tmparr['musicclass'] = array('prompttext' => _('Music on hold'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1); - $devopts = $tmparr; - return $devopts; - } + $devopts = $tmparr; + return $devopts; + } } diff --git a/conf/Sccp.class.php.v433 b/conf/Sccp.class.php.v433 index 58cd64f..76947d8 100644 --- a/conf/Sccp.class.php.v433 +++ b/conf/Sccp.class.php.v433 @@ -301,7 +301,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { $currentcomponent->addTabTranslation('sccp',_('SCCP')); // $currentcomponent->addTabTranslation('Codec',_('Codec')); - //Fill Codecs Information + //Fill Codecs Informations $Sccp_Codec = array('gsm','slin16','alaw','ulaw','g722','g723','g726','g728','g729','ilibc','opus','h264','h263','h265','h261'); $allCodecs = $this->freepbx->Codecs->getAudio(true); diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 2882f8d..62a0590 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -534,8 +534,164 @@ and open the template in the editor. Base Version before all crash :-) Date Format: Time zone - + + + + + + + + vendorconfig_logserver + + sccp-custom + + + Log server Address: x.x.x.x:9001 + + + + + vendorconfig_daysdisplaynotactive + + sccp-custom + + + Comma separated list of days that the phone's display is not active and will be automatically turned off after the time specified by "displayIdleTimeout" has elapsed (1 - Sunday, 7 - Saturday) + + + + + vendorconfig_displayontime + + sccp-custom + + + Time in HH:MM format to automatically turn on the phone display. + + + + + vendorconfig_displayonduration + + sccp-custom + + + Time duration in HH:MM format to automatically turn off the phone display after it was turned on. + + + + + vendorconfig_displayidletimeout + + sccp-custom + + + Timeout in HH:MM format to automatically turn off phone display if outside the time specified by "daysDisplayNotActive", "displayOnTime" and "displayOnTimeout". + + + + vendorconfig_settingsaccess + + + + + + Whether a user can access the phone settings. + + + vendorconfig_videocapability + + + + + + + + + vendorconfig_webaccess + + + + + + Enable the phone's HTTP server. + + + vendorconfig_webadmin + + + + + + Enable remote administration using the phone's HTTP server. 8821 model only. + + + vendorconfig_pcport + + + + + + Disable the PC (computer) port + + + vendorconfig_spantopcport + + + + + + Forward packets sent and received on the SW (network) port to the PC (computer) port. + + + vendorconfig_voicevlanaccess + + + + + + Allow devices connected to the PC (computer) port to access the voice VLAN. + + + vendorconfig_enablecdpswport + + + + + + Enable Cisco Discovery Protocol on the SW (network) port. + + + vendorconfig_enablecdppcport + + + + + + Enable Cisco Discovery Protocol on the PC (computer) port. + + + vendorconfig_enablelldpswport + + + + + + Enable Link Layer Discovery Protocol on the SW (network) port. + + + vendorconfig_enablelldppcport + + + + + + Enable Link Layer Discovery Protocol on the PC (computer) port. + + + + @@ -622,8 +778,17 @@ and open the template in the editor. Base Version before all crash :-) dev_servicesURL - - + + + + + + + + dev_secureservicesURL + + + @@ -637,15 +802,15 @@ and open the template in the editor. Base Version before all crash :-) The above is simply a dummy authentication page. It literally contains one word: AUTHORIZED (it receives UserId, Password, and devicename in the url - if you truly wish to implement special auth) - - + + - dev_idleURL - + dev_secureauthenticationURL + - URL of CiscoIPPhoneImage. Requires a non-zero setting in idleTimeout. + @@ -656,11 +821,29 @@ and open the template in the editor. Base Version before all crash :-) + + + + dev_secureinformationURL + + + + + dev_messagesURL - + + + + + + + + + dev_securemessagesURL + @@ -674,6 +857,36 @@ and open the template in the editor. Base Version before all crash :-) This is the URL for a CiscoIPPhoneMenu which gets appended to the end of the Missed/Received/Placed calls. I don't use it (I find it makes more sense to put my phone book under services) + + + + dev_securedirectoryURL + + + + + + + + + dev_idleURL + + + + + URL of CiscoIPPhoneImage. Requires a non-zero setting in idleTimeout. + + + + + dev_secureidleURL + + + + + + + diff --git a/i18n/ru_RU/LC_MESSAGES/sccp_manager.po b/i18n/ru_RU/LC_MESSAGES/sccp_manager.po index 9a8cc14..4309487 100644 --- a/i18n/ru_RU/LC_MESSAGES/sccp_manager.po +++ b/i18n/ru_RU/LC_MESSAGES/sccp_manager.po @@ -154,7 +154,7 @@ msgstr "Внешний адрес" #: views/sccpgeneral.xml: msgid "" "External IP Address of the firewall, required in case the PBX is running on " -"a seperatehost behind it. IP Address that we're going to notify in RTP media " +"a separatehost behind it. IP Address that we're going to notify in RTP media " "stream as the pbx source address." msgstr "" "Внешнее имя FQDN в системе DNS на внешнем интерфейсе (WAN) роутера, которое " @@ -504,7 +504,7 @@ msgid "NTP Server name or IP" msgstr "Адрес Сервера NTP" #: views/sccpgeneral.xml: -msgid "Configure NTP Server protocol time syncronization" +msgid "Configure NTP Server protocol time synchronization" msgstr "Настойка протокола синхронизации времени" #: views/sccpgeneral.xml: @@ -1306,7 +1306,7 @@ msgid "Close" msgstr "Закрыть" #: views/server.model: -msgid "Add New model whithout Enabled" +msgid "Add New model without Enabled" msgstr "Добавить шаблон как неактивный" #: views/server.model: diff --git a/install.php b/install.php index bd026f1..20d235e 100644 --- a/install.php +++ b/install.php @@ -670,10 +670,10 @@ function InstallDB_fillsccpdevmodel() global $db; outn("
  • " . _("Fill sccpdevmodel") . "
  • "); $sql = "REPLACE INTO `sccpdevmodel` (`model`, `vendor`, `dns`, `buttons`, `loadimage`, `loadinformationid`, `enabled`, `nametemplate`) VALUES ('12 SP', 'CISCO', 1, 1, '', 'loadInformation3', 0, NULL)," . - "('12 SP+', 'CISCO', 1, 1, '', 'loadInformation2', 0, NULL), ('30 SP+', 'CISCO', 1, 1, '', 'loadInformation1', 0, NULL), ('30 VIP', 'CISCO', 1, 1, '', 'loadInformation5', 0, NULL), ('3911', 'CISCO', 1, 1, '', 'loadInformation446', 0, NULL), ('3951', 'CISCO', 1, 1, '', 'loadInformation412', 0, ''), ('6901', 'CISCO', 1, 0, 'SCCP6901.9-2-1-a', 'loadInformation547', 0, NULL), ('6911', 'CISCO', 1, 0, 'SCCP6911.9-2-1-a', 'loadInformation548', 0, NULL), ('6921', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation496', 0, NULL), ('6941', 'CISCO', 1, 1, 'SCCP69xx.9-2-1-0', 'loadInformation495', 0, NULL), ('6945', 'CISCO', 1, 0, 'SCCP6945.9-2-1-0', 'loadInformation564', 0, NULL), ('6961', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation497', 0, NULL), ('7902', 'CISCO', 1, 1, 'CP7902080002SCCP060817A', 'loadInformation30008', 0, NULL), " . + "('12 SP+', 'CISCO', 1, 1, '', 'loadInformation2', 0, NULL), ('30 SP+', 'CISCO', 1, 1, '', 'loadInformation1', 0, NULL), ('30 VIP', 'CISCO', 1, 1, '', 'loadInformation5', 0, NULL), ('3911', 'CISCO', 1, 1, '', 'loadInformation446', 0, NULL), ('3951', 'CISCO', 1, 1, '', 'loadInformation412', 0, ''), ('6901', 'CISCO', 1, 0, 'SCCP6901.9-2-1-a', 'loadInformation547', 0, NULL), ('6911', 'CISCO', 1, 0, 'SCCP6911.9-2-1-a', 'loadInformation548', 0, NULL), ('6921', 'CISCO', 1, 0, 'SCCP69xx.9-4-1-3SR3', 'loadInformation496', 0, NULL), ('6941', 'CISCO', 1, 1, 'SCCP69xx.9-3-1-3', 'loadInformation495', 0, NULL), ('6945', 'CISCO', 1, 0, 'SCCP6945.9-3-1-3', 'loadInformation564', 0, NULL), ('6961', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation497', 0, NULL), ('7902', 'CISCO', 1, 1, 'CP7902080002SCCP060817A', 'loadInformation30008', 0, NULL), " . "('7905', 'CISCO', 1, 1, 'CP7905080003SCCP070409A', 'loadInformation20000', 0, NULL), ('7906', 'CISCO', 1, 1, 'SCCP11.9-4-2SR3-1S', 'loadInformation369', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7910', 'CISCO', 1, 1, 'P00405000700', 'loadInformation6', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7911', 'CISCO', 1, 1, 'SCCP11.9-4-2SR3-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7912', 'CISCO', 1, 1, 'CP7912080004SCCP080108A', 'loadInformation30007', 0, NULL), ('7914', 'CISCO', 0, 14, 'S00105000400', 'loadInformation124', 1, NULL),('7914;7914', 'CISCO', 0, 28, 'S00105000400', 'loadInformation124', 1, NULL), ('7915', 'CISCO', 0, 24, 'B015-1-0-4-2', 'loadInformation227', 1, NULL), ('7915;7915', 'CISCO', 0, 48, 'B015-1-0-4-2', 'loadInformation228', 1, NULL), ('7916', 'CISCO', 0, 24, 'B016-1-0-4-2', 'loadInformation229', 1, NULL), " . - "('7916;7916', 'CISCO', 0, 48, 'B016-1-0-4-2', 'loadInformation230', 1, NULL), ('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL), ('7921', 'CISCO', 1, 1, 'CP7921G-1.4.6.3', 'loadInformation365', 0, NULL),('7925', 'CISCO', 1, 6, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, NULL), ('7926', 'CISCO', 1, 1, 'CP7926G-1.4.1SR1', 'loadInformation557', 0, NULL), ('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL), ('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL), ('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL), ('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-5-7', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template'), ('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_7940_template'), " . - "('7941', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation115', 0, 'SEP0000000000.cnf.xml_796x_template'),('7941G-GE', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation309', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7942', 'CISCO', 1, 2, 'SCCP42.9-4-2SR3-1S', 'loadInformation434', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7945', 'CISCO', 1, 2, 'SCCP45.9-3-1SR1-1S', 'loadInformation435', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7960', 'CISCO', 3, 6, 'P0030801SR02', 'loadInformation7', 1, 'SEP0000000000.cnf.xml_796x_template'), ('7961', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation30018', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7961G-GE', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation308', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7962', 'CISCO', 3, 6, 'SCCP42.9-4-2SR3-1S', 'loadInformation404', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7965', 'CISCO', 3, 6, 'SCCP45.9-3-1SR1-1S', 'loadInformation436', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7970', 'CISCO', 3, 8, 'SCCP70.9-4-2SR3-1S', 'loadInformation30006', 0, NULL), ('7971', 'CISCO', 1, 2, 'SCCP70.9-4-2SR3-1S', 'loadInformation119', 0, NULL), ('7975', 'CISCO', 3, 8, 'SCCP75.9-4-2SR3-1S', 'loadInformation437', 0, NULL), ('7985', 'CISCO', 3, 8, 'cmterm_7985.4-1-7-0', 'loadInformation302', 0, NULL), ('8941', 'CISCO', 1, 0, 'SCCP894x.9-2-2-0', 'loadInformation586', 0, NULL), ('8945', 'CISCO', 1, 0, 'SCCP894x.9-2-2-0', 'loadInformation585', 0, NULL), ('ATA 186', 'CISCO', 1, 1, 'ATA030204SCCP090202A', 'loadInformation12', 0, 'SEP0000000000.cnf.xml_ATA_template'), ('ATA 187', 'CISCO', 1, 1, 'ATA187.9-2-3-1', 'loadInformation550', 0, 'SEP0000000000.cnf.xml_ATA_template'), ('CN622', 'MOTOROLA', 1, 1, '', 'loadInformation335', 0, NULL), ('Digital Access', 'CISCO', 1, 1, 'D001M022', 'loadInformation40', 0, NULL), ('Digital Access+', 'CISCO', 1, 1, 'D00303010033', 'loadInformation42', 0, NULL), ('E-Series', 'NOKIA', 1, 1, '', '', 0, NULL), ('ICC', 'NOKIA', 1, 1, '', '', 0, NULL), " . + "('7916;7916', 'CISCO', 0, 48, 'B016-1-0-4-2', 'loadInformation230', 1, NULL), ('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL), ('7921', 'CISCO', 1, 1, 'CP7921G-1.4.6.3', 'loadInformation365', 0, NULL),('7925', 'CISCO', 1, 6, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, 'SEP0000000000.cnf.xml_7925_template'), ('7926', 'CISCO', 1, 1, 'CP7926G-1.4.1SR1', 'loadInformation557', 0, NULL), ('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL), ('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL), ('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL), ('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-5-7', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template'), ('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_7940_template'), " . + "('7941', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation115', 0, 'SEP0000000000.cnf.xml_796x_template'),('7941G-GE', 'CISCO', 1, 2, 'SCCP41.9-4-2SR3-1S', 'loadInformation309', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7942', 'CISCO', 1, 2, 'SCCP42.9-4-2SR3-1S', 'loadInformation434', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7945', 'CISCO', 1, 2, 'SCCP45.9-3-1SR1-1S', 'loadInformation435', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7960', 'CISCO', 3, 6, 'P0030801SR02', 'loadInformation7', 1, 'SEP0000000000.cnf.xml_7940_template'), ('7961', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation30018', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7961G-GE', 'CISCO', 3, 6, 'SCCP41.9-4-2SR3-1S', 'loadInformation308', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7962', 'CISCO', 3, 6, 'SCCP42.9-4-2SR3-1S', 'loadInformation404', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7965', 'CISCO', 3, 6, 'SCCP45.9-3-1SR1-1S', 'loadInformation436', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7970', 'CISCO', 3, 8, 'SCCP70.9-4-2SR3-1S', 'loadInformation30006', 0, 'SEP0000000000.cnf.xml_797x_template'), ('7971', 'CISCO', 1, 2, 'SCCP70.9-4-2SR3-1S', 'loadInformation119', 0, 'SEP0000000000.cnf.xml_797x_template'), ('7975', 'CISCO', 3, 8, 'SCCP75.9-4-2SR3-1S', 'loadInformation437', 0, 'SEP0000000000.cnf.xml_797x_template'), ('7985', 'CISCO', 3, 8, 'cmterm_7985.4-1-7-0', 'loadInformation302', 0, NULL), ('8941', 'CISCO', 1, 0, 'SCCP894x.9-2-2-0', 'loadInformation586', 0, NULL), ('8945', 'CISCO', 1, 0, 'SCCP894x.9-2-2-0', 'loadInformation585', 0, NULL), ('ATA 186', 'CISCO', 1, 1, 'ATA030204SCCP090202A', 'loadInformation12', 0, 'SEP0000000000.cnf.xml_ATA_template'), ('ATA 187', 'CISCO', 1, 1, 'ATA187.9-2-3-1', 'loadInformation550', 0, 'SEP0000000000.cnf.xml_ATA_template'), ('CN622', 'MOTOROLA', 1, 1, '', 'loadInformation335', 0, NULL), ('Digital Access', 'CISCO', 1, 1, 'D001M022', 'loadInformation40', 0, NULL), ('Digital Access+', 'CISCO', 1, 1, 'D00303010033', 'loadInformation42', 0, NULL), ('E-Series', 'NOKIA', 1, 1, '', '', 0, NULL), ('ICC', 'NOKIA', 1, 1, '', '', 0, NULL), " . "('Analog Access', 'CISCO', 1, 1, 'A001C030', 'loadInformation30', 0, ''),('WS-X6608', 'CISCO', 1, 1, 'D00404000032', 'loadInformation43', 0, ''), ('WS-X6624', 'CISCO', 1, 1, 'A00204000013', 'loadInformation43', 0, ''), ('WS-X6608', 'CISCO', 1, 1, 'C00104000003', 'loadInformation51', 0, ''), ('H.323 Phone', 'CISCO', 1, 1, '', 'loadInformation61', 0, ''), ('Simulator', 'CISCO', 1, 1, '', 'loadInformation100', 0, ''), ('MTP', 'CISCO', 1, 1, '', 'loadInformation111', 0, ''), ('MGCP Station', 'CISCO', 1, 1, '', 'loadInformation120', 0, ''), ('MGCP Trunk', 'CISCO', 1, 1, '', 'loadInformation121', 0, ''), ('UPC', 'CISCO', 1, 1, '', 'loadInformation358', 0, ''), ". "('TelePresence', 'TELEPRESENCE', 1, 1, '', 'loadInformation375', 0, ''), ('1000', 'TELEPRESENCE', 1, 1, '', 'loadInformation478', 0, ''), ('3000', 'TELEPRESENCE', 1, 1, '', 'loadInformation479', 0, ''), ('3200', 'TELEPRESENCE', 1, 1, '', 'loadInformation480', 0, ''), ('500-37', 'TELEPRESENCE', 1, 1, '', 'loadInformation481', 0, ''), ('1300-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation505', 0, ''), ('1100', 'TELEPRESENCE', 1, 1, '', 'loadInformation520', 0, ''), ('200', 'TELEPRESENCE', 1, 1, '', 'loadInformation557', 0, ''), ('400', 'TELEPRESENCE', 1, 1, '', 'loadInformation558', 0, ''), ('EX90', 'TELEPRESENCE', 1, 1, '', 'loadInformation584', 0, ''), ('500-32', 'TELEPRESENCE', 1, 1, '', 'loadInformation590', 0, ''), ('1300-47', 'TELEPRESENCE', 1, 1, '', 'loadInformation591', 0, ''), ('TX1310-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation596', 0, ''), ('EX60', 'TELEPRESENCE', 1, 1, '', 'loadInformation604', 0, ''), ('C90', 'TELEPRESENCE', 1, 1, '', 'loadInformation606', 0, ''), ('C60', 'TELEPRESENCE', 1, 1, '', 'loadInformation607', 0, ''), ('C40', 'TELEPRESENCE', 1, 1, '', 'loadInformation608', 0, ''), ('C20', 'TELEPRESENCE', 1, 1, '', 'loadInformation609', 0, ''), ('C20-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation610', 0, ''), ('C60-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation611', 0, ''), ('C40-52', 'TELEPRESENCE', 1, 1, '', 'loadInformation612', 0, ''), ('C60-52', 'TELEPRESENCE', 1, 1, '', 'loadInformation613', 0, ''), ('C60-52D', 'TELEPRESENCE', 1, 1, '', 'loadInformation614', 0, ''),('C60-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation615', 0, ''), ('C90-65', 'TELEPRESENCE', 1, 1, '', 'loadInformation616', 0, ''), ('MX200', 'TELEPRESENCE', 1, 1, '', 'loadInformation617', 0, ''), ('TX9000', 'TELEPRESENCE', 1, 1, '', 'loadInformation619', 0, ''), ('TX9200', 'TELEPRESENCE', 1, 1, '', 'loadInformation620', 0, ''), ('SX20', 'TELEPRESENCE', 1, 1, '', 'loadInformation626', 0, ''), ('MX300', 'TELEPRESENCE', 1, 1, '', 'loadInformation627', 0, ''), ('C40-42', 'TELEPRESENCE', 1, 1, '', 'loadInformation633', 0, ''), ('Jabber', 'CISCO', 1, 1, '', 'loadInformation652', 0, ''), ". "('S60', 'NOKIA', 0, 1, '', 'loadInformation376', 0, ''), ('9971', 'CISCO', 1, 1, '', 'loadInformation493', 0, ''), ('9951', 'CISCO', 1, 1, '', 'loadInformation537', 0, ''), ('8961', 'CISCO', 1, 1, '', 'loadInformation540', 0, ''), ('Iphone', 'APPLE', 0, 1, '', 'loadInformation562', 0, ''), ('Android', 'ANDROID', 0, 1, '', 'loadInformation575', 0, ''), ('7926', 'CISCO', 1, 1, 'CP7926G-1.4.5.3', 'loadInformation577', 0, ''), ('7821', 'CISCO', 1, 1, '', 'loadInformation621', 0, ''), ('7841', 'CISCO', 1, 1, '', 'loadInformation622', 0, ''), ('7861', 'CISCO', 1, 1, '', 'loadInformation623', 0, ''), ('VXC 6215', 'CISCO', 1, 1, '', 'loadInformation634', 0, ''), ('8831', 'CISCO', 1, 1, '', 'loadInformation659', 0, ''), ('8841', 'CISCO', 1, 1, '', 'loadInformation683', 0, ''), ('8851', 'CISCO', 1, 1, '', 'loadInformation684', 0, ''), ('8861', 'CISCO', 1, 1, '', 'loadInformation685', 0, ''), ". diff --git a/views/formShow.php b/views/formShow.php index fd215e5..047a38d 100644 --- a/views/formShow.php +++ b/views/formShow.php @@ -354,18 +354,17 @@ foreach ($items as $child) { $i = 0; // $res_v = 'no'; $opt_hide = ''; - if (empty($child->default)) { - $res_v = 'no'; - } else { + $res_v = ''; + if (!empty($child->default)) { $res_v = (string)$child->default; } if (!empty($child->value)) { $res_v = (string)$child->value; } if (!empty($fvalues[$res_n])) { - if (!empty($fvalues[$res_n]['data'])) { + if (($fvalues[$res_n]['data'] != '') ) { $res_v = (string)$fvalues[$res_n]['data']; - } + } } if (!empty($child->option_hide)) { $opt_hide = ' class="sccp_button_hide" data-vhide="'.$child->option_hide.'" data-clhide="'.$child->option_hide['class'].'" '; @@ -377,14 +376,18 @@ foreach ($items as $child) { $opt_hide .= ' data-vshow="'.$child->option_show.'" data-clshow="'.$child->option_show['class'].'" '; } foreach ($child->xpath('button') as $value) { - $val_check = (string)$value[@value]; - if ($val_check == '' || $val_check == 'NONE' || $val_check == 'none') { - $val_check = (((string)$value[@value] == $res_v) ? " checked" : ""); + $val_check = strtolower((string)$value[@value]); + if ($val_check == strtolower($res_v)) { + $val_check = " checked"; } else { - $val_check = (strtolower((string)$value[@value]) == strtolower($res_v) ? " checked" : ""); + if ($val_check == '' || $val_check == 'none' ) { + if (strtolower($res_v) == 'none' || $res_v == '' ) { + $val_check = " checked"; + } else {$val_check = "";} + } else {$val_check = "";} } echo ''; - echo ''; + echo ''; $i++; } ?> diff --git a/views/server.advanced.php b/views/server.advanced.php index a79c007..e263154 100644 --- a/views/server.advanced.php +++ b/views/server.advanced.php @@ -13,6 +13,7 @@ showGroup('sccp_srst', 1); + echo $this->showGroup('sccp_advant', 1); // echo $this->showGroup('sccp_dev_time',1); ?> diff --git a/views/server.device.php b/views/server.device.php index 887bd21..b55d920 100644 --- a/views/server.device.php +++ b/views/server.device.php @@ -5,17 +5,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -/* -$data = 'none;'; -foreach ($this->getDialPlanList() as $value) { - $data .= $value['id'].';'; -} -if (strlen($data) >0 ){ - $data = substr ($data,0,-1); -} - $this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90'); - * - */ + ?>
    @@ -26,7 +16,6 @@ if (strlen($data) >0 ){ echo $this->showGroup('sccp_dev_group_config', 1); echo $this->showGroup('sccp_dev_advconfig', 1); echo $this->showGroup('sccp_dev_softkey', 1); - echo $this->showGroup('sccp_dev_url', 1); echo $this->showGroup('sccp_hotline_config', 1); ?>
    diff --git a/views/server.url.php b/views/server.url.php new file mode 100644 index 0000000..ceb8a1f --- /dev/null +++ b/views/server.url.php @@ -0,0 +1,14 @@ + +
    + + +showGroup('sccp_dev_url', 1); +?> +