Hi All,
This is what I got when I want to repeat an audio for n number of times. In my requirement, I need to prompt a menu which took dtmf as input, if user enter 9 as dtmf , I need to prompt an audio n number of times. The number of iterations can get from configuration of Voice element. I attached my code with this post, can any one guide where I went wrong.
this how my code look likes, I used for loop to repeat a menu for n number of times.
VPreference pref = ved.getPreference();
String submittedMainFieldName =(String) ved.getScratchData(AUDIO_NAME);
VoiceElementConfig conf=ved.getVoiceElementConfig();
String some= conf.getSettingValue(OPTION_DTMF, ved);
String menuOption = null;
if (submittedMainFieldName!=null) {
System.out.println("first time its null second time check what will happen");
menuOption = (String)reqParameters.get(submittedMainFieldName);
}
if(null==menuOption){
VForm form=new SampleVFCElement().getVForm(pref, ved);// this method will build menu options
vxml.add(form);
ved.setScratchData(AUDIO_NAME, "Mfield");
return null;
}else if(menuOption.equals("9")){
for(int i=0;i<3;i++){
System.out.println("repeat block "+i);
VForm prompt_form = VForm.getNew(pref, "start");
VBlock prompt_block = VBlock.getNew(pref);
prompt_form.add(prompt_block);
VAudio media_item=VAudio.getNew(pref, null,null,"this will repeat ",".wav");
prompt_block.add(media_item);
VAction prompt_submit = VAction.getNew(pref);
prompt_submit.add(getSubmitVAction(null, pref));
prompt_block.add(prompt_submit);
vxml.add(prompt_form);
}
return "done";
}
else{
System.out.println("some thing ");
}
Can any one please help me out of this, I attached my code .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you can call your form almost anything except 'start' - that's reserved.
Call it something else.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.