Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
I need a simple form that includes the repeat functionality, ie when the user says "repeat", the initial prompt is prompted again fon input.
When I run the form, I get the initial prompt, When I say "repeat", I get the prompt again as expected , but this time the voice browser is not recognizing the word "repeat". Actually it's not "listening" for any input (voice only) and it's timing out all the time. I am positive the grammars are loaded correclty. It must be something obvious I am doing wrong .. I am including the code .. I anyone can help it would be much appreciated 😉
Thanks a lot Mitch
THE CODE (Audium 3.4.1): ******************************************************** public class UniversalsForm extends MFoundationForm implements ElementInterface,VoiceElementInterface {
// Some essential Tags // The values here should match those of // DVXAP.properties in the Grammar Tag section public static String CONSULTANT_TAG = "CONSULTANT"; public static String HELP_TAG = "HELP"; public static String REPEAT_TAG = "REPEAT"; public static String START_AGAIN_TAG = "START_AGAIN";
public String getElementName() { return "UniversalsForm"; }
public String getDescription() { return "Default Form "; }
/** * This method returns the name of the folder in which this voice * element resides. Return null if it is to appear directly under the * Elements folder. */ public String getDisplayFolderName() { return "My Elements"; }
public ExitState[] getExitStates() throws ElementException { ExitState[] exitStateArray = new ExitState[2]; exitStateArray[0] = new ExitState(ExitState.DONE); exitStateArray[1] = new ExitState("alternate", "Alternate path", "Alternate path"); return exitStateArray; }
public ElementData[] getElementData() throws ElementException { return null; }
public Setting[] getSettings() throws ElementException { return null; }
public String[] getAudioGroupDisplayOrder() { return null; }
public HashMap getAudioGroups() throws ElementException { return null; }
// Get the configuration from a property file Properties props = (Properties)elementAPI.getSessionData(DarwinVXAPConstants.AUDIUM_SESSION_DVXAP_PROPS_ATTR); String DEFAULT_TIMEOUT_SETTING = props.getProperty("universals.default.timeout"); String DEFAULT_CONFIDENCE_LEVEL = props.getProperty("universals.confidence.level");
// Load the initial Form VoiceElementConfig.AudioGroup initial = defaultConfig.new AudioGroup("initial_audio_group",true,1); defaultConfig.setAudioGroup(initial); VoiceElementConfig.StaticAudio audio = loadAudio(props, defaultConfig, initial,name, ".initial.audio.");
// Load grammars specified in the current DVXAP loadGrammars(props,defaultConfig,"voice_grammar", name); // Load grammars specified in the global DVXAP loadGrammars(props,defaultConfig,"voice_grammar", "universals");
// if it's the first time if (currentState == null) {
data.setScratchData("PREV_STATE","undone"); data.setScratchData("REPEAT_COUNT", new Integer(0)); data.setScratchData("ERROR_COUNT", new Integer(0)); data.setScratchData("HELP_COUNT", new Integer(0));
// second time gets here if ("undone".equals(currentState)) {
String value = null;
value = data.getElementData(data.getCurrentElement(),"value");
value = (String)params.get("foundation_fld");
if ("repeat".equals(value)) {
MFoundationForm tmpForm = new MFoundationForm(); params.clear(); VoiceElementResult result = tmpForm.createSubVoiceElement(this,vxml,params,data); String returned = result.getExitState(); if (returned == null) {
Subject: RE: Simple Audium Form - issue with the Repeat functionality Replied by: Vance Vagell on 10-10-2005 04:43:41 PM Hi Mitch,
The functionality you would like to implement does not require a custom element. You can accomplish the same result by following a Form element with a Decision element in your callflow. Configure the Decision element to exit back to the Form element if the "value" variable (in element data) of the Form element holds "repeat". Additionally, you could introduce a Counter element to keep track of the amount of times the Form has been repeated.
However, you may have a requirement that all Form elements support this functionality, in which case it would be beneficial to create a custom element. While code reviews and debugging are not part of standard support, we now offer a new Premium Support service whereby we would create and support this custom element for you. If time constraints are present, we also offer expedited service. If you are interested in this option, please contact us directly.
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: