<Record>
The <Record> verb records the voice of the caller and generates an audio file that can be downloaded via a URL.
<Record> Attributes
<Record> supports the following attributes that change its behavior:
| Attribute | Allowed Values | Default Value |
|---|---|---|
| action | relative or absolute URL | none |
| method | GET, POST | POST |
| timeout | integer > 0 | 5 seconds |
| finishOnKey | any digit, #, *, or none | 1234567890*# |
| maxLength | integer between 1 and 14400 (4 hours) | 3600 (1 hour) |
| playBeep | true, false | true |
| history | disable, compact, full | disable |
| recordingStatusCallback | relative or absolute URL | none |
| recordingStatusCallbackMethod | GET, POST | POST |
| recordingStatusCallbackEvent | in-progress, completed, failed | completed |
action
The action attribute accepts a URL as its argument. The URL tells Voxtelesys where to make a POST or GET request after the recording ends.
If you do not provide an action URL, <Record> will finish and Voxtelesys will move on to the next VoXML verb in the document.
See additional parameters sent on the action webhook.
method
The method attribute accepts either GET or POST. This tells Voxtelesys whether to request the action URL via HTTP GET or POST, with POST as its default value.
timeout
The timeout attribute sets the number of seconds of silence for the <Record> verb to allow before ending the recording and setting its status to completed. Once the timeout is reached, the VoXML fetched from the action URL will be played, or the execution of the current VoXML will continue if no action URL is provided. The default value of timeout is 5 seconds. To disable this feature, set timeout to 0 seconds.
finishOnKey
The finishOnKey attribute accepts a list of characters that, when pressed, will end the recording, set its status to completed, and proceed with VoXML execution. More than one character can be specified. For example, if finishOnKey is set to 3#, both the digit "3" and the pound key "#" can be pressed to end the recording. By default, the value is 1234567890*#, which is all characters. If the value is set to none then the recording will end once the timeout duration has been met.
maxLength
The maxLength attribute is the maximum length of the recording, in seconds. The default is 3600 seconds (1 hour), the minimum is 1 second, and the maximum is 14400 seconds (4 hours). For example, if maxLength is set to 60 seconds, the recording will automatically end after 1 minute.
playBeep
The playBeep attribute accepts a boolean that determines whether to play a beep at the beginning of the recording. The default is to play the beep. If playBeep is set to false, then no beep will be played before the recording starts.
recordingStatusCallback
The recordingStatusCallback attribute accepts a relative or absolute URL. If a recordingStatusCallback is given, then an HTTP request will be sent to the specified URL with information for each recording status that is requested in recordingStatusCallbackEvent.
See additional parameters sent on the recordingStatus webhook.
recordingStatusCallbackMethod
The recordingStatusCallbackMethod attribute specifies which HTTP method to use when sending a callback to the recordingStatusCallback URL. The default is POST.
recordingStatusCallbackEvent
The recordingStatusCallbackEvent attribute accepts a list of events for which HTTP callbacks should be sent to recordingStatusCallback. To specify more than one event, separate each event name with a space. The default is completed, and the available events are:
in-progress: the recording has started.completed: the recording has finished and has been uploaded.failed: the recording failed to be uploaded and is not available.
history
The history attribute determines if the <Record> verb should be logged in the history array of the CDR. The default is to not log.
For <Record>, the compact and full values log the following payload to the history array respectively.
compact
{
"payload": {
"action": "/next"
}
}
full
{
"payload": {
"action": "/next",
"method": "POST",
"timeout": 5,
"finishOnKey": "#",
"method": "POST",
"maxLength": 60,
"playBeep": true,
"recordingStatusCallback": "http://example.com",
"recordingStatusCallbackMethod": "POST",
"recordingStatusCallbackEvent": "completed"
}
}
<Record> Webhooks
action Webhook
If you specify an action URL, Voxtelesys will send a webhook with the following additional parameters:
| Parameter | Description |
|---|---|
RecordingUrl | The URL of the recorded audio file |
RecordingDuration | The duration of the audio recording. |
Digits | The DTMF characters that were used to end the recording, if applicable. If the recording ended on a hangup, then the value will instead be hangup. |
recordingStatus Webhook
If you specify a recordingStatusCallback URL, Voxtelesys will send a webhook with the following additional parameters:
| Parameter | Description |
|---|---|
RecordingSid | The unique ID of the recording. |
RecordingUrl | The URL of the recorded audio file |
RecordingDuration | The duration of the audio recording. |
RecordingStatus | The status of the recording. The possible values are in-progress, completed, and failed. |
RecordingChannels | The number of channels in the final recording file. For <Record>, only one channel is supported. |
RecordingSource | The method used to create this recording. For <Record>, this will always be RecordVerb. |
The possible values for RecordingStatus are:
| Value | Description |
|---|---|
in-progress | The recording has started. |
completed | The recording has finished and has been uploaded. |
failed | The recording failed to be uploaded and is not accessible. |
<Record> Example
Simple Usage
<Response>
<Record/>
</Response>
Voicemail System
<Response>
<Say>Please leave a message at the beep and press "star" when finished.</Say>
<Record finishOnKey="*"/>
</Response>