- Contents
- Index
VoiceXML Technical Reference
Example
In order to help you effectively use the com.inin.securedata property in your VoiceXML documents, the following example script, which performs a simple output/input test while treating some data as secure, illustrates how the property is used.
<?xml version="1.0" encoding="UTF-8"?>
<!--
File:WhichDrink_secure.vxml
Date:07/03/2014
Author:WEB
Desc:This document does a simple output/input test whilst treating some data as secure.
Basic Steps:
- Play a text prompt
- Define an inline grammar
- Get input
- Play back the choice
-->
<vxml xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/voicexml20/vxml.xsd"
version="2.0">
<var name="answer1"/>
<var name="answer2"/>
<var name="answer3"/>
<form>
<property name="com.inin.securedata" value="true"/>
<!--
We want to treat the "number", "drink" and "delight" information as sensitive data.
-->
<field name="number">
<prompt>
<audio src="http://billbairdpc4:8080/my-files/Suzanna.wav">
Alternative text for Suzanna prompt.
</audio>
Punch a two digit number.
</prompt>
<grammar src="builtin:dtmf/digits?minlength=2;maxlength=2"/>
</field>
<field name="drink">
<prompt>Would you like coffee, tea, milk, or nothing?</prompt>
<grammar version="1.0" mode="voice" root="drinklist">
<rule id="drinklist" scope="public">
<one-of>
<item>coffee</item>
<item>tea</item>
<item>milk</item>
<item>nothing</item>
</one-of>
</rule>
</grammar>
</field>
<field name="delight">
<prompt>What kind of tasty delight would you like?</prompt>
<grammar version="1.0" mode="voice" root="delightlist">
<rule id="delightlist" scope="public">
<one-of>
<item>cookies</item>
<item>crumpets</item>
<item>biscuits</item>
<item>nothing</item>
</one-of>
</rule>
</grammar>
</field>
<filled>
<prompt>You
chose <value expr="number"/>, <value expr="drink"/>
and <value
expr="delight"/>.</prompt>
<assign name="answer1" expr="drink"/>
<assign name="answer2" expr="delight"/>
<goto next="#weather"/>
</filled>
</form>
<form id="weather">
<property name="com.inin.securedata" value="false"/>
<!--
The weather information obtained in this form is not sensitive data.
Note
that the <prompt> queued above ("You chose xxx and yyy.")
is not actually issued until the
recognition input generated by the
<form> below, and so is not treated as sensitive data.
Trace logs should be secure, but if
the call is being recorded by the CIC server, then it won't
be secure.
-->
<field name="temperature">
<prompt>Is the weather hot or cold?</prompt>
<grammar version="1.0" mode="voice" root="templist">
<rule id="templist" scope="public">
<one-of>
<item>hot</item>
<item>cold</item>
</one-of>
</rule>
</grammar>
</field>
<field name="state">
<property name="com.inin.securedata" value="true"/>
<prompt>In which state do you live?</prompt>
<grammar version="1.0" mode="voice" root="statelist">
<rule id="statelist" scope="public">
<one-of>
<item>Indiana</item>
<item>Ohio</item>
</one-of>
</rule>
</grammar>
</field>
<field name="number2">
<prompt>
Punch a three digit number.
</prompt>
<grammar src="builtin:dtmf/digits?minlength=3;maxlength=3"/>
</field>
<filled>
<prompt>The weather is <value expr="temperature"/>.</prompt>
<assign name="answer3" expr="temperature"/>
<prompt>You entered <value expr="number2"/>.</prompt>
<goto next="#the_end"/>
</filled>
</form>
<form id="the_end">
<property name="com.inin.securedata" value="true"/>
<block>
<!--
answer1 and answer2 contain sensitive data, and since we want to pass this
information back to the handler, we must make sure that we <exit> from a
secure form.
-->
<prompt>Your
answers are <value expr="answer1"/>, <value expr="answer2"/>
and <value
expr="answer3"/>.</prompt>
<log>I
am logging sensitive data (Suzanna): (<value expr="answer1"/>
and <value
expr="answer2"/>)</log>
<exit namelist="answer1 answer2 answer3"/>
</block>
</form>
</vxml>

