Can I resume execution of vxml from the point where I called subdialog or submit. e.g
User recording titles are played. When 4th title is played, user select to listen it by pressing #. 4th recording is played. Now I want to take user back to the same previous menu of titles and play 5th title.
Is that possible?
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Resuming from the last point before calling subdialog
IVR code to resume from last point before calling subdialog
Hi,
Here is some sample IVR code using the IVR tag, <subdialog>, that will help you achieve this:
playtitles.php:
yoursubdialog.php:
Hope this IVR example helps.
Regards,
Plum Support
Here is some sample IVR code using the IVR tag, <subdialog>, that will help you achieve this:
playtitles.php:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<script>
var selected = 0;
var menu = new Array();
menu[1] = true;
menu[2] = true;
menu[3] = true;
</script>
<property name="inputmodes" value="dtmf"/>
<var name="tracker" expr=" "/>
<form id="menu">
<field name="field1" cond="menu[1]">
<grammar type="application/x-jsgf" mode="dtmf">
"#"
</grammar>
<prompt>
1st title
</prompt>
<filled>
<assign name="tracker" expr="1"/>
<assign name="menu[1]" expr="false"/>
<prompt>
You entered <value expr="field1"/>.
</prompt>
<goto next="#form2"/>
</filled>
<noinput>
<assign name="menu[1]" expr="false"/>
</noinput>
</field>
<field name="field2" cond="menu[2]">
<grammar type="application/x-jsgf" mode="dtmf">
"#"
</grammar>
<prompt>
2nd title
</prompt>
<filled>
<assign name="tracker" expr="2"/>
<assign name="menu[2]" expr="false"/>
<prompt>
You entered <value expr="field2"/>.
</prompt>
<goto next="#form2"/>
</filled>
<noinput>
<assign name="menu[2]" expr="false"/>
</noinput>
</field>
<field name="field3" cond="menu[3]">
<grammar type="application/x-jsgf" mode="dtmf">
"#"
</grammar>
<prompt>
3rd title
</prompt>
<filled>
<assign name="tracker" expr="3"/>
<assign name="menu[3]" expr="false"/>
<prompt>
You entered <value expr="field3"/>.
</prompt>
<goto next="#form2"/>
</filled>
<noinput>
<assign name="menu[3]" expr="false"/>
</noinput>
</field>
</form>
<form id="form2">
<subdialog namelist="tracker" method="post" src="yoursubdialog.php">
<filled>
<goto next="#menu"/>
</filled>
</subdialog>
</form>
</vxml>
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$tracker = $_POST['tracker'];
?>
<vxml version="2.0">
<form>
<block>
<?php
echo "<audio src=\"path/to/the/file/$tracker.wav\">
This is where you would hear recording number $tracker.
</audio>"
?>
<return/>
</block>
</form>
</vxml>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com