Voicemail, Missed Calls to E-mail, IP Phone Setup

Voicemail, Missed Calls to E-mail, IP Phone Setup
The "Voice Mailbox" system (in English VoiceMail, which for brevity I will use from now on) allows, as its very name suggests, recording a voice message for an employee when they are away from their desk. VoiceMail has not become widespread in our country. First, because of the spread of mobile communications, when an employee can be "tracked down" literally … everywhere. Second, an employee who returns to their place must somehow find out that there are voice messages for them. It is good if the office phone has a display and the appropriate settings are made to show information about unheard messages as an icon or a number. But how many employees actually pay attention to the office phone’s display? Or else everyone in the office must develop the habit of immediately pressing the button to listen to incoming messages upon returning to their workplace. It is somehow hard to believe in such behavior from the majority of employees.
However,
- if the use of mobile phones in your company is regulated to a certain extent,
- if employees do not hand out their mobile numbers left and right (especially on corporate plans),
- if VoiceMail is configured to send the voice message as an audio file to the employee’s e-mail (everyone does check e-mail!),
the VoiceMail system can boost the efficiency of your work. It can simply raise, figuratively speaking, the work culture of employees.
Using the example of the Asterisk IP telephony server and Fanvil 210 and Snom m9 devices, this can be set up as follows -
On the server, the configuration file /etc/asterisk/voicemail.conf must contain the following parameters:
[general]
Format = wav49|gsm # audio file format
Serveremail = zzz.zzz.zu #name/address of the mail server
Attach = yes #so that the recorded file is attached to the e-mail
Charset = UTF-8 #this is clear
Locale=ru_RU.UTF-8
Moveheard = no #so that listened messages are not moved to the Old folder. All messages are in the INBOX folder, which is the default folder a caller dialing the VoiceMail number ends up in.
Minsecs = 3 #the minimum message length for Asterisk to record the message into a file. By default there are no limits, i.e. the subscriber breathed into the receiver for 0.5 sec and this bit of erotica got recorded and even flew off to the employee as an attachment.
pbxskip=yes ; Skip the "[PBX]:" string from the message title
fromstring=Voicemail #your text for the From: field
emailsubject = Message from ${VM_CIDNAME} (${VM_CIDNUM}) #the original voicemail.conf has examples
emailbody = Dear ${VM_NAME},nnt on ${VM_DATE} ${VM_CIDNAME} (phone number ${VM_CIDNUM}) tried to reach you. They even left you a message ${VM_DUR} long - see the attachment.ntMoreover, you can enter the voicemail system by dialing 334.nnP.S.tDo not forget that left messages take up space on the server disk.ntThe admins will delete them and that’s it!
emaildateformat=%A, %d %B %Y at %H:%M:%S #I like it this way better
mailcmd = /usr/bin/msmtp -C /etc/msmtp.conf -t #a small program for sending; be sure to read the documentation before use!
sendvoicemail = no #does not allow users to record and send a message while they are directly inside their own voicemailbox.
[default] #this default is not at all the same default as in /etc/asterisk/extensions.conf
#these are the mailboxes themselves.
110 => passwd,Vasya,[email protected],,delete
109 => passwd,Petya,[email protected],,delete
In the next config /etc/asterisk/sip.conf
among other things, there must be these lines:
[general]
..
vmexten = 334 #the extension number for entering VoiceMail; it will appear later in extension.conf, and also so that the MWI button works correctly on IP devices.
..
#And in the accounts themselves
[109]
type=friend
username=109
...
mailbox=109@default
..
[110]
type=friend
username=110
...
mailbox=110@default
..
#This is also needed for the IP devices to work correctly

And finally /etc/asterisk/extensions.conf itself must contain
exten => 109,1,NoOp("${CALLERID(num)}" --> ${EXTEN})
same => n(hasvm),Set(HASVOICEMAIL=yes)
same => n,Set(ORIGINALXTEN=${EXTEN})
same => n,Set([email protected])
;The three lines above will be needed for checks
same => n,Dial(SIP/${EXTEN},15,t)
same => n,NoOp(Status is "${DIALSTATUS}")
same => n(busycheck),GotoIf($["${DIALSTATUS}" = "CONGESTION"]?BadDial,s,1:)
same => n,GotoIf($[${DIALSTATUS}=NOANSWER]?noanswer,1:) ;And this is the redirect on "no answer"
same => n(end),Hangup()
Accordingly, Vasya needs the same kind of rule. Naturally, in Asterisk you can use templates.
#And now the checks begin
exten => noanswer,1,NoOp(The subscriber did not answer. HASVOICEMAIL=${HASVOICEMAIL})
exten => noanswer,n,GotoIf($["${HASVOICEMAIL}" != ""]?vm-noanswer,1)
exten => noanswer,n,NoOp(The subscriber has no voicemailbox)
exten => noanswer,n,Hangup() ;Hang up
exten => vm-noanswer,1,NoOp(Wow! The subscriber has VoiceMail!)
exten => vm-noanswer,n,Wait(1)
exten => vm-noanswer,n,VoiceMail(${ORIGINALXTEN},u) ; The u option is so that the caller hears that the subscriber is unavailable and that they may leave a message…
exten => vm-noanswer,n,Playback(vm-goodbye)
exten => vm-noanswer,n,Hangup()
;Entering the voice mailbox
exten => 334,1,Answer()
same => n,Set(CHANNEL(language)=ru)
same => n,Wait(0.5)
same =>n,VoicemailMain(${CALLERID(num)},sa(0))
same => n,Hangup()

Setting up the IP devices.
Fanvil 210
VOIP>SIP>Voice Mail Number>109 #the mailbox number
PHONE>CALL SERVICE>MWI Number>334 #the VoiceMail extension number #so that the MWI button works
Snom9
Up to 9 handsets can be connected to the base; we go to the settings of a specific handset
Identity 1>Account>Mailbox>334 # Note! Here we enter not the mailbox number but the VoiceMail extension number!!!

After these manipulations, when there are messages in the VoiceMailBox, an "envelope" icon appears on both devices. On the Fanvil the MWI button works; on the Snom the top right button takes on the same function.
And the employee receives an e-mail like this:
Subject: Message from Fedorova (192)
Attachments: msg0007.WAV (17 kB)
Dear Petya,
On Tuesday, 20 January 2015 at 09:02:03 Fedorova (phone number 192) tried to reach you. They even left you a message 0:09 s long - see the attachment.
Moreover, you can enter the voicemail system by dialing 334.
P.S. Do not forget that left messages take up space on the server disk.
And the admins are not made of iron, they will simply delete them and that’s it!

With this level of "service", most likely no one will dial 334. And no one will ever enter their VoiceMailBox. But the goal is achieved! And old messages from the voice mailboxes can be deleted on a schedule, so that they really do not take up space. Or perhaps after some time your employees will warm to the possibilities of VoiceMail, and you will have to change the settings a little to make fuller use of the system’s functionality.
Article author: Andrey