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?
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.
of the IVR
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.
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
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
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
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.
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
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.
<?xml version="1.0" encoding="UTF-8"?>
<UserInput timeout="5" repeat="true">
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.
<UserInput timeout="2" repeat="true">
For balance inquiring, press 1.
For a new bill, press 2.
Your balance is 234 Dollar!
You are going to receive a new bill.
<UserInput timeout="2" repeat="true">
If you have forgotten your password, press 1.
If you want to activate your account, press 2.
Your password is "I have forgotten".
Your account is activated.
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.
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
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.
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
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
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
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
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
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
- 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/voip-download-ozeki-phone-system-xe-pbx-software-for-windows-21.html