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

Created by: null on 24-11-2005 01:24:56 PM
Hi
I have taken an form element and written the code as follows

[code:1:060e1bcd06]
public VoiceElementConfig getConfig(String name,ElementAPI elementAPI, VoiceElementConfig voiceElementConfig) throws AudiumException {

String entryCondition = "", promptsURL = null;
VoiceElementConfig.AudioGroup audioGroup = voiceElementConfig.new AudioGroup("initial_audio_group", true);

try {

entryCondition = (String)elementAPI.getSessionData("entryCondition");

if( entryCondition.equals("FirstItem") ){
VoiceElementConfig.StaticAudio PR_606 = voiceElementConfig.new StaticAudio("That was the first item", promptsURL+"PR_606.wav");
audioGroup.addAudioItem(PR_606);
}
else if(entryCondition.equals("help")) { //help

VoiceElementConfig.StaticAudio PRS_4_1 = voiceElementConfig.new StaticAudio("Help", promptsURL+"PRS_4_1.wav");
audioGroup.addAudioItem(PRS_4_1);
}
}
else if(entryCondition.equals("NoMatch")){ //OOG error audio
String toRepeat = (String)elementAPI.getSessionData("toRepeat");

if(toRepeat == null || (toRepeat != null && !toRepeat.equals("true"))){ // if toRepeat flag is set, then "I'm Sorry..." must not be played
VoiceElementConfig.StaticAudio PRA_0a = voiceElementConfig.new StaticAudio("I'm sorry, I didn't understand.",promptsURL+"PRA_0a.wav");
audioGroup.addAudioItem(PRA_0a);
}
else
elementAPI.setSessionData("toRepeat", "false");

VoiceElementConfig.StaticAudio PR_166 = voiceElementConfig.new StaticAudio("To move on to the next item, say 'next'.", promptsURL+"PR_166.wav");
audioGroup.addAudioItem(PR_166);
VoiceElementConfig.StaticAudio PR_167 = voiceElementConfig.new StaticAudio("To move to the next section, say 'next section'.", promptsURL+"PR_167.wav");
audioGroup.addAudioItem(PR_167);
VoiceElementConfig.StaticAudio PR_168 = voiceElementConfig.new StaticAudio("You can also say 'previous,' 'previous section,' 'repeat,' 'first,' or 'last'.", promptsURL+"PR_168.wav");
audioGroup.addAudioItem(PR_168);
}
else{

VoiceElementConfig.StaticAudio silence = voiceElementConfig.new StaticAudio("Hello", promptsURL+"PR_166.wav"); //this is the audio that will be played in the ordinary case
audioGroup.addAudioItem(silence);

}

}
catch(CantHandleRequestException exception){
elementAPI.addToLog("- CantHandleRequestException - ", exception.toString());
}
catch(Exception e){
elementAPI.addToLog("- The exception was ::", ""+e);
}

voiceElementConfig.setAudioGroup(audioGroup);

return voiceElementConfig;
}
[/code:1:060e1bcd06]

When its running it throws element,error,A VoiceXML exception occurred: error.badfetch

Can anyone let me know where might the problem in the code

Subject: RE: Get error while running the application
Replied by: Michael Bochynski on 28-11-2005 02:50:22 PM
Hi Mahesh,

Note that the error.badfetch can be thrown by a voice browser when, as stated in the Voice XML 2.0 specification
[quote:e90cd8cb51]
a fetch of a document has failed and the interpreter context has reached a place in the document interpretation where the fetch result is required. Fetch failures result from unsupported scheme references, malformed URIs, client aborts, communication errors, timeouts, security violations, unsupported resource types, resource type mismatches, document parse errors, and a variety of errors represented by scheme-specific error codes.
[/quote:e90cd8cb51]

I would suggest making sure that all your static WAV files are reachable for a voice browser, since this is the most common source for badfetch errors.

You might want to debug the generated VoiceXML in the web browser to make sure that the correct Voice XML is produced. Please refer to the Knowledge Base article number 14 - How to test deployed Audium applications in a web browser

I would also suggest starting from a smaller code, adding [i:e90cd8cb51]System.out.println()[/i:e90cd8cb51] statements to your code and adding new lines successively.

Hope this helps,
Michael
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