clear memcache correctly when saving a call flow

This commit is contained in:
Mark Crane 2014-05-24 14:15:18 +00:00
parent ffa99a7620
commit b1dc620fce
1 changed files with 17 additions and 17 deletions

View File

@ -222,9 +222,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$app_uuid = 'b1b70f85-6b42-429b-8c5a-60c8b02b7d14';
dialplan_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_name, $dialplan_order, $dialplan_context, $dialplan_enabled, $dialplan_description, $app_uuid);
//dialplan group 1
require_once "app/dialplan/resources/classes/dialplan.php";
//<condition destination_number="300" break="on-true"/>
$dialplan = new dialplan;
$dialplan->domain_uuid = $domain_uuid;
@ -345,19 +342,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//apply settings reminder
$_SESSION["reload_xml"] = true;
//delete the dialplan context from memcache
//delete the cache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$switch_cmd = "memcache delete dialplan:".$_SESSION["context"]."@".$_SESSION['domain_name'];
$switch_cmd = "memcache delete dialplan:".$call_flow_context;
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
//set the message
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
}
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
}
//redirect the browser
header("Location: call_flows.php");
return;
}