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