From 3b617cb35ca683bd9977357acf8de2b7682361db Mon Sep 17 00:00:00 2001 From: sdwru <40401953+sdwru@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:56:31 -0700 Subject: [PATCH] Update switch.php (#6785) Running install.php the first time after a manual (not using script) install on Debian 11, there is a failure due to $_SESSION['switch']['conf']['dir'] not yet existing. Subsequent installs will work. It's only on the first install that it fails. There may be better ways but this is the fix I came up with that works for me. --- resources/switch.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);