From dbb7acc5249c4816e4d81ddd4692173a07c03b46 Mon Sep 17 00:00:00 2001 From: PhantomVl Date: Tue, 26 Jun 2018 18:33:05 +0300 Subject: [PATCH] Bug Fix --- Sccp_manager.class.php | 11 +++++++---- Sccp_manager.inc/extconfigs.class.php | 2 +- conf/Sccp.class.php.v431 | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 1c7bc51..abd45a9 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -1524,8 +1524,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { function init_sccp_path() { global $db; global $amp_conf; - - $confDir = $amp_conf["ASTETCDIR"]; + $driver_revision = array('0' => '', '430' => '.v431', '431' => '.v431'); + + + $confDir = $amp_conf["ASTETCDIR"]; if (empty($this->sccppath["asterisk"])) { if (strlen($confDir) < 1) { $this->sccppath["asterisk"] = "/etc/asterisk"; @@ -1533,6 +1535,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $this->sccppath["asterisk"] = $confDir; } } + $ver_id = $this->srvinterface->get_compatible_sccp(); $driver = $this->FreePBX->Core->getAllDriversInfo(); $sccp_driver_replace= ''; @@ -1542,14 +1545,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { if (empty($driver['sccp']['Version'])) { $sccp_driver_replace = 'yes'; } else { - if ($driver['sccp']['Version'] != $this->sccp_driver_ver) { + if ($driver['sccp']['Version'] != $this->sccp_driver_ver.$driver_revision[$ver_id]) { $sccp_driver_replace = 'yes'; } } } - $this->sccpvalues['sccp_compatible'] = array('keyword' => 'compatible', 'data' => $this->srvinterface->get_compatible_sccp(), 'type' => '1', 'seq' => '99'); // $this->sccpvalues['sccp_compatible'] = '11'; + $this->sccpvalues['sccp_compatible'] = array('keyword' => 'compatible', 'data' => $ver_id, 'type' => '1', 'seq' => '99'); $this->sccppath = $this->extconfigs->validate_init_path($confDir, $this->sccpvalues, $sccp_driver_replace); diff --git a/Sccp_manager.inc/extconfigs.class.php b/Sccp_manager.inc/extconfigs.class.php index 8b1a546..151cf41 100644 --- a/Sccp_manager.inc/extconfigs.class.php +++ b/Sccp_manager.inc/extconfigs.class.php @@ -317,7 +317,7 @@ class extconfigs { $dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php'; if (!file_exists($dst) || $sccp_driver_replace == 'yes') { - $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst) . '.v' . $this->sccpvalues['sccp_compatible']['data']; + $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst) . '.v' . $db_vars['sccp_compatible']['data']; if (file_exists($src_path)) { copy($src_path, $dst); } else { diff --git a/conf/Sccp.class.php.v431 b/conf/Sccp.class.php.v431 index d89f319..5a75ef6 100644 --- a/conf/Sccp.class.php.v431 +++ b/conf/Sccp.class.php.v431 @@ -34,7 +34,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { "prettyName" => _("Sccp Custom Driver"), "shortName" => "SCCP", "description" => _("Sccp Device"), - "Version" => "11.3", + "Version" => "11.3.v431", "about" => "Sccp mysql class Base ver: 11.3, Sccp ver: 431" ); }