What am I doing wrong?
-----------------------------
VoiceXML
-----------------------------
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd"
version="2.0">
<script>
<![CDATA[
function speakablePhoneNumber(num) {
var str = "";
var startIndex = 0;
// keep 800 together so it is read as "eight-hundred"
if (num.match(/^800/)) {
startIndex = 3;
str += "800 ";
}
for (var i = startIndex; i < num.length; i++) {
str += num.charAt(i) + " ";
// pause after area code and three-digit prefix
if ((i == 2) || (i == 5)) {
str += ", ";
}
}
return str;
}
function speakableNumber(num) {
var digitString = "";
for (var i = 0; i < num.length; i++) {
digitString += num.charAt(i) + " ";
}
return digitString;
}
]]>
</script>
<!-- turn off speech recognition -->
<property name="inputmodes" value="dtmf"/>
<script>
var contractNum = "3";
var callbackNum;
var message;
var requestTypeID;
var productID;
var requestTypeList = new Array();
requestTypeList[1] = 52894;
requestTypeList[2] = 52908;
var productList = new Array();
productList[1] = 52852;
productList[2] = 52850;
</script>
<menu id="main">
<prompt>
Select a product for this ticket from the following choices: <enumerate/>
</prompt>
<choice dtmf="1" next="#setProduct">
For David's Portal, press 1.
</choice>
<choice dtmf="2" next="#setProduct">
For default, press 2.
</choice>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
</menu>
<form id="setProduct">
<block>
<prompt>You selected <value expr="application.lastresult$[i].utterance"/>.</prompt>
<assign name="productID" expr="productList[application.lastresult$[i].utterance]"/>
<goto next="#callbackMenu"/>
</block>
</form>
<menu id="callbackMenu">
<prompt>
To enter a call back number, press 1.
To continue without entering a call back number, press 2.
</prompt>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
<choice dtmf="1" next="#getCallbackNum"/>
<choice dtmf="2" next="#useContractPhoneNumber"/>
</menu>
<form id="getCallbackNum">
<field name="callbackNumField" type="digits?length=10">
<prompt>
Please enter the phone number, including area code, where you may be contacted.
</prompt>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
</field>
<field name="confirmCallback" type="boolean">
<prompt>
You entered <value expr="speakablePhoneNumber(callbackNumField)"/>.
If this is correct, press 1.
To enter the call back number again, press 2.
</prompt>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
<filled>
<if cond="confirmCallback">
<assign name="callbackNum" expr="callbackNumField"/>
<goto next="#getRequestType"/>
<else/>
<goto next="#getCallbackNum"/>
</if>
</filled>
</field>
</form>
<form id="useContractPhoneNumber">
<block>
<assign name="callbackNum" expr="session.telephone.ani"/>
<goto next="#getRequestType"/>
</block>
</form>
<form id="getRequestType">
<field name="requestTypeField" type="digits">
<prompt>
Select a request type for this ticket:
For Bug, press 1.
For Feature Request, press 2.
</prompt>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
<filled>
<if cond="(requestTypeField == 0) || (requestTypeField > requestTypeList.length)">
<prompt>I'm sorry, <value expr="requestTypeField"/> is an invalid response.</prompt>
<clear namelist="requestTypeField"/>
<else/>
<assign name="requestTypeID" expr="requestTypeList[requestTypeField]"/>
<goto next="#getMessage"/>
</if>
</filled>
</field>
</form>
<form id="getMessage">
<record name="messageField" beep="true" maxtime="120s"
finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">
<prompt>Please leave a message after the beep.</prompt>
<filled>
<assign name="message" expr="messageField"/>
<goto next="#messageMenu"/>
</filled>
</record>
</form>
<menu id="messageMenu">
<prompt>
To listen to this message, press 1.
To use this message, press 2.
To re-record the message, press 3.
</prompt>
<noinput>
<reprompt/>
</noinput>
<nomatch>
I'm sorry, the value you entered is invalid.
<reprompt/>
</nomatch>
<choice dtmf="1" next="#listenToMessage"/>
<choice dtmf="2" next="#submitTicket"/>
<choice dtmf="3" next="#getMessage"/>
</menu>
<form id="submitTicket">
<block>
<submit next="http://dking.zeus.dev.poss.com/desktop?control_action=HD_PORTS_TICKET_CREATE"
method="post"
enctype="multipart/form-data"
namelist="contractNum callbackNum
requestTypeID message
productID"
fetchtimeout="100s"/>
</block>
</form>
<form id="listenToMessage">
<block>
<audio expr="message"/>
<goto next="#messageMenu"/>
</block>
</form>
</vxml>
------------------------------
Call Log
------------------------------
Wed 21 Jul 2004 04:47:04 PM EDT:
New call
Beginning tel session
Beginning prompt session
Beginning rec session
Call Start ANII 7175061128 DNIS 3108 VURL http://hosting.plumgroup.com/plumvp/director.vxml
DocumentParser::FetchDocument()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
DocumentParser::FetchDocument(http://hosting.plumgroup.com/plumvp/director.vxml)
Attempting to fetch http://hosting.plumgroup.com/plumvp/director.vxml
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
DocumentParser::FetchDocument(director.php)
Posted form data is URL encoded
Attempting to fetch http://hosting.plumgroup.com/plumvp/director.php
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
DocumentParser::FetchDocument([edited])
Attempting to fetch [edited]
Wed 21 Jul 2004 04:47:07 PM EDT:
GrammarManager::CreateGrammarFromString(application/x-jsgf):
---------
<?xml version='1.0'?>
<grammar type="application/jsgf" mode="dtmf">
(1)
</grammar>
---------
GrammarManager::CreateGrammarFromString(application/x-jsgf):
---------
<?xml version='1.0'?>
<grammar type="application/jsgf" mode="dtmf">
(2)
</grammar>
---------
Loading Builtin builtin:grammar/digits
Loading Builtin builtin:dtmf/digits
Loading Builtin builtin:grammar/digits
Loading Builtin builtin:dtmf/digits
Attempting to fetch [edited]
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
Welcome to Perfect Order telephone support.
---------
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
To submit a ticket, press 1.
To check the status of a ticket, press 2.
---------
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Wed 21 Jul 2004 04:47:13 PM EDT:
Found grammar match
hypothesis #11
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
Enter contract number.
---------
VXI::field_element - activating grammars for form = 'submitTicket' formitem = 'contractNum'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Wed 21 Jul 2004 04:47:16 PM EDT:
Found grammar match
hypothesis #13
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
DocumentParser::FetchDocument([edited])
Posted form data is URL encoded
Attempting to fetch [edited]
Wed 21 Jul 2004 04:47:19 PM EDT:
Loading Builtin builtin:grammar/digits
Loading Builtin builtin:dtmf/digits
Attempting to fetch [edited]
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
Enter PIN for this contract.
---------
VXI::field_element - activating grammars for form = 'activeContract' formitem = 'pin'
VXI::do_recognition()
PromptManager::Play()
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Wed 21 Jul 2004 04:47:24 PM EDT:
Found grammar match
hypothesis #11234
VXI::var_element(name="contractNum" expr = "3")
Previously playing audio (if any) has finished
Previously playing audio (if any) has finished
DocumentParser::FetchDocument([edited])
Posted form data is URL encoded
Attempting to fetch [edited]
Wed 21 Jul 2004 04:47:26 PM EDT:
GrammarManager::CreateGrammarFromString(application/x-jsgf):
---------
<?xml version='1.0'?>
<grammar type="application/jsgf" mode="dtmf">
(For David's Portal, press 1.)
</grammar>
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
A serious error of type
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
error.grammar.choice
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS text/plain;charset=wchar_t for:
---------
has occured. Exiting.
---------
VXI::exit_element()
Previously playing audio (if any) has finished
Newly queued prompts are now being played
Wed 21 Jul 2004 04:47:32 PM EDT:
Previously playing audio (if any) has finished
Call End Event
Ending session
Ending Session On Channel 0