Get line status: line busy,
line occupied, busy, etc
Line status in VoiceXML is handled by VXML exceptions. The
following are the exception values:
"telephone.noanswer"
"telephone.noline"
"telephone.linebusy"
"telephone.linedrop"
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>
<catch event="telephone.linebusy">
<submit next="..." namelist="..."/>
</catch>
...
</form>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));;
%>
<block>
<audio src="audio/answering.wav"/>
</block>
<% } else {
%>
<field name="rating">
<prompt timeout="10s">
<block>
<audio src="audio/live.wav"/>
</block>
</prompt>
<dtmf>
1 | 2 | 3 | 4 | 5
</dtmf>
<filled>
<submit next="recordrating.jsp" namelist="rating"/>
</filled>
</field>
<% } %>
</form>
</vxml>
|