cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

Dynamic Configurable Form Element

219
Views
0
Helpful
0
Comments
This document was generated from CDN thread

Created by: Selim Budakoglu on 21-06-2010 08:47:18 AM
Hi all,
I have been develoing a class for a form element. Class simply checks some session elements and then configures dtmf properties and audio settings for that elemenent. Interesting thing here that the class is working fine in debug mode at production environment and I have been gettting no error. But when I deploy the class to production environment, call is not able to pass that element and it drops with the warning below. Any Idea.
 
"element,warning,A session has timed out after 30 minutes. This is most likely caused by a start of call class or action element at the top of the callflow not completing before the voice browser's fetch timeout occurred. To resolve it ensure this class executes in a timely manner or run it in the background. Session timeouts may also occur under high load or if there"
 
CODE :
 
import com.audium.server.proxy.*;
import com.audium.server.session.*;
import com.audium.server.*;
import com.audium.server.xml.*;
public class DynamicMenuConfig implements VoiceElementInterface {
 public VoiceElementConfig getConfig(java.lang.String name,
   ElementAPI elementAPI, VoiceElementConfig defaults)
   throws AudiumException {
  VoiceElementConfig.AudioGroup initial = defaults.getAudioGroup(
    "initial_audio_group", 1);
  VoiceElementConfig.AudioGroup nomatch = defaults.getAudioGroup(
    "nomatch_audio_group", 1);
  VoiceElementConfig.AudioGroup noinput = defaults.getAudioGroup(
    "noinput_audio_group", 1);
  VoiceElementConfig.AudioGroup nomatch2 = defaults.getAudioGroup(
    "nomatch_audio_group", 2);
  VoiceElementConfig.AudioGroup noinput2 = defaults.getAudioGroup(
    "noinput_audio_group", 2);
  VoiceElementConfig.AudioGroup nomatch3 = defaults.getAudioGroup(
    "nomatch_audio_group", 3);
  VoiceElementConfig.AudioGroup noinput3 = defaults.getAudioGroup(
    "noinput_audio_group", 3);
  System.out.println("Voice element config");
  try {
   initial.removeAllAudioItems();
   nomatch.removeAllAudioItems();
   noinput.removeAllAudioItems();
   nomatch2.removeAllAudioItems();
   noinput2.removeAllAudioItems();
   nomatch3.removeAllAudioItems();
   noinput3.removeAllAudioItems();
  } catch (Exception e) {
   System.out.println("removeAllAudioItems");
   System.out.println(e);
  }
  Integer menu_item_count = Integer.valueOf(elementAPI.getSessionData(
    "MenuItemCount").toString());
  String dtmf_keypress = "0,*,#";
  String enable, prompt;
  VoiceElementConfig.StaticAudio staticAudio;
  try {
   staticAudio = defaults.new StaticAudio("NoMatch",
     "invalid_entry_error.wav");
   nomatch.addAudioItem(staticAudio);
   nomatch2.addAudioItem(staticAudio);
   nomatch3.addAudioItem(staticAudio);
  } catch (Exception e) {
   System.out.println("set invalid_entry_error.wav");
   System.out.println(e);
  }
  try {
   staticAudio = defaults.new StaticAudio("NoInput",
     "no_entry_error.wav");
   noinput.addAudioItem(staticAudio);
   noinput2.addAudioItem(staticAudio);
   noinput3.addAudioItem(staticAudio);
  } catch (Exception e) {
   System.out.println("set no_entry_error.wav");
   System.out.println(e);
  }
  dtmf_keypress = defaults.getSettingValue("dtmf_keypress", elementAPI);
  for (Integer i = 1; i <= menu_item_count; i++) {
   System.out.println("COUNT :");
   System.out.println(i);
   enable = elementAPI.getSessionData("ENABLE10".concat(i.toString()))
     .toString();
   prompt = elementAPI.getSessionData("PROMPT10".concat(i.toString()))
     .toString();
   if (enable.equals("1")) {
    dtmf_keypress = dtmf_keypress.concat(",").concat(i.toString());
    System.out.println("DTMF KEYPRESS :");
    System.out.println(dtmf_keypress);
    staticAudio = defaults.new StaticAudio("DynamicPrompt".concat(i
      .toString()), prompt);
    initial.addAudioItem(staticAudio);
    nomatch.addAudioItem(staticAudio);
    noinput.addAudioItem(staticAudio);
    nomatch2.addAudioItem(staticAudio);
    noinput2.addAudioItem(staticAudio);
   }
  }
  try {
   staticAudio = defaults.new StaticAudio("Genmenu01", "Genmenu01.wav");
   initial.addAudioItem(staticAudio);
   nomatch.addAudioItem(staticAudio);
   noinput.addAudioItem(staticAudio);
   nomatch2.addAudioItem(staticAudio);
   noinput2.addAudioItem(staticAudio);
  } catch (Exception e) {
   System.out.println("set Genmenu01");
   System.out.println(e);
  }
  try {
   staticAudio = defaults.new StaticAudio("Genmenu02", "Genmenu02.wav");
   initial.addAudioItem(staticAudio);
   nomatch.addAudioItem(staticAudio);
   noinput.addAudioItem(staticAudio);
   nomatch2.addAudioItem(staticAudio);
   noinput2.addAudioItem(staticAudio);
  } catch (Exception e) {
   System.out.println("set Genmenu02");
   System.out.println(e);
  }
  try {
   staticAudio = defaults.new StaticAudio("Genmenu03", "Genmenu03.wav");
   initial.addAudioItem(staticAudio);
   nomatch.addAudioItem(staticAudio);
   noinput.addAudioItem(staticAudio);
   nomatch2.addAudioItem(staticAudio);
   noinput2.addAudioItem(staticAudio);
  } catch (Exception e) {
   System.out.println("set Genmenu03");
   System.out.println(e);
  }
  try {
   defaults.setSettingValue("dtmf_keypress", dtmf_keypress);
  } catch (Exception e) {
   System.out.println("set dtmf_keypress");
   System.out.println(e);
  }
  System.out.println("EXIT DYMANIC MENU");
  return defaults;
 }
}

