Clear memcached when toggling on/off dialplans (#1717)
When clicking True/False link from the dialplan list (like outbound routers for examples), the change isn't effective until the cache expires. Full editing the dialplan entry (dialplan_detail_edit.php) does this right and clears the cache, I took the code from there.
This commit is contained in:
parent
9d8a237bcd
commit
3151b9b74a
|
|
@ -49,6 +49,13 @@ else {
|
|||
unset($sql);
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
}
|
||||
|
||||
//delete the dialplan context from 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:".$_SESSION["context"];
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
}
|
||||
|
||||
//set the http values as php variables
|
||||
$search = check_str($_REQUEST["search"]);
|
||||
|
|
@ -403,4 +410,4 @@ else {
|
|||
unset ($val);
|
||||
unset ($c);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue