Skip to content

Invoking a subdialogue and passing HTTP parameters

Jean-Philippe Gariépy edited this page Apr 25, 2015 · 2 revisions

This example shows how to invoke a VoiceXML subdialogue which requires HTTP parameters.

We proceed as with Invoking a subdialogue but we define a VariableList that will contain the various parameters. Be careful as initial value for each parameter is a JavaScript expression, so don't forget relevant quoting:

Dialogue.java:

VariableList parameters = new VariableList();
parameters.addWithExpression("parameter1", "'value1'");
parameters.addWithExpression("parameter2", "'value2'");

We set those parameters in the turn as submit parameters:

Dialogue.java:

subdialogueCall.setSubmitParameters(parameters);

Running this example

You can download or browse the complete code for this example at GitHub.This is a complete working application that you can build and run for yourself.

You can also clone the Rivr Cookbook repository and checkout this example:

git clone -b subdialogue-invocation-http-parameters git@github.com:nuecho/rivr-cookbook.git

Then, to build and run it:

cd rivr-cookbook

./gradlew jettyRun

The VoiceXML dialogue should be available at http://localhost:8080/rivr-cookbook/dialogue

To stop the application, press Control-C in the console.