Howto:Send Email MWI Notification From The innovaphone Voicemail: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
(Added "Configure the SMTP Agent, Firmware Version 13r1")
Line 62: Line 62:
Client host name
Client host name
;$_pbx_auth_email_addr:
;$_pbx_auth_email_addr:
Email address
Sender Email address
;$_pbx_auth_email_usr:
;$_pbx_auth_email_usr:
Username for authentication
Username for authentication
Line 69: Line 69:
;$_pbx_auth_email_sender:
;$_pbx_auth_email_sender:
Sender name
Sender name


==Configure the SMTP Agent==
==Configure the SMTP Agent==

Revision as of 17:15, 17 April 2019

Applies To

This information applies to

Note: The required Voicemail is not suitable for V6 SR1 environments.

  • innovaphone PBX, V6 SR2
  • innovaphone Voicemail, Build 07-60049

More Information

Email notifications about newly received voicemails can be sent towards the owner of a voicebox. The mechanism is not reliable, because there is no spooling implemented. Currently, there will be one transmission attempt per email.

The destination email address can be taken from a file, that is to be located within the ../personal directory of a voicebox. Alternatively may the email address be configured into a user's URL parameter within the corresping PBX object.

Such an email consists of a subject "You have received a new voicemail from: xxx", where xxx stands for the number of the calling party. There is additional functionality available to attach a voicemail as a wave file (a-law, u-law encoded) to an email.

The email will be sent by means of the Simple Mail Transfer Protocol (SMTP). The protocols SMTPS/SMTP over TLS/STARTTLS are not supported at the moment - a pending feature request exists already.

As SMTP Authentication mechanisms are supported (as of the writing of this arcticle): PLAIN, LOGIN and CRAM-MD5

Installation

  • Install the above mentioned VoiceMail build or later as usual.
  • In the VoiceMail folder where vm.xml is placed you will find email.xml. This file contains the SMTP configuration and must be edited to adjust it to your needs.
  • Ensure that the IP configuration (Default Gateway, DNS server) is appropriate.

Provisioning Of Destination Email Addresses

Email addresses must be configured manually. The script file email.xml firstly looks into a user's E-Mail parameter (only on the first configured E-Mail). If no value found in the E-Mail parameter, the user's URL parameter is used at second place and then the user's personal file mail.txt, in order to find an email destination. Since the URL parameter may be used in other contexts, the script ensures that a non-empty URL parameter contains the '@' character as an indication that it deals with an email address.

By E-Mail Parameter

The email address can be taken from a user's E-Mail parameter.

Provisioning of a user's email address by E-Mail parameter

  • Proceed to PBX/Objects.
  • Open the desired Object GUI by clicking on it.
  • Enter the email address into the E-Mail edit field. The email address may be entered raw as e.g. pbxuser@mycompany.com.

Repeat these steps for each voicebox.

By URL Parameter

The email address can be taken from a user's URL parameter.

Provisioning of a user's email address by URL parameter

  • Proceed to Administration/PBX/Objects.
  • Open the desired Object GUI by clicking on it.
  • Enter the email address into the URL edit field. The email address may be entered raw as e.g. pbxuser@mycompany.com or as mailto-URL alike e.g. mailto:pbxuser@mycompany.com.

Repeat these steps for each voicebox.

By File

The email address can be taken from the mass storage. The destination email address can be written into a file.

Provisioning of a user's email address by file

  • Within a text editor open up a new file.
  • Enter the user's email address, e.g.: pbxuser@mycompany.com
  • Save the file as ...yyy/personal/mail.txt, where yyy stands for the directory name of the user's voicebox.

Repeat these steps for each voicebox.

Configure the SMTP Agent, Firmware Version 13r1

From on 13r1 the script email.xml doesn't need to be edited. The script reads the static configuration underneath PBX/Config/Authentication/Email Verification. The following script variables will yield those email settings when read.

$_pbx_auth_email_server

SMTP server

$_pbx_auth_email_host

Client host name

$_pbx_auth_email_addr

Sender Email address

$_pbx_auth_email_usr

Username for authentication

$_pbx_auth_email_pwd

Password for authentication

$_pbx_auth_email_sender

Sender name

Configure the SMTP Agent

By default the email will be sent with the sender- and destination- email address being identical. In addition will the email be sent alike a Mail Transfer Agent (MTA) does.

You can configure the content of the above mentioned file email.xml, in order to provide a different sender email address.

