Add error message for chan-sccp compatibility
Ad error message in install if chan-sccp version is too low Minor formatting
This commit is contained in:
parent
ee0fda775e
commit
97c02f125f
|
@ -30,7 +30,10 @@ class aminterface
|
|||
{
|
||||
$driverNamespace = "\\FreePBX\\Modules\\Sccp_manager\\aminterface";
|
||||
|
||||
$drivers = array('Message' => 'Message.class.php', 'Response' => 'Response.class.php', 'Event' => 'Event.class.php');
|
||||
$drivers = array('Message' => 'Message.class.php',
|
||||
'Response' => 'Response.class.php',
|
||||
'Event' => 'Event.class.php'
|
||||
);
|
||||
foreach ($drivers as $key => $value) {
|
||||
$class = $driverNamespace . "\\" . $key;
|
||||
$driver = __DIR__ . "/aminterface/" . $value;
|
||||
|
@ -51,7 +54,14 @@ class aminterface
|
|||
$this->_socket = false;
|
||||
$this->_connect_state = false;
|
||||
$this->_error = array();
|
||||
$this->_config = array('host' => 'localhost', 'user' => '', 'pass' => '', 'port' => '5038', 'tsoket' => 'tcp://', 'timeout' => 30, 'enabled' => true);
|
||||
$this->_config = array('host' => 'localhost',
|
||||
'user' => '',
|
||||
'pass' => '',
|
||||
'port' => '5038',
|
||||
'tsoket' => 'tcp://',
|
||||
'timeout' => 30,
|
||||
'enabled' => true
|
||||
);
|
||||
$this->_eventListeners = array();
|
||||
$this->_incomingMsgObjectList = array();
|
||||
$this->_lastActionId = false;
|
||||
|
@ -70,31 +80,19 @@ class aminterface
|
|||
$this->load_subspace();
|
||||
}
|
||||
|
||||
if ($this->status()) {
|
||||
// Ami is not hard disabled in Amiinterface __construct line 54.
|
||||
if ($this->_config['enabled'] {
|
||||
// Ami is not hard disabled in __construct line 63.
|
||||
if ($this->open()) {
|
||||
// Can open a connection. Now check compatibility with chan-sccp.
|
||||
// will return true if compatible.
|
||||
if (!$this->get_compatible_sccp(true)[1]) {
|
||||
// Close the open socket as will not use
|
||||
$this->close();
|
||||
} else {
|
||||
// is compatible so enable AMI mode
|
||||
$this->ami_mode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
if ($this->_config['enabled']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function info()
|
||||
{
|
||||
$Ver = '13.0.4';
|
||||
|
|
|
@ -1149,7 +1149,7 @@ InstallDB_CreateSccpDeviceConfigView($sccp_compatible);
|
|||
InstallDB_updateDBVer($sccp_compatible);
|
||||
if ($chanSCCPWarning) {
|
||||
outn("<br>");
|
||||
outn("<font color='red'>Warning: Upgrade chan_sccp_b to use full ami functionality</font>");
|
||||
outn("<font color='red'>Error: installed version of chan-sccp is not compatible. Please upgrade chan-sccp</font>");
|
||||
}
|
||||
if (!$sccp_db_ver) {
|
||||
Setup_RealTime();
|
||||
|
|
|
@ -35,7 +35,11 @@ $info['dbinterface'] = $this->dbinterface->info();
|
|||
$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']);
|
||||
$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';
|
||||
|
@ -125,12 +129,6 @@ if ($cisco_tz['offset'] == 0) {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* Test Ok
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
if (!empty($this->info_warning)) {
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue