diff --git a/app/dialplan/app_defaults.php b/app/dialplan/app_defaults.php index 541b602574..909cfd57d6 100644 --- a/app/dialplan/app_defaults.php +++ b/app/dialplan/app_defaults.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2014 the Initial Developer. All Rights Reserved. Contributor(s): @@ -68,9 +68,11 @@ $file_path = $_SESSION['switch']['conf']['dir'].'/dialplan/'.$_SESSION['context'].'.xml'; //write the default dialplan - $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); + if (strlen($_SESSION['context']) > 0) { + $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); + } } //get the $apps array from the installed apps from the core and mod directories