Gateway Outbound Application Tutorial Table of Content << Previous >> Next

Get line status: line busy, line occupied, busy, etc

Line status in VoiceXML is handled by VXML exceptions. The following are the exception values:


You can certainly catch these exceptions in your own VXML code and handle these exception accordingly.

<form id="td">
  <catch event="telephone.noline">
    <submit next="..." namelist="..."/>
  <catch event="telephone.linebusy">
    <submit next="..." namelist="..."/>

Actually, these exceptions are caught by the gateway by default. And you can get the line status from the call status request page as defined in Voicent Gateway Outbound Call Scheduler Reference.

One thing that is not handled by VoiceXML standard is whether the phone call is answered by live person or answering machine. Here we simply record this fact in the application attributes also. The following is the updated file:

<?xml version="1.0"?>
<vxml version="1.0">

    String ans = request.getParameter("ans");
    boolean isAnsweringMachine = ("t".equals(ans));

<form id="td">
<% if (isAnsweringMachine) {
     int anstotal = 1;
     Integer AnsTotal = (Integer) application.getAttribute("anstotal");
     if (AnsTotal != null)
         anstotal = AnsTotal.intValue() + 1;
     application.setAttribute("anstotal", new Integer(anstotal));;
    <audio src="audio/answering.wav"/>
<% } else { %>
  <field name="rating">
    <prompt timeout="10s">
        <audio src="audio/live.wav"/>
      1 | 2 | 3 | 4 | 5
      <submit next="recordrating.jsp" namelist="rating"/>
<% } %>


Developer Network Table of Content << Previous >> Next