Author Message
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
We are routing to to a survey via a vxml code indicated below. In getWebAppEntryPoint method we attempt to route to BUILT url variable. This is given by the URL syntax. http://<host ip>/<method name>?parameter1=value1&parameter2=value2
XML
In the above URL if we send just one parameter we could route to the VXML without issues. If we send more than one parameter we hear the Avaya promt stating "We are experiencing technical difficulties". Is there a restriction for ampersand character (&). Is there a way to encode this URL?

Thank you

package flow;

import java.net.MalformedURLException;
import java.net.URL;

import com.avaya.sce.runtime.tracking.TraceInfo;
import com.avaya.sce.runtimecommon.ITraceInfo;

/**
* Class that represents a call to a reusable application.
* Last generated by Orchestration Designer at: 2018-JUL-18 08:02:57 AM
*/
public class RouteToSurvey extends com.avaya.sce.runtime.Invoke {

//{{START:CLASS:FIELDS
//}}END:CLASS:FIELDS

/**
* Default constructor
* Last generated by Orchestration Designer at: 2018-JUL-18 08:02:57 AM
*/
public RouteToSurvey() {
//{{START:CLASS:CONSTRUCTOR
super();
setNeedsDefaultDisconnectHandler(false);
//}}END:CLASS:CONSTRUCTOR
}

/**
* Returns a collection of Parameters that has information about the
* parameters to pass to the reusable module. If it has
* no inputs, then an empty list is returned
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public java.util.Collection getInputParams(com.avaya.sce.runtimecommon.SCESession mySession) {
java.util.List list = null;
com.avaya.sce.runtime.Parameter param = null;
list = new java.util.ArrayList();

return(list);
}
/**
* Returns a collection of strings that are the names of the output parameters
* of the reusable application being invoked. If it has no outputs, then an
* empty list is returned
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public java.util.Collection getOutputParams(com.avaya.sce.runtimecommon.SCESession mySession) {
java.util.List list = null;
list = new java.util.ArrayList();

return(list);
}
/**
* Returns the name of the next form in the application
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public String getNext() {
return("EndCall");
}
/**
* Returns the entry point URL to the application being invoked.
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public String getWebAppEntryPoint(com.avaya.sce.runtimecommon.SCESession mySession) {

String entryPointBuilt= mySession.getVariableField(IProjectVariables.BUILT_URL).getStringValue();



return(checkEntryPoint(entryPoint, mySession));

}
/**
* This method is generated automatically and should not be manually edited.
* To manually edit the event handlers for the node, override:
* void updateEvents(Collection events, SCESession mySession)
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
* @return a collection of Events
*/
public java.util.Collection getEvents(com.avaya.sce.runtimecommon.SCESession mySession) {
java.util.List list;
com.avaya.sce.runtime.Event event;
list = new java.util.ArrayList(1);
java.util.List eventPromptNames = null;
String ___tempPromptName = null;
event = new com.avaya.sce.runtime.OnDisconnect("EndCall", false);
list.add(event);
return(list);
}
/**
* Returns the submit method.
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public String getSubmitMethod() {
return("get");
}
/**
* Returns the flag to indicate whether to use namelist.
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public boolean passParamsAsNameList() {
return(false);
}
/**
* Returns the flag to indicate whether output data contains multipart.
* Last generated by Orchestration Designer at: 2018-JUL-20 11:05:30 AM
*/
public boolean outputMultipart() {
return(false);
}
}
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
How do you get the url into the BUILDURL variable in the first place?
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Via an AAOD Data Node we concatenate http://<host IP>/<method name>? and every parameter with & character
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Should we get BUILTURL in getWebAppEntryPoint with a specific way to make it work?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Try to use the java API URLEncoder to encode the url.
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Thank you


I am still getting the same error. How should I assign the entryPoint? Below, how I attempted: Am I missing anything?

public String getWebAppEntryPoint(com.avaya.sce.runtimecommon.SCESession mySession) {
String entryPoint="";
try {
entryPoint = encodeVXMLParams(mySession).toString();
mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG,"Routing to VXML URL "+entryPoint);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (entryPoint != null)
return checkEntryPoint(entryPoint, mySession);

return "";
}

