We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Root vxml

Questions and answers about Plum iOn systems

Moderators: admin, support

Post Reply
amitkhosla
Posts: 53
Joined: Sun Feb 15, 2009 11:42 pm
Contact:

Root vxml

Post by amitkhosla »

In the documentation, i read that there is a concept of root vxml that can be included in all other vxml pages. My question is where should we put that vxml?

As the application configuration tells us that point to this url or have this vxml from scratchpad.

But where i should have this root file, i am not able to locate.

Please help me in this.

Thanks
Amit

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR example for using root file

Post by support »

Hi,

You can refer to this documentation about how to use a root file: http://www.plumvoice.com/docs/dev/developer_reference:rootdocument

For IVR example, suppose you had the following 3 files on your IVR application server:

root.php
leaf1.php
leaf2.php

root.php (this is your root document):

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>

<vxml version="2.0">

<var name="language" expr="''"/>

</vxml>


leaf1.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>

<vxml version="2.0" application="/path/to/the/file/root.php"> (THIS IS WHERE YOU REFER TO YOUR ROOT DOCUMENT)

<form id="choose_lang">

<field name="lang">
<grammar>1{English}|2{Spanish}</grammar>
<prompt>
For American English, press 1. For Spanish, press 2.
</prompt>
<filled>
<assign name="language" expr="lang"/>
<goto next="leaf2.php"/>
</filled>
</field>

</form>
</vxml>


leaf2.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>

<vxml version="2.0" application="/path/to/the/file/root.php"> (THIS IS WHERE YOU REFER TO YOUR ROOT DOCUMENT)

  <form>
    <block>
      <prompt bargein="false">
        The language you have chosen is <value expr="language"/>.
      </prompt>
    </block>
  </form>
</vxml>


So, you would set up leaf1.php as the application URL for your phone number and when callers would call in, they would be prompted to choose a language. Once they have made a choice, there is a transition to leaf2.php, where the user is told what language they have chosen. Because leaf1.php and leaf2.php make a reference to root.php, the variable, "language", is not lost between page transitions.

Hope this IVR example helps.

Regards,
Plum Support

Post Reply