Skip to main content
The <Recording> instruction starts a non-blocking call recording when nested inside <Start>. After recording starts, Telnyx immediately continues executing the next TeXML instruction. The recording stops when the call ends or when it is stopped with the Stop Recording command.

Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
recordingStatusCallback Optional URL that tells Telnyx where to make its GET or POST request when recording status events occur. Relative URLs are resolved against the current TeXML document URL. -
recordingStatusCallbackMethod HTTP request type used for recordingStatusCallback. GET, POSTPOST
recordingStatusCallbackEvent The recording events for which Telnyx should send a webhook to the recordingStatusCallback URL. Multiple events are separated by a space. in-progress, completed, absentcompleted
channels Specifies whether the final audio file should be recorded as one channel or two channels. Use mono or single for a single-channel recording. mono, single, dualdual
track Specifies which track should be recorded. inbound, outbound, bothboth
trim Removes silence from the beginning and end of the recording when set to trim-silence. trim-silence-
format The format of the recording file. mp3, wavmp3

Examples

Start a recording and continue immediately to the next TeXML instruction:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Start>
    <Recording />
  </Start>
  <Say>Recording has started.</Say>
</Response>
Start a dual-channel recording and receive status callbacks:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Start>
    <Recording
      channels="dual"
      track="both"
      format="mp3"
      trim="trim-silence"
      recordingStatusCallback="https://example.com/recording-status"
      recordingStatusCallbackMethod="POST"
      recordingStatusCallbackEvent="in-progress completed absent" />
  </Start>
  <Say>This call may be recorded for quality assurance.</Say>
</Response>

Expected callbacks

If recordingStatusCallback is set, recording status callbacks are sent for the events listed in recordingStatusCallbackEvent:
EventCallback Reference
in-progressRecording In Progress
completedRecording Completed
absentRecording failed or was not created
When recordingStatusCallbackEvent is not provided, Telnyx sends the completed callback by default.