System information
Configuring voicemail.conf for ODBC Storage
There isn’t much to add to the voicemail.conf file to enable the ODBC voicemail storage.
In fact, it’s only three lines! Normally, you probably have multiple format types defined
in the [general] section of voicemail.conf, but we need to set this to a single format
because we can only save one file (format) to the database. The wav49 format is a
compressed WAV file format that should be playable on both Linux and Microsoft
Windows desktops.
The odbcstorage option points at the name you defined in the res_odbc.conf file (if
you’ve been following along in this chapter, then we called it asterisk). The odbctable
option refers to the table where voicemail information should be stored. In the examples
in this chapter we use the table named voicemessages:
[general]
format=wav49
odbcstorage=asterisk
odbctable=voicemessages
You may want to create a separate voicemail context, or you can utilize the default
voicemail context. Alternatively, you can skip creating a new user and use an existing
user, such as 0000FFFF0001. We’ll define the mailbox in the default voicemail context
like so:
[default]
1000 => 1000,J.P. Wiser
You can also use the voicemail definition in extconfig.conf to load your
users from the database. See “Dynamic Realtime” on page 371 for more
information about setting up certain module configuration options in
the database, and “Static Realtime” on page 368 for details on loading
the rest of the configuration file.
Now connect to your Asterisk console and unload then reload the app_voicemail.so
module:
*CLI> module unload app_voicemail.so
== Unregistered application 'VoiceMail'
== Unregistered application 'VoiceMailMain'
== Unregistered application 'MailboxExists'
== Unregistered application 'VMAuthenticate'
*CLI> module load app_voicemail.so
Loaded /usr/lib/asterisk/modules/app_voicemail.so =>
(Comedian Mail (Voicemail System))
== Registered application 'VoiceMail'
== Registered application 'VoiceMailMain'
== Registered application 'MailboxExists'
== Registered application 'VMAuthenticate'
== Parsing '/etc/asterisk/voicemail.conf': Found
382 | Chapter 16: Relational Database Integration