Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (if_group("superadmin")) { //access granted } else { echo "access denied"; exit; } //set the variables $profile = $_GET['profile']; $command = $_GET['cmd']; //create the event socket connection $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { //if reloadxml then run reloadacl, reloadxml and rescan the external profile for new gateways if ($command == "api reloadxml") { //reloadxml message::add(rtrim(event_socket_request($fp, $command)), 'alert'); unset($command); //clear the apply settings reminder $_SESSION["reload_xml"] = false; //rescan the external profile to look for new or stopped gateways $command = 'api sofia profile external rescan'; message::add(rtrim(event_socket_request($fp, $command)), 'alert'); unset($command); } //cache flush if ($command == "api cache flush") { $cache = new cache; $response = $cache->flush(); message::add($response, 'alert'); } //reloadacl if ($command == "api reloadacl") { message::add(rtrim(event_socket_request($fp, $command)), 'alert'); unset($command); } //sofia profile if (substr($command, 0, 17) == "api sofia profile") { message::add(($profile ? ''.$profile.': ' : null).rtrim(event_socket_request($fp, $command)), 'alert', 3000); } //close the connection fclose($fp); } //redirect the user header("Location: sip_status.php"); ?>