cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
68
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: null on 12-08-2005 01:20:49 PM
When adding a new choice to a VMenuField in my code:

menuField.setChoice(new VoiceInput("1","bob"), null, exit);
menuField.setChoice(new VoiceInput("2","ted"), null, exit);

The field's value attribute is always returning either "1" or "2" never "bob" or "ted", even if the input is done via voice.

How do I get this code to always return either "bob" or "ted" no matter whether the input to this menu is DTMF or voice?

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: Vance Vagell on 12-08-2005 02:31:21 PM
Hi Rich,

The constructor your are using for VoiceInput is not one that supports storing an explicit value. The constructor that supports what you are trying to do is:

[code:1:d7f1819fd0]
VoiceInput(String digits, String dtmfName, String dtmfValue, String keyword, String keywordName, String keywordValue)
[/code:1:d7f1819fd0]

Here are the descriptions of the parameters, this is from the Audium Java API Javadocs:

[b:d7f1819fd0]digits[/b:d7f1819fd0] - The multi-digit DTMF sequence to listen for, expressed as a String of numeric characters.
[b:d7f1819fd0]dtmfName[/b:d7f1819fd0] - The name of the field that will be filled with a value when the DTMF digits are detected.
[b:d7f1819fd0]dtmfValue[/b:d7f1819fd0] - The value to store in the field when the DTMF digits are detected.
[b:d7f1819fd0]keyword[/b:d7f1819fd0] - The speech recognition keyword to listen for.
[b:d7f1819fd0]keywordName[/b:d7f1819fd0] - The name of the field that will be filled with a value when the keyword is spoken.
[b:d7f1819fd0]keywordValue[/b:d7f1819fd0] - The value to store in the field when the keyword is spoken.

Here is how it would be used for the example you gave (add this to your menuField):

[code:1:d7f1819fd0]
VoiceInput("1", "name", "bob", "bob", "name", "bob")
[/code:1:d7f1819fd0]

Now, when the user enters dtmf-1, or if they say "bob", then the "name" field will be set to "bob".

Hope this helps,
Vance

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: null on 12-08-2005 05:35:17 PM
When I tried the other method signature:

menuField.setChoice(new VoiceInput("1","menu_fld","bob","bob","menu_fld","bob"), null, exit);
menuField.setChoice(new VoiceInput("2","menu_fld","ted","ted","menu_fld","ted"), null, exit);

The MainMenuForm.value field is still giving me a "1" or a "2" instead of the name.

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: null on 12-08-2005 05:39:33 PM
In addition, I have the following code at the top of the addXmlBody method:

if (reqParameters.get("menu_fld") != null) {
ved.setElementData("MainMenuChoice", (String)reqParameters.get("menu_fld"));
ved.addToLog("MainMenuChoice stored", (String)reqParameters.get("menu_fld"));
return "done";
}

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: Vance Vagell on 12-08-2005 06:46:48 PM
Hi Rich,

If possible, could you please provide the source file for the class you are working on? If we can see the context of what you are trying to accomplish, it will aid us in helping you find a solution.

Regards,
Vance

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: Vance Vagell on 12-08-2005 07:24:44 PM
Hi Rich,

Thank you, I am reviewing your class and will post shortly with next steps for this issue. Note that I have deleted your post, since it looks as though the code may contain sensitive information.

Regards,
Vance

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: Vance Vagell on 12-08-2005 07:43:46 PM
Hi Rich,

The method you are using to create a submit element is not recommended:

[code:1:74b8a63188]
VAction exit = VAction.getNew(pref);
exit.add(VAction.SUBMIT, "/Audium/Server");
[/code:1:74b8a63188]

Please instead use this method, from VoiceElementBase:

[code:1:74b8a63188]
protected VAction getSubmitVAction(String args, VPreference pref)
[/code:1:74b8a63188]

This convenience method will create a submit that comes preconfigured with the correct URL to send the submit to. The "args" parameter should be a space-delimited string made up of the VoiceXML variables and/or fields that you would like to submit back to Audium Call Services (you should list your menu_fld field in here). It will also automatically send back the Audium logging variable, so that you do not need to manage that manually.

I believe that your original code was submitting the result to an incorrect URL, and that that is why you cannot retrieve the value. Please try this new method to create the submit, and let me know if you encounter any further problems.

Hope this helps,
Vance

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: null on 15-08-2005 01:25:31 PM
I replaced my call with the submit code you mentioned above, but I'm still getting the dtmf value instead of the voice value being passed into the field. Here's the VXML that was generated, it looks as though the <option> tags are not getting the voice values I specify:

