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

How do I return prompt choices?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
Transformations
Posts: 2
Joined: Tue Dec 11, 2012 11:31 am

How do I return prompt choices?

Post 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?

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

Re: How do I return prompt choices?

Post 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

Post Reply