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[C-000001cc] app_mixmonitor.c: Begin MixMonitor Recording SIP/GXWT10-In-0000089f
[2018-12-04 22:23:24] WARNING[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[C-000001cc] app_mixmonitor.c: Cannot open /mnt/recordings/2018/12/04/in-1231231234-1231231234-20181204-222324-1543962204.2207.wav
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.