Fix call recordings maintenance path (#7334)

This commit is contained in:
frytimo 2025-03-25 17:44:20 -03:00 committed by GitHub
parent ba413775c7
commit 2ae77071e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -480,7 +480,7 @@
$domain_settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]); $domain_settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]);
//get the recording location for this domain //get the recording location for this domain
$call_recording_location = $domain_settings->get('switch', 'recordings', '/var/lib/freeswitch/storage/recordings') . '/default'; $call_recording_location = $domain_settings->get('switch', 'recordings', '/var/lib/freeswitch/recordings');
//get the retention days for this domain //get the retention days for this domain
$retention_days = $domain_settings->get('call_recordings', 'filesystem_retention_days', ''); $retention_days = $domain_settings->get('call_recordings', 'filesystem_retention_days', '');
@ -490,8 +490,8 @@
$retention_days = intval($retention_days); $retention_days = intval($retention_days);
//get list of mp3 and wav files //get list of mp3 and wav files
$mp3_files = glob("$call_recording_location/$domain_name/*/archive/*.mp3"); $mp3_files = glob("$call_recording_location/$domain_name/archive/*/*/*/*.mp3");
$wav_files = glob("$call_recording_location/$domain_name/*/archive/*.wav"); $wav_files = glob("$call_recording_location/$domain_name/archive/*/*/*/*.wav");
//combine to single array //combine to single array
$domain_call_recording_files = array_merge($mp3_files, $wav_files); $domain_call_recording_files = array_merge($mp3_files, $wav_files);
@ -504,7 +504,7 @@
//remove the file when it is older //remove the file when it is older
if (unlink($file)) { if (unlink($file)) {
//log success //log success
maintenance_service::log_write(self::class, "Removed $file from call_recordings", $domain_uuid); maintenance_service::log_write(self::class, "Removed $file from call_recordings older than $retention_days days", $domain_uuid);
} else { } else {
//log failure //log failure
maintenance_service::log_write(self::class, "Unable to remove $file", $domain_uuid, maintenance_service::LOG_ERROR); maintenance_service::log_write(self::class, "Unable to remove $file", $domain_uuid, maintenance_service::LOG_ERROR);