.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 create an IVR by using your web server

Posted By:Simon Robert VoIP       Posted Date: February 14, 2014    Points: 200    Category: XML    URL: http://www.dotnetspark.com  

This article is intended to be a great explanation on how to develop an Interactive Voice Response (IVR) in the most simplest way. It can be used to interact with the computer or database of the company with DTMF tones of the phone keypad. This guide is meant to be a detailed step-by-step guide with free source code.
 

How to create an IVR by using your web server

 

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 PBXes 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 Ozeki PBX. They can be either desktop or softphones.

The creation of the IVR

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

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

Figure 1 - The login screen of Ozeki Phone System XE

In the main screen of the Ozeki PBX 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

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

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 you will see the following.

Figure 4 - The registered phones

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

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-reference-book-of-ozml-the-xml-language-of-ozeki-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.

<?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>

The IVR code (OzML)

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.

Figure 6 - Select HTTP API

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

The next step is to get back to the main screen of the phone system 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

The dial plan above 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 Ozeki Phone System XE as on the figure below.

Figure 9 - The finished configuration

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

Summarize

To sum it up this article 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.

References

  1. You can get the latest version of Wampserver for free from its official page: http://www.wampserver.com/en/
  2. You can download the trial version of Ozeki Phone System XE from the following page: http://www.ozekiphone.com/voip-download-ozeki-phone-system-xe-pbx-software-for-windows-21.html


 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