4.4. voicemail.conf

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

[general]

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.
Example:
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.
Example:
callback = internal-extensions
charset = [charset]
Specifies the character set used to encode the text of the e-mail.
Example:
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.
Example:
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)”).
Example:
directoryintro = intro-widgets-phonebook
emailsubject = [subject]
Specifies the subject line to be used in e-mail notifications. For information about variables, see emailbody.
Example:
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.
Example:
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:
${VM_NAME}
Name of mailbox owner
${VM_DUR}
Message length
${VM_MSGNUM}
Message number
${VM_MAILBOX}
Mailbox number
${VM_CALLERID}
Name and number of caller
${VM_CIDNUM}
Number of caller
${VM_CIDNAME}
Name of caller
${VM_DATE}
Date and time of call
${VM_MESSAGEFILE}
Name of the sound file that contains the voice message
Example:
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.
Example:
serveremail = voicemail@widgets-inc.biz
fromstring = [fromname]
Specifies the envelope sender (From-Header) in e-mail notifications.
Example:
fromstring = VM
mailcmd = [mailer]
Specifies the application (including absolute path) to be used for sending e-mail notifications.
Examples:
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.
Example:
externnotify = /usr/bin/local/send-sms.sh
externpass = [application]
Specifies the application (including absolute path) called by Asterisk when a user changes his password.
Example:
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
Example:
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
Example:
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.
Examples:
format = gsm|wav
Every message is saved in GSM and WAV format.
format = wav
Every message is saved only in WAV format.

Caution

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
Example:
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
[18].
Example:
maxmsg = 50
maxmessage = [length in seconds]
Sets the maximum duration of a message. Default: no limit
Example:
maxmessage = 120
minmessage = [length in seconds]
Sets the minimum duration of a message. Default: 0
Example:
minmessage = 5
maxgreet = [length in seconds]
Sets the maximum duration of greeting messages. Default: no limit
Example:
maxgreet=240
maxsilence = [length in seconds]
Sets the number of seconds of silence that the system will allow before it assumes that the caller has finished.
Example:
maxsilence=10
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
[19]
Example:
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
Example:
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
Example:
skipms = 3000
usedirectory = [yes|no]
Gives callers access to the Dial-by-Name system. Default: no
Example:
usedirectory = yes
saycid = [yes|no]
Sets whether the telephone number of the caller is announced when the message is heard. Default: no
Example:
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=.
Example:
pagerfromstring = Widgets, Inc.
pagersubject = [subject]
Specifies the subject for pager notifications. See emailsubject=.
Example:
pagersubject = New message
pagerbody = [body text]
Specifies the message body for pager notifications. See emailbody=.
Example:
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.

[zonemessages]

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.
[20]

Syntax

zonename = timezone | format
zonename
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.
timezone
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 /.
Examples:
Canada/Mountain
Europe/Berlin
Australia/Sydney
format
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.
MMinute
PAM or PM
pas P
Q"Today," "yesterday," or "weekday, month, day, year."
qNothing if today, "yesterday," or "weekday, month, day, year."
RHour:minute:second
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.
Example:
[zonemessages]
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.

Mailboxesd

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

Syntax

mailbox => password,name[,e-mail[,pager-e-mail[,options]]]
Example:
202 => 1234,Gina Smart,gina@widgets-inc.biz,,attachfmt=wav|delete=yes
mailbox
Mailbox number (digits)
password
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
E-mail address to which to send e-mail notifications.
pager-e-mail
E-mail address for the pager to which pager notifications should be sent.[21]
options
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:
tz=[timezone]
Sets the time zone previously defined in [zonemessages] (see the section called “[zonemessages]).
Example:
tz=alberta
attach=[yes|no]
If defined, sets whether voice message files are attached to e-mail notifications.
attachfmt=[gsm|wav|wav49]
If defined, overrides the format= value set in [general] for message attachments to e-mail notifications.
saycid=[yes|no]
Sets whether the telephone number of the caller is announced when the message is heard.
sayduration=[yes|no]
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
dialout=[context]
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.
Example:
dialout=internal-extensions
sendvoicemail=[yes|no]
Sets whether a user may send messages to other voicemail users.
callback=[context]
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.
review=[yes|no]
Sets whether callers leaving a message may listen to the message before sending it. Default: no
operator=[yes|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
envelope=[yes|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
delete=[yes|no]
Sets whether messages are deleted after they have been attached to an e-mail notification. Default: no
nextaftercmd=[yes|no]
Sets whether the system jumps to the next message after the current message has been saved or deleted. Default: no
forcename=[yes|no]
If set to yes, forces a system user to record her name when accessing the system for the first time. Default: no
forcegreetings=[yes|no]
If set to yes, forces a system user to record a personal greeting when accessing the system for the first time. Default: no
hidefromdir=[yes|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.