Skip to content

VoiceML: <Record>

The <Record> action records audio from the call (from one party). It is a blocking action and no other actions will run until it is complete.

To instead record what happens on the entire call, use <RecordCall> instead.

Compliance Notice

You need to comply with certain laws and regulations, including those regarding obtaining consent to record. Enfonica recommends that you consult with your legal counsel to make sure that you are complying with all applicable laws in connection with communications you record or store using Enfonica.

Attributes

The <Record> action supports the following attributes.

Attribute Allowed Values Default
MaxDurationSeconds >= 1 and <= 3600 600
NextUri absolute or relative URI -
PlayBeep true or false true
PostProcessing trim-silence
RecordingReadyUri absolute or relative URI
StopKey
TimeoutSeconds >= 1 and <= 30 5
Transcribe disabled, default disabled
TranscriptionReadyUri absolute or relative URI -

MaxDurationSeconds

The MaxDurationSeconds attribute specified the maximum duration of the recording.

NextUri

The NextUri attribute specifies the URI where Enfonica will perform a VoiceML request after the <Record> action completes, regardless of whether a recording was successfully recorded. If not specified, VoiceML execution will continue at the next action.

Enfonica will include the following parameters on the request to NextUri.

Parameter Description
action The action that has just finished executing. This will be equal to RECORD.
recording The resource name of the recording. Note that the recording may not be ready immediately. You should set RecordingReadyUri to be informed when the recording is ready.
estimatedDurationSeconds The estimated duration of the recording, before any silence is trimmed. To get the actual duration of the recording, you must wait for the recording ready callback. Entirely silent recordings are sometimes detected in advance. If this is the case, then this duration will be 0.

PlayBeep

The PlayBeep attribute plays a beep before starting the recording.

PostProcessing

The PostProcessing attribute specified any post processing that should be applied to the audio file.

You can use trim-silence to remove any silence from the start and end of the audio.

RecordingReadyUri

The RecordingReadyUri attribute specifies the URI to send the recording ready webhook to. As there is post-processing and other tasks that must run on the recording after completion, the recording may not be available immediately when the <Record> action completes. You should use the recording ready webhook to be notified when the recording is available. It is typically available very quickly.

The recording ready webhook body contains a JSON serialized enfonica.voice.v1beta1.Recording instance. For successful recordings, this will contain the URIs where you can download the recording in WAV and MP3 formats.

StopKey

The StopKey attribute specified a key that will stop recording.

TimeoutSeconds

The TimeoutSeconds attribute specifies the amount of silence in seconds that will trigger the recording to stop.

Transcribe

The Transcribe attribute specifies how the recording should be transcribed. To transcribe the recording, specify default as the value, which indicates that you would like to use Enfonica's default transcription service. Additional options may become available in the future.

Please note that transcription incurs additional charges.

TranscriptionReadyUri

The TranscriptionReadyUri attribute specifies the URI to send the transcription ready webhook to. As transcription can take some time to transcribe the audio, you should use this webhook to be notified when the transcription is available. It is typically available in 10-30 seconds for a short recording or several minutes for longer recordings.

Body

No actions can be nested within the <Record> action.