Callback invoked when a quality warning should be surfaced.
Set/update the call_report_id. BaseCall constructs the recorder in
_init() — before the server has assigned session.callReportId (it
arrives on the verto invite/answer response) — so the value snapshotted
in callContext.callReportId is typically empty. BaseCall calls this once
the id is available (at the Active state and again before the final flush)
so every envelope carries the real call_report_id and recordings correlate
with the call report.
Set/update the connection host. BaseCall constructs the recorder before
the connection host is always known (it reads this.session.connection?.host
at construction), so the periodic flush and final flush can use an
up-to-date host if the session reconnects to a different host.
Post the remaining buffered packets as the final segment. Called from
BaseCall._postCallReport at end of call. Mirrors CallReportCollector's
final-report POST (retry + keepalive). Throws on exhaustion so the caller
can record failure. The final segment carries segment: 'final' and
ended_at. The endpoint is resolved from the host passed at construction
(BaseCall sets callContext.host).
Start capturing PCM from the local outbound and/or remote inbound audio
tracks. If MediaStreamTrackProcessor is unavailable, logs a single
RECORDING_UNAVAILABLE warning and no-ops. Safe to call with undefined
tracks (skips the missing ones).
Optional localTrack: MediaStreamTrackOptional remoteTrack: MediaStreamTrack
CallRecorder — captures raw audio PCM from WebRTC tracks, synthesizes RTP packets, buffers them with a bounded ring buffer, and POSTs flushes.
Mirrors
CallReportCollector's POST/retry/keepalive shape so the upload behaves the same way the call-report upload does (x-call-report-id / x-call-id / x-voice-sdk-id headers, retry with [500,1000,2000]ms backoff,keepalive: truefor small final payloads).