time to store call recording files and CDR per domain

Mikeme

Member
Apr 26, 2021
191
4
18
39
As far as i understand according fusionpbx-maintenance code settings for keep CDR records and call recording files are for entire system and not per domain.
https://github.com/fusionpbx/fusion...debian/resources/backup/fusionpbx-maintenance

Since that, i'm asking; how to set per domain, for example, system settings will be to store both CDR and call recording files for 180 days but specific domain will saved for 364 days.

how it is possible?

also i found in "Default Settings" --> "CDR" -->"limit" which is set to 3000
is that limitation are for records of CDR recorders and call recording files?
 
Last edited:

Mikeme

Member
Apr 26, 2021
191
4
18
39
and one more question, the right locarion of "fusionpbx-maintenance" is in "/etc/cron.daily/" ?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,505
419
83
The fusionpbx-maintenance script is certainly more comprehensive now than it was when we used to use FusionPBX. The way you address your issue may depend how many domains you have that require a specific time period. If you only have a few then the way we addressed it may work for you.

For the specific domains where I needed a longer retention period, I would have a script that would run BEFORE the fusion-maintenance script and save the required recordings to a separate storage area, together with a csv extract of the relevant CDR records where applicable.

I believe the default settings for CDR limit is a display limit for the GUI - but I could be wrong.

/etc/cron.daily is OK but I used to like setting up a crontab for a specific user to execute the scripts precisely when and how I wanted them to run.
 

voipBull

Member
Dec 3, 2023
103
21
18
@Mikeme @Adrian Fretwell I think there's a more user friendly way of doing this now in FusionPBX. There's now this Maintenance application that controls the retention period for all the different stuff at system level, and there can be unique retention periods set for everything per domain as well.
 

whut

Active Member
Dec 23, 2022
246
27
28
When you use the fusion maintenance script you can easily adjust it to "delete CDRs, call recordings, etc at N days old except where the domain is X, Y, or Z. Delete "mikeme" domain CDRs and call recording at X days old" There are 12 items or more that fusion is maintaining out of the box with the maintenance script.
 
  • Like
Reactions: Mikeme

Mikeme

Member
Apr 26, 2021
191
4
18
39
When you use the fusion maintenance script you can easily adjust it to "delete CDRs, call recordings, etc at N days old except where the domain is X, Y, or Z. Delete "mikeme" domain CDRs and call recording at X days old" There are 12 items or more that fusion is maintaining out of the box with the maintenance
That was my thought, can you maybe post a simple updated script for address this issue?
 
Jan 9, 2018
159
16
18
54
For call recordings, we only have one customer where we keep it longer, so we adjusted the script like so:

Bash:
        find /mnt/nfs/recordings/*/archive/*  -not -path "*/<exception domain>/*" -name '*.wav' -mtime +$days_keep_call_recordings -exec rm {} \;
        find /mnt/nfs/recordings/*/archive/*  -not -path "*/<exception domain>/*" -name '*.mp3' -mtime +$days_keep_call_recordings -exec rm {} \;
        find /mnt/nfs/recordings/<exception domain>/archive/*  -name '*.wav' -mtime +$days_keep_call_recordings_ed -exec rm {} \;
        find /mnt/nfs/recordings/<exception domain>/archive/*  -name '*.mp3' -mtime +$days_keep_call_recordings_ed -exec rm {} \;
Replace <exception domain> with your domain, and note the different variable name in the last two lines. You'll need to create that up top.

For CDRs, we keep all of them much longer, so it isn't an issue. But if it was, you could do something similar in that section.

This doesn't scale easily, so if you have multiple domains with different requirements, definitely check out the new Maintenance app. I am pretty sure it supports domain-level settings.
 

whut

Active Member
Dec 23, 2022
246
27
28
The maintenance application does allow for domain level. When using it you will need to carefully review what it is handling and what your maintenance script is handling. Maintenance application keeping ABC domain call recordings for 365 days and maintenance script keeping for 180 will yield only 180 days for ABC domain without careful accounting.

You will need to account very carefully when using the maintenance script only as well. ABC 365 days, all others 180 days. Or ABC, DEF, GHI domains 365 days while all others are 180 days. Plan for the future too to make it as easy as possible to add additional domains to 365 days or 270 days or any other variations will be very good. Future self to thank current self
 
  • Like
Reactions: Jonathan Black
Jan 9, 2018
159
16
18
54
The maintenance application does allow for domain level. When using it you will need to carefully review what it is handling and what your maintenance script is handling. Maintenance application keeping ABC domain call recordings for 365 days and maintenance script keeping for 180 will yield only 180 days for ABC domain without careful accounting.

You will need to account very carefully when using the maintenance script only as well. ABC 365 days, all others 180 days. Or ABC, DEF, GHI domains 365 days while all others are 180 days. Plan for the future too to make it as easy as possible to add additional domains to 365 days or 270 days or any other variations will be very good. Future self to thank current self
VERY good points!