4.4. voicemail.conf

Voicemail is configured in voicemail.conf. The file has three sections:
  • [general]
  • [zonemessages]
  • defined contexts


Global configurations for the voicemail system go here. The available options for this section are described in detail below.
attach = [yes|no]
Sets whether voice message files are attached to e-mail notifications. Default: yes. The format defined by the first entry in the format= line is used.
attach = no
callback = [context]
Specifies the context through which callbacks from the voicemail system are made. If unset, callbacks cannot be made from voicemail. Default: unset.
callback = internal-extensions
charset = [charset]
Specifies the character set used to encode the text of the e-mail.
charset = ISO-8859-1
delete = [yes|no]
Sets whether messages are deleted once the e-mail notification with attachment has been sent. This saves hard disk space on the server if users are only to receive messages via e-mail.
delete = yes
directoryintro = [filename]
Specifies the filename of a sound file (found in the default sound file directory /var/lib/asterisk/sounds/) to be used instead of the default sound file for the Dial-by-Name system (see Section 4.5, “Directory (Dial-by-Name)”).
directoryintro = intro-widgets-phonebook
emailsubject = [subject]
Specifies the subject line to be used in e-mail notifications. For information about variables, see emailbody.
emailsubject = New message from ${VM_CALLERID}
pbxskip = [yes|no]
Asterisk prefixes [PBX] to the subject line of every e-mail notification. This is intended to make filtering e-mail notifications into a specific folder more straightforward, but can be suppressed with yes if undesired.
pbxskip = yes
emailbody = [Text der Email]
Specifies the body text of the e-mail notifications. Limited to 512 characters.
You may use variables in the subject and body of e-mail notifications:
Name of mailbox owner
Message length
Message number
Mailbox number
Name and number of caller
Number of caller
Name of caller
Date and time of call
Name of the sound file that contains the voice message
emailbody = Hi, ${VM_NAME}!\n\nYou have a new message from ${VM_CALLERID} in mailbox ${VM_MAILBOX}.[17]
serveremail = [fromaddress]
Specifies the e-mail address that appears in the "From:" field of e-mail notifications.
serveremail = voicemail@widgets-inc.biz
fromstring = [fromname]
Specifies the envelope sender (From-Header) in e-mail notifications.
fromstring = VM
mailcmd = [mailer]
Specifies the application (including absolute path) to be used for sending e-mail notifications.
mailcmd = /usr/sbin/sendmail -t
mailcmd = /usr/exim/bin/exim -t
externnotify = [application]
Specifies the application (including absolute path) called by Asterisk when a new message arrives.
externnotify = /usr/bin/local/send-sms.sh
externpass = [application]
Specifies the application (including absolute path) called by Asterisk when a user changes his password.
externpass = /usr/bin/local/password-notify.sh
forcegreetings = [yes|no]
Sets whether the user will be forced to record a new greeting when logging in to the system for the first time. Default: no
forcegreetings = no
forcename = [yes|no]
Sets whether the user will be forced to record her name when logging in to the system for the first time. Default: no
forcename = yes
format = [gsm|wav|wav49]
Defines the codecs used to save voicemail messages. If more than one codec is specified, the message is stored once in each of the formats specified. This can lead to a shortage of available disk space but means further transcoding will not be needed if a user using a different codec is retrieving the messages.
If attach=yes, the first format specified is used for the attachment to the e-mail notification.
format = gsm|wav
Every message is saved in GSM and WAV format.
format = wav
Every message is saved only in WAV format.


If this setting is changed during operation, existing files in other formats must be deleted manually by the system administrator.
searchcontexts = [yes|no]
Asterisk only looks for mailboxes in the specified context. Setting searchcontexts=yes makes Asterisk search in all contexts. Default: no
searchcontexts = no
maxmsg = [number of messages]
Defines the maximum number of messages a single mailbox may hold. Once this limit is reached, no further messages can be recorded, and the caller hears the message /var/lib/asterisk/sounds/vm-mailboxfull.gsm. Default: 100
maxmsg = 50
maxmessage = [length in seconds]
Sets the maximum duration of a message. Default: no limit
maxmessage = 120
minmessage = [length in seconds]
Sets the minimum duration of a message. Default: 0
minmessage = 5
maxgreet = [length in seconds]
Sets the maximum duration of greeting messages. Default: no limit
maxsilence = [length in seconds]
Sets the number of seconds of silence that the system will allow before it assumes that the caller has finished.
silencethreshold = [Schwellenwert]
Specifies the maximum sound level that Asterisk considers silence when measuring maxsilence=. The lower the number, the more sensitive the detection. Default: 128
silencethreshold = 50
maxlogins = [number of login attempts]
Sets the maximum number of failed login attempts (e.g., the user enters an incorrect password) before Asterisk hangs up. Default: 3
maxlogins = 3
skipms = [milliseconds]
Sets the number of milliseconds the "skip forward" and "rewind" keys will jump forward or back during message playback. Default: 3000
skipms = 3000
usedirectory = [yes|no]
Gives callers access to the Dial-by-Name system. Default: no
usedirectory = yes
saycid = [yes|no]
Sets whether the telephone number of the caller is announced when the message is heard. Default: no
saycid = yes
cidinternalcontexts = [context,context,...]
Defines (through a comma-separated list) which contexts are treated as internal when the originating telephone number is announced as per saycid=. For contexts defined as internal only the caller's extension is announced. Default: none
pagerfromstring = [sendername]
Indicates the sender for pager notifications. See fromstring=.
pagerfromstring = Widgets, Inc.
pagersubject = [subject]
Specifies the subject for pager notifications. See emailsubject=.
pagersubject = New message
pagerbody = [body text]
Specifies the message body for pager notifications. See emailbody=.
pagerbody = New message in mailbox ${VM_MAILBOX} from ${VM_CALLERID}.
There are other parameters in addition to those documented above; nevertheless, these are those most frequently used. A complete listing of the available parameters, with brief descriptions, may be found in the default version of voicemail.conf.


