Change call recording location

Oh wow. I feel stupid, sorry about that. I think I have what you are looking for, this is the dbug log when refreshing the call log page

2014-Aug-06 16:20:57 /var/www/html/admin/modules/cxpanel/brand.php:3
[WARNING]: file_get_contents(/etc/schmooze/operator-panel-brand): failed to open stream: No such file or directory

2014-Aug-06 16:20:58 /var/www/html/admin/modules/endpointman/ari/modules/phonesettings.module:49
[NOTICE]: Undefined variable: ARI_ADMIN_USERNAME

None of your recordings even think a recording happened. Thats all I can say sorry.

Thanks for the help. I think I’ll just put the storage back to default and leave it for now.

Thanks again. I appreciate it!

There are too many vagaries as to how FreePBX treats legacy directory settings in it’s various modules, I suspect the venerable “/var/www/html/recordings”

You could try the underlying non “clever” linux method of :-

rsync -av --progress /var/spool/asterisk /home/justin/asterisk-recordings
mount -o bind /home/justin/asterisk-recordings /var/spool/asterisk
echo /home/justin/asterisk-recordings /var/spool/asterisk none rw,bind 0 0 >> /etc/fstab

This procedure work for me:

  1. Create a monitor folder with owner:group asterisk:asterisk permission 777.
    the Asterisk script will look for the folder monitor.
    i.e: I want my recordings on: /recordings/monitor
    #cd /recordings
    #mkdir monitor

chmod 777 monitor

#cd /recordings

chown -h asterisk:asterisk monitor

  1. Settings
    Advanced Setings
    Override Call Recording Location: /recordings/monitor

  2. Edit file: paloSantoMonitoring.class.php
    define (‘DEFAULT_ASTERISK_RECORDING_BASEDIR’, ‘/var/spool/asterisk/monitor’);
    define (‘DEFAULT_ASTERISK_RECORDING_BASEDIR’, ‘/recordings/monitor’);

path: vi /var/www/html/modules/monitoring/libs/paloSantoMonitoring.class.php

After those 3 steps the recording are being storage on /recordings/monitor and the web portal have the recording.


I don’t think there are many Elastix users out there anymore. An easier way is to just change the “astspooldir” as referenced in /etc/asterisk/asterisk.conf, I believe you can set it in “advanced settings” of the GUI if you override the readonly settings

I forgot to state , if you use a remote FileSystem then you really should add

cache_record_files => yes
record_cache_dir => /some/where/local

to that same file.

If you’re changing the base file directory in which you want to store the call recordings and are fine with the YEAR/MONTH/DAY sub-directory format then just edit globals_custom.conf and add a single like that is:

MIXMON_DIR = /path/to/monitor/dir/ ;Needs trailing /

This will now set the global var ${MIXMON_DIR} which all MixMonitor() commands in the dialplan use for the default path. If that is empty then it defaults to the /var/spool/asterisk/monitor/ location.

So your recordings would end up in /home/recordings/2018/08/25 for recordings on Aug 25th 2018 if you set the MIXMON_DIR to /home/recordings/

I’m going to assume after 3 years this is solved… but just for posterity…

You can create a symlink to your new location. That’s what I did to have my recordings go to an external USB drive.

1 Like

Hello ,
I have FreePBX , i need to changed my recording location to newly mounted HDD ( USB ) .

Can someone please help me on this I am new to linux and FreePBX.

and if someone has a script to move the recording from FreePBX to other location on weekly basis that will work too.


I use the backup and restore module to backup call recordings to my desktop each night. I use Filezilla server on my desktop then add my desktop as a server in PBX. I then use Allways Sync on my desktop to push those backups to Google Drive.

One challenge I have found with this is I can’t just backup new recordings. If I backup the directory __ASTSPOOLDIR__/monitor/2019 it will backup all recordings from 01/01/19 to 08/01/19 one night, then 01/01/19 to 08/02/19 the next night, etc. I have mitigated this slightly by using __ASTSPOOLDIR__/monitor/2019/08 for my backup directory. I just go in to my PBX on the first of the month to change the directory to __ASTSPOOLDIR__/monitor/2019/09"…etc. Otherwise, the backup files can get pretty large.

Can you tell me the step for changing default directory /var/spool/asterisk/monitor to new mounted (2-TB USB) /media/monitoring.
and what are the permission command i have to give.

version is mentioned above