diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index f1e69a4..c08e21e 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -747,7 +747,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $this->srvinterface->sccpDeviceReset($idv); } } - return array('status' => true, 'table_reload' => true, 'message' => 'HW is Delete ! '); + return array('status' => true, 'table_reload' => true, 'message' => 'Hardware device has been deleted! '); } break; case 'create_hw_tftp': diff --git a/Sccp_manager.inc/aminterface/Message.class.php b/Sccp_manager.inc/aminterface/Message.class.php index d7193c4..f28f53d 100644 --- a/Sccp_manager.inc/aminterface/Message.class.php +++ b/Sccp_manager.inc/aminterface/Message.class.php @@ -402,7 +402,7 @@ class SCCPDeviceRestartAction extends ActionMessage public function __construct($DeviceName, $Type = "restart") { parent::__construct('SCCPDeviceRestart'); - $this->setResponseHandler("SCCPGeneric"); + $this->setResponseHandler("Generic"); if (empty($Type)) { $Type = "restart"; } diff --git a/Sccp_manager.inc/aminterface/Response.class.php b/Sccp_manager.inc/aminterface/Response.class.php index 7efc69e..7362509 100644 --- a/Sccp_manager.inc/aminterface/Response.class.php +++ b/Sccp_manager.inc/aminterface/Response.class.php @@ -19,8 +19,10 @@ abstract class Response extends IncomingMessage public function __construct($rawContent) { + parent::__construct($rawContent); $this->_events = array(); +// this logic is false - even if we have an error, we will not get anymore data, so is completed. $this->_completed = $this->isSuccess(); } @@ -98,9 +100,13 @@ class Generic_Response extends Response { public function __construct($rawContent) { + // Only used for self contained responses. parent::__construct($rawContent); // add dummy closing event $this->_events['ClosingEvent'] = new ResponseComplete_Event($rawContent); + $this->_completed = true; + $this->eventListIsCompleted = true; + } } @@ -250,7 +256,7 @@ class SCCPGeneric_Response extends Response if (empty($_rawtable)) { return $result;} foreach ($_rawtable as $_row) { $all_key_ok = true; - // No need to test if $_fkey is arrray as array required + // No need to test if $_fkey is array as array required foreach ($_fkey as $_fid) { if (empty($_row[$_fid])) { $all_key_ok = false; diff --git a/Sccp_manager.inc/aminterface/aminterface.class.php b/Sccp_manager.inc/aminterface/aminterface.class.php index 008bf30..0389914 100644 --- a/Sccp_manager.inc/aminterface/aminterface.class.php +++ b/Sccp_manager.inc/aminterface/aminterface.class.php @@ -387,10 +387,7 @@ class aminterface $result = array(); if ($this->_connect_state) { $_action = new \FreePBX\modules\Sccp_manager\aminterface\SCCPShowDevicesAction(); - $_res = $this->send($_action)->getResult(); - foreach ($_res as $key => $value) { - $result[$key]['name'] = $key; - } + $result = $this->send($_action)->getResult(); } return $result; } diff --git a/Sccp_manager.inc/dbinterface.class.php b/Sccp_manager.inc/dbinterface.class.php index 5192647..bb5f234 100644 --- a/Sccp_manager.inc/dbinterface.class.php +++ b/Sccp_manager.inc/dbinterface.class.php @@ -308,7 +308,7 @@ class dbinterface $stmt = $dbh->prepare('UPDATE ' . $table_name . ' SET ' . $sql_var . ' WHERE ' . $sql_key); break; case 'replace': - $stmt = $dbh->prepare('REPLACE INTO ' . $table_name . ' VALUES ' . $sql_var); + $stmt = $dbh->prepare('REPLACE INTO ' . $table_name . ' SET ' . $sql_var); break; // no default mode - must be explicit. } diff --git a/Sccp_manager.inc/extconfigs.class.php b/Sccp_manager.inc/extconfigs.class.php index d88d078..506126b 100644 --- a/Sccp_manager.inc/extconfigs.class.php +++ b/Sccp_manager.inc/extconfigs.class.php @@ -413,7 +413,7 @@ class extconfigs return $base_config; } - + // Type declaration in below function is incompatible with PHP 5 public function validate_RealTime( string $connector ) { // This method only checks that asterisk is correctly configured for Realtime diff --git a/views/server.info.php b/views/server.info.php index 4b9d28c..b5c1fb0 100644 --- a/views/server.info.php +++ b/views/server.info.php @@ -86,6 +86,8 @@ if (empty($ast_realtime)) { } $info['RealTime'] = array('Version' => $rt_sccp, 'about' => $rt_info); } +// There are potential issues with string Type Declarations in PHP 5. +$info['PHP'] = array('Version' => phpversion(), 'about' => version_compare(phpversion(), '7.0.0', '>' ) ? 'OK' : 'PHP 7 Preferred - Please upgrade if possible'); if (empty($conf_realtime)) { $info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => '