The examples which follow should give you a quick overview of typical configurations. Specifics and special features are covered in the following section the section called “Dialplan applications”.
In the course of modernizing their home, the Robinson family has decided to install an Asterisk system, including a voicemail system with a mailbox for every family member.
Each family member needs a mailbox:
| Name | Extension | Notes |
|---|---|---|
| Dave Robinson | 200 | Standard voice mailbox |
| Colleen Robinson | 201 | Standard voice mailbox |
| Matthew Robinson | 202 | Normal voice mailbox with e-mail notification (in this case, voice messages are attached as an audio file to a an e-mail and sent to a specified e-mail address) |
| Lisa Robinson | 203 | Normal voice mailbox with e-mail notification with deletion (in this case, voice messages are attached as an audio file to an e-mail, sent to a specified e-mail address, but the original message is deleted from the Comedian Mail system immediately) |
The voicemail.conf looks like
this:
[general] format = wav attach = yes [default] ; Syntax for new entries looks like this: ; MailboxNumber => password,name,e-mail,pager,options ; (usually, the MailboxNumber is the same as the Extension) 200 => 1234,Dave Robinson 201 => 1234,Colleen Robinson 202 => 1234,Matthew Robinson,matt@robinsonfamily.name 203 => 1234,Lisa Robinson,lisa@robinsonfamily.name,,delete=yes
In extensions.conf, we send an
unanswered call to voicemail like so:
[robinson-family]
; If nobody picks up within 30 seconds, the call is sent to voicemail
; If the extension is busy, the call is sent to voicemail
exten => _20[0-3],1,Set(TARGETNO=${EXTEN})
exten => _20[0-3],n,Dial(SIP/${EXTEN},30)
exten => _20[0-3],n,Goto(s-${DIALSTATUS},1) ; routes the call to the st
atus priority (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,VoiceMail(${TARGETNO},u) ; Person at extension "is
unavailable" message
exten => s-BUSY,1,VoiceMail(${TARGETNO},b) ; Person at extension "is
busy" message
exten => s-ANSWER,1,Hangup() ; To be safe, clean up the
call after an answer by hanging up
exten => _s-.,1,Goto(s-NOANSWER,1) ; Handle any unhandled stat
us the same way we handle NOANSWER
; Check your voicemail from your own extension by dialling "250"
exten => 250,1,VoiceMailMain(${CALLERID(num)})
A more elegant implementation can use a macro:
[robinson-family]
exten => _20[0-3],1,Macro(normal|SIP/${EXTEN}|${EXTEN})
exten => 250,1,VoiceMailMain(${CALLERID(num)})
[macro-normal];
; ${ARG1} - extension(s) being called (e.g. SIP/123&SIP/124)
; ${ARG2} - Mailbox (usually the same as ${MACRO_EXTEN})
exten => s,1,Dial(${ARG1},30) ; ring extension for a maxim
um of 30 seconds
exten => s,n,Goto(s-${DIALSTATUS},1) ; go to status priority (NOA
NSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,VoiceMail(${ARG2},u) ; Person at extension "is un
available" message
exten => s-BUSY,1,VoiceMail(${ARG2},b) ; Person at extension "is bu
sy" message
exten => s-ANSWER,1,Hangup() ; To be safe, clean up the c
all after an answer by hanging up
exten => _s-.,1,Goto(s-NOANSWER,1) ; Handle any unhandled statu
s the same way we handle NOANSWER
A business like Widgets, Inc. (introduced in ???) will need a more comprehensive voicemail system. In this example, you'll be able to see how much you can do with Comedian Mail.
The default settings for each voice mailbox are:
Beyond these default settings, individual departments have additional needs and wants for their mailboxes:
| Mailbox | Department/Title | Notes |
|---|---|---|
| 150 | Building manager on duty |
|
| 160 - 169 | IT |
|
| 802 | Sales (Domestic) |
|
| 803 | Sales (International) |
|
| 201 | Division Manager |
|
| 202 | Assistant Manager |
|
| 804 | Reception |
|
|
[a] This is a safety measure to prevent a complete denial of service in the event of a major IT outage; if the entire company staff call in and leave a message, the IT department would never be able to listen to them all. [b] We don't want e-mail sent to a specific person because there is more than one staff member in the sales group. We might, however, configure all the extensions in the group to illuminate the Message Waiting Indicator light if there are new messages in the mailbox. |
||
The voicemail.conf for Widgets, Inc.
looks like this:
[general]
; Messages are stored in higher-quality WAV format.
format = wav
; E-mail notifications sent by the system have voicemail@widgets-inc.biz
; as the From: address
serveremail = voicemail@widgets-inc.biz
; We set a maximum of 200 messages per mailbox.
maxmsg = 200
; The maximum message length is 5 minutes. The message length is set in
seconds (5 x 60 = 300)
maxmessage = 300
; We set the text for the e-mail notifications.
; The entire text must fit on one line!
emailbody = Hello, ${VM_NAME},\n\nyou have a new voicemail message from
${VM_CALLERID} in your mailbox ${VM_MAILBOX}. To listen to your new mess
ages, dial 800.\n\n-- Asterisk Voicemail System\n
; Text for the pager notifications.
; The entire text must fit on one line!
pagerbody = New voicemail from ${VM_CALLERID} at ${VM_DATE}.
; Attach messages to e-mail notifications?
attach = yes
[default]
; Syntax for new entries looks like this:
; MailboxNumber => password,name,e-mail,pager,options
150 => 1234,Building Manager,,pager.buildingmgr@widgets-inc.biz,review=y
es|callback=internal-extensions
802 => 1234,Sales (Domestic)
803 => 1234,Sales (International)
201 => 1234,Chelsea Important,bob.important@widgets-inc.biz,,review=yes|
callback=internal-extensions
202 => 1234,Rick Important,rick.important@widgets-inc.biz,,review=yes|ca
llback=internal-extensions
804 => 1234,Reception,reception@widgets-inc.biz,,review=yes
Calls are sent to voicemail in
extensions.conf like so:
[building-mgr]
include => internal-extensions
include => voicemail-buildingmgr
[it]
include => internal-extensions
include => voicemail-easyaccess
include => voicemail-generalaccess
[managers]
include => internal-extensions
include => voicemail-easyaccess
[reception]
include => internal-extensions
include => voicemail-easyaccess
[sales-domestic]
include => internal-extensions
include => voicemail-sales-domestic
[sales-international]
include => internal-extensions
include => voicemail-sales-international
[shipping]
include => internal-extensions
include => voicemail-easyaccess
[production]
include => internal-extensions
include => voicemail-easyaccess
[others]
[macro-simple];
; ${ARG1} - extension(s) being called (e.g. SIP/123&SIP/124)
; ${ARG2} - Mailbox (usually the same as ${MACRO_EXTEN})
exten => s,1,Dial(${ARG1},30) ; ring extension for a maxim
um of 30 seconds
exten => s,n,Goto(s-${DIALSTATUS},1) ; go to status priority (NOA
NSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,VoiceMail(${ARG2},u) ; Person at extension "is un
available" message
exten => s-BUSY,1,VoiceMail(${ARG2},b) ; Person at extension "is bu
sy" message
exten => s-ANSWER,1,Hangup() ; To be safe, clean up the c
all after an answer by hanging up
exten => _s-.,1,Goto(s-NOANSWER,1) ; Handle any unhandled statu
s the same way we handle NOANSWER
[internal-extensions]
; If the building manager on duty does not answer the phone,
; the call is routed to mailbox 150:
exten => _15X,1,Macro(simple|SIP/${EXTEN}|150)
; IT has normal mailboxes:
exten => _16X,1,Macro(simple|SIP/${EXTEN}|${EXTEN})
; Each manager has his or her own mailbox:
exten => _20[1-2],1,Macro(simple|SIP/${EXTEN}|${EXTEN})
; The reception staff have a common mailbox:
exten => _2[3-6]X,1,Macro(simple|SIP/${EXTEN}|804)
; The domestic sales group has a common mailbox:
exten => _3[0-4]X,1,Macro(simple|SIP/${EXTEN}|802)
; The international sales group has a common mailbox:
exten => _3[5-9]X,1,Macro(simple|SIP/${EXTEN}|803)
; No voice mail on the other extensions.
exten => _[4-5]XX,1,Dial(SIP/${EXTEN},30)
[voicemail-easyaccess]
exten => 800,1,VoiceMailMain(${CALLERID(num)})
[voicemail-generalaccess]
exten => 801,1,VoiceMailMain()
[voicemail-buildingmgr]
exten => 800,1,VoiceMailMain(150)
[voicemail-sales-domestic]
exten => 800,1,VoiceMailMain(802,s)
[voicemail-sales-international]
exten => 800,1,VoiceMailMain(803,s)
The extensions.conf for Widgets, Inc. is
already starting to look a bit more complicated. This is because we
are using different mailbox features for different users and
departments. There are normal individual mailboxes for some staff and
group mailboxes for sales and reception; on top of that, sales staff
must be able to access messages without having to enter a password.
This must be as easy and transparent as possible for individual staff
members, so we set the standard voice mailbox access number to 800 for
everyone.