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.
This commit is contained in:
sdwru 2023-08-29 09:56:31 -07:00 committed by GitHub
parent 254d58f614
commit 3b617cb35c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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);