Test for chan_sccp_b version compatibility

SoftKeySets fails with chan_sccp-b prior to revision number 11048.

Check the version with the installer, and subsequently to ensure do not get exception.
This commit is contained in:
steve-lad 2021-02-07 14:48:49 +01:00 committed by Diederik de Groot
parent 9d29d11a08
commit 92ca19ed41
No known key found for this signature in database
GPG key ID: AFA728250A1BECD6
4 changed files with 12 additions and 11 deletions

View file

@ -306,7 +306,7 @@ class oldinterface
$result["vCode"] = 433;
} else {
$result["vCode"] = 430;
}
}
}
}

View file

@ -14,8 +14,8 @@ class srvinterface {
var $error;
var $_info;
var $ami_mode = false;
var $useAmiInterface = true;
var $ami_mode;
var $useAmiForSoftKeys = true;
public function __construct($parent_class = null) {
$this->paren_class = $parent_class;
@ -231,11 +231,11 @@ class srvinterface {
default:
$retval = 430;
}
if ($res['RevisionNum'] < 11063) {
$this->useAmiInterface = false;
if ($res['RevisionNum'] < 11048) {
$this->useAmiForSoftKeys = false;
}
if ($revNumComp) {
return array($retval, $this->useAmiInterface);
return array($retval, $this->useAmiForSoftKeys);
}
return $retval;
}
@ -249,7 +249,7 @@ class srvinterface {
}
public function sccp_list_keysets() {
if ($this->ami_mode) {
if (($this->ami_mode) && ($this->useAmiForSoftKeys)){
return $this->aminterface->sccp_list_keysets();
} else {
return $this->oldinterface->sccp_list_keysets();

View file

@ -17,6 +17,7 @@ global $astman;
global $version;
global $srvinterface;
global $mobile_hw;
global $useAmiForSoftKeys;
$mobile_hw = '0';
$class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface";
@ -1003,9 +1004,10 @@ if (!$sccp_db_ver) {
InstallDB_createButtonConfigTrigger();
InstallDB_CreateSccpDeviceConfigView($sccp_compatible);
InstallDB_updateDBVer($sccp_compatible);
dbug('chanSCCPWarning',$chanSCCPWarning);
if ($chanSCCPWarning) {
outn("<br>");
outn("<font color='red'>Warning: Upgrade chan_sccp_b to use full ami functionality</font>");
outn("<br>");
outn("<font color='red'>Warning: Upgrade chan_sccp_b to use full ami functionality</font>");
}
if (!$sccp_db_ver) {
Setup_RealTime();

View file

@ -36,8 +36,7 @@ $info['aminterface'] = $this->aminterface->info();
$info['XML'] = $this->xmlinterface->info();
$info['sccp_class'] = $driver['sccp'];
$info['Core_sccp'] = array('Version' => $core['Version'], 'about' => 'Sccp ver.' . $core['Version'] . ' r' . $core['vCode'] . ' Revision :' . $core['RevisionNum'] . ' Hash :' . $core['RevisionHash']);
if (!$this->srvinterface->useAmiInterface) {
$info['aminterface']['about'] .= ' -- Disabled';
if (!$this->srvinterface->useAmiForSoftKeys) {
$info['Core_sccp'] = array('Version' => $core['Version'], 'about' => 'Sccp ver.' . $core['Version'] . ' r' . $core['vCode'] . ' Revision :' . $core['RevisionNum'] . ' Hash :' . $core['RevisionHash'] . ' ----Warning: Upgrade chan_sccp to use full ami functionality');
}
$info['Asterisk'] = array('Version' => FreePBX::Config()->get('ASTVERSION'), 'about' => 'Asterisk.');