public StringBuilder encodeVXMLParams(com.avaya.sce.runtimecommon.SCESession mySession) throws UnsupportedEncodingException{

StringBuilder queryString = new StringBuilder();
String urlStr = "http://<hostname>/<method>?";
String key = "";
String value ="";
queryString.append(URLEncoder.encode(urlStr,"UTF-8"));
queryString.append(URLEncoder.encode("BROWSERNAME","UTF-8"));
queryString.append("=");

queryString.append(URLEncoder.encode("AVP","UTF-8"));
queryString.append("&");

queryString.append(URLEncoder.encode("LANG_CODE_PARAM","UTF-8"));
queryString.append("=");

queryString.append(URLEncoder.encode("en","UTF-8"));
queryString.append("&");

queryString.append(URLEncoder.encode("ANI_PARAM","UTF-8"));
queryString.append("=");

queryString.append(encodeValue(mySession.getVariableField(IProjectVariables.ANI).getStringValue()));

queryString.append("&");
queryString.append(URLEncoder.encode("UCID","UTF-8"));
queryString.append("=");

queryString.append(encodeValue(mySession.getVariableField(IProjectVariables.UCID).getStringValue()));

queryString.append("&");
queryString.append(URLEncoder.encode("UUI_PARAM","UTF-8"));

queryString.append("=");

queryString.append(encodeValue(mySession.getVariableField(IProjectVariables.UUI).getStringValue()));

return queryString;

}
public String encodeValue(String value) throws UnsupportedEncodingException{
return URLEncoder.encode(value,"UTF-8");

}
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You should first create the whole url with all the special characters such as "&" and "=". then encode the whole string.
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Thank you.

It doesn't work.

If I encode only & character it works from IVR perspective. However our client mentions he cannot get the parameters. Any other idea?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
It would be easier to figure out what to do if you know what the error is. If the parameters are missing, you can look into the URL or http data being sent over the wire.
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
The encoded URL with URLEncoder doesn't work at all. I cannot reach the VXML destination
http%3A%2F%2Fvrnvsrvy1.txhhsc.txnet.state.tx.us%2Fcf%2Fstartcall%3FBROWSERNAME%3DAVP%26LANG_CODE_PARAM%3Den%26ANI_PARAM%3D8573278880%26UCID%3D00001029981535564829%26UUI_PARAM%3DPD%2C00%3BFA%2C00010BB65B86DC1D

If I encode & and the value assigned to each parameter it results in the URL below. I can reach the VXML destination. However the client complains it cannot parse the parameters once it comes with %26.
http://vrnvsrvy1.txhhsc.txnet.state.tx.us/cf/startcall?BROWSERNAME=AVP%26LANG_CODE_PARAM=en%26ANI_PARAM=8573278880%26UCID=00001029981535564829%26UUI_PARAM=PD%2C00%3BFA%2C00010BB65B86DC1D

Do you have any idea? Thank you
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You can decide the query string with the decoder, for example:

java.net.URLDecoder.decode(url, "UTF-8")
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Thank you.

Not sure I understood. Did you suggest that our client should decode the parameters we sent? The VXML we are routing is not under the control of my company.


Best Regards,
Cesar
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Is there any restriction in VXML Servlet node of AAOD with regards to character &? It is quite complicated to our client to change it
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
I need to understand this a little more. Is this vxml app you are calling from OD running on the same app server or different app server?
Cesar.Alba
Joined: Apr 17, 2014
Messages: 41
Offline
Thanks to both.


I tried to change the approach. In a VXML code I have: Please check the attachments. In getWebAppEntryPoint method entryPoint is equal null. It looks like my parameters are not being assigned once the value obtained from checkEntryPoint is http://<hostname>; /cf/startcall? and we do not see any parameter. Do you have any hint to see the parameters in the final URL?

Thank you,


package flow;

