Tidy up
Remove unused variables Close socket if not using
This commit is contained in:
parent
d5290f18cf
commit
0f9ebb8cd1
|
@ -23,7 +23,6 @@ abstract class Response extends IncomingMessage
|
|||
{
|
||||
parent::__construct($rawContent);
|
||||
$this->_events = array();
|
||||
$this->_eventsCount = 0;
|
||||
$this->_completed = $this->isSuccess();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,11 +52,17 @@ class srvinterface {
|
|||
}
|
||||
}
|
||||
if ($this->aminterface->status()) {
|
||||
// Ami is not hard disabled in Amiinterface __construct 54.
|
||||
// Ami is not hard disabled in Amiinterface __construct line 54.
|
||||
if ($this->aminterface->open()) {
|
||||
// Can open a connection. Now check compatibility with chan-sccp.
|
||||
// will return true if compatible.
|
||||
$this->ami_mode = $this->get_compatible_sccp(true)[1];
|
||||
if (!$this->get_compatible_sccp(true)[1]) {
|
||||
// Close the open socket as will not use
|
||||
$this->aminterface->close();
|
||||
} else {
|
||||
// is compatible so enable AMI mode
|
||||
$this->ami_mode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ global $version;
|
|||
global $srvinterface;
|
||||
global $mobile_hw;
|
||||
$mobile_hw = '0';
|
||||
global $useAmiInterface;
|
||||
|
||||
$class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface";
|
||||
if (!class_exists($class, false)) {
|
||||
|
|
Loading…
Reference in a new issue