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 can I assign recording to another variable

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

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

IVR code for saving recording to another variable

Post by support »

Hi,

Here is some sample IVR code that will allow you to store your recording in another variable:

recordvariable.vxml:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<property name="sensitivity" value="0.3"/>
<var name="store"/>

<form id="xfer">
  <record name="msg" beep="true" maxtime="10s" finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">
    <prompt timeout="5s">
      Record a message after the beep.
    </prompt>
    <filled>
      <assign name="store" expr="msg"/>
    </filled>
    <noinput>
      I didn't hear anything, please try again.
    </noinput>
  </record>

<field name="confirm">
  <grammar>
    Yes|No
  </grammar>     
  <prompt>
    Your message is <audio expr="store"/>.
  </prompt>
  <prompt>
    To keep it, say yes.  To discard it, say no.
  </prompt>
  <filled>
    <if cond="confirm=='Yes'">
      <submit next="save.php" namelist="store" method="post"/>
    </if>
    <clear/>
  </filled>
</field>
</form>
</vxml>
From this IVR example, note that our original <record> variable, msg, gets stored into another variable, store.

Hope this helps.

Regards,
Plum Support
Last edited by support on Wed Feb 24, 2010 11:05 am, edited 1 time in total.

Post Reply