In larger enterprises, voicemail users can be spread across time zones; the [zonemessages] section allows for time announcements that correspond to the user's time zone.


zonename = timezone | format
This is an arbitrary identifier used to identify the time zone. Only small letters (a-z), numbers (0-9), dash (-) and underscore (_) characters are allowed.
Time zone information is stored in /usr/share/zoneinfo for most Linux distributions. Typically the time zone files are sorted by continent, then region or city, separated by a /.
Defines the format for time announcements. This is done with the following variables:
AWeekday (Monday to Sunday)
aas A
BMonth (January to December)
bas B
has B
dDay of the month (1st to 31st)
eas d
YYear (e.g. 2007)
IHour in 12 hour clock
las I
HHour in 24 hour clock. Single digit hours are preceded by a 0 ("oh").
kHour in 24 hour clock. Single digit hours have no prefix.
pas P
Q"Today," "yesterday," or "weekday, month, day, year."
qNothing if today, "yesterday," or "weekday, month, day, year."
Other allowed variables include ${ANY_VARIABLE} (the contents of the variable are entered) and 'soundfilename'. When specifying a sound file, be careful not to add a file extension (e.g. .wav, .gsm); the specified sound file in /var/lib/asterisk/sounds is then played. The single quotation marks are mandatory.
germany = Europe/Berlin | 'vm-received' Q 'digits/at' kM
alberta = Canada/Mountain | 'vm-received' Q 'digits/at' HM
england = Europe/London | 'vm-received' Q 'digits/at' R
military = Zulu | 'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'

Defined contexts

As in the dialplan (extensions.conf) we can define contexts in voicemail.conf. This is useful when there is a need to separate voicemail access by department, branch, or city, and makes it possible to define separate Dial-by-Name directories as well (see Section 4.5, “Directory (Dial-by-Name)”).

The default context

A default context is mandatory. For most installations, this is all that is required.


You can configure as many mailboxes as you like in a given context.


mailbox => password,name[,e-mail[,pager-e-mail[,options]]]
202 => 1234,Gina Smart,gina@widgets-inc.biz,,attachfmt=wav|delete=yes
Mailbox number (digits)
Password for the mailbox (this may be letters or numbers). Generally, numbers are more practical as they are more likely to be enterable from a standard telephone set.
E-mail address to which to send e-mail notifications.
E-mail address for the pager to which pager notifications should be sent.[21]
Multiple options must be separated by the pipe character (|); these options can override global options set in [general]. Note that there cannot be any spaces between the parameter name, the = sign, and the value, nor between the options and the pipe character.
The most important options applied here are:
Sets the time zone previously defined in [zonemessages] (see the section called “[zonemessages]).
If defined, sets whether voice message files are attached to e-mail notifications.
If defined, overrides the format= value set in [general] for message attachments to e-mail notifications.
Sets whether the telephone number of the caller is announced when the message is heard.
Sets whether the length of the message will be announced. Default: yes
saydurationm=[length in minutes]
Defines the minimum duration for a message to be before the duration is announced. Default: 0
Specifies the context to be used for dialling out from a message. Calls cannot be made out of voice mail unless this parameter is set.
Sets whether a user may send messages to other voicemail users.
Specifies the context to be used for dialling out from a message. If defined, this makes it possible to return a call to someone who has left a message.
Sets whether callers leaving a message may listen to the message before sending it. Default: no
Sets whether callers can connect to the operator before, during or after recording a message by pressing "0" (zero). In Asterisk, the operator is always the "o" (small letter o) extension in the current context. Default: no
Sets whether message envelope information is announced before the message is heard. Setting this parameter to no overrides other parameters (for example, tz). Default: yes
Sets whether messages are deleted after they have been attached to an e-mail notification. Default: no
Sets whether the system jumps to the next message after the current message has been saved or deleted. Default: no
If set to yes, forces a system user to record her name when accessing the system for the first time. Default: no
If set to yes, forces a system user to record a personal greeting when accessing the system for the first time. Default: no
Sets whether the mailbox for this user will be hidden from the Dial-by-Name directory. Default: no

This must all be on one line. The \n character puts a carriage return in the text.
The path depends on the installation; some packages install the sounds in /usr/share/asterisk/sounds/
There is no indication in the Asterisk source code what the range or unit for this value is. The only way to set the value sensibly is through trial and error.
Note that time zones defined here must still be activated for individual users. See the section called “Mailboxesd”
Note that such notifications are still, in essence, e-mail notifications. If you want to send SMS notifications, this can be done with a number of external applications which may be invoked through Asterisk.