Call the XML writing function for those that need it. Clear memcache for those using XML on demand
This commit is contained in:
@@ -58,6 +58,7 @@ else {
|
|||||||
$result = $orm->find()->get();
|
$result = $orm->find()->get();
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
$dialplan_uuid = $row["dialplan_uuid"];
|
$dialplan_uuid = $row["dialplan_uuid"];
|
||||||
|
$destination_context = $row["destination_context"];
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
@@ -83,6 +84,16 @@ else {
|
|||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($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
|
//redirect the user
|
||||||
$_SESSION["message"] = $text['message-delete'];
|
$_SESSION["message"] = $text['message-delete'];
|
||||||
header("Location: destinations.php");
|
header("Location: destinations.php");
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
//add or update the database
|
//add or update the database
|
||||||
if ($_POST["persistformvar"] != "true") {
|
if ($_POST["persistformvar"] != "true") {
|
||||||
|
|
||||||
|
|
||||||
//get the array
|
//get the array
|
||||||
$dialplan_details = $_POST["dialplan_details"];
|
$dialplan_details = $_POST["dialplan_details"];
|
||||||
|
|
||||||
@@ -221,7 +220,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
if (strlen($destination_response['uuid']) > 0) {
|
if (strlen($destination_response['uuid']) > 0) {
|
||||||
$destination_uuid = $destination_response['uuid'];
|
$destination_uuid = $destination_response['uuid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//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
|
//redirect the user
|
||||||
if ($action == "add") {
|
if ($action == "add") {
|
||||||
$_SESSION["message"] = $text['message-add'];
|
$_SESSION["message"] = $text['message-add'];
|
||||||
|
|||||||
Reference in New Issue
Block a user