Change Queue Recording Filename

By default, queues configured in FreePBX save the files in the “/var/spool/asterisk/monitor” directory, using the following logic:

This results in filenames like “q400-20121128-085759-1354111073.263109.WAV”

This method works fine, but results in massive numbers of files in one directory if you are doing any volume of call recording. To wit, we are up to 260,000 files in less than three years. As you can imagine, disk performance when retrieving recordings suffers as a result.

A better solution would be to store the recordings by month and by date, such that we end up with many directories with a few files in each, rather than one directory with a HUGE number of files in it.

Many have implemented shell scripts to move the files to folders by year, month, and date, which also works, but is unnecessarily cumbersome. It would be much easier to simply store the files by folder in the first place by changing the “Set(MONITOR FILENAME” instruction.

I would propose that the instruction be changed to something like:

If I have put it together correctly, that would result in calls for November 28, 2012 being stored in the directory “/var/spool/asterisk/monitor/2012-11/28/” with the same filename that is currently being used.

This could be accomplished today by overriding the queue entry, but that is less than elegant and might cause issues with updates to FreePBX.

Would it be possible to change the default, or barring that, add an option where we could specify a custom monitor filename for our queue(s)?


FreePBX 2.10 does all of this for you already so update to 2.10 and you will be all set.



Do you have details about the changes to the recordings, etc. in 2.10. I looked around and found this:

It doesn’t provide much specificity, and that would be nice before pulling the trigger on the update. In particular, I ran across this link, which makes me want to be certain about how extension settings will affect queue recordings.

In general, we record only queue calls, and the extensions are set to “On Demand”, IIRC, and I want to make sure I keep everything up to speed.

Thank you,


So, I didn’t wait for more information. Upgrade to 2.10 went OK, after a scary moment where the framework upgraded through 2.10.1, and seemed to hang while applying After that point I waited about 5-minutes to see if it would finish, but nothing. I opened a new tab and upgraded the rest of the modules. It looked hosed until I completely closed Firefox and reopened, at which point the new interface popped up and things looked good. Applied changes and Robert is your father’s brother.

So, I have perused the new interface, and I have installed the Call Recordings module, but I see nowhere to specify the filename of the queue recording.

I suppose I could create a call recording destination, and send all incoming queue calls there, but that seems a bit silly and overly complex. Am I missing something (likely) , or will I have to wait for this feature request?

Thank you,


Just go into queues and enable call recording and it will set the whole year/month/day directory structure up

Got it, Tony.

Thank you for your help.