Realtime and Voicemail

I have Asterisk 11.3.0 installed with Realtime using mySQL.

Everything now works thankfully except for voicemail when a peer is offline. I cannot find how to set this up in the extensions database as the priority doesn’t support the dialstatus parameter.

Can someone please give me a tip or resource on getting voicemail to work in this case?

Thanks,
Ryan

OK, another issue magically fixed itself but… there is always a but… it replaced itself, messages cannot be left for anyone and we get the following output:

[May  2 22:27:07] ERROR[2395][C-00000003]: app.c:1729 ast_lock_path_lockfile: Unable to create lock file '/var/spool/asterisk/voicemail/default/XXXXX/INBOX': Permission denied
[May  2 22:27:07] ERROR[2395][C-00000003]: app.c:1761 ast_unlock_path_lockfile: Could not unlock path '/var/spool/asterisk/voicemail/default/XXXXX/INBOX': No such file or directory
[May  2 22:27:11] ERROR[2395][C-00000003]: app_voicemail.c:6557 leave_voicemail: Unable to create message file: Permission denied
[May  2 22:27:11] ERROR[2395][C-00000003]: cdr_csv.c:304 csv_log: Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : Permission denied

The folder ‘/var/spool/asterisk/voicemail/default/XXXXX/INBOX’ has the following permissions:

total 16
drwxr-xr-x 4 root root 4096 Apr 30 15:29 .
drwxr-xr-x 5 root root 4096 Apr 30 15:29 ..
drwxr-xr-x 2 root root 4096 Apr 30 15:29 INBOX
drwxr-xr-x 2 root root 4096 Apr 30 15:29 tmp

So I ran ‘chmod 777 INBOX’, the folder now has the following permissions:

drwxr-xr-x 4 root root 4096 Apr 30 15:29 .
drwxr-xr-x 5 root root 4096 Apr 30 15:29 ..
drwxrwxrwx 2 root root 4096 Apr 30 15:29 INBOX
drwxr-xr-x 2 root root 4096 Apr 30 15:29 tmp

Now messages still cannot be left and we get this error:

[May  2 22:39:29] ERROR[2418][C-00000004]: app_voicemail.c:6557 leave_voicemail: Unable to create message file: Permission denied
[May  2 22:39:29] ERROR[2418][C-00000004]: cdr_csv.c:304 csv_log: Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : Permission denied

Does anyone know what to do to resolve this?

Looks like Asterisk isn’t running as root, but the permissions on the assorted directories are expecting it to be. Either run Asterisk as root or chown -R the appropriate directory trees to the user that Asterisk is running as.

Thanks for the reply jsharp,
I rebooted the machine and it started working, tells me I may have somehow restarted Asterisk under another user by accident? Not sure how I would have done that but stranger things have happened.

Thanks again