How to make an Interactive Voice Response (IVR) using an OzML script

14
How to make an Interactive Voice Response (IVR) using an OzML script This slideshow is intended to be a great explanation on how to develop an Interactive Voice Response (IVR) in the most simplest way. It explains how to build an IVR menu system through HTTP requests and responses. This presentation is meant to be a detailed step-by-step guide with free source code. 1/14

description

This slideshow is intended to be a great explanation on how to develop an Interactive Voice Response (IVR) in the most simplest way. It explains how to build an IVR menu system through HTTP requests and responses. This guide is meant to be a detailed step-by-step guide with free source code.

Transcript of How to make an Interactive Voice Response (IVR) using an OzML script

How to make an

Interactive Voice Response (IVR) using an OzML script

This slideshow is intended to be a great explanation on how to develop an Interactive Voice Response (IVR) in the most simplest way. It explains how to build an IVR menu system through HTTP requests and responses. This presentation is meant to be a detailed step-by-step guide with free source code.

1/14

What is IVR?

IVR is the acronym of Interactive Voice Response that is a widely used technology in most of today’s businesses. It is used for interacting with the computer or database of the company with DTMF tones of the phone keypad. It works so that the customer calls up the IVR of the company and the IVR will navigate the customer to the menu point he/she needs, with the help of a voice menu. This voice menu can be read out by the computer or it can stand of pre-recorded messages. These IVR systems are most commonly used by banks and Phone/TV/Internet providers.

What you need to create an IVR?

IVR systems are most commonly made with PBXs because they already have the necessary tools ready and you don’t have to create everything from scratch. In this article I am going to use the Ozeki Phone System XE because this is the PBX I am most familiar with, but you can use any other IP PBX of your choice. So for this article you will need the Ozeki Phone System XE and the Wampserver, which will work as a web server and two VoIP phones registered to the PBX. They can be either desktop or softphones.

2/14

The creation of the IVR Install the PBX

Before everything you have to install the Ozeki Phone System XE and the Wampserver on your computer. I’ll assume that you have already done it so let’s see how to begin with your IVR system.

Figure 1 The login screen of Ozeki Phone System XE

3/14

The creation of the IVR Register 2 VoIP phones into the PBX

First of all you are going to register the 2 VoIP phones into the PBX. For this you have to login to the the phone system with the username and password you have given during the installation.

In the main screen of the Ozeki Phone System XE you have to click on the Install button next to the SIP extension in the Extensions column at the right side of the screen.

Figure 2 Add an extension

4/14

Set the Phone Number, Authentication name and Password for 2000 for the first phone as you can see on Figure 3.

Figure 3 The configuration of the first phone

The creation of the IVR Configure the first SIP extension

5/14

Then add another extension, just this time instead of 2000 give it the value of 500. After you are ready with this step you have to configure the phones themselves so they can register in to the PBX. When both phones have successfully registered to the phone system you will see the following:

Figure 4 The registered phones

The creation of the IVR Add another SIP extension

6/14

The next step is to Add an API extension, for this click on the Add button in the Extensions column and scroll down the screen to API extension. Then click on the Install next to it and name it to 7000 and click on OK as you can see on the figure below:

Figure 5 The creation of the API extension

The creation of the IVR Add another SIP extension

7/14

<?php

header ("Content-Type:text/xml");

?>

<?xml version="1.0" encoding="UTF-8"?>

<Response>

<UserInput timeout="5" repeat="true">

<InitialCommands>

<Speak>

Welcome to XYZ Phone Company!

For the handling of your subscription matters, press 1.

For the management of your user account, press 2.

For transferring you to one of your agents, press 3.

</Speak>

</InitialCommands>

<Inputs>

<Input Key="1">

<UserInput timeout="2" repeat="true">

<InitialCommands>

<Speak>

For balance inquiring, press 1.

For a new bill, press 2.

</Speak>

</InitialCommands>

<Inputs>

<Input Key="1">

<Speak>

Your balance is 234 Dollar!

</Speak>

<Hangup></Hangup>

</Input>

<Input Key="2">

<Speak>

You are going to receive a new bill.

</Speak>

<Hangup></Hangup>

</Input>

</Inputs>

</UserInput>

</Input>

<Input Key="2">

<UserInput timeout="2" repeat="true">

<InitialCommands>

<Speak>

If you have forgotten your password, press 1.

If you want to activate your account, press 2.

