Auto archive calls recorded by Asterisk in FreePBX

by: Moshe Brevda

One of my greatest gripes with call recording in Asterisk/FreePBX has always been the mess left behind in the monitor directory. There is a rarely know script bundled with FreePBX which is supposed to archive the call files in a year/month/day folder structure, but its rather hit or miss (it tries to match files to the cdr DB). While looking at a support ticket recently, I suddenly had a brainstorm as to how this can be accomplished in a simple and clean way.

I feel rather late to the party sharing this now, as the Recordings module (currently under active development) holds many promising surprises - including auto-archiving calls - and is due out in 2.10. Nevertheless, and for the time being, here is quick and simple way to get your calls recorded in a year/month/day format.

In Advanced Settings (your going to need Display Readonly Settings = true and Override Readonly Settings = true), for Override Call Recording Location enter the following:

${STRFTIME(${EPOCH},,%Y/%m/%d)}

Hit the little green submit button, and the orange Apply Changes bar. The next time you place a call that is recorded you should find it properly “archived” under the date the call was placed.

Happy talking!

UPDATE: to get variables parsed at call time (as apposed to when the dialplan is created), the $ prefix needs to be replaced with a ^. Update above.

UPDATE2: on second (3rd?) though, the original syntax was correct. Make sure your using FreePBX Core version 2.9.0.2 or greater!

UPDATE3: as alluded to above, this howto is absolute and unnecessary as of FreePBX 2.10, as this feature is BUILT IN!!!