Update gateway_delete.php

This commit is contained in:
FusionPBX 2019-03-07 16:44:09 -07:00 committed by GitHub
parent 7ba3fd49c5
commit 3841c6f51c
1 changed files with 65 additions and 59 deletions

View File

@ -23,9 +23,12 @@
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('gateway_delete')) {
//access granted
}
@ -38,7 +41,8 @@ else {
$language = new text;
$text = $language->get();
if (strlen($_GET["id"])>0) {
//delete the gateway
if (is_array($_GET["id"])) {
//set the variable
$id = check_str($_GET["id"]);
@ -91,11 +95,13 @@ if (strlen($_GET["id"])>0) {
$cache = new cache;
$cache->delete("configuration:sofia.conf:".$hostname);
//rescan the sip profile to look for new or stopped gateways
//create the event socket connection and send a command
if (!$fp) {
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
}
//rescan the sip profile to look for new or stopped gateways
if ($fp) {
//send the api commandover event socket
$cmd = 'api sofia profile '.$profile.' rescan';