Voicemail Permissions and Ownership PLEASE HELP

Problem, voicemails are currently being created with the user root and group root. Since this is the case I don’t have access to them in the ARI. I can run a amportal chown and the voicemail permissions are as they should be and I can access them in the ARI.

My question: how can I make it to where these files are created with the correct owner. Should be asterisk as the owner and asterisk as the group. This all worked fine up to a few weeks ago, not sure what would have made it change except for an upgrade on some of my freepbx modules. I’ve search around and seen similar issues but no clear cut answer. I’m sure I could create a cron job to just run amportal chown every 5min but I think that’d be cheating an not really a solution to the problem just a quick fix.

I’ve seen this post on the wiki:
voip-info.org/wiki/index.php … +vmail.cgi

And it takes me to this link that has a patch but I’m not even sure how to apply it:

I’m sure there is an easy way about this, so if anyone could help me out it would be greatly appreciated.


It sounds as if you are starting Asterisk when logged in as root and nor su’ing to asterisk


Well then thing is all this worked fine like 3 weeks ago…and in the past I’ve never had to su to start asterisk as user asterisk. Even when I try to su in as user asterisk and start Asterisk or amportal the commands are invalid. Is there a way I can make it to were even if I were to reboot the box asterisk would run as user asterisk so I can avoid these permission issues.

And since I didn’t state before, I’m running…
Asterisk 1.1.14
FreePBX 2.2.1
Centos 2.6.9-42.0.3.EL


do a ps -ef to see what asterisk is running as.

on reboot safe_asterisk would normally start * with the correct user.


K thanks I’m a try that out after hours and see if I can asterisk running as the right user…I really appreciate your help

Ended up just having to go into /etc/rc.d/init.d /asterisk and uncommenting out the lines:


Now all is good. Thanks for your help though

I’ve the same problem…
I cannot check Voicemail with ARI and even if I try to check CDR using freePBX I obtain nothing!
I’m running

  • Asterisk 1.2
  • freePBX 2.2.1
  • Kubuntu Edgy 6.10
    and all asterisk directories are root:root owner…
    I tried to uncomment AST_USER and AST_GROUP in /etc/init.d/asterisk
    but this not solve the problem…
    Then I changed permission and owner to all folders… but nothing: when I try to reboot, safe_asterisk script was launched with /usr/sbin/asterisk -G asterisk -U asterisk -vvvg -c
    but it doesn’t work until I launh asterisk -cvvv again!!!

Just as a test if you run amportal chown are you then able to see your voicemails in the ari?

Oh and FYI when I uncommented out the lines:


in /etc/rc.d/init.d /asterisk I did have to restart asterisk, This just made it so asterisk now runs as user asterisk and all files created (voicemails in particular) are created with the owner asterisk, group asterisk. Depending on how your running your version of asterisk you may need to specify a different user or group. I know some people run * with the group Apache.

I tried to change in:

then I launch amportal chown, and I had some problem: I reinstalled Asterisk and freePBX following Error suggestion (to change in /var/run/asterisk and reinstall…)

But when I reboot… Asterisk doesn’t run, maybe… if I launch
ps -elf | grep asterisk
I see:
4 S root 5111 5107 0 76 0 - 49633 - 11:12 pts/2 00:00:00 /usr/sbin/asterisk -U asterisk -G asterisk -vvvg -c
but the PBX doesn’t work since I restart…

If I try to launch
the prompt says:
Asterisk died with code 1.
Automatically restarting Asterisk.
Asterisk ended with exit status 1


any tip?

I also look at this link: bugs.digium.com/view.php?id=6334
but in this case I can modify permissions and run Asterisk as root… but I would like to launch Asterisk as asterisk:asterisk… :question:

I found a solution using “amportal start”…
so now all permissions are ok!

when I try to connect to console using asterisk -r
I obtain
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

and inside /var/run/asterisk there is nothing!!!