4.3. Dialplan applications

There are two voicemail applications we can use in the dialplan (extensions.conf):
VoiceMail()
This application sends a caller to the voicemail system, where she will be asked to leave a message.
VoiceMailMain()
This application lets recipients check their voice messages and record new voicemail prompts.

VoiceMail()

Action: The caller is prompted to leave a voice message.
The VoiceMail() command is always called from the dialplan (extensions.conf). For example:
exten => 2000,2,VoiceMail(2000,u)

Syntax

VoiceMail(mailbox[@context][,u|b|s])
mailbox
This is the mailbox number. This does not have to be the same as the extension the caller dialled; nevertheless, this is a sensible practice, particularly in larger installations.
@context
Mailboxes may be implemented in a specific context. If no context is provided, the [default] context is used.
If the caller presses "0" while listening to the prompt, the application will jump to extension "o" (the small letter o) in the specified context.
If the caller presses "*" while listening to the prompt, the application will jump to extension "a" (the small letter a) in the specified context.
[u|b|s]
u
causes the "unavailable" message to be played. The pathname for this message is /var/lib/asterisk/sounds/vm-isunavail.gsm[16]
b
causes the "busy" to be played. The pathname for this message is /var/lib/asterisk/sounds/vm-rec-busy.gsm.
s
suppresses playback of the "unavailable" or "busy" notifications, plays a beep, and begins recording.
If there is no mailbox configured in voicemail.conf for the given number but there is a n+101 priority, Asterisk jumps to this priority and continues executing there.

VoiceMailMain()

Action: Lets users listen to their voicemail messages and record prompts.
The VoiceMailMain() command is always called from the dialplan (extensions.conf). For example:
exten => 300,1,VoiceMailMain()

Syntax

VoiceMailMain([mailbox][@context][,s|p|g(#)])
mailbox
This is the mailbox number. If no mailbox number is provided, Asterisk prompts for it.
@context
specifies the voicemail context (in voicemail.conf) for the mailbox.
[s|p|g#]
s
Disables the password requirement.
p
The user is asked for a mailbox number. The number entered is attached as a suffix to the contents of [mailbox]; for example, if the user enters 123, [mailbox]123 is called. This lets you easily configure mailbox groups.
g(#)
Adjusts the gain (in decibels) when recording voicemail prompts.

IVR

A complete description of the voice menus for VoiceMailMain() is difficult because they depend on the installed prompts. The main functions are described below.
1Play messages
 
3Advanced options
 
1Reply
2Call back
3Envelope
4Outgoing call
4Play previous message
5Repeat the current message
6Play the next message
7Delete the current message
8Forward the message to another mailbox
9Save the message in a folder
*Help; during message playback, rewind
#Exit; during message playback, skip forward
2Change folders
0Mailbox options
 
1Record your unavailable message
2Record your busy message
3Record your name
4Record your temporary message
 Recording options
 
1Accept
2Review
3Re-record
*Help
#Exit


If you are using a pre-packaged Asterisk, the path may be different; for example, /usr/share/asterisk/sounds/.