diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 652ec2ec13..53fa47cfb8 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -361,12 +361,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //synchronize the xml config save_dialplan_xml(); - //clear memcache - $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); - if ($fp) { - $switch_cmd = "memcache delete dialplan:".$destination_context; - $switch_result = event_socket_request($fp, 'api '.$switch_cmd); - } + //clear the cache + $cache = new cache; + $cache->delete("dialplan:".$destination_context); } //add or update the dialplan if the destination number is set diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index 958bb12273..e2abd8e1ef 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -155,7 +155,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //clear the cache $cache = new cache; - $cache->delete('dialplan:".$dialplan_context'); + $cache->delete("dialplan:".$dialplan_context); //synchronize the xml config save_dialplan_xml(); diff --git a/resources/classes/cache.php b/resources/classes/cache.php index 29903555b2..7f1b63ea71 100644 --- a/resources/classes/cache.php +++ b/resources/classes/cache.php @@ -39,7 +39,7 @@ class cache { $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { $command = "memcache set ".$key." ".$value; - $return = event_socket_request($fp, 'api '.$command); + return event_socket_request($fp, 'api '.$command); } else { return false; @@ -57,7 +57,7 @@ class cache { $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { $command = "memcache get ".$key; - $return = event_socket_request($fp, 'api '.$command); + return event_socket_request($fp, 'api '.$command); } else { return false; @@ -75,7 +75,7 @@ class cache { $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { $command = "memcache delete ".$key; - $return = event_socket_request($fp, 'api '.$command); + return event_socket_request($fp, 'api '.$command); } else { return false; @@ -92,7 +92,7 @@ class cache { $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { $command = "memcache flush"; - $return = event_socket_request($fp, 'api '.$command); + return event_socket_request($fp, 'api '.$command); } else { return false;