System information
The VoiceMailMain() Dialplan Application
Users can retrieve their voicemail messages, change their voicemail options, and record
their voicemail greetings using the VoiceMailMain() application. VoiceMailMain() ac-
cepts two arguments: the mailbox number (and optionally the context) to be accessed,
and some options. Both arguments are optional.
The structure of the VoiceMailMain() application looks like this:
VoiceMailMain([mailbox][@context][,options])
If you do not pass any arguments to VoiceMailMain(), it will play a prompt asking the
caller to provide her mailbox number. The options that can be supplied are listed in
Table 8-5.
Table 8-5. VoiceMailMain() optional arguments
Argument Purpose
p Allows you to treat the <mailbox> parameter as a prefix to the mailbox number.
g(#) Increases the gain by # decibels when playing back messages.
s Skips the password check.
a(folder) Starts the session in one of the following voicemail folders (defaults to 0): 0 - INBOX, 1 - Old, 2 -
Work, 3 - Family, 4 - Friends, 5 - Cust1, 6 - Cust2, 7 - Cust3, 8 - Cust4,
9 - Cust5
To allow users to dial 8500 to check their voicemail or modify their voicemail options,
you would add an extension to the dialplan like this:
[Services]
exten => *98,1,VoiceMailMain()
Creating a Dial-by-Name Directory
One last feature of the Asterisk voicemail system that we should cover is the dial-by-
name directory. This is created with the Directory() application. This application uses
the names defined in the mailboxes in voicemail.conf to present the caller with a dial-
by-name directory of the users.
Directory() takes up to three arguments: the voicemail context from which to read the
names, the optional dialplan context in which to dial the user, and an option string
(which is also optional). By default, Directory() searches for the user by last name, but
passing the f option forces it to search by first name instead. Let’s add two dial-by-
name directories to the incoming context of our sample dialplan, so that callers can
search by either first or last name:
exten => 8,1,Directory(default,incoming,f)
exten => 9,1,Directory(default,incoming)
Dialplan Integration | 171