Merge pull request #1017 from moteus/no_default_domain

Change. Does not use `default` dialplan/directory.
This commit is contained in:
FusionPBX
2015-08-10 11:27:19 -06:00
5 changed files with 10 additions and 45 deletions
+4 -12
View File
@@ -192,18 +192,10 @@ include "root.php";
$file_default_path = $src_dir.'/dialplan/default.xml';
$file_default_contents = file_get_contents($file_default_path);
//prepare the file contents and the path
if (count($_SESSION['domains']) < 2) {
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number
$file_default_contents = str_replace("{v_domain}", 'default', $file_default_contents);
//set the file path
$file_path = $switch_dialplan_dir.'/default.xml';
}
else {
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number
$file_default_contents = str_replace("{v_domain}", $_SESSION['domain_name'], $file_default_contents);
//set the file path
$file_path = $switch_dialplan_dir.'/'.$_SESSION['domain_name'].'.xml';
}
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number
$file_default_contents = str_replace("{v_domain}", $_SESSION['domain_name'], $file_default_contents);
//set the file path
$file_path = $switch_dialplan_dir.'/'.$_SESSION['domain_name'].'.xml';
//write the default dialplan
$fh = fopen($file_path,'w') or die('Unable to write to '.$file_path.'. Make sure the path exists and permissons are set correctly.');
fwrite($fh, $file_default_contents);