Unable to delete call recordings, owned by root and not asterisk

I’m currently running AsteriskNOW 1.7.1, 32-bit, using Asterisk 1.4. I’ve upgraded to the latest FreePBX 2.8.

When I set call recordings to record my outgoing calls, they record fine. I can see them and listen to them in the recordings area of the GUI. However, when I attempt to delete them, they will not delete.

I went into Linux and checked the permissions on /var/spool/asterisk/monitor, which is where asterisk stores the recordings. I executed ls -l, and it appears that asterisk is saving the .wav files as root, and not as asterisk.

I’ve tried amportal chown, but it didn’t fix the problem.
When I “chown -R 777 the /var/spool/asterisk/monitor”, that only fixes the files that are currently recorded. New files record as root and still cannot be deleted.

I am not having this problem with voicemails. Only call recordings.

  1. Can anyone suggest a solution that will fix the problem permanently?
  2. In running chown -R 777 for …/monitor, I’ve opened the directory to the world. Can someone tell me the parameter I’d want to use to return …/monitor back to the proper permissions state?

Thanks in advance!

What is asterisk running as. Asterisk should be running as user asterisk not root.

Do a “ps aux | grep asterisk” and print the output here.

Tony,

Thanks for responding. If Asterisk is running as root, that’s how AsteriskNOW set it up. How can I change it?

I’ve run ps aux | grep asterisk from the command line. Here’s what I found:

[[email protected] ~]# ps aux | grep asterisk
root 3020 0.0 0.0 4620 552 ? S 11:28 0:00 /bin/sh /usr/sb
in/safe_asterisk
root 3031 1.9 0.6 25700 11104 ? Sl 11:28 0:00 /usr/sbin/aster
isk -f -vvvg -c
asterisk 3096 1.7 0.8 33064 16320 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3097 0.0 0.2 21116 3960 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3098 0.0 0.2 21116 3956 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3099 0.0 0.2 21116 3960 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3100 0.0 0.2 21116 3956 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3101 0.0 0.2 21116 3960 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3102 0.0 0.2 21116 3956 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3103 0.0 0.2 21116 3956 ? S 11:28 0:00 /usr/sbin/httpd
asterisk 3212 0.0 0.0 4572 444 ? S 11:28 0:00 bash -c cd /var
/www/html/panel && /var/www/html/panel/safe_opserver &
asterisk 3213 0.0 0.0 4568 1040 ? S 11:28 0:00 sh /var/www/htm
l/panel/safe_opserver
asterisk 3215 4.5 0.4 12652 8640 ? S 11:28 0:00 /usr/bin/perl /
var/www/html/panel/op_server.pl
root 3319 0.0 0.0 3996 700 pts/0 S+ 11:29 0:00 grep asterisk

Did you issue a service asterisk start or restart at one point. With FreePBX systems you need to use the amportal start and restart commands.

Go into the asterisk cli by typing asterisk -r. Type stop now or core stop now.

Once you have stopped asterisk issue a amportal start command. That will make asterisk start as the asterisk user.

Tony,

Thanks again for your assistance. Just for fun, I did a reinstall of AsteriskNOW 1.7.1 32-bit and ran ps aux | grep asterisk. The results were the same as what I posted, above. So, it appears that Digium set-up the AsteriskNOW 1.7.1. distro such that Asterisk runs as root. Sometimes I wonder if they mess up the distro just a little to encourage people to buy the paid products???

Your suggestion resolved the problem. Thanks again!

Tony/Anyone,

So apparently, the command sequence you recommended does fix the problem, but only until the system is rebooted. Once rebooted, ps aux | grep asterisk reveals asterisk again running as root and not as the asterisk user.

Any suggestions on how to get asterisk to run as asterisk user on reboot instead of running as root?