Get event socket details from the settings class

This commit is contained in:
FusionPBX 2023-09-16 02:00:57 -06:00 committed by GitHub
parent c6d966395e
commit fb8b6db71d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 14 deletions

View File

@ -27,22 +27,15 @@
*/
//includes files
require_once __DIR__ . "/require.php";
require_once __DIR__ . "/require.php";
//get the event socket information
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/settings/app_config.php")) {
if ((! isset($_SESSION['event_socket_ip_address'])) or empty($_SESSION['event_socket_ip_address'])) {
$sql = "select * from v_settings ";
$database = new database;
$row = $database->select($sql, null, 'row');
if (!empty($row)) {
$_SESSION['event_socket_ip_address'] = $row["event_socket_ip_address"];
$_SESSION['event_socket_port'] = $row["event_socket_port"];
$_SESSION['event_socket_password'] = $row["event_socket_password"];
}
unset($sql, $row);
}
}
if (empty($_SESSION['event_socket_ip_address'])) {
$setting = new settings(["category" => "switch"]);
$_SESSION['event_socket_ip_address'] = $setting->get('switch', 'event_socket_ip_address');
$_SESSION['event_socket_port'] = $setting->get('switch', 'event_socket_port');
$_SESSION['event_socket_password'] = $setting->get('switch', 'event_socket_password');
}
function event_socket_create($host, $port, $password) {
$esl = new event_socket;