import com.avaya.sce.runtimecommon.ITraceInfo;

/**
* Class that represents a call to a reusable application.
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public class finalSurvey1 extends com.avaya.sce.runtime.Invoke {

//{{START:CLASS:FIELDS
//}}END:CLASS:FIELDS

/**
* Default constructor
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public finalSurvey1() {
//{{START:CLASS:CONSTRUCTOR
super();
setNeedsDefaultDisconnectHandler(false);
//}}END:CLASS:CONSTRUCTOR
}

/**
* Returns a collection of Parameters that has information about the
* parameters to pass to the reusable module. If it has
* no inputs, then an empty list is returned
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public java.util.Collection getInputParams(com.avaya.sce.runtimecommon.SCESession mySession) {
java.util.List list = null;
com.avaya.sce.runtime.Parameter param = null;
list = new java.util.ArrayList(2);

param = new com.avaya.sce.runtime.Parameter("BROWSERNAME", "AVP", com.avaya.sce.runtime.Parameter.CONSTANT);
list.add(param);

param = new com.avaya.sce.runtime.Parameter("LANG_CODE_PARAM", "en", com.avaya.sce.runtime.Parameter.CONSTANT);
list.add(param);

return(list);
}
/**
* Returns a collection of strings that are the names of the output parameters
* of the reusable application being invoked. If it has no outputs, then an
* empty list is returned
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public java.util.Collection getOutputParams(com.avaya.sce.runtimecommon.SCESession mySession) {
java.util.List list = null;
list = new java.util.ArrayList(1);

list.add("outPar");

return(list);
}
/**
* Returns the name of the next form in the application
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public String getNext() {
return("End");
}
/**
* Returns the entry point URL to the application being invoked.
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public String getWebAppEntryPoint(com.avaya.sce.runtimecommon.SCESession mySession) {
String entryPoint = mySession.getParameter("module.finalSurvey.entrypoint");


mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG, "survey URL "+entryPoint);
String output ="";
if (entryPoint != null){
mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG, "entryPoint NOT null");

output = checkEntryPoint(entryPoint, mySession);
mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG, "routing URL "+output);
String outPar ="";
outPar = mySession.getVariableField(IProjectVariables.FINAL_SURVEY_1, IProjectVariables.FINAL_SURVEY_1_FIELD_OUT_PAR).getStringValue();
mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG,outPar);
return output;
}else{
mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG, "entryPoint is null");

output = checkEntryPoint("http://<hostname> /cf/startcall?", mySession);

mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG, "routing URL "+output);
String outPar="";
outPar = mySession.getVariableField(IProjectVariables.FINAL_SURVEY_1, IProjectVariables.FINAL_SURVEY_1_FIELD_OUT_PAR).getStringValue();
mySession.getTraceOutput().writeln(ITraceInfo.TRACE_LEVEL_DEBUG,outPar);

return output;
}
}
/**
* This method is generated automatically and should not be manually edited.
* To manually edit the event handlers for the node, override:
* void updateEvents(Collection events, SCESession mySession)
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
* @return a collection of Events
*/
public java.util.Collection getEvents(com.avaya.sce.runtimecommon.SCESession mySession) {
java.util.List list;
com.avaya.sce.runtime.Event event;
list = new java.util.ArrayList();
java.util.List eventPromptNames = null;
String ___tempPromptName = null;
return(list);
}
/**
* Returns the submit method.
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public String getSubmitMethod() {
return("get");
}
/**
* Returns the flag to indicate whether to use namelist.
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public boolean passParamsAsNameList() {
return(true);
}
/**
* Returns the flag to indicate whether output data contains multipart.
* Last generated by Orchestration Designer at: 2018-AUG-30 09:42:03 AM
*/
public boolean outputMultipart() {
return(true);
}
}
  • [Thumb - HowGenerateMySurvey1.JPG]
[Disk] Download
  • [Thumb - HowGenerateMySurvey2.JPG]
[Disk] Download
  • [Thumb - App20180830.JPG]
[Disk] Download
Go to:   
Mobile view