# Asterisk Project : ODBC Voicemail Storage

Added by mdavenport , edited by mjordan on Aug 06, 2012

ODBC Storage allows you to store voicemail messages within a database instead of using a file. This is not a full realtime engine and only supports ODBC. The table description for the voicemessages table is as follows:

Field | Type | Null | Key | Default | Extra
--- | --- | --- | --- | --- | ---
msgnum | int(11) | Yes |  | NULL |
dir | varchar(80) | Yes | MUL |  | NULL
context | varchar(80) | Yes |  | NULL |
macrocontext | varchar(80) | Yes |  | NULL |
callerid | varchar(40) | Yes |  | NULL |
origtime | varchar(40) | Yes |  | NULL |
duration | varchar(20) | Yes |  | NULL |
flag | varchar(8) | Yes |  | NULL |
mailboxuser | varchar(80) | Yes |  | NULL |
mailboxcontext | varchar(80) | Yes |  | NULL |
recording | longblob | Yes |  | NULL |
msg_id | varchar(40) | Yes |  | NULL | (See Note)

Upgrade Notice

The msg_id column is new in Asterisk 11. Existing installations should add this column to their schema when upgrading to Asterisk 11. Existing voicemail messages will have this value populated when the messages are initially manipulated by app_voicemail in Asterisk 11.

The database name (from /etc/asterisk/res_odbc.conf) is in the odbcstorage variable in the general section of voicemail.conf.

You may modify the voicemessages table name by using odbctable=table_name in voicemail.conf.