Update dialplan.php
This commit is contained in:
parent
a413f35f70
commit
f0e02654b2
|
|
@ -232,7 +232,7 @@ include "root.php";
|
||||||
//set the row id
|
//set the row id
|
||||||
$x = 0;
|
$x = 0;
|
||||||
|
|
||||||
//check if the dialplan app uuid exists
|
//loop through each domain
|
||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
|
|
||||||
//get the array of xml files
|
//get the array of xml files
|
||||||
|
|
@ -247,9 +247,9 @@ include "root.php";
|
||||||
if (strlen($xml_string) > 0) {
|
if (strlen($xml_string) > 0) {
|
||||||
//replace the variables
|
//replace the variables
|
||||||
$length = (is_numeric($_SESSION["security"]["pin_length"]["var"])) ? $_SESSION["security"]["pin_length"]["var"] : 8;
|
$length = (is_numeric($_SESSION["security"]["pin_length"]["var"])) ? $_SESSION["security"]["pin_length"]["var"] : 8;
|
||||||
//$this->xml = str_replace("{v_context}", $this->default_context, $xml_string);
|
$xml_string = str_replace("{v_context}", $domain['domain_name'], $xml_string);
|
||||||
$this->xml = str_replace("{v_pin_number}", generate_password($length, 1), $xml_string);
|
$xml_string = str_replace("{v_pin_number}", generate_password($length, 1), $xml_string);
|
||||||
$this->xml = str_replace("{v_switch_recordings_dir}", $_SESSION['switch']['recordings']['dir'], $xml_string);
|
$xml_string = str_replace("{v_switch_recordings_dir}", $_SESSION['switch']['recordings']['dir'], $xml_string);
|
||||||
//convert the xml string to an xml object
|
//convert the xml string to an xml object
|
||||||
$xml = simplexml_load_string($xml_string);
|
$xml = simplexml_load_string($xml_string);
|
||||||
//convert to json
|
//convert to json
|
||||||
|
|
@ -284,15 +284,9 @@ include "root.php";
|
||||||
//check if the dialplan exists
|
//check if the dialplan exists
|
||||||
if (!$app_uuid_exists) {
|
if (!$app_uuid_exists) {
|
||||||
|
|
||||||
//set the dialplan_context
|
|
||||||
$dialplan_context = $dialplan['@attributes']['name'];
|
|
||||||
if ($dialplan_context == "{v_context}") {
|
|
||||||
$dialplan_context = $domain['domain_name'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//dialplan global
|
//dialplan global
|
||||||
if (isset($dialplan['extension']['@attributes']['global']) && $dialplan['extension']['@attributes']['global'] == "true") {
|
if (isset($dialplan['extension']['@attributes']['global']) && $dialplan['extension']['@attributes']['global'] == "true") {
|
||||||
$dialplan_global = true;
|
$dialplan_global = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$dialplan_global = false;
|
$dialplan_global = false;
|
||||||
|
|
@ -314,7 +308,7 @@ include "root.php";
|
||||||
$array['dialplans'][$x]['app_uuid'] = $dialplan['extension']['@attributes']['app_uuid'];
|
$array['dialplans'][$x]['app_uuid'] = $dialplan['extension']['@attributes']['app_uuid'];
|
||||||
$array['dialplans'][$x]['dialplan_name'] = $dialplan['extension']['@attributes']['name'];
|
$array['dialplans'][$x]['dialplan_name'] = $dialplan['extension']['@attributes']['name'];
|
||||||
$array['dialplans'][$x]['dialplan_number'] = $dialplan['extension']['@attributes']['number'];
|
$array['dialplans'][$x]['dialplan_number'] = $dialplan['extension']['@attributes']['number'];
|
||||||
$array['dialplans'][$x]['dialplan_context'] = $dialplan_context;
|
$array['dialplans'][$x]['dialplan_context'] = $dialplan['@attributes']['name'];
|
||||||
if (strlen($dialplan['extension']['@attributes']['destination']) > 0) {
|
if (strlen($dialplan['extension']['@attributes']['destination']) > 0) {
|
||||||
$array['dialplans'][$x]['dialplan_destination'] = $dialplan['extension']['@attributes']['destination'];
|
$array['dialplans'][$x]['dialplan_destination'] = $dialplan['extension']['@attributes']['destination'];
|
||||||
}
|
}
|
||||||
|
|
@ -413,14 +407,13 @@ include "root.php";
|
||||||
|
|
||||||
//increase the order number
|
//increase the order number
|
||||||
$order = $order + 5;
|
$order = $order + 5;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//update the session array
|
//update the session array
|
||||||
$_SESSION['upgrade']['app_defaults']['dialplans'][$domain['domain_name']][]['dialplan_name'] = $dialplan_name;
|
$_SESSION['upgrade']['app_defaults']['dialplans'][$domain['domain_name']][]['dialplan_name'] = $dialplan_name;
|
||||||
|
|
||||||
//increase the row number
|
//increase the row number
|
||||||
$x++;
|
$x++;
|
||||||
} //app_uuid exists
|
} //app_uuid exists
|
||||||
} //end foreach $xml_list
|
} //end foreach $xml_list
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue