It was an odbc database connection problem, user freepbxuser and password(see /etc/freepbx.conf for password) were missing in /etc/odbc.ini, and in /etc/asterisk/res_odbc.conf I made following changes:
Don’t know if it’s needed, but for testing I did(SECURITY WARNING):
chmod 777 /var/spool/asterisk/voicemail/default/100
Created the file /etc/e-smith/templates-custom/etc/odbc.ini/91voicemail with following content:
User = freepbxuser
Password = PASSWORDFROMFREEPBX.CONF
Edit /etc/asterisk/res_odbc.conf and add odbcstorage entry:
#include res_odbc_custom.conf
#include res_odbc_additional.conf
[odbcstorage]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pre-connect=>yes
In freepbx I setup odbcstorage and voicemessages table
Via phpmyadmin(https://wiki.nethserver.org/doku.php?id=phpmyadmin) I created a new table in asteriskcdrdb but now I have the script, so you can run it in mariadb:
mysql
CREATE TABLE `asteriskcdrdb`.`voicemessages` ( `msgnum` INT(11) NULL DEFAULT NULL , `dir` VARCHAR(80) NOT NULL , `context` VARCHAR(80) NULL DEFAULT NULL , `macrocontext` VARCHAR(80) NULL DEFAULT NULL , `callerid` VARCHAR(40) NULL DEFAULT NULL , `origtime` VARCHAR(40) NULL DEFAULT NULL , `duration` VARCHAR(20) NULL DEFAULT NULL , `flag` VARCHAR(8) NULL DEFAULT NULL , `mailboxuser` VARCHAR(80) NULL DEFAULT NULL , `mailboxcontext` VARCHAR(80) NULL DEFAULT NULL , `recording` LONGBLOB NULL DEFAULT NULL , `msg_id` VARCHAR(40) NULL DEFAULT NULL ) ENGINE = InnoDB;
exit
Then write the config and restart asterisk
expand-template /etc/odbc.ini
systemctl restart asterisk
Now it should work, I can dial *97 to listen to my messages or *98 to listen to another voicemailbox but I get a security warning in freepbx because I changed res_odbc.conf.
You can only disable it completely, so you won’t get a warning if any module file changed…
Please keep in mind, that this is just a quick solution…
https://wiki.freepbx.org/display/F2/Module+Signing
Sources:
https://wiki.asterisk.org/wiki/display/AST/ODBC+Voicemail+Storage