Subject: RE: Dynamic Configurable Form Element
Replied by: Janine Graves on 21-06-2010 01:33:34 PM
Is there anything in the Tomcat stdout logs, any error messages? Or in the Studio error log?
By the way, the studio debugger and the Vxml Gateway use different voice browsers, so they might give different errors. Also, the debugger ignores all http fetches of audio and all asr/tts interaction.
 
First make sure that you're passing a Base Config to your java code. If there are any required parameters that you're not configuring in the java, then you'll get a runtime error.
 
I see you're looping  " for (Integer i = 1; i <= menu_item_count; i++) " - is there a reason you're not starting your loop at 0? Is there a reason you're using Integer instead of int?
 
Try turning on Vxml Debug Logging to capture the Vxml that is being created - it might give some insight into what's wrong. Perhaps you've forgotten to include something.
 
Finally, have you ever written a dynamic configuration for a form element before? If not, you should strip away most of your code until you get a simple one that works, then start adding things back.
 
Janine
 
 
 

Subject: RE: Dynamic Configurable Form Element
Replied by: Janine Graves on 21-06-2010 01:46:23 PM
Looking over your code, I don't think you are setting the dtmf_keypress settings correctly. If you wanted a caller to be able to press 1,2,3 you wouldn't set dtmf_keypress to "1,2,3"
 
Instead, you could create an array String dtmfKeypressArray= new String [] {"1","2","3"} and then use defaults.setSettingValues("dtmf_keypress",dtmfKeypressArray);  to add the settings.
 
Or you could loop and 
 for (int i=1;i<=3;i++){
   defaults.addSettingValue(("dtmf_keypress", i);
}
 
Janine
 

Subject: RE: Dynamic Configurable Form Element
Replied by: Selim Budakoglu on 21-06-2010 03:41:43 PM
Thank you Janine.
The confusing thing is here that it is working in debug mode perfectly.

I have seen both kind of coding so after my tests I changed the code accordingly.
Ragards.

Subject: RE: Dynamic Configurable Form Element
Replied by: Sanjay Gulati on 11-08-2010 03:28:47 PM
I am also trying to achive similar dynamic Menu. Can you please help me with code ?

Subject: RE: Dynamic Configurable Form Element
Replied by: Selim Budakoglu on 14-09-2010 12:51:58 PM
Hi Sanjay,
If you still need that element I can send you the code and sample application to run that.
Thank you
CreatePlease to create content
Content for Community-Ad
FusionCharts will render here