Fix. Clear the cache when callcenter config changed.

This commit is contained in:
Alexey Melnichuk
2015-09-28 12:10:31 +04:00
parent b374e5bdc5
commit 87441198b1
6 changed files with 20 additions and 2 deletions

View File

@@ -86,6 +86,7 @@ if (count($_GET)>0) {
//synchronize configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
//redirect the browser
$_SESSION["message"] = $text['message-delete'];

View File

@@ -264,6 +264,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//syncrhonize configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
$_SESSION["message"] = $text['message-add'];
header("Location: call_center_agents.php");
@@ -291,7 +292,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql);
//syncrhonize configuration
save_call_center_xml();
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
$_SESSION["message"] = $text['message-update'];
header("Location: call_center_agents.php");

View File

@@ -87,9 +87,11 @@ if (strlen($id) > 0) {
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION["context"]);
remove_config_from_cache('configuration:callcenter.conf');
//synchronize configuration
save_dialplan_xml();
save_call_center_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;

View File

@@ -257,6 +257,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//syncrhonize the configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
//delete the dialplan context from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
@@ -326,6 +327,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//synchronize the configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
//clear the cache
$cache = new cache;
@@ -393,6 +395,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//syncrhonize configuration
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
}
//redirect

View File

@@ -111,7 +111,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql);
//syncrhonize configuration
save_call_center_xml();
save_call_center_xml();
remove_config_from_cache('configuration:callcenter.conf');
//look up queue uuid by queue name (ugh)
$sql = "select call_center_queue_uuid from v_call_center_queues where queue_name = '".$queue_name."'";

View File

@@ -158,6 +158,15 @@ function byte_convert($bytes, $decimals = 2) {
return $formattedbytes;
}
function remove_config_from_cache($name) {
$cache = new cache;
$cache->delete($name);
$hostname = trim(event_socket_request_cmd('api switchname'));
if($hostname){
$cache->delete($name . ':' . $hostname);
}
}
function ListFiles($dir) {
if($dh = opendir($dir)) {
$files = Array();