LemonGateway.Voice.RecordingManager (lemon_gateway v0.1.0)

View Source

Manages call recordings via the Twilio REST API.

Starts dual-channel recording when a call's media stream connects, and registers a status callback so the recording is auto-downloaded when the call ends.

How it works

  1. CallSession calls start_recording/2 when the Twilio WebSocket connects
  2. This module POSTs to the Twilio Recordings API to begin recording
  3. When the call ends, Twilio POSTs the recording status to our callback
  4. WebhookRouter receives the callback and triggers RecordingDownloader

Summary

Functions

Starts dual-channel recording for the given call.

Functions

start_recording(call_sid, opts \\ [])

@spec start_recording(
  String.t(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}

Starts dual-channel recording for the given call.

opts may include:

  • :recording_callback_url - the full URL for Twilio to POST recording status to. If omitted, Twilio won't notify us (we'd have to poll).

Returns {:ok, recording_sid} or {:error, reason}.