Fix. Delete some keys from memcache

This commit is contained in:
Alexey Melnichuk 2015-08-24 10:34:33 +04:00
parent c7c173f674
commit c19cd89bc5
5 changed files with 13 additions and 8 deletions

View File

@ -86,7 +86,7 @@ if (strlen($id) > 0) {
//clear the cache //clear the cache
$cache = new cache; $cache = new cache;
$cache->delete("memcache delete dialplan:".$_SESSION["context"]); $cache->delete("dialplan:".$_SESSION["context"]);
//synchronize configuration //synchronize configuration
save_dialplan_xml(); save_dialplan_xml();

View File

@ -329,7 +329,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//clear the cache //clear the cache
$cache = new cache; $cache = new cache;
$cache->delete("memcache delete dialplan:".$_SESSION["context"]); $cache->delete("dialplan:".$_SESSION["context"]);
//set the update message //set the update message
$_SESSION["message"] = $text['message-update']; $_SESSION["message"] = $text['message-update'];

View File

@ -337,7 +337,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//clear the cache //clear the cache
$cache = new cache; $cache = new cache;
$cache->delete("memcache delete dialplan:".$call_flow_context); $cache->delete("dialplan:".$call_flow_context);
//set the message //set the message
if ($action == "add") { if ($action == "add") {

View File

@ -379,7 +379,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//clear the cache //clear the cache
$cache = new cache; $cache = new cache;
$cache->delete("memcache delete directory:".$extension."@".$_SESSION['domain_name']); $cache->delete("directory:".$extension."@".$_SESSION['domain_name']);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$number_alias."@".$_SESSION['domain_name']);
}
//redirect the user //redirect the user
$_SESSION["message"] = $text['confirm-update']; $_SESSION["message"] = $text['confirm-update'];

View File

@ -35,6 +35,7 @@ include "root.php";
public $domain_name; public $domain_name;
public $extension_uuid; public $extension_uuid;
private $extension; private $extension;
private $number_alias;
public $forward_all_destination; public $forward_all_destination;
public $forward_all_enabled; public $forward_all_enabled;
private $dial_string; private $dial_string;
@ -58,6 +59,7 @@ include "root.php";
if (count($result) > 0) { if (count($result) > 0) {
foreach ($result as &$row) { foreach ($result as &$row) {
$this->extension = $row["extension"]; $this->extension = $row["extension"];
$this->number_alias = $row["number_alias"];
$this->accountcode = $row["accountcode"]; $this->accountcode = $row["accountcode"];
$this->toll_allow = $row["toll_allow"]; $this->toll_allow = $row["toll_allow"];
$this->outbound_caller_id_name = $row["outbound_caller_id_name"]; $this->outbound_caller_id_name = $row["outbound_caller_id_name"];
@ -155,10 +157,10 @@ include "root.php";
unset($sql); unset($sql);
//delete extension from memcache //delete extension from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $cache = new cache;
if ($fp) { $cache->delete("directory:".$this->extension."@".$this->domain_name);
$switch_cmd = "memcache delete directory:".$this->extension."@".$this->domain_name; if(strlen($this->number_alias) > 0){
$switch_result = event_socket_request($fp, 'api '.$switch_cmd); $cache->delete("directory:".$this->number_alias."@".$this->domain_name);
} }
} //function } //function