IVR & Voice XML Information
Tuesday, February 10, 2015
Thursday, July 22, 2010
How to check the generated VoiceXML code in CVP?
The following URL format displays the generated VXML code for application's start page.
http://<IP address>:<port number>/CVP/Server?application=<application name>
The following URL format displays the generated VXML code of particular dialog(element) of the application.
http://<IP address>:<port number>/CVP/Server?<application name>/<element name>
Default port number is : 7000.
http://<IP address>
The following URL format displays the generated VXML code of particular dialog(element) of the application.
http://<IP address>:<port number>
Default port number is : 7000.
Thursday, February 25, 2010
How to set External URL to play the wave files(local dir/MPP/external server) in DD?
Hi All,
Create a phrase set and open it.
Select the "External" radio button and provide the URL to point to the wave file directory
for e.g.,
c://IVR/Phrases/Standard/
(or)
file:///opt/XXX/ (To point to the wave files location which is stored in MPP server)
(or)
http://hostname(or)IP address:port/IVR(application name)/Data/phrases/
Create a phrase set and open it.
Select the "External" radio button and provide the URL to point to the wave file directory
for e.g.,
c://IVR/Phrases/Standard/
(or)
file:///opt/XXX/ (To point to the wave files location which is stored in MPP server)
(or)
http://hostname(or)IP address:port/IVR(application name)/Data/phrases/
How to use DD Trace or logging in Java code
Hi All,
Here the code snippet to use the Trace functionality in POJOs or in Java code.
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("Hai this is test trace for Debug mode"), objSCESession);
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_INFO, ("Hai this is test trace for Info mode"), objSCESession);
To avoid System.out.println()s in DD projects Java code, use the Trace functionality.
Here the code snippet to use the Trace functionality in POJOs or in Java code.
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("Hai this is test trace for Debug mode"), objSCESession);
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_INFO, ("Hai this is test trace for Info mode"), objSCESession);
To avoid System.out.println()s in DD projects Java code, use the Trace functionality.
How to access DD project variables in Java code
Hi All,
Here the code snippet to access DD variables and manipulate the values of those variable in Java code.
If you have the simple variable in project variables list as "name" then here is the ways to get that variable value in Java code.
//First way
IVariable way1ToGet_Name = objSCESession.getVariable("name");
String strWay1ToGetName = way1ToGet_Name.getSimpleVariable().getStringValue();
//Second way
IVariable way2ToGet_Name = objSCESession.getVariable(IProjectVariables.NAME);
String strWay2ToGetName = way2ToGet_Name.getSimpleVariable().getStringValue();
//Third way
IVariableField way3ToGet_Name = objSCESession.getVariable(IProjectVariables.NAME).getSimpleVariable();
String getstrWay3ToGetNameName = way3ToGet_Name.getStringValue();
//Fourth way
String getstrWay4ToGetNameName = objSCESession.getVariableField("name").getStringValue();
//Fifth way
String getstrWay5ToGetNameName = objSCESession.getVariableField(IProjectVariables.NAME).getStringValue();
Note: Here there is a drawback of using the First and Fourth way, if we these ways then later in your project variables list if you change the variable name then it won't show any error and at runtime it will give you the problem.
So better go for other ways(other than First and Fourth). If you change the variable name in project variables list then it will show you some errors at compile time itself. So that you can figure out where exactly you have used that variable and where you need to change.
The above is to get the DD variable value in Java code and assign that value to local java variables.
If you want to set the DD variable value then you have to use setValue("") method.
The following line shows you how to set the String value to DD variable.
objSCESession.getVariableField(IProjectVariables.NAME).setValue("Ramu");
(or)
objSCESession.getVariableField(IProjectVariables.NAME).setValue(strName); //Java String type variable
IVariable mySimpleVar = objSCESession.getVariable(IProjectVariables.ARRAY_OF_PERSONS);
mySimpleVar.setCollection(new SimpleCollection(mySimpleVar.getSimpleVariable(), IProjectVariables.ARRAY_OF_PERSONS));
ICollection mySimpleCollectionVar = mySimpleVar.getCollection();
//To Clear the collection
mySimpleVar.getCollection().removeAll();
mySimpleCollectionVar.removeAll();
//To Reset the collection
mySimpleVar.getCollection().reset();
mySimpleCollectionVar.reset();
Here I have declared one complex variable called "person" with fields "age" and "name". To access these values use the following code snippet.
IComplexVariable complexVar = objSCESession.getVariable(IProjectVariables.PERSON).getComplexVariable();
IVariableField complexVarField1 = complexVar.getField(IProjectVariables.PERSON_FIELD_AGE);
IVariableField complexVarField2 = complexVar.getField(IProjectVariables.PERSON_FIELD_NAME);
complexVarField1.getIntValue();
complexVarField2.getStringValue();
To Set the values to complex fields use the following code snippet.
complexVarField1.setValue(28); //Set the age as 28
complexVarField2.setValue("Ramu"); //Set the name as Ramu
IComplexVariable complexVar = objSCESession.getVariable(IProjectVariables.PERSON).getComplexVariable();
IVariableField complexVarField1 = complexVar.getField(IProjectVariables.PERSON_FIELD_AGE);
IVariableField complexVarField2 = complexVar.getField(IProjectVariables.PERSON_FIELD_NAME);
complexVarField1.getIntValue();
complexVarField2.getStringValue();
complexVarField1.setValue(28); //Set the age as 28
complexVarField2.setValue("Ramu"); //Set the name as Ramu
IVariable myComplex = objSCESession.getVariable(IProjectVariables.PERSON);
myComplex.setCollection(new ComplexCollection(myComplex.getComplexVariable(), IProjectVariables.PERSON));
ICollection myComplexCollection = myComplex.getCollection();
//To Reset the complex collection
myComplexCollection.reset();
//To Remove the complex collection values and make it empty
myComplexCollection.removeAll();
IVariableField complexCollectionField1_Age = myComplex.getComplexVariable().getField(IProjectVariables.PERSON_FIELD_AGE);
IVariableField complexCollectionField2_Name = myComplex.getComplexVariable().getField(IProjectVariables.PERSON_FIELD_NAME);
//Set first record values
complexCollectionField1_Age.setValue(28);
complexCollectionField1_Age.setValue("Ramu");
myComplexCollection.append();
//Set Second record values
complexCollectionField1_Age.setValue(28);
complexCollectionField1_Age.setValue("Srikanth");
myComplex.getCollection().append();
//Reset the collection to travarse the collection values
myComplexCollection.reset();
while (myComplexCollection.hasMore())
{
myComplexCollection.next();
//Log the record values
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("Person Age : " + complexCollectionField1_Age.getIntValue()), objSCESession);
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("Person Name : " + complexCollectionField2_Name.getStringValue()), objSCESession);
}
//Reset the collection to travarse the collection values
myComplexCollection.reset();
Note: If you write your own POJO class then you need to pass SCESession object as parameter to the methods in POJO. Because, all the DD variables are stored in SCESession object.
Here the code snippet to access DD variables and manipulate the values of those variable in Java code.
1) Simple variables:
If you have the simple variable in project variables list as "name" then here is the ways to get that variable value in Java code.
//First way
IVariable way1ToGet_Name = objSCESession.getVariable("name");
String strWay1ToGetName = way1ToGet_Name.getSimpleVariable().getStringValue();
//Second way
IVariable way2ToGet_Name = objSCESession.getVariable(IProjectVariables.NAME);
String strWay2ToGetName = way2ToGet_Name.getSimpleVariable().getStringValue();
//Third way
IVariableField way3ToGet_Name = objSCESession.getVariable(IProjectVariables.NAME).getSimpleVariable();
String getstrWay3ToGetNameName = way3ToGet_Name.getStringValue();
//Fourth way
String getstrWay4ToGetNameName = objSCESession.getVariableField("name").getStringValue();
//Fifth way
String getstrWay5ToGetNameName = objSCESession.getVariableField(IProjectVariables.NAME).getStringValue();
Note: Here there is a drawback of using the First and Fourth way, if we these ways then later in your project variables list if you change the variable name then it won't show any error and at runtime it will give you the problem.
So better go for other ways(other than First and Fourth). If you change the variable name in project variables list then it will show you some errors at compile time itself. So that you can figure out where exactly you have used that variable and where you need to change.
The above is to get the DD variable value in Java code and assign that value to local java variables.
If you want to set the DD variable value then you have to use setValue("") method.
The following line shows you how to set the String value to DD variable.
objSCESession.getVariableField(IProjectVariables.NAME).setValue("Ramu");
(or)
objSCESession.getVariableField(IProjectVariables.NAME).setValue(strName); //Java String type variable
2) Simple Collection Variables:(To store Array of values to DD variable)
IVariable mySimpleVar = objSCESession.getVariable(IProjectVariables.ARRAY_OF_PERSONS);
mySimpleVar.setCollection(new SimpleCollection(mySimpleVar.getSimpleVariable(), IProjectVariables.ARRAY_OF_PERSONS));
ICollection mySimpleCollectionVar = mySimpleVar.getCollection();
//To Clear the collection
mySimpleVar.getCollection().removeAll();
mySimpleCollectionVar.removeAll();
//To Reset the collection
mySimpleVar.getCollection().reset();
mySimpleCollectionVar.reset();
3) Complex Variables:
Here I have declared one complex variable called "person" with fields "age" and "name". To access these values use the following code snippet.
IComplexVariable complexVar = objSCESession.getVariable(IProjectVariables.PERSON).getComplexVariable();
IVariableField complexVarField1 = complexVar.getField(IProjectVariables.PERSON_FIELD_AGE);
IVariableField complexVarField2 = complexVar.getField(IProjectVariables.PERSON_FIELD_NAME);
complexVarField1.getIntValue();
complexVarField2.getStringValue();
To Set the values to complex fields use the following code snippet.
complexVarField1.setValue(28); //Set the age as 28
complexVarField2.setValue("Ramu"); //Set the name as Ramu
4) Complex Collection variables:
IComplexVariable complexVar = objSCESession.getVariable(IProjectVariables.PERSON).getComplexVariable();
IVariableField complexVarField1 = complexVar.getField(IProjectVariables.PERSON_FIELD_AGE);
IVariableField complexVarField2 = complexVar.getField(IProjectVariables.PERSON_FIELD_NAME);
complexVarField1.getIntValue();
complexVarField2.getStringValue();
complexVarField1.setValue(28); //Set the age as 28
complexVarField2.setValue("Ramu"); //Set the name as Ramu
IVariable myComplex = objSCESession.getVariable(IProjectVariables.PERSON);
myComplex.setCollection(new ComplexCollection(myComplex.getComplexVariable(), IProjectVariables.PERSON));
ICollection myComplexCollection = myComplex.getCollection();
//To Reset the complex collection
myComplexCollection.reset();
//To Remove the complex collection values and make it empty
myComplexCollection.removeAll();
IVariableField complexCollectionField1_Age = myComplex.getComplexVariable().getField(IProjectVariables.PERSON_FIELD_AGE);
IVariableField complexCollectionField2_Name = myComplex.getComplexVariable().getField(IProjectVariables.PERSON_FIELD_NAME);
//Set first record values
complexCollectionField1_Age.setValue(28);
complexCollectionField1_Age.setValue("Ramu");
myComplexCollection.append();
//Set Second record values
complexCollectionField1_Age.setValue(28);
complexCollectionField1_Age.setValue("Srikanth");
myComplex.getCollection().append();
//Reset the collection to travarse the collection values
myComplexCollection.reset();
while (myComplexCollection.hasMore())
{
myComplexCollection.next();
//Log the record values
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("Person Age : " + complexCollectionField1_Age.getIntValue()), objSCESession);
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("Person Name : " + complexCollectionField2_Name.getStringValue()), objSCESession);
}
//Reset the collection to travarse the collection values
myComplexCollection.reset();
Note: If you write your own POJO class then you need to pass SCESession object as parameter to the methods in POJO. Because, all the DD variables are stored in SCESession object.
Friday, June 26, 2009
Settings to write the vxml code though eclipse...
Hi All,
If you need editor for vxml then do the following.
Take DTD for the vxml version(we can get it from W3C site) and configure your eclipse and add *.vxml extension to file assoication in eclipse properties.
example :
in Eclipse
Window -> preference - > General -> Editor -> File Assoication (add *.vxml extension and choose xml editor)
DTD configuration for eclipse
in Eclipse
Window -> preference - > General ->Web and XML -> XML Catalog
Press Add button
specify location of the dtd file (ex: /home/ramu/xxxxx.dtd)
Key Type is Public ID
Key is specify some common name (because this name only you specify DOCTYPE in your vxml file). example ://DTD/vxml
and specify alternative url (ex:https://studio.tellme.com/vxml2/dtd/vxml-20-tm-pub.dtd) and press ok
it will create entry for user specified entries. in XML Catalog window
then create vxml file
example
<?xml version = "1.0"?>
<!DOCTYPE vxml PUBLIC "//DTD/vxml" "unknown.dtd">
<vxml version="2.0">
</vxml>
<vxml version="2.0">
</vxml>
//DTD/vxml is your key
I hope this will help you.
If you need editor for vxml then do the following.
Take DTD for the vxml version(we can get it from W3C site) and configure your eclipse and add *.vxml extension to file assoication in eclipse properties.
example :
in Eclipse
Window -> preference - > General -> Editor -> File Assoication (add *.vxml extension and choose xml editor)
DTD configuration for eclipse
in Eclipse
Window -> preference - > General ->Web and XML -> XML Catalog
Press Add button
specify location of the dtd file (ex: /home/ramu/xxxxx.dtd)
Key Type is Public ID
Key is specify some common name (because this name only you specify DOCTYPE in your vxml file). example ://DTD/vxml
and specify alternative url (ex:https://studio.tellme.com/
it will create entry for user specified entries. in XML Catalog window
then create vxml file
example
<?xml version = "1.0"?>
<!DOCTYPE vxml PUBLIC "//DTD/vxml" "unknown.dtd">
<vxml version="2.0">
</vxml>
<vxml version="2.0">
</vxml>
//DTD/vxml is your key
I hope this will help you.
--
Thanks,
Srikanth Reddy
Creating the DD variables at runtime through java code in DD(Dialog Designer)
Hi All,
The Following code will help you to create the variables at runtime through java code in Avaya Dialog Designer and we can use those variables throughout the session.
Sample Code snippet:
String varName = "CreatedVar";
String varValue = "123456";
//Creating the Simple Variable
IVariable ddMySampleVar = SimpleVariable.createSimpleVariable(varName, varValue, null, mySession, false, false);
//Adding the Simple Variable to DD session(SCESession)
mySession.putVariable(ddMySampleVar);
// Log the created variable value through app traces
if (mySession.isAppTraceEnabled())
{
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("My Sample Variable value is : " + ddMySampleVar.getStringValue()), mySession);
}
The Following code will help you to create the variables at runtime through java code in Avaya Dialog Designer and we can use those variables throughout the session.
Sample Code snippet:
String varName = "CreatedVar";
String varValue = "123456";
//Creating the Simple Variable
IVariable ddMySampleVar = SimpleVariable.createSimpleVariable(varName, varValue, null, mySession, false, false);
//Adding the Simple Variable to DD session(SCESession)
mySession.putVariable(ddMySampleVar);
// Log the created variable value through app traces
if (mySession.isAppTraceEnabled())
{
TraceInfo.trace(ITraceInfo.TRACE_LEVEL_DEBUG, ("My Sample Variable value is : " + ddMySampleVar.getStringValue()), mySession);
}
Below is the API declaration of createSimpleVariable method:
public static IVariable createSimpleVariable(java.lang.String name,
java.lang.String value,
java.lang.String factoryID,
SCESession session,
boolean isCollection,
boolean transparencyAllowed)
Thanks,
Ramu.
java.lang.String value,
java.lang.String factoryID,
SCESession session,
boolean isCollection,
boolean transparencyAllowed)
Thanks,
Ramu.
Subscribe to:
Comments (Atom)