Fix issue 591 where the dialplan xml file was not including the dialplan directory

This commit is contained in:
Mark Crane
2014-05-03 00:49:11 +00:00
parent 74ae6fc900
commit 03f376be02
2 changed files with 4 additions and 4 deletions

View File

@@ -63,12 +63,12 @@
//prepare the file contents and the path
//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['context'], $file_default_contents);
$file_default_contents = str_replace("{v_domain}", $context, $file_default_contents);
//set the file path
$file_path = $_SESSION['switch']['conf']['dir'].'/dialplan/'.$_SESSION['context'].'.xml';
$file_path = $_SESSION['switch']['conf']['dir'].'/dialplan/'.$context.'.xml';
//write the default dialplan
if (strlen($_SESSION['context']) > 0) {
if (!file_exists($file_path)) {
$fh = fopen($file_path,'w') or die('Unable to write to '.$file_path.'. Make sure the path exists and permissions are set correctly.');
fwrite($fh, $file_default_contents);
fclose($fh);