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

Saving recording to a file on the http server

Questions and answers about Plum iOn systems

Moderators: admin, support

Post Reply
leftkost
Posts: 11
Joined: Tue Feb 24, 2004 12:51 am

Saving recording to a file on the http server

Post by leftkost »

How do you save a voice recording to a file on the server? Say to verify an order, or similar? Is it saved as a wav file?

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

IVR code for Saving recording to a file on the http server

Post by support »

Hello:

This question belongs in the VoiceXML Developer Q&A forum; this particular forum is meant for IVR platform setup/configuration issues.

In order to save a wav file, you need to do 2 things:
Step 1) use a <record> tag to record audio from a telephone call session. here is an IVR example of a record tag that does this:

Code: Select all

  <form id="record_audio"> 
   <record name="aud" beep="true" type="audio/basic" dtmfterm="true"
      maxtime="60.0s" finalsilence="2.0s">
      <prompt>
        <audio src="wav/record_instruction.wav">
          After the beep, please record a message. 
          To cancel the recording and start over, press the star key. 
        </audio>
      </prompt>
      <filled>
        <if cond="aud$.termchar == '*'">
          <clear/>
          <reprompt/>
       <else/>
          <assign name="myrecording" expr="aud"/>
          <goto next="#review_audio"/>
        </if>
      </filled>
      <catch event="noinput nomatch">
        <audio src="wav/didnthear.wav">Sorry, I didn't hear you.</audio>
        <reprompt />
      </catch>
   </record>  
</form>

Step 2) submit the wav data to a server side script that will read the wav file out of the HTTP POST data, and save it to disk on the web server locally. Here is an IVR example <submit> that posts the recorded file to a webserver:

Code: Select all

<submit next="http://www.samplehost.com/file_upload.php" 
		method="post" 
		enctype="multipart/form-data"
		namelist="myrecording"/> 
The IVR script located at http://www.samplehost.com/file_upload.php is now responsible for reading the audio data out of the POST variable and storing it to disk.


If you need more information, please clarify where you are having the problem and we will provide more assistance. Good luck!

sincerely,

The Plum Support Team

Post Reply