Run the audio bridge yourself. Pipe the caller’s uplink (what the caller says) straight into a streaming recognizer that you control: Deepgram, a self-hosted Whisper, or any ASR that accepts 16-bit PCM. audioBridge.attach subscribes the uplink track and gives you every frame in onUplink. Ask for pcm16 at 16000 Hz. The bridge then transcodes the G.711 PSTN leg for you, so your ASR gets exactly the audio it wants.
This is the “bring your own ASR” path. You own the recognizer and the dialog logic. If you prefer that ClutchCall runs a managed cascade (ASR → LLM → TTS) from one config file, see BYO ASR / LLM / TTS instead.

Attach the bridge and feed your ASR

attach takes the call_sid, a codec/rate, and your onUplink callback. Frames arrive as raw little-endian PCM16. A mono 20 ms frame at 16 kHz is 320 samples (640 bytes). Push each frame to your recognizer as it arrives.
attach subscribes the uplink and publishes a downlink track. Hold the returned bridge for the full duration of the call. If the garbage collector removes it, both tracks drop and the bridge ends. When you are done, call bridge.close() before call.hangup() so that the tracks close cleanly.

Transcribe an inbound call

Bind the bridge as soon as the call answers. The example below originates an outbound call with no server-side agent, so your ASR is the only consumer of the uplink. The same attach works for an inbound sid that you already hold.

Want Opus frames instead?

Your recognizer possibly takes Opus directly, or you only capture to disk. In that case, ask for codec: "opus" and skip the transcode. The caller’s audio then reaches you as 20 ms encoded Opus packets. Use pcm16 only when your ASR needs raw samples.
tsUs / ts_us is the frame’s presentation timestamp in microseconds. Feed it to a recognizer that supports word-level timing. Or use it to align the transcript with a recording keyed on the same call_sid.

Send TTS audio back

Push synthesized audio to the caller with publishDownlink.

BYO ASR / LLM / TTS

Let the runtime assemble a managed cascade from one config file.

Turn detection

VAD and barge-in: decide when a caller’s turn is over.

Sessions, calls & tracks

How voice/<sid>/uplink and downlink tracks are addressed.