Fix call recordings maintenance path (#7335)

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

View File

@ -482,7 +482,7 @@ if (!class_exists('call_recordings')) {
$domain_settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]);
//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
$retention_days = $domain_settings->get('call_recordings', 'filesystem_retention_days', '');
@ -492,8 +492,8 @@ if (!class_exists('call_recordings')) {
$retention_days = intval($retention_days);
//get list of mp3 and wav files
$mp3_files = glob("$call_recording_location/$domain_name/*/archive/*.mp3");
$wav_files = glob("$call_recording_location/$domain_name/*/archive/*.wav");
$mp3_files = glob("$call_recording_location/$domain_name/archive/*/*/*/*.mp3");
$wav_files = glob("$call_recording_location/$domain_name/archive/*/*/*/*.wav");
//combine to single array
$domain_call_recording_files = array_merge($mp3_files, $wav_files);
@ -506,7 +506,7 @@ if (!class_exists('call_recordings')) {
//remove the file when it is older
if (unlink($file)) {
//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 {
//log failure
maintenance_service::log_write(self::class, "Unable to remove $file", $domain_uuid, maintenance_service::LOG_ERROR);