Record

The <Record> verb records the caller’s audio, returning the URL of a file containing the audio recording.

Usage

<Record> is setup as a way to capture a response from the user and do a callback to you. No other commands after Record should be done, as Record will call back to you and allow you to continue call control.

Record Attributes

action. The 'action' attribute takes an absolute or relative URL as a value. When recording is finished CallAPI will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, <Record> will default to requesting the current document’s URL. After making this request, CallAPI will continue the current call using the RCML received in your response. Any RCML verbs occuring after a <Record> are unreachable. There is one exception: if CallAPI receives an empty recording, it will not make a request to the 'action' URL. The current call flow will continue with the next verb in the current RCML document.

Request Parameters

Method. The 'method' attribute takes the value 'GET' or 'POST'. This tells CallAPI whether to request the URL via HTTP GET or POST.

Timeout. The 'timeout' attribute tells CallAPI to end the recording after a number of seconds of silence has passed.

finishOnKey. The 'finishOnKey' attribute lets you choose a set of digits that end the recording when entered. For example, if you set 'finishOnKey' to '#' and the caller presses '#', CallAPI will immediately stop recording and submit 'RecordingUrl', 'RecordingDuration', and the '#' as parameters in a request to the 'action' URL. The allowed values are the digits 0-9, '#', '*' and '-1'. The default value is '1234567890*#' which means that any key will end the recording. The value '-1' is a special value that can be used to disable finishOnKey and never stop recording on a DTMF. Unlike <Gather>, you may specify more than one character as a 'finishOnKey' value but '-1' must be used alone.

maxLength. The 'maxLength' attribute lets you set the maximum length for the recording in seconds.

playBeep. The 'playBeep' attribute allows you to toggle between playing a sound before the start of a recording.

Media. The 'media' attribute defines the which kind of information will be stored. Choose 'audio_only' so store a WAV file containing audio; 'video_only' to store a MP4 file containing vide; 'audio_video' to store a MP4 file containing audio and video*.

Nesting

The <Record> verb cannot have any other verbs or nouns nested.

Example

Example of how to use the <Record> verb:

<Response>
  <Say>What is your full name</Say>
  <Record maxLength="10" playBeep="false" action="https://example.com/record"/>
</Response>

If you choose to record voice calls, you need to comply with various laws and regulations, including those regarding obtaining consent to record (such as California’s Invasion of Privacy Act and similar laws in other jurisdictions). We recommend that you consult with your legal department to make sure you comply with all applicable laws in connection with communications you record or store using call API

Last updated