Skip to main content

Record

The <Record> verb creates an audio file with the call audio. If a recordingStatusCallback is provided, Telnyx will deliver the URL for the recording to that address once the call has ended. Recording URLs are valid for 10 minutes after the call has ended. All recordings are also available via the Telnyx Mission Control Portal

Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
action Optional URL where TeXML will make a request when the <Record> ends to retrieve a new set of TeXML instructions to continue the call flow sent with additional request parameters. -
method HTTP request type used to retrieve the next set of instructions. GET, POST POST
finishOnKey Set of digits specified together, any one of which will end the recording. Supported characters values: Any digit, #, *. 1234567890*#
timeout The number of seconds that Telnyx will wait for the recording to be stopped if silence is detected. The timer only starts when the speech is detected. Please note that the transcription is used to detect silence and the related charge will be applied. 0 for infinite. 0
maxLength Defines the maximum length for the recording in seconds. 0 for infinite. 0 - 14400 3600
playBeep Whether or not a sound is played before the start of a recording. true
trim Will remove silence from the beginning and end of the recording when set to trim-silence. trim-silence -
channels When using dual channels, the final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B. single, dual dual
recordingStatusCallback Optional URL that tells Telnyx where to make its GET or POST request when the recording is available. -
recordingStatusCallbackMethod HTTP request type used for recordingStatusCallback. GET, POST POST

Examples

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Record action="https://example.com/recording-complete"
maxLength="30"
playBeep="true"/>
</Response>

Expected callbacks

If the statusCallback or the action is set, the following callbacks are sent:

completed and action callback

{
"AccountSid": "cb6cfbbc-eb00-41af-a3f3-0d7b32009e4b",
"CallSid": "v2:7V3r4VFCGLTzKLOveE0-7vM9dX17-NRQgU1byo-uuOIX9JcDadLLKw",
"CallSidLegacy": "v2:7V3r4VFCGLTzKLOveE0-7vM9dX17-NRQgU1byo-uuOIX9JcDadLLKw",
"ConnectionId": "1684641123236054244",
"RecordingStatus" : "completed",
"RecordingDuration" : 100,
"RecordingChannels" : 2,
"RecordingSid" : "efgcfbbc-eb00-41af-a3f3-0d7b32009e4",
"RecordingUrl" : ""
}

in-progress

{
"AccountSid": "cb6cfbbc-eb00-41af-a3f3-0d7b32009e4b",
"CallSid": "v2:7V3r4VFCGLTzKLOveE0-7vM9dX17-NRQgU1byo-uuOIX9JcDadLLKw",
"CallSidLegacy": "v2:7V3r4VFCGLTzKLOveE0-7vM9dX17-NRQgU1byo-uuOIX9JcDadLLKw",
"ConnectionId": "1684641123236054244",
"RecordingStatus": "in-progress"
}

transcription

{
"AccountSid": "cb6cfbbc-eb00-41af-a3f3-0d7b32009e4b",
"CallSid": "v2:7V3r4VFCGLTzKLOveE0-7vM9dX17-NRQgU1byo-uuOIX9JcDadLLKw",
"CallSidLegacy": "v2:7V3r4VFCGLTzKLOveE0-7vM9dX17-NRQgU1byo-uuOIX9JcDadLLKw",
"From": "Defaultj35z6@sip.telnyx.com",
"To": "+12132045020",
"CallStatus": "completed",
"RecordingSid": "efgcfbbc-eb00-41af-a3f3-0d7b32009e4",
"RecordingUrl": "https://s3.amazonaws.com/PRESIGNED-RECORDING-URL",
"TranscriptionStatus": "completed",
"TranscriptionSid": "hykcfbbc-eb00-41af-a3f3-0d7b32009e4",
"TranscriptionText": "Hi, how are you?"
}

Status callback attributes

ATTRIBUTEDESCRIPTION
AccountSidA unique identifier for the account generating this call.
CallSidA unique identifier for this call, generated by Telnyx.
CallSidLegacyA unique identifier for the call sent for keeping backward compatibility.
FromThe outbound caller number.
ToThe inbound callee number.
CallStatusThe value is one of in-progress or completed
RecordingSidA unique identifier for the recording, generated by Telnyx.
RecordingUrlA Url to download the recording. It is active for 10 minutes after the recording is stored
TranscriptionStatusA status of the transcription. Always completed
TranscriptionSidA unique identifier for the transcription, generated by Telnyx
TranscriptionTextA recording transcription