From f2135f02310a73f7ced5e1c00bdd2f98a8bfa7e9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 5 Feb 2019 10:15:26 -0700 Subject: [PATCH] Update gateway_delete.php --- app/gateways/gateway_delete.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/gateways/gateway_delete.php b/app/gateways/gateway_delete.php index 8e16c3266c..becd0755f9 100644 --- a/app/gateways/gateway_delete.php +++ b/app/gateways/gateway_delete.php @@ -85,14 +85,12 @@ if (strlen($_GET["id"])>0) { //syncrhonize configuration save_gateway_xml(); - //delete the gateways from memcache + //clear the cache $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); - if ($fp) { - $hostname = trim(event_socket_request($fp, 'api switchname')); - $switch_cmd = "memcache delete configuration:sofia.conf:".$hostname; - $switch_result = event_socket_request($fp, 'api '.$switch_cmd); - } - + $hostname = trim(event_socket_request($fp, 'api switchname')); + $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) { @@ -117,4 +115,4 @@ if (strlen($_GET["id"])>0) { header("Location: gateways.php"); return; -?> \ No newline at end of file +?>