cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
359
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Arvand Owji on 21-05-2013 03:54:06 PM
Hi,
Im writing a custom DTMF only menu and I used the VFCExample2.java as the guide. However there seems to be some issues which I cannot figure out.
Here is the exceprt of the code I have:
 
VForm form = VForm.getNew(pref, "start");
 VMenuField menufield = VMenuField.getNew(pref, "myMenu", VMenuField.DTMF);
 
 
 VoiceElementConfig config=ved.getVoiceElementConfig();
VAction exit = VAction.getNew(pref, VAction.EXIT );
 for (int i=0; i<5; i++ ){
     menufield.setPromptCount(i+1, VAudio.getNew(pref,null,somearray+"","","wav",false));                         
      menufield.setChoice(new VoiceInput((i+1)+"","Value"+i),null,exit);
  }             
form.add(menufield);    
 
 vxml.add(form);       
 
 return "done";                 
When I run the  code, I can hear the audio, and I can also confirm that the nomatch and noinput works. But if I press a correct dtmf, the calls hangs up. Looking at the VFC api, seems Exit is not the correct action to use in SetChoice as it hangs up the call. So im wondering what should I use instead? I also tried to pass null insted of exit looked and I got the same result. I looked the resulting VXML for both cases and the <filled> tag is much different from a vxml code generated from a real menu element (such as Studio 2 options menu). In Studio menu, I can see <Submit next="/CVP/Server .....> but the VFC element lacks all those. Any idea what I need to set for the VFC menu to work? Thanks.

Subject: Re: New Message from Arvand Owji in Customer Voice Portal (CVP) - General D
Replied by: Janine Graves on 21-05-2013 04:36:27 PM
you need to have a VSubmit - to submit what you collected back to VXML Server. On 5/21/2013 4:54 PM, Cisco Developer Community Forums wrote: Arvand Owji has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- Hi, Im writing a custom DTMF only menu and I used the VFCExample2.java as the guide. However there seems to be some issues which I cannot figure out. Here is the exceprt of the code I have:   VForm form = VForm.getNew(pref, "start");  VMenuField menufield = VMenuField.getNew(pref, "myMenu", VMenuField.DTMF);      VoiceElementConfig config=ved.getVoiceElementConfig(); VAction exit = VAction.getNew(pref, VAction.EXIT );  for (int i=0; i<5; i++ ){      menufield.setPromptCount(i+1, VAudio.getNew(pref,null,somearray+"","","wav",false));                                menufield.setChoice(new VoiceInput((i+1)+"","Value"+i),null,exit);   }              form.add(menufield);        vxml.add(form);           return "done";                  When I run the  code, I can hear the audio, and I can also confirm that the nomatch and noinput works. But if I press a correct dtmf, the calls hangs up. Looking at the VFC api, seems Exit is not the correct action to use in SetChoice as it hangs up the call. So im wondering what should I use instead? I also tried to pass null insted of exit looked and I got the same result. I looked the resulting VXML for both cases and the <filled> tag is much different from a vxml code generated from a real menu element (such as Studio 2 options menu). In Studio menu, I can see <Submit next="/CVP/Server .....> but the VFC element lacks all those. Any idea what I need to set for the VFC menu to work? Thanks. -- To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/community/-/message_boards/view_message/15465482 or simply reply to this email. -- Janine Graves

Subject: RE: Simple Menu with VFC
Replied by: Arvand Owji on 22-05-2013 09:13:18 AM
Janine,
I dont see any VSubmit class in the VFC API. I also tried to add a VAction.Submit to my form but CVP errors out with "Invalid Action Type". Other than the VFCExamples from Programng guide, do you have any other VFC classes that you know it works for sure? Thanks. 

Subject: RE: Simple Menu with VFC
Replied by: Arvand Owji on 22-05-2013 09:48:25 AM
ok, i think I need to use Action.Submit but add it to a block and add the block to the form. But there is a small problem. VMenuField cant be added to block and if I add it to the Form and add the block with submit to the form, the VFC stops working. Looking at the VXML it shows <filled> is empty and the block is just outside of it. This is obviously not correct. Any idea?

Subject: RE: Simple Menu with VFC
Replied by: Paul Tindall on 22-05-2013 11:18:47 AM
Without seeing the code, it sounds like you need to use the setOutsideSubmit(false) method.

Subject: RE: Simple Menu with VFC
Replied by: Arvand Owji on 22-05-2013 11:38:00 AM
Paul Tindall:
Without seeing the code, it sounds like you need to use the setOutsideSubmit(false) method.

Paul, thanks for your reply. Here is the code. All im doing is playing aan audio and creating a menu ehich its dtmfs and values are coming from a ResultSet Object. I guess i can do this in a much simpler way with dynamic configuration but I really like to know why this does not work. If I remove the Submit form the menufield, i hear the audio but when i choose a correct dtmf, the code errors out. If I add the submit, the audio wont even play and the vxmlis like this:
 
 
<form id="start">
    <field name="myMenu" modal="false">
      <property name="inputmodes" value="dtmf" />
        <prompt bargein="true" count="1">
        <audio src="http://someip//TestAudio.wav" />
      </prompt>
      <option value="1" dtmf="1">val2</option>
      <option value="2" dtmf="2">val1</option>
      <filled>
        <submit next="/CVP/Server" method="post" namelist="" />
      </filled>
    </field>
  </form>
</vxml>
 
 
 
 
protected String addXmlBody(VMain vxml, Hashtable reqParameters, VoiceElementData ved)
throws VException, ElementException 
{
VPreference pref = ved.getPreference();
 
 
VForm form = VForm.getNew(pref, "start");
// Make a menu with N options that react to only DTMF and 
VMenuField menufield = VMenuField.getNew(pref, "myMenu", VMenuField.DTMF);
VoiceElementConfig config=ved.getVoiceElementConfig();
String Object=config.getSettingValue("DBObject", ved);
ResultSetList RS = (ResultSetList) ved.getSessionData(Object);
int NumberOfRows=RS.getNumRows();
int NumberOfCols=RS.getNumColumns();
ved.setElementData("NumberOfCols", NumberOfCols+"", ActionElementData.PD_STRING, true);
VAction Submit = VAction.getNew(pref, VAction.SUBMIT, super.getSubmitURL());
menufield.setPromptCount(1, VAudio.getNew(pref,null,"TestAudio","","wav",false));
for (int i=0; i<NumberOfRows; i++ ){
menufield.setChoice(new VoiceInput((i+1)+"",RS.getValue(1, i)),null,null);
}
menufield.add(Submit);
form.add(menufield);    // Add the menu to the form.
vxml.add(form);         // Add myForm to the VMain object
 
 
return "done";
}
 
 

Subject: RE: Simple Menu with VFC
Replied by: Paul Tindall on 22-05-2013 12:03:41 PM
You have to implement a two-pass approach, exiting with null on the first pass.  The second pass handles the submit response.   See the simple example attached.

Subject: Re: New Message from Arvand Owji in Customer Voice Portal (CVP) - General D
Replied by: Janine Graves on 22-05-2013 02:25:51 PM
It helps to know some of the rules of VXML --  <submit> can't be a child of <field> - But you can create a <filled> inside your <field> (filled inside a field executes whenever you collect valid input from the caller for that field). And you can put the <submit> as child of <filled>, and this <filled> is a child of  <field>. Janine
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