Welcome Back. In Part 1 and Part 2 we finished installing asterisk and configured IVR in this part we will confiugre voicemail and SFB/Lync side.
Install postfix on linux
- First you need to remove sendmail and install postfix to make it default mail client on the voicemail server.
- To remove snedmail run "yum remove sendmail".
- To install postfix run "yum -y install postfix mailx cyrus-sasl-plain" .
- You need to create a new file with name "/etc/postfix/sasl_passwd" with your mail account smtp server and credentials in the following format:
- Then you need to hash your password file by run "postmap hash:/etc/postfix/sasl_passwd"
- Open the /etc/postfix/main.cf and add following lines.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
# Secure channel TLS with exact nexthop name match.
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
relayhost = smtpserver.yourdomain.com
- You could change tls confiugration according to your SMTP server.
- Some times you will need to change the from email address in the header of sent mail so you need to create two additional files "/etc/postfix/header_checks,canonical" check this URI for more details http://tech.gate.io/postfix-sender-address-rewriting-changing-mails-from-field-in-header-on-relay-server/
- Then restart the postfix service by "service postfix restart".
- Test sending mail by run "echo 'Test mail from voicemail system' | mail -s 'test mail' -r 'voicemail system <firstname.lastname@example.org>' email@example.com".
- To troubleshoot you could find the logs in "/var/log/maillog"
- Once you send the mail check your email to see if you received the email and then you can go ahead and remove the text password file by run "rm /etc/postfix/sasl_passwd".
Configure asterisk voicemail
- first copy the voicemail sample file from sample to asterisk directory by run "cp /usr/src/asterisk*/configs/vociemail.conf.sample /etc/asterisk/voicemail.conf"
- If you need more details on how to configure the voicemail file just read the sample file comments, but I'll go through basic needs.
- To change from name check "fromstring="
- To change the subject check "emailsubject="
- To change the body check "emailbody="
- Now we will configure the voicemail boxes by write the following under "[default]" section
user 3 digit extension=> 1234,user display name,user email address
- repeat this line for every user you need to send him voicemail.
Configure missed call notification
- Now let's configure the missed call notification open "/etc/asterisk/extensions.conf".
- write following line at end of "[IVR_EN]" and "[IVR_EN]" sections.
- Write "[Missed]" in the end of the file.
- Under "[Missed]" section write.
- Repeat this line for every user you need to send him voicemail.
- Restart asterisk service.
Configure SIP trunks @ SFB/Lync and @ voice gateway
- From Lync/SFB side it is similar to create SIP trunk with any gateway it was written a lot in other blog so no need to duplicate it here but to summarize you need to do the following.
- Create SIP trunk with IVR using port 5060 at both sides.
- Create SIP trunk with Voice gateway.
- Route external calls to Voice gateway.
- About voice gateway it depend upon your gateway, but you need to do the following:
- Create sip trunk with IVR server using port 5060 for each side using TCP as transport.
- Create sip trunk with Lync/SFB.
- Route 299 calls to IVR system.
- Route DID to Lync/SFB direct.
- I'll provide in next blogs examples on how to configure most gateways which integrate with Lync/SFB.