diff --git a/resources/switch.php b/resources/switch.php index faab9b8620..b1b97c17d6 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -942,7 +942,8 @@ if (!function_exists('xml_cdr_conf_xml')) { unset ($v_pass); //write the XML config file - $fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/xml_cdr.conf.xml","w"); + $switch_configuration_dir = !empty($_SESSION['switch']['conf']['dir']) ? $_SESSION['switch']['conf']['dir'] : '/etc/freeswitch'; + $fout = fopen($switch_configuration_dir . "/autoload_configs/xml_cdr.conf.xml","w"); fwrite($fout, $file_contents); fclose($fout);