How do I relate CDR with Call Recording

I have FreePBX - Distro install

My Call recording file name looks like this:


How do I relate which call recording file is for which CDR record? Right now, we are doing guesswork based on {Exten# - CID - Date - Time} but I don’t think this is right.

Please assist.


The field uniqueid is the date in seconds , period, number of sessions since asterisk started, in the filename ‘,external-1010-2127551234-20221021-183125-1666402285.282801.mp3’

date -u -d @1666402285.282801
Sat 22 Oct 2022 01:31:25 AM UTC

suggesting you are in the 'central timezone ( -7 hours)

mysql asteriskcdrdb -e "select from cdr WHERE uniqueid='1666402285.282801'"
1 Like

The recording is associated to the CDRs in the CDR reports. The cdr table has a field called recordingfile the recording is populated with.

Thanks @dicko @BlazeStudios
This is of great help !!

1 Like

Do not forget to delete files after a specific time has elapsed.
This root crontab entry substituts files older than 30 day by a link to standard wav-file, which I extra recorded. (was an earlier recommendation from Dicko and/or BlszeStudios):
@daily find /var/spool/asterisk/monitor/ -mtime +30 -exec ln -sf /var/lib/asterisk/sounds/de_DE/custom/thisfilehasbeenpurged.wav {} ;

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.