Page 1 of 1

How do I return prompt choices?

Posted: Thu Dec 13, 2012 3:11 pm
by Transformations
When a prompt choice is returned do I have to submit that choice, and if so, how do I get the message_reference so I save the data to the correct record?

Re: How do I return prompt choices?

Posted: Thu Dec 13, 2012 4:56 pm
by support
Hi,

We are not sure if we're totally understanding your question. If you would like to save a choice and associate it with the outbound message_reference, you will need to send both values to your save script.

start_url.php:

Code: Select all

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

<vxml version="2.0">
  <var name="message_reference" expr="'<?= $_POST['message_reference'] ?>'"/>
  <form>
    <field name="choice" type="digits">
      <prompt> Enter a number. </prompt>
      <filled>
        <submit next="save_choice.php" namelist="choice message_reference" method="post"/>
      </filled>
    </field>
  </form>
</vxml>
save_choice.php:

Code: Select all

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

//Save the file here
//reference $_POST['choice'] and $_POST['message_reference']
?>

<vxml version="2.0">
  <form>
    <block>
      <prompt> Thank you.  Your choice has been saved. </prompt>
      <disconnect/>
    </block>
  </form>
</vxml>
Hope this helps.

Regards,
Plum Support