.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> XML >> Post New Resource Bookmark and Share   

 Subscribe to Articles

How to setup voicemail using an XML code and how to send SMSs automatically to greet your customers

Posted By:Simon Robert VoIP       Posted Date: May 05, 2014    Points: 25    Category: XML    URL: http://www.dotnetspark.com  

This article presents what you strictly need to setup in your communication system before leaving the office for any reason. It explains how to setup voicemail and how to send SMS messages automatically to greet your customers by using an XML script.
 

Introduction

In today's business sector 24/7 ('twenty hours a day, 7 days a week') availability is more and more required. A 24/7 service is a service or business available without interruption regardless of time or day. 24/7 service might be offered by commercial companies, public service providers, indsustrial and utility services and nonprofit organisations. In addition to the availability of services provided by the companies, 24/7 availabity also means that your customers and other partners can get into contact to you in 24/4 - that is without any interruption.

After the Easter Holiday season, it occured to me that: 'What about the customers'calls made during these days?' In addition to the Easter Holiday there are many cases when you are unable to accept your customers' calls: for instance if you are out of the office, you are on Holiday or it is weekend.

On this bases, in my article I inteded to show a code example on how to implement a customized voicemail solution to be able accept incoming calls if you are out of the office.

What is Voicemail

Voicemail is a computer-based system that allows users to exchange personal voice messages, that is to deliver voice information by using a telephone. Among corporate communication systems voicemail is widespread, since the caller party can easily leave a message for the company by recording her/his voice, then later one of the employees can listen that back.

Prerequisites for my solution

In order to implement any call management feature, it is essentially needed to have a PBX. Many phone systems are available in the market, and some of them may provide APIs for customization. As I use Ozeki Phone System XE as a company PBX, in this code example I used this PBX and its OzML API to develop, as well.


The implementation of the customized voicemail


#1) Install a voicemail extension in your PBX

1.   After opening your PBX, you need to add a new voicemail extension by clicking the Add button in the Extensions panel

2.   After that, click on the Voicemail button that can be found at the right side of the screen.

#2) Configure a voicemail extension in your PBX

1.   Now it is time to configure the voicemail. The basic functionalities can be set on the General tab. Here you need to enter an extension number for your voicemail and browse a path for file saving. You also need to specify some parameters (minimum record length, recording format, automated sending in e-mail) concerning to file saving. The greeting message can be also configured: if you want to greet your callers, you can type welcome message for them (such as 'Hello, welcome to XY company! We are out of the office, so please leave a message and we will call back you!') and the Text-to-Speech engine will be reading in that. Or you can upload a prerecorded greeting message as a sound file that will be played in for the caller.

2.   After clicking on the Advanced tab, you can see that 2 functionalities can be customized. The recording behaviour specifies how the voicemail reacts when someone wants to leave a message and the play behaviour specifies how the voicemail reacts when someone wants to listen to the messages left on the voicemail.

#3) Customize the recording behaviour

1.   In the Recording behaviour section select the Custom behaviour option.

