This commit is contained in:
PhantomVl 2018-06-26 18:33:05 +03:00
parent 5d2944ab7a
commit dbb7acc524
3 changed files with 9 additions and 6 deletions

View file

@ -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);

View file

@ -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 {

View file

@ -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"
);
}