Use settings class for app_defaults.php

This commit is contained in:
FusionPBX
2023-09-16 00:22:12 -06:00
committed by GitHub
parent 81b92075a9
commit c6d966395e
17 changed files with 44 additions and 228 deletions
+7 -7
View File
@@ -25,9 +25,9 @@
*/
//if the recordings directory doesn't exist then create it
if (!empty($_SESSION['switch']['recordings']['dir']) && !empty($domain_name)) {
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) {
mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name."/archive", 0770, true);
if (!empty($setting->get('switch','recordings')) && !empty($domain_name)) {
if (!is_readable($setting->get('switch','recordings')."/".$domain_name)) {
mkdir($setting->get('switch','recordings')."/".$domain_name."/archive", 0770, true);
}
}
@@ -35,7 +35,7 @@
if ($domains_processed == 1) {
//if base64, populate from existing recording files, then remove
if (!empty($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] == 'base64') {
if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') == 'base64') {
//get recordings without base64 in db
$sql = "select recording_uuid, domain_uuid, recording_filename ";
$sql .= "from v_recordings ";
@@ -51,7 +51,7 @@
$recording_filename = $row['recording_filename'];
//set recording directory
$recording_directory = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name;
$recording_directory = $setting->get('switch','recordings').'/'.$domain_name;
//encode recording file (if exists)
if (file_exists($recording_directory.'/'.$recording_filename)) {
@@ -79,7 +79,7 @@
unset($sql, $result, $row);
}
//if not base64, decode to local files, remove base64 data from db
else if (!empty($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] != 'base64') {
else if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') != 'base64') {
//get recordings with base64 in db
$sql = "select recording_uuid, domain_uuid, recording_filename, recording_base64 ";
$sql .= "from v_recordings ";
@@ -95,7 +95,7 @@
$recording_base64 = $row['recording_base64'];
//set recording directory
$recording_directory = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name;
$recording_directory = $setting->get('switch','recordings').'/'.$domain_name;
//remove local file, if any
if (file_exists($recording_directory.'/'.$recording_filename)) {