2.   You can see in the OzML code (Code example 1) that there will be two seconds of delay and a beep after the greeting message. You can optimize your recording by modifying the default OzML script (for example your can modify the record path or the format of the record that can be mp3 or wav, and you can specify the inactivity period and the finish digits to create commands for interrupting the recordingd. However, you can customize your voicemail in many other different ways. For this purpose use the OzML reference guide:http://www.ozekiphone.com/voip-reference-book-of-ozml-the-xml-language-of-ozeki-254.html

<OzML>

    $greetingmessagemode

      <Delay>2</Delay>

      <Beep></Beep>

      <Record RecordPath='$recordpath' Format='$format' Inactivity='5' FinishDigits='1234567890*#'></Record>

    <Speak>Your message has been saved.</Speak>

</OzML>

Code example 1: The default recording behaviour

 

#4) Customize the play behaviour

1.   In the Play behaviour section select the Custom behaviour option.

2.   You can customize the play behaviour by modifying the default OzML code (Code example 2) that offers you three options: If you press the 1, you can listen to your new messages. With the ForEach loop you can go through your messages, and you will be informed if you have a voicemail. Then the system will play the recording and move this file into the old messages directory. That will be repeated until you listen to the last voicemail. If you press the 2, you can listen to your old messages and you can delete them with the DeleteFile command. And finally, if you press the 3, you can record a new greeting message. However, you can setup many other option if you want to. For this purpose use the OzML reference guide:http://www.ozekiphone.com/voip-reference-book-of-ozml-the-xml-language-of-ozeki-254.html

<OzML>

    <UserInput repeat='true' digits='1'>

        <InitialCommands>

            <Speak>This is the voicemail of user $username .</Speak>

            <Speak>To listen to your new messages, press 1.</Speak>

            <Delay>1</Delay>

            <Speak>To listen to your old messages, press 2.</Speak>

            <Delay>1</Delay>

            <Speak>To record a new greeting message, press 3.</Speak>

            <Delay>2</Delay>

        </InitialCommands>

        <Inputs>

            <Input key='1'>

                <ForEach source='voicemails'>

                    <Speak>This voicemail has been recorded at $item.date from $item.from .</Speak>

                    <Play>$item.message</Play>

                    <MoveFile SourceFile='$item.message' TargetDirectory='$oldmessagepath'></MoveFile>

                </ForEach>

                <Speak>You have no new messages.</Speak>

            </Input>

            <Input key='2'>

                <ForEach source='oldvoicemails'>

                    <Speak>This voicemail has been recorded at $item.date from $item.from .</Speak>

                    <Play>$item.message</Play>

                    <UserInput digits='1' timeout='3'>

                        <InitialCommands>

                            <Speak>To delete this message, press 1.</Speak>

                        </InitialCommands>

                        <Inputs>

                            <Input key='1'>

                                <DeleteFile>$item.message</DeleteFile>

                            </Input>

                        </Inputs>

                    </UserInput>

                </ForEach>

                <Speak>End of old messages.</Speak>

            </Input>

            <Input key='3'>

                <Speak>Your new greeting message will be recorded. The recording will start after the beep.</Speak>

                <Delay>1</Delay>

                  <Beep></Beep>

                  <Record RecordPath='$greetingmessage' Format='$format' Inactivity='5' FinishDigits='1234567890*#'></Record>

                <Speak>Your new greeting message has been saved.</Speak>

            </Input>

        </Inputs>

    </UserInput>

</OzML>

 Code example 2: The default play behaviour

 

#5) Setup dial plan rules

In order to listen to your voicemails, call your Voicemail extension. If someone else calls your Voicemail extension, the caller will be able to leave a message for you.

By default, every extension can call every other extension. For changing the that or managing outgoing and incoming calls from outside lines, you will need to set up dial plan rules:

1.   If you would like to call telephones in PSTN or GSM networks, you need to set up Standars connections within the Outside lines panel, and you also need to set Outbound routing rules within the Dial plan panel (since the called party is not on the list of Standard extensions in the PBX).

2.   It is also possible that there are incoming calls from the PSTN or GSM networks. In these cases, you need to add Inbound routing rules to forward them to any of the extensions.

3.   If a call is not answered by the destination and you wish to forward that to an another extension (for example to a Voicemail), you need to add new Missed call rules.

4.   To be able to send and receive SMS messages, you need to add new Message routing rules.

Bonus tutorial: How to send automated greeting SMS for your partners

The following code example demonstrates how to send an automated [Have a nice day or Happy Birthday] SMS for your customers by using OzML.

<Response>

        <SendSms Recipient="+062554670">

        Have a nice day, Dear Customer!

        </SendSms>

</Response>

Code example 3: Automated SMS sending with OzML

This code example sends the 'Have a nice day, Dear Customer!' greeting messeage with the <SendSms> OzML command. Now host your script by using your database.

Summary

Voicemail is the best option to be able to accept all calls incoming while you are out of the office. Due to the OzML API, it is quite easy to customize your voicemail system based on your sepcific needs. I have added a short script to my article that presents how to send a greeting SMS message to your customers in order to wish them a nice day. This code can also used during any Holidays or as a reminder or alert SMS.

References


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend