This commit is contained in:
markjcrane
2015-08-25 11:58:17 -06:00
9 changed files with 238 additions and 78 deletions
@@ -86,7 +86,7 @@ if (strlen($id) > 0) {
//clear the cache
$cache = new cache;
$cache->delete("memcache delete dialplan:".$_SESSION["context"]);
$cache->delete("dialplan:".$_SESSION["context"]);
//synchronize configuration
save_dialplan_xml();
+1 -1
View File
@@ -329,7 +329,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//clear the cache
$cache = new cache;
$cache->delete("memcache delete dialplan:".$_SESSION["context"]);
$cache->delete("dialplan:".$_SESSION["context"]);
//set the update message
$_SESSION["message"] = $text['message-update'];
+1 -1
View File
@@ -337,7 +337,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//clear the cache
$cache = new cache;
$cache->delete("memcache delete dialplan:".$call_flow_context);
$cache->delete("dialplan:".$call_flow_context);
//set the message
if ($action == "add") {
+4 -1
View File
@@ -379,7 +379,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//clear the cache
$cache = new cache;
$cache->delete("memcache delete directory:".$extension."@".$_SESSION['domain_name']);
$cache->delete("directory:".$extension."@".$_SESSION['domain_name']);
if(strlen($number_alias) > 0){
$cache->delete("directory:".$number_alias."@".$_SESSION['domain_name']);
}
//redirect the user
$_SESSION["message"] = $text['confirm-update'];
+6 -4
View File
@@ -35,6 +35,7 @@ include "root.php";
public $domain_name;
public $extension_uuid;
private $extension;
private $number_alias;
public $forward_all_destination;
public $forward_all_enabled;
private $dial_string;
@@ -58,6 +59,7 @@ include "root.php";
if (count($result) > 0) {
foreach ($result as &$row) {
$this->extension = $row["extension"];
$this->number_alias = $row["number_alias"];
$this->accountcode = $row["accountcode"];
$this->toll_allow = $row["toll_allow"];
$this->outbound_caller_id_name = $row["outbound_caller_id_name"];
@@ -155,10 +157,10 @@ include "root.php";
unset($sql);
//delete extension 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 directory:".$this->extension."@".$this->domain_name;
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$cache = new cache;
$cache->delete("directory:".$this->extension."@".$this->domain_name);
if(strlen($this->number_alias) > 0){
$cache->delete("directory:".$this->number_alias."@".$this->domain_name);
}
} //function
@@ -46,7 +46,7 @@
<action application="set" data="record_session=true" inline="true"/>
</condition>
<condition field="${record_session}" expression="^true$">
<action application="set" data="api_on_answer=uuid_record ${uuid} start ${recordings_dir}/${domain_name}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.${record_ext}"/>
<action application="export" data="nolocal:api_on_answer=uuid_record ${uuid} start ${recordings_dir}/${domain_name}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.${record_ext}"/>
</condition>
</extension>
</context>
+11 -2
View File
@@ -93,16 +93,25 @@ if ($_GET['a'] == "download") {
}
//get the gateways
$sql = "select g.domain_uuid, g.gateway, g.gateway_uuid, d.domain_name from v_gateways as g, v_domains as d ";
$sql .= "where d.domain_uuid = g.domain_uuid ";
$sql = "select g.domain_uuid, g.gateway, g.gateway_uuid, d.domain_name ";
$sql .= "from v_gateways as g left outer join v_domains as d on d.domain_uuid = g.domain_uuid";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$gateways = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
if ($fp) {
$hostname = trim(event_socket_request($fp, 'api switchname'));
}
//get the sip profiles
$sql = "select sip_profile_name from v_sip_profiles ";
$sql .= "where sip_profile_enabled = 'true' ";
if ($hostname) {
$sql .= "and (sip_profile_hostname = '" . check_str($hostname) . "' ";
$sql .= "or sip_profile_hostname = '' ";
$sql .= "or sip_profile_hostname is null ) ";
}
$sql .= "order by sip_profile_name asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();