</Speak>

</InitialCommands>

<Inputs>

<Input Key="1">

<Speak>

Your password is "I have forgotten".

</Speak>

<Hangup></Hangup>

</Input>

<Input Key="2">

<Speak>

Your account is activated.

</Speak>

<Hangup></Hangup>

</Input>

</Inputs>

</UserInput>

</Input>

<Input Key="3">

<BlindTransfer>500</BlindTransfer>

</Input>

</Inputs>

</UserInput>

</Response>

Now we have arrived to the most important part of our IVR system. You are going to create an IVR menu by writing an OzML code. You may wonder what OzML is so I’ll tell you.

Ozeki XML (OzML) is an XML language that uses predefined commands. These commands are used in response to the notifications coming from the PBX.

For better understanding of the code you can find a detailed guide of the OzML commands in the following page:

http://www.ozekiphone.com/voip-ozml-254.html

You will have to save the IVR menu in the form of a .php file, for this article I have made the IVR.php which as you will see below is just a simple menu meant to be an example. You can write this code in a simple text editor, you just have to save it as IVR.php.

Writing the OzML code

8/14

As you can see what this menu does is it reads out the text between the <Speak> and </Speak> tags and depending on the buttons you press on your phone, it brings you to the appropriate parts of the menu. After the text is read out in the submenus, the IVR will hang up the call or if you asked for an agent it will transfer the call to his/her phone.

After you have made the IVR.php you will need to copy it to the www folder of wamp which can be found by default in the following path: C:\wamp\www\

The next step is to start the services of Wampserver, so the IVR.php file will be available in your local host web server. The services may not start if any other application is using the port 80. In this case you have to close those programs which usually are the Skype or stop the services of an SQL server.

After this you have to open Ozeki Phone System XE and navigate your mouse cursor to the drop down menu of Productivity and select the HTTP API from it.

Writing the OzML code (2)

Figure 6 Select HTTP API

9/14

In the screen of the HTTP API click on the Subscribe to events and in its window click on Subscribe. In the Subscribe for PBX events windows select the previously created 7000 API extension and type in the URL of the IVR.php to the Incoming call URL: textbox which in our case is going to be: http://localhost/IVR.php. You can see these setting in the figure below.

Figure 7 Create HTTP API

HTTP API settings

10/14

The next step is to get back to the main screen of Ozeki Phone System XE and add a Dial plan for the API extension. For this click on the Add button in the Dial plan column. In the next window set Outbound/internal call for Rule scope and set the SIP extension 2000 as Specific extension in the Source field. Then in the Destination field set the API extension 7000 as Send to extension then click on save. With this the necessary Dial plan is created and our IVR is ready to accept the calls.

Figure 8 The dial plan for the API extension

Add dial plan rules

11/14

The previous dial plan does the following. It will forward the calls from the SIP extension 2000, which is one of the registered phones to the API extension. You could select the Any extension too in the Source field for letting every extension in your network to be able to call up the API extension. But if you want to let phones outside from your network to be able to call up the IVR you will have to set a dial plan for Inbound calls.

With this your IVR system is ready to be tested, so if you did everything according to this guide till know you should see the same in the home page of your PBX as on the figure below:

Figure 9 The finished configuration

HTTP API settings

12/14

For the testing of the IVR you should call up the API extension 7000 from the phone which is registered into the PBX with extension number 2000. The call should be successful and if you open the API extension click on the link next to the History of the extension. Then you should see the call history of the API extension and a successful call in it, which was hung up by the callee.

Figure 10 Successful test call

Make a test call

13/14

References

You can get the latest version of Wampserver for free from its official page: http://www.wampserver.com/en/

You can download the trial version of Ozeki Phone System XE from the following page: http://www.ozekiphone.com/

How to make an

Interactive Voice Response (IVR) using an OzML script

To sum it up this presentation is about the creation of a simple IVR menu that can read out some customer related information or it can transfer the customer to a live agent. For this I have used the Ozeki Phone System XE as an IP PBX and Wampserver as a web server. I have written the IVR menu in OzML script language which is Ozeki’s own programming language. It was quite easy to create the IVR thanks to the OzML language, because it has already implemented every function that I needed for my IVR, I only had to use the predefined tags. So I can gladly recommend it to anyone who wants to make an IVR menu because he/she only has to use the necessary tags and does not need to write every function himself/herself.

14/14