Saving phone call recordings to second drive

As simple as I presummed it should be, I have been having some odd trouble on a recent freepbx install. The client had requested all their departments calls, in and out, to be recorded. 20 phones in total. The second drive that I set PBX via advanced settings to is a 1TB drive. Formatted and empty. I can create files to it, granted as root, however in the asterisk logs, it says it is failing to save the files, as the location does not exist.

For testing purposes only, thinking maybe it was a permissions issue, I chmod the drive as 777, however no change on recordings to be saved.

The location the recordings should save to, /mnt/recordings/

Error on each call:

[2018-12-04 22:23:24] VERBOSE[2762][C-000001cc] app_mixmonitor.c: Begin MixMonitor Recording SIP/GXWT10-In-0000089f
[2018-12-04 22:23:24] WARNING[2762][C-000001cc] file.c: Unable to open file /mnt/recordings/2018/12/04/in-1231231234-1231231234-20181204-222324-1543962204.2207.wav: No such file or directory
[2018-12-04 22:23:24] ERROR[2762][C-000001cc] app_mixmonitor.c: Cannot open /mnt/recordings/2018/12/04/in-1231231234-1231231234-20181204-222324-1543962204.2207.wav

Have you tried changing the ownership of the new location to asterisk:asterisk? You have the “base directory” set to 777 but then it’s trying to make multiple “stepped” subdirectories and files.

Did you even see the directory 2018 and then in that 12 and then in that 04 created?

I ran chmod -R 777. No other folders are created. I made a 2018, checked the permissions, which has full read/write. But no new folders/files created under it when recordings were attempted to be made. I’ll change ownership to asterisk, as it is Root Root.

777 lets anyone create/delete/execute files that have that permission. In the case of the directory is means everything in that directory, itself. The directories below it, unless told to use 777 will be created as 755 by default meaning that the directories like the month and then the subdirectories in that directory (days and then the recordings in those days directories) will not be 777 and the user asterisk will not have permission to write to them.

Everything that Asterisk/FreePBX needs to have access to needs to belong to the user asterisk.

That did it, changing the owner of the drive to asterisk fixed the issue.

cd /mnt
ls (shown the folder which the drive is mounted to, in this case “recordings”)
sudo chown asterisk:asterisk -R *

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