Voicemail and VoicemailMain

Synopsis
The Asterisk system features complete Voicemail functionality including remote message retrieval, multiple message folders, and user customizable busy and away messages. The applications which comprise the Voicemail system are 'Voicemail' and 'VoicemailMain'.

How to use
Configuration for the Asterisk Voicemail system is located  in /etc/asterisk/voicemail.conf, and /var/spool/asterisk/vm/ is the spool directory used for storing messages. New mailboxes are created by adding a line for each mailbox to voicemail.conf. Once created, voicemail boxes can be utilized by the 'Voicemail' application for leaving messages or by the 'VoicemailMain' application for retrieving messages within the dialplan. See voicemail.conf under references for more information on creating user mailboxes.

Syntax
Voicemail is called from within the dialplan (see extensions.conf)like any other application. It takes as an argument the mailbox to be used and the message to be played (busy or unavailable.) The message is set in the dialplan by preceding the mailbox number with ‘b’ or ‘u’ for busy or unavailable. Alternately, the mailbox number may be preceeded by an ‘s’ for silent, in which case no instructions or greeting is played (just a beep). Ifn the event no letter preceding letter is present, then only the instructions are played and not the greeting.

The Voicemail application is called from within the dialplan like this:

Example:
This example will play the unavailable message for mailbox 7100

exten => 7100,3,Voicemail,u7100

This example will play the busy message for the caller.  Note that we are using extension 103 instead of three, indicating the 'Dial' application has returned busy.  See extensions.conf for more details.

exten => 7100,103,Voicemail,b7100

A typical extension with voicemail would look like this.

exten => 7100,1,Dial,Zap/1|20
exten => 7100,2,Voicemail,u7100
exten => 7100,103,Voicemail,b7100

The 'VoicemailMain' application commonly takes no arguments. When the extension is dialed, the user is prompted to enter a mailbox number and their numeric passcode.  Within the dialog, the user can check his or her voicemail, store important messages in custom folders, and create new unavailable and busy messages.  The syntax to launch the 'VoicemailMain' application with no arguments is shown in the following example:

Example:  
exten => 7500,1,VoicemailMain

Alternately the 'VoicemailMain' application can take a mailbox number as an argument, in which case it will automatically route the caller to a specific mailbox and ask for the numeric passcode.  The following example will route the user to mailbox 6161 and prompt them for the numeric passcode:

Example:  
exten => 7500,1,VoicemailMain,7100

Steps for implementing a fully functional voicemail system:

a)Edit voicemail.conf and create an entry for each voicemail box. (See voicemail.conf.)
b)Edit the extensions.conf and call the mailbox from within the dialplan using the 'Voicemail' application. In most cases the voicemail box will be called after the application 'Dial' in an extension. (See extensions.conf and the 'Dial' application.)
c)Make sure there is an available extension to the 'VoicemailMain' application in order for users to check their voicemail boxes.

See also:		voicemail.conf
			extensions.conf
			'Dial' application