text
stringlengths
0
152
exten => *98,1,NoOp(Access voicemail retrieval.)
same => n,VoiceMailMain()
Any user whose device is assigned to the [sets] context can now dial *98, and they’ll
be able to log into their mailbox to listen to messages, record their name, set their
greeting, and so forth.
Standard Voicemail Keymap
Figure 8-1 shows the standard keymap configuration for Asterisk Mail. Some options
may be enabled or disabled based on the configuration of voicemail.conf (e.g.,
envelope=no). This can be given to users as a reference.
142
|
Chapter 8: Voicemail
Figure 8-1. Keymap configuration for Comedian Mail
Creating a Dial-by-Name Directory
One last feature of the Asterisk voicemail system that we should cover is the dial-by-
name directory. This is created with the Directory() application. This application
uses the names defined in the mailboxes in voicemail.conf to present the caller with a
dial-by-name directory of users.
Directory() takes up to three arguments: the voicemail context from which to read
the names, the optional dialplan context in which to dial the user, and an option
Voicemail Dialplan Integration
|
143
string (which is also optional). By default, Directory() searches for the user by last
name, but passing the f option forces it to search by first name instead. Let’s add two
dial-by-name directories to the TestMenu context of our sample dialplan, so that call‐
ers can search by either first or last name:
exten => 4,1,Dial(${UserB_SoftPhone},10)
same => n,Playback(vm-nobodyavail)
same => n,Hangup()
exten => 8,1,Directory(default,sets,f)
exten => 9,1,Directory(default,sets)
exten => i,1,Playback(pbx-invalid)
same => n,Goto(TestMenu,start,1)
If you call 201, and then press 8, you’ll get a directory by first name. If you dial 9,
you’ll get the directory by last name.
Voicemail to Email
When Asterisk first came out, it did something very simple that was nevertheless rev‐
olutionary within the PBX market of the time. None of the major PBX brands could
figure out how to effectively send voice messages to email (which, put simply, is just
sending an email with the message itself as a WAV file attachment). Sure, some man‐
ufacturers offered the functionality, but it was needlessly complex, unreliable, and
expensive. Asterisk cut through all that nonsense and just allowed a mailbox to have
an assigned email address, and messages would simply be sent through the normal
email mechanisms of Linux. This proved both simple and effective, and really showed
how out-of-date and out-of-touch the traditional PBX manufacturers were.
Unfortunately, in every great story there’s always a bad guy, and in this case a whole
epidemic of them: spammers nearly brought the internet to its knees. The simple
SMTP relay could no longer be trusted, as any machine open to relaying email would
quickly become a vector for spam.
So, email became far more complex. If you want to send email from your Asterisk
system, you have three fundamental ways to do that, as shown in Table 8-7.
144
|
Chapter 8: Voicemail
Table 8-7. Overview of methods for transmitting voicemail to email
Cons
Downstream spam filters will
tend to discard suspicious
traffic, and this traffic will look
very suspicious.
The downstream relay server
will need to be configured to
work correctly with this
arrangement (it will need to
trust email relayed from your
Asterisk server).
Slightly more complicated to set
up on the Asterisk server.
Method
1. Send email in the clear, directly to the SMTP port
of the MX record the target domain returns. Almost
guaranteed to fail.