diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 92aee4e..7945780 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -68,7 +68,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { // private $SCCP_LANG_DICTIONARY = 'SCCP-dictionary.xml'; // CISCO LANG file search in /tftp-path private $SCCP_LANG_DICTIONARY = 'be-sccp.jar'; // CISCO LANG file search in /tftp-path private $pagedata = null; - private $sccp_driver_ver = '11.21'; + private $sccp_driver_ver = '11.2'; private $tftpLang = array(); private $hint_context = '@ext-local'; /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Get it from Config !!! private $val_null = 'NONE'; /// REPLACE to null Field @@ -120,7 +120,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { // Load Advanced Form Constuctor Data - $xml_vars = __DIR__ . '/conf/sccpgeneral.xml.v'.$this->sccpvalues['sccp_comatable']['data']; + $xml_vars = __DIR__ . '/conf/sccpgeneral.xml.v'.$this->sccpvalues['sccp_compatible']['data']; if (!file_exists($xml_vars)) { $xml_vars = __DIR__ . '/conf/sccpgeneral.xml'; } @@ -1451,8 +1451,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { copy($filename, $dst_path . basename($filename)); } } - $this->sccpvalues['sccp_comatable'] = array('keyword' => 'sccp_comatable', 'data' => $this->srvinterface->get_comatable_sccp(), 'type' => '1', 'seq' => '99'); -// $this->sccpvalues['sccp_comatable'] = '11'; + + $this->sccpvalues['sccp_compatible'] = array('keyword' => 'compatible', 'data' => $this->srvinterface->get_compatible_sccp(), 'type' => '1', 'seq' => '99'); +// $this->sccpvalues['sccp_compatible'] = '11'; $driver = $this->FreePBX->Core->getAllDriversInfo(); $driver_replace = ''; @@ -1470,7 +1471,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php'; if (!file_exists($dst) || $driver_replace =='yes') { - $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst).'.v'.$this->sccpvalues['sccp_comatable']['data']; + $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst).'.v'.$this->sccpvalues['sccp_compatible']['data']; if (file_exists($src_path)) { copy($src_path, $dst); } else { @@ -1951,7 +1952,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { case "netlang": // Remove Key case "devlang": case "tftp_path": - case "sccp_comatable": + case "sccp_compatible": break; default: $this->sccp_conf_init['general'][$key] = $value['data']; diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index 1b5752d..ba716fd 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -125,8 +125,8 @@ class srvinterface { } return $ast_key; } - - public function get_comatable_sccp() { + + public function get_compatible_sccp() { $res = $this-> getChanSCCPVersion(); if (empty($res)) { $res = $this-> getChanSCCPVersion(); @@ -135,9 +135,9 @@ class srvinterface { return 0; } if ($res["vCode"] >= 431) { - return '4.3.1'; + return 431; } else { - return '4.3.0'; + return 430; } // return $res["vCode"]; } @@ -222,6 +222,7 @@ class srvinterface { } } if (array_key_exists("RevisionNum",$metadata)) { + $result["RevisionNum"]=$metadata["RevisionNum"]; if ($metadata["RevisionNum"] >= "10403") { // new method, RevisionNum is incremental $result["vCode"] = 432; } diff --git a/conf/Sccp.class.php.v4.3.1 b/conf/Sccp.class.php.v431 similarity index 100% rename from conf/Sccp.class.php.v4.3.1 rename to conf/Sccp.class.php.v431 diff --git a/conf/sccpgeneral.xml.v4.3.1 b/conf/sccpgeneral.xml.v431 similarity index 99% rename from conf/sccpgeneral.xml.v4.3.1 rename to conf/sccpgeneral.xml.v431 index da0633f..0ec23c1 100644 --- a/conf/sccpgeneral.xml.v4.3.1 +++ b/conf/sccpgeneral.xml.v431 @@ -31,7 +31,7 @@ and open the template in the editor. Base Version before all crash :-) - + diff --git a/install.php b/install.php index fb665f2..8371446 100644 --- a/install.php +++ b/install.php @@ -40,7 +40,7 @@ function astman_retrieveJSFromMetaData($astman, $segment = "") { } } -function Get_DB_config($sccp_comatable) { +function Get_DB_config($sccp_compatible) { $db_config_v0 = array( 'sccpdevmodel' => array( 'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"), @@ -238,7 +238,7 @@ $db_config_v3 = array( 'dnd' => array('create' => "enum('off','reject','silent','user') NOT NULL default 'reject'", 'modify' => "enum('off','reject','silent','user')", 'def_modify' =>"reject") ) ); - if ($sccp_comatable >= 11) { + if ($sccp_compatible >= 430) { return $db_config_v3; } else { return $db_config_v0; @@ -250,7 +250,7 @@ $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENG $table_req = array('sccpdevice', 'sccpline', 'buttonconfig'); $ss = FreePBX::create()->Sccp_manager; $astman = FreePBX::create()->astman; -$sccp_comatable = 0; +$sccp_compatible = 0; //$db_config = $db_config_v0; $db_config = ''; @@ -300,9 +300,9 @@ function CheckChanSCCPСomatable() { if (!$astman) { ie_freepbx('No asterisk manager connection provided!. Installation Failed'); } - $sccp_comatable = $srvinterface->get_comatable_sccp(); - outn("
  • " . _("Sccp model Compatable code : ") . $sccp_comatable . "
  • "); - return $sccp_comatable; + $sccp_compatible = $srvinterface->get_compatible_sccp(); + outn("
  • " . _("Sccp model Compatable code : ") . $sccp_compatible . "
  • "); + return $sccp_compatible; } @@ -556,11 +556,11 @@ function InstallDB_createButtonConfigTrigger() { return true; } -function InstallDB_CreateSccpDeviceConfigView($sccp_comatable) { +function InstallDB_CreateSccpDeviceConfigView($sccp_compatible) { global $db; outn("
  • " . _("(Re)Create sccpdeviceconfig view") . "
  • "); $sql = ""; - if ($sccp_comatable < 11) { + if ($sccp_compatible < 431) { $sql= " CREATE OR REPLACE ALGORITHM = MERGE @@ -670,15 +670,15 @@ function Setup_RealTime() { CheckSCCPManagerDBTables($table_req); CheckPermissions(); CheckAsteriskVersion(); -$sccp_comatable = CheckChanSCCPСomatable(); -$db_config = Get_DB_config($sccp_comatable); +$sccp_compatible = CheckChanSCCPСomatable(); +$db_config = Get_DB_config($sccp_compatible); InstallDB_sccpsettings(); InstallDB_sccpdevmodel(); InstallDB_updateSchema($db_config); InstallDB_fillsccpdevmodel(); InstallDB_updateSccpDevice(); InstallDB_createButtonConfigTrigger(); -InstallDB_CreateSccpDeviceConfigView($sccp_comatable); +InstallDB_CreateSccpDeviceConfigView($sccp_compatible); Setup_RealTime(); outn("
    "); diff --git a/views/server.setting.php b/views/server.setting.php index 30fffed..46329f5 100644 --- a/views/server.setting.php +++ b/views/server.setting.php @@ -5,7 +5,7 @@ * and open the template in the editor. */ // vim: set ai ts=4 sw=4 ft=phtml: -// print_r($this->sccpvalues['sccp_comatable']); +// print_r($this->sccpvalues['sccp_compatible']); // print_r($this->sccpvalues); // $id_name = 'SEP000A8A5C5F25'; // print_r($this->srvinterface->getChanSCCPVersion());