Record
The <Record> verb records the caller's voice and, once recording ends, sends the result to your action URL.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
action | string (uri) | None | URL to send the result to. When absent, the next verb in the document runs once recording ends. |
method | string | POST | HTTP method used to request action. GET or POST. |
timeout | integer | 5 | Seconds of silence that end the recording. Set to 0 to disable the silence timeout. |
finishOnKey | string | # | Key that ends the recording. A single character: a digit, * or #. Set to an empty string to disable it. |
maxLength | integer | 3600 | Maximum recording length, in seconds. |
playBeep | boolean | true | Whether to play a beep before recording starts. |
recordingStatusCallback | string (uri) | None | URL to notify when the recording finishes. Signals requests it once, for the completed event only. |
recordingStatusCallbackMethod | string | POST | HTTP method used to request recordingStatusCallback. GET or POST. |
RecordingUrl points at the recording audio on the Calls API. Downloading it requires your AccountSid and auth token. See Download recording audio.
Nesting
<Record> is a self-closing element with no text content and no nested verbs.
Action parameters
| Name | Type | Description |
|---|---|---|
RecordingSid | string | Unique identifier for the recording. |
RecordingUrl | string (uri) | URL of the recording audio, ending in .wav. |
RecordingDuration | integer | Duration of the recording, in seconds. |
Recording status callback parameters
When recordingStatusCallback is set, Signals posts these parameters to it once the recording completes:
| Name | Type | Description |
|---|---|---|
AccountSid | string | Your Voice Account SID. |
CallSid | string | Unique identifier for the call. |
RecordingSid | string | Unique identifier for the recording. |
RecordingUrl | string (uri) | URL of the recording audio, ending in .wav. |
RecordingStatus | string | Always completed. |
RecordingDuration | integer | Duration of the recording, in seconds. |
RecordingChannels | integer | Number of audio channels in the recording. |
RecordingSource | string | Always RecordVerb for <Record>. |
Examples
A voicemail prompt that records a message and requests action when done:
Code
The /voicemail-complete handler, complete and runnable:
A silent recording of the rest of the call, reported through recordingStatusCallback instead of action:
Code
See Recording calls for a complete /recording-status receiver and for downloading the audio.