You can also control that emails are to be sent alike a Mail User Agent (MUA) does, or in other words: alike a regular email SMTP client does.

Open up the file email.xml within a text editor.

  • In order to modify the sender email address, modify the line
    <assign out="$from" value="$to"/>

into e.g.

    <assign out="$from" value="voicemail@mycompany.com"/>

PLEASE NOTE (obsolete with V11) : if your smtp server requires authorization, you will also need to edit the following line at the end of the email.xml file:

<exec url="mailto:$to?from=$to&subject=$subject&subject=$cgpn&srv=$server&usr=$user&pwd=$password&file=$file"/>

to

<exec url="mailto:$to?from=$from&subject=$subject&subject=$cgpn&srv=$server&usr=$user&pwd=$password&file=$file"/>

otherwise sender address and authorization credentials won't match and you will get an "authorization failed" error

MTA-to-MTA communication may fail, depending on policies implemented within the receiving MTA. Therefore, it is desirable to turn our sending MTA into a simple MUA. That is, emails are to be sent via an SMTP provider server. Such a server is often termed as an Outgoing SMTP Server.

Open up the file email.xml within a text editor.

To configure an outgoing SMTP server, modify the lines

    <assign out="$server" value=""/>
    <assign out="$user" value=""/>
    <assign out="$password" value=""/>

into e.g.

    <assign out="$server" value="smtpserver.myprovider.com"/>
    <assign out="$user" value="myuser"/>
    <assign out="$password" value="mypassword"/>

Note : the server value can be also with port configured like this : smtpserver.myprovider.com:port

mailto: URL Query Arguments

The SMTP agent is configured using query args. The following args are recognized

from
sets the senders's email address. Must be a valid email address thus. E.g. ?from=user@company.tld
subject
sets the email's subject. The values of multiple occurrences of the subject query arg will be concatenated. E.g. ?subject=foo&subject=bar yield foobar as subject. Empty by default.
body
sets the email's body. The values of multiple occurrences of the body query arg will be concatenated. E.g. ?body=foo&body=bar yield foobar as body. Empty by default.
srv
sets the SMTP server address (that is, the address of the SMTP server the mail is sent to). Must be either an IP address or a DNS name. Empty by default. If you need another port than 25, just add :<portnr> at then end of to the srv
usr
sets the user name to be used for authentication towards the SMTP server. Empty by default.
pwd
sets the password to be used for authentication towards the SMTP server. Empty by default.
fromname
sets the sender's display name. Voicemail by default.
toname
sets the recipients's display name. Voicemail User by default.
host
sets the local SMTP name (used in SMTP HELO or ELOH command). [127.0.0.1] by default.

Please note that the mailto: URL in email.xml must be noted as valid XML code. Special characters (most notably the ampersand &) must be quoted thus, e.g. ?subject=foo&amp;subject=bar

MS Exchange 2003

An in-house test yielded the following approach, allowing to talk to the Exchange 2003 MTA-wise. The file email.xml was left as-is, except the following line has been set to the dotted decimal IP address of the exchange machine.

    <assign out="$server" value="172.16.0.4"/>

or when you smtp server is listening on port 2525 instead of 25

    <assign out="$server" value="172.16.0.4:2525"/>

This allowed an intranet PBX to send emails to Exchange users, where the source- destination email address were identical.

Send Voicemail As Email Attachment

Emails won't carry a voicemail attachment by default. The file email.xml can be edited, in order to send voicemails as wave files together with the notification email.

Open up the file email.xml within a text editor, modify the line

<assign out="$file" value=""/>

into

<assign out="$file" value="$vm"/>


The wave files will inform about themselves as to contain a-law-, respectively u-law content. From on Windows XP SP2 the Mediaplayer will contain the required codecs.

Testing

  • Call a user with a CFU into his/her voicebox.
  • Leave a voicemail, tear down (on-hook) the call.
  • The owner of the voicebox should now have received an email.


Troubleshooting

Before contacting the support, you are asked to create a trace file covering the transmission attempt for an email.

The following lines in the configuration must be changed manually, from:

config change DNS0
config change SMTP0

into

config change DNS0 /trace
config change SMTP0 /trace

Activate the trace checkmark at the affected voicemail object. In addition should the voicemail object's trace flags be set to the value 59 alike: http://192.168.0.1/drive/CF0/vm.xml?$_trace=59.