Author Message
ManievanderMerwe
Joined: Sep 21, 2007
Messages: 0
Offline
Also just remember that the web server cannot access documents outside it context directory...
DanielaBanin
Joined: Nov 6, 2013
Messages: 86
Offline

The data base query brings 3 rows:
getoptions:NAME http://10.96.0.5/hanaya.wav getoptions:ID 2
getoptions:NAME http://10.96.0.5/arnona.wav getoptions:ID 3
getoptions:NAME http://10.96.0.5/maym.wav getoptions:ID 4

When I tried to use vname or "vname" I am gettting an exception -the variable http.... does not exist or variable vname does not exist.

If I use

add(1, new PromptElement(PromptElement.VARIABLE_TEXT, "getoptions:NAME" ,f)); I am getting the following

Personal Voice Browser Version 5.1 Copyright (c) 2004-2010, Avaya
Queuing prompt: File(http://10.96.0.5/hanaya.wav)
Queuing prompt: File(http://10.96.0.5/hanaya.wav)
Queuing prompt: File(http://10.96.0.5/hanaya.wav)
Playing text "welcome. You have reached the dynamic flow application", Language (en-us), Gender (Female)
Playing text "please select one of the following", Language (en-us), Gender (Female)
Playing file(http://10.96.0.5/hanaya.wav)
Playing text "press2", Language (en-us), Gender (Female)
Playing file(http://10.96.0.5/hanaya.wav)
Playing text "press3", Language (en-us), Gender (Female)
Playing file(http://10.96.0.5/hanaya.wav)
Playing text "press4", Language (en-us), Gender (Female)
- instead of looping I am just getting the first row - for the NAME field.
while the ID field - is looping oK through the results.

Clearly, I don't know how to pass the NAME ( the url of the wav file to be spoken) one at a time through each loop followed by the ID field.

DanielaBanin
Joined: Nov 6, 2013
Messages: 86
Offline
Also , when I tried to use instead the PhraseVariableElement - I would get all three wav files ( the entire collection) , for each loop, followd by the ID field spoken correctly.


ManievanderMerwe
Joined: Sep 21, 2007
Messages: 0
Offline
Just another comment here... Remember that the "/" character is a special character in Java and if you would like to use this you will need to use "//" to be translated into a single "/" at runtime. So, maybe try the follwoing URL as a test in the DB :

http:////10.96.0.5//hanaya.wav

Maybe it helps...?
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Okay I see what is happening...

For one vname contains the actual url.

add(1, new PromptElement(PromptElement.VARIABLE_TEXT, "vname" ,f));

The above line expects "vname" to be a variable name.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Try using something like this:


   public void updatePrompt(SCESession mySession) {

      IVariable var = mySession.getVariable(IProjectVariables.GET_OPTIONS);
      IComplexVariable cplx = var.getComplexVariable();
      ICollection coll = var.getCollection();
      Format f = new Format();
      f.add(Format.FORMAT, Format.FMT_FILEURL);
      coll.reset();
      int i = 0;
      while (coll.hasMore()) {
         coll.next();
         /* get the values the current row in the collection */
         int id = cplx.getField(IProjectVariables.GET_OPTIONS_FIELD_ID).getIntValue();
         String nameValue = cplx.getField(IProjectVariables.GET_OPTIONS_FIELD_NAME).getStringValue();

         /* create a temp name */
         String varName = IProjectVariables.GET_OPTIONS_FIELD_NAME + Integer.toString(i);
         
         /* see if the varaible exists, if not create it */
         IVariableField tempField = mySession.getVariableField(varName);
         if (tempField == null) {
            IVariable variable = SimpleVariable.createSimpleVariable(varName, "avaya", null, mySession, false, false );
            mySession.putVariable(variable);
            tempField = mySession.getVariableField(varName);
         }
         /* store the value into the varaible */
         tempField.setValue(nameValue);
         add(1, new PromptElement(PromptElement.VARIABLE_TEXT, varName, f));
         add(1, new PromptElement(PromptElement.TEXT, "press"));
         add(1, new PromptElement(PromptElement.TEXT, String.valueOf(id)));
      }

      // reset collection for others
      coll.reset();
      coll.next();
   }
MichaelReynolds [Avatar]

Joined: Nov 7, 2013
Messages: 140
Location: South Carolina
Offline
Ross;
I just found this thread which is exactly what I am trying to accomplish. I am several steps behind though and have a basic question:

Into what JAVA file is this method sippossed to be added?

Michael Reynolds mike.reynolds@realpage.com (864) 272-3541
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
The prompt file. If you have a prompt named "welcome.prompt" then there will be a java file welcome.java in the src/<language>/prompts directory. Edith that file.
MichaelReynolds [Avatar]

Joined: Nov 7, 2013
Messages: 140
Location: South Carolina
Offline
In what document or tutorial can I look to learn how to implement this type of change? I know how to code JAVA and VXML but am unsure of where within the OD to insert this code.

Michael Reynolds mike.reynolds@realpage.com (864) 272-3541
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
There is some info here :
https://devconnect.avaya.com/public/dyn/d_dyn.jsp?fn=156

Send me an email I may have some other docs too.

yakulis@avaya.com
Go to:   
Mobile view