Call the XML writing function for those that need it. Clear memcache for those using XML on demand

This commit is contained in:
Mark Crane
2014-04-25 02:56:41 +00:00
parent 9feccaa075
commit 2b99cb286c
2 changed files with 22 additions and 2 deletions
+11
View File
@@ -58,6 +58,7 @@ else {
$result = $orm->find()->get();
foreach ($result as &$row) {
$dialplan_uuid = $row["dialplan_uuid"];
$destination_context = $row["destination_context"];
}
unset ($prep_statement);
@@ -83,6 +84,16 @@ else {
$db->exec(check_sql($sql));
unset($sql);
//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);
}
//redirect the user
$_SESSION["message"] = $text['message-delete'];
header("Location: destinations.php");