IVR Introduction
Interactive Voice Response (IVR) applications enable callers to interact with any software, such as query and modify database information, over the telephone. Callers can use their touch-tone pad to input requests, or just say what they want to do, such as requesting account balance information. IVR systems usually employ text-to-speech software to read information back.
Voicent Gateway Background
Voicent Gateway is ideal for developing interactive telephony applications such as Voicent AutoReminder and Voicent BroadcastByPhone. Based on the W3C VoiceXML standard, Voicent Gateway enables interactive voice access to the web and enterprise systems from any telephone.
Voicent Gateway can be deployed on any Windows 2000/2003/XP/Vista PC, making it possible to develop and deploy Voicent based solutions at a cost most small business and organizations can afford. The gateway also supports multiple phone lines by using multiple modems on a single computer. For large scale applications, multiple gateways in different locations can be networked together through the web interface.
Voicent Gateway requires no additional hardware when used with Skype. Calls are made over the Internet to landline or cell phones. The gateway also supports regular analog phone lines through the use of a voice modem. You can combine Skype and voice modems together to easily increase system capacity.
Voicent Gateway contains an outbound call scheduler which can be accessed through its HTTP interface. This interface enables easy integration with almost any application and with almost any programming language.
VoiceXML tutorial and samples are provided under the developer section of this website. For setup and options, please see Voicent Gateway User Guide. A free version of the product is also available for download.
You can also use IVR Studio to develop your IVR applications. This tool enables flexible application development without any knowledge of VoiceXML. All you need is point and click to draw a call flow diagram.
Using the IVR API
Since all these functions are implemented as an HTTP client communicating directly with the Voicent Gateway, they can be run on any machine that has a connection to the host running the gateway. The Java interface source code is included at the end of this section.
This Java Simple Interface is developed based on the Voicent Gateway Simple Outbound Call Interface.
callText
String callText(String phoneno, String text, boolean selfdelete)
Make a phone call and play the specified text message. The text message is converted to voice by Voicent Gateway's text-to-speech engine.
The options are:
phoneno | The phone number to call |
text | The message for the phone call |
selfdelete | Ask the gateway to automatically delete the call request after the call is made, if it is set to '1' |
The return value is the call request ID <reqId>
.
Example
callText("123-4567", "Hello, how are you doing", 1);
Make a call to phone number '123-4567' and say 'Hello, how are you doing'. Since the selfdelete
bit is set, the call request record in the gateway will be removed automatically after the call.
String reqId = callText("123-4567", "Hello, how are you", 0);
Make a call to phone number '123-4567' and say 'Hello, how are you'. Since the selfdelete
bit is not set, the call request record in the gateway will not be removed after the call. You can then use callStatus
to get the call status, or use callRemove
to remove the call record.
String callAudio(String phoneno, String audiofile, boolean selfdelete)
Make a phone call and play the specified audio message.
The options are:
phoneno | The phone number to call. |
audiofile | The audio message for the phone call. The format must be PCM 16bit, 8KHz, mono wave file. The audio file must be on the same host as the Voicent Gateway. |
selfdelete | Ask the gateway to automatically delete the call request after the call is made, if it is set to '1'. |
The return value is the call request ID <reqId>
.
Example
callAudio("123-4567", "C:\my audios\hello.wav", 1);
Make a call to phone number '123-4567' and play the hello.wav file. Since the selfdelete
bit is set, the call request record in the gateway will be removed automatically after the call.
String reqId = callAudio("123-4567", "C:\my audios\hello.wav", 0);
Make a call to phone number '123-4567' and play the hello.wav file. Since the selfdelete
bit is not set, the call request record in the gateway will not be removed after the call. You can then use callStatus
to get the call status, or use callRemove
to remove the call record.
String callStatus(String reqId)
Check the call status of the call with <reqId>
. If the call is made, the return value is 'Call Made', or if the call fails, the return value is 'Call Failed', or if the call will retry, the return value is "Call Will Retry", and for any other status, the return value is "".
Please note that an empty string is returned if the call is still in progress. You'll need to wait and then poll the status again.
Example
String status = callStatus("11234035434");
void callRemove(String reqId)
Remove the call record of the call with reqId
. If the call is not made yet, it will be removed also.
Example
allRemove("11234035434");
void callTillConfirm(String vcastexe, String vocfile, String wavfile, String ccode)
Keep calling a list of people until anyone enters the confirmation code. The message is the specified audio file. This is ideal for using in a phone notification escalation process.
To use this feature, the Voicent BroadcastByPhone Professional version has to be installed. This function is similar to the command line interface BroadcastByPhone
has. But since the command cannot be invoked over a remote machine, this Perl function uses the gateway to schedule an event, which in turn invokes the command on the gateway host.
The options are:
vcastexe | The BroadcastByPhone program. It is usually located at 'C:\Program Files\Voicent\BroadcastByPhone\bin\vcast.exe' on the gateway host. |
vocfile | The BroadcastByPhone call list to use. |
ccode | The confirmation code used for the broadcast |
wavfile | The audio file to use for the broadcast |
Example
CallTillConfirm(
"C:\Program Files\Voicent\BroadcastByPhone\bin\vcast.exe",
"C:\My calllist\escalation.voc",
"C:\My calllist\escalation.wav","911911");
This will invoke the BroadcastByPhone program on the gateway host and start calling everyone on the call list defined in 'C:\My calllist\escalation.voc'. The audio message played is 'C:\My calllist\escalation.wav'. And as soon as anyone on the list enters the confirmation code '911911', the call will stop automatically.
------------------
File Voicent.java:
------------------
import java.net.URL;
import java.net.URLEncoder;
import java.net.HttpURLConnection;
import java.io.PrintWriter;
import java.io.InputStream;
public class Voicent
{
public Voicent()
{
host_ = "localhost";
port_ = 8155;
}
public Voicent(String host, int port)
{
host_ = host;
port_ = port;
}
public String callText(String phoneno, String text, boolean selfdelete)
{
String urlstr = "/ocall/callreqHandler.jsp";
String poststr = "info=";
poststr += URLEncoder.encode("Simple Text Call " + phoneno);
poststr += "&phoneno=";
poststr += phoneno;
poststr += "&firstocc=10";
poststr += "&selfdelete=";
poststr += (selfdelete ? "1" : "0");
poststr += "&txt=";
poststr += URLEncoder.encode(text);
String rcstr = postToGateway(urlstr, poststr);
return getReqId(rcstr);
}
public String callAudio(String phoneno, String audiofile, boolean selfdelete)
{
String urlstr = "/ocall/callreqHandler.jsp";
String poststr = "info=";
poststr += URLEncoder.encode("Simple Audio Call " + phoneno);
poststr += "&phoneno=";
poststr += phoneno;
poststr += "&firstocc=10";
poststr += "&selfdelete=";
poststr += (selfdelete ? "1" : "0");
poststr += "&audiofile=";
poststr += URLEncoder.encode(audiofile);
String rcstr = postToGateway(urlstr, poststr);
return getReqId(rcstr);
}
public String callStatus(String reqID)
{
String urlstr = "/ocall/callstatusHandler.jsp";
String poststr = "reqid=";
poststr += URLEncoder.encode(reqID);
String rcstr = postToGateway(urlstr, poststr);
return getCallStatus(rcstr);
}
public void callRemove(String reqID)
{
String urlstr = "/ocall/callremoveHandler.jsp";
String poststr = "reqid=";
poststr += URLEncoder.encode(reqID);
postToGateway(urlstr, poststr);
}
public void callTillConfirm(String vcastexe, String vocfile,
String wavfile, String ccode)
{
String urlstr = "/ocall/callreqHandler.jsp";
String poststr = "info=";
poststr += URLEncoder.encode("Simple Call till Confirm");
poststr += "&phoneno=1111111";
poststr += "&firstocc=10";
poststr += "&selfdelete=0";
poststr += "&startexec=";
poststr += URLEncoder.encode(vcastexe);
String cmdline = "\"";
cmdline += vocfile;
cmdline += "\"";
cmdline += " -startnow";
cmdline += " -confirmcode ";
cmdline += ccode;
cmdline += " -wavfile ";
cmdline += "\"";
cmdline += wavfile;
cmdline += "\"";
poststr += "&cmdline=";
poststr += URLEncoder.encode(cmdline);
postToGateway(urlstr, poststr);
}
private String postToGateway(String urlstr, String poststr)
{
try {
URL url = new URL("http", host_, port_, urlstr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestMethod("POST");
PrintWriter out = new PrintWriter(conn.getOutputStream());
out.print(poststr);
out.close();
InputStream in = conn.getInputStream();
StringBuffer rcstr = new StringBuffer();
byte[] b = new byte[4096];
int len;
while ((len = in.read(b)) != -1)
rcstr.append(new String(b, 0, len));
return rcstr.toString();
}
catch (Exception e) {
e.printStackTrace();
return "";
}
}
private String getReqId(String rcstr)
{
int index1 = rcstr.indexOf("[ReqId=");
if (index1 == -1)
return "";
index1 += 7;
int index2 = rcstr.indexOf("]", index1);
if (index2 == -1)
return "";
return rcstr.substring(index1, index2);
}
private String getCallStatus(String rcstr)
{
if (rcstr.indexOf("^made^") != -1)
return "Call Made";
if (rcstr.indexOf("^failed^") != -1)
return "Call Failed";
if (rcstr.indexOf("^retry^") != -1)
return "Call Will Retry";
return "";
}
public static void main(String args[])
throws InterruptedException
{
String mynumber = "1112222";
Voicent voicent = new Voicent();
String reqId = voicent.callText(mynumber,
"hello, how are you", true);
System.out.println("callText: " + reqId);
reqId = voicent.callAudio(mynumber,
"C:/Program Files/Voicent/MyRecordings/sample_message.wav",
false);
System.out.println("callAudio: " + reqId);
while (true) {
Thread.currentThread().sleep(30000);
String status = voicent.callStatus(reqId);
if (status.length() > 0) {
System.out.println(status);
voicent.callRemove(reqId);
break;
}
}
voicent.callTillConfirm("C:/Program Files/Voicent/BroadcastByPhone/bin/vcast.exe",
"C:/temp/testctf.voc",
"C:/Program Files/Voicent/MyRecordings/sample_message.wav",
"1234");
}
private String host_;
private int port_;
}
Points of Interest about IVR
Ideal Inbound & Outbound IVR Solution
- Self-service: Allows callers to get answers to standard enquiries simply and easily, and in seconds, without the need for an agent.
- Reach the right agent: Automatically capture relevant information from your callers and direct them to the appropriate agent to handle their call.
- 24/7 customer service: Enable your customers to get the information they need, when they need it. Your IVR application is working even when you're not, or it can transfer calls to your cell phone.
- Automated Outbound IVR: Fully integrated with BroadcastByPhone Autodialer. Fully automated interactive outbound call applications to generate sales leads and keep in touch with your customers.
Inbound & Outbound IVR Solution Key Features
- Point-and-click call flow design
- Deployed on any PC with Windows 2000/2003/XP/Vista
- Transfer call to any phone, such as your cell phone
- Interactive touch tone response
- Speech command response
- Automatically convert text to speech
- Easy integration with your website
- (Developer feature) Integrate with any program through Java
- Support Skype or voice modems for making calls
- Support single phone line or multiple phone lines
- Natural Text-to-Speech engine for playing any text over the phone
IVR History
None.