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

subdialog to do HTTP POST

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
scooter6
Posts: 1
Joined: Wed Nov 23, 2005 9:37 pm

subdialog to do HTTP POST

Post by scooter6 »

I am developing an application that asks along the way for the
caller to speak their name after the beep -- then right after that they speak their address after the beep.

So - conceivably, I have 2 wav files now that the caller has recorded.

I have the full vxml dialog already done - is it possible to do a
<subdialog> or a <submit> to have the vxml POST these files to my
webserver and then continue on in this vxml root document or do I have to then dynamically create another vxml page for the call to continue?

Also - I have see the php examples to do file upload and I have gotten this to work with no problem. Is there an example of php code that anyone uses in order to POST multiple files at once?
Thanks

Scott

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

IVR example that posts 2 files from main page to a subdialog

Post by support »

Hello,

Here is an IVR example that posts 2 files from a main page to a <subdialog>, this will allow you to save the files while still continuing on your normal execution path.

main.vxml:

Code: Select all

<vxml version="2.1">
<form>
  <record name="rec1" beep="true">
    <prompt bargein="false">Recording 1.  Start recording after the beep.</prompt>
  </record>
  <record name="rec2" beep="true">
    <prompt bargein="false">Recording 2.  Start recording after the beep.</prompt>
  </record>
  <subdialog src="subdialog.php" method="post" enctype="multipart/form-data" namelist="rec1 rec2">
    <filled>Files uploaded successfully</filled>
  </subdialog>
</form>
</vxml>
subdialog.php:

Code: Select all

<?php
move_uploaded_file($_FILES['rec1']['tmp_name'], "/tmp/recording1.raw");
move_uploaded_file($_FILES['rec2']['tmp_name'], "/tmp/recording2.raw");
echo("<?xml version=\"1.0\"?>");
?>
<vxml version="2.1">
<form>
  <block>
    <return/>
  </block>
</form>
</vxml>
The above IVR code does not make use of any IVR error handling or pass back status variables from the subdialog to the main page. Hope this helps.

Regards,
Plum Support

Post Reply