MySQL and MariaDB voicemessages Schema

Home » Initial Configuration of Asterisk » MySQL and MariaDB voicemessages Schema

If you are using MySQL or MariaDB, and are planning to use ODBC storage for Voicemail, this table schema for voicemessages table could be useful.

The storage engine has explicitly been defined as ‘MyISAM’. Recent versions of MySQL use InnoDB by default, you can also use XtraDB (drop-in replacement for InnoDB in MariaDB).

CREATE TABLE `voicemessages` (
  `msgnum` INT(11) UNSIGNED DEFAULT NULL,
  `dir` VARCHAR(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `context` VARCHAR(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `macrocontext` VARCHAR(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `callerid` VARCHAR(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `origtime` VARCHAR(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `duration` VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `flag` VARCHAR(8) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailboxuser` VARCHAR(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailboxcontext` VARCHAR(80) COLLATE utf8_unicode_ci DEFAULT NULL,
  `recording` LONGBLOB,
  KEY `msgnum` (`msgnum`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT=‘Voicemail Messages’;