[code:1:7b14554de0]
-
<vxml version="2.0" application="/Audium/Server?audium_root=true&#38;calling_into=PE">
<meta name="maintainer" content="UVP Architecture"/>
-
<form id="audium_start_form">
-
<block>
<assign name="audium_vxmlLog" expr="''"/>
<assign name="audium_element_start_time_millisecs" expr="new Date&#38;#40;&#38;#41;.getTime&#38;#40;&#38;#41;"/>
<goto next="#start"/>
</block>
</form>
-
<form id="start">
-
<field name="menu_fld" modal="false">
<property name="inputmodes" value="dtmf voice"/>
-
<prompt bargein="true">
-
<audio src="/vetss_wavs/poc//main_menuprompt_valid.wav">
When you hear the service you want just say it. Claims, Benefits and Eligibility, Care Notifications, Privacy Practices or Network Management Services.
</audio>
</prompt>
-
<catch event="nomatch">
<prompt bargein="true"> I'm sorry, I didn't get that.</prompt>
<reprompt/>
</catch>
-
<catch event="nomatch" count="2">
<prompt bargein="true"> I'm sorry, I still didn't get that.</prompt>
<reprompt/>
</catch>
-
<catch event="nomatch" count="3">
<prompt bargein="true"> I'm sorry, I'm just not getting that.</prompt>
<throw event="GoodbyeEvent"/>
<throw event="GoodbyeEvent"/>
</catch>
-
<catch event="noinput">
<prompt bargein="true"> I'm sorry, I didn't get that.</prompt>
<reprompt/>
</catch>
-
<catch event="noinput" count="2">
<prompt bargein="true"> I'm sorry, I still didn't get that.</prompt>
<reprompt/>
</catch>
-
<catch event="noinput" count="3">
<prompt bargein="true"> I'm sorry, I'm just not getting that.</prompt>
</catch>
-
<catch event="help">
<prompt bargein="true"> Okay, here's some help. This is the help audio.</prompt>
<reprompt/>
</catch>
<option value="1" dtmf="1">claims</option>
<option value="2" dtmf="2">&#40;?benefits ?and eligibility&#41;</option>
<option value="3" dtmf="3">&#40;?care notifications&#41;</option>
-
<option value="4" dtmf="4">
&#40;&#91;privacy policy policies &#40;privacy policy&#41; &#40;privacy policies&#41;&#93;&#41;
</option>
-
<option value="5" dtmf="5">
&#40;&#91;network &#40;network management&#41; &#40;network management services&#41;&#93;&#41;
</option>
-
<filled>
-
<if cond=" &#38;#40; menu_fld == '1' &#38;#41; ">
<submit next="/Audium/Server" method="post" namelist="menu_fld"/>
<elseif cond=" &#38;#40; menu_fld == '2' &#38;#41; "/>
<submit next="/Audium/Server" method="post" namelist="menu_fld"/>
<elseif cond=" &#38;#40; menu_fld == '3' &#38;#41; "/>
<submit next="/Audium/Server" method="post" namelist="menu_fld"/>
<elseif cond=" &#38;#40; menu_fld == '4' &#38;#41; "/>
<submit next="/Audium/Server" method="post" namelist="menu_fld"/>
<elseif cond=" &#38;#40; menu_fld == '5' &#38;#41; "/>
<submit next="/Audium/Server" method="post" namelist="menu_fld"/>
</if>
</filled>
</field>
</form>
</vxml>
[/code:1:7b14554de0]

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: null on 15-08-2005 02:31:24 PM
Note: if I define the Voice Input object by itself with the same constructor, then do a setOptionValue(string) on that object and then add it to the menufield.setChoice, then it works properly. It almost seems as though the constructor for VoiceInput that takes the 6 arguements is not working.

Subject: RE: Return Values for VoiceInput in VFCs
Replied by: Vance Vagell on 15-08-2005 04:48:34 PM
Hi Rich,

Thank you for the additional information. I have conferred with the development team, and we recommend that you continue to use this constructor in combination with the setOptionValue() method. While this is the correct constructor to use per the Audium Java API Javadocs, it has been determined that it does not properly set the value of options (as you have demonstrated). We have logged this problem in our internal issue-tracking system, and will investigate the possibility of including a fix for it in future releases. If you would like to track the status of this issue, please refer to issue number AC-237.

Regards,
Vance
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links