[resolved] ODBC Voicemail Storage with MySQL


On wiki https://wiki.asterisk.org/wiki/display/AST/ODBC+Voicemail+Storage, we can read the table description for the voicemessages.

But I don’t know I can configure field “dir”.
I test this on MySQL :
CREATE TABLE voicemessages
msgnum int(11) DEFAULT NULL,
dir varchar(80) NULL DEFAULT ‘’,
context varchar(80) DEFAULT NULL,
macrocontext varchar(80) DEFAULT NULL,
callerid varchar(40) DEFAULT NULL,
origtime varchar(40) DEFAULT NULL,
duration varchar(20) DEFAULT NULL,
flag varchar(8) DEFAULT NULL,
mailboxuser varchar(80) DEFAULT NULL,
mailboxcontext varchar(80) DEFAULT NULL,
recording longblob DEFAULT NULL,
msg_id varchar(40) DEFAULT NULL,

Could you help me ?

Thanks in advance.
Best regards

I finded into http://asterisk-service.com/downloads/Asterisk-%20The%20Definitive%20Guide,%204th%20Edition.pdf

CREATE TABLE voicemessages
uniqueid serial PRIMARY KEY,
msgnum int(4),
dir varchar(80),
context varchar(80),
macrocontext varchar(80),
callerid varchar(40),
origtime varchar(40),
duration varchar(20),
mailboxuser varchar(80),
mailboxcontext varchar(80),
recording blob,
label varchar(30),
read bool DEFAULT false,
flag varchar(10)

What is the better way ?

You should be using the file mysql_voicemail.sql
in the subdirectory of your asterisk source contrib/realtime/mysql

Thanks JohnKiniston

I use debian’s package (Asterisk 13.14.1) and into *.deb there’s not directories contrib/realtime/mysql

Can I use contrib/realtime/mysql/mysql_voicemail.sql into the tarball http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.14.1.tar.gz ?

What is the “alembric_version” table used for ?

Alembic can automatically migrate and change tables as things are added/removed, the version table is used to record the information to allow this to happen.

Yes the file from the tarball should work.

Thanks !!
It works perfectly !

An another question, with Digium Phones and voicemail application, on screen the date appears like this : aN/aN/aN

Can I change it somewhere ?

Sorry I don’t use the Digium phones, I’d suggest contacting their support team.

iirc, the date formatting is controlled by the phone’s locale setting. Totally a separate thread conversation though :smiley:

1 Like