Accepts the Media-Streams websocket for an inbound call already delivered by the voice webhook.
The inbound Call SID from the webhook.
Ends the call (REST calls(sid).update({ status: 'completed' })).
The Call SID to complete.
Places an outbound call via the Twilio REST API (calls.create) with TwiML that opens a
bidirectional Media-Streams <Connect><Stream> to the agent's websocket.
Destination number (E.164).
The agent's Twilio number / verified caller-id the call originates from.
Optionalargs: Record<string, unknown>Provider-specific options (status-callback URL, stream URL, recording flags, …).
The created Call SID.
Registers the call-ended callback (status-callback completed/failed/canceled or stream stop).
The Call SID.
Invoked when the call ends.
Registers the inbound DTMF callback (<Gather> webhook results or Media-Streams dtmf events).
The Call SID.
Invoked with each received DTMF digit string.
Registers the inbound Media-Streams audio callback for the call (what the agent hears).
The Call SID whose inbound stream to subscribe to.
Invoked with each inbound PCM audio frame.
Sends DTMF digits on the call (REST calls(sid).update with <Play digits> / <Dial sendDigits>).
The Call SID.
The DTMF digit string.
Pushes one outbound audio payload onto the call's Media-Streams websocket (the agent's voice).
The Call SID whose stream to write to.
The audio bytes (the adapter encodes to the Media-Streams μ-law/PCM media frame).
Transfers the live call (REST calls(sid).update({ twiml: '<Dial>...' })).
The Call SID to redirect.
The transfer destination.
The minimal Twilio client surface TwilioCallSdk drives. A production deployment implements this over the real
twilioSDK (REST) + a Media-Streams websocket handler; this package never importstwilioso it builds and tests with no network. When no bindings are supplied, TwilioCallSdk throws the explicit "bind the real Twilio client" error from every operation.The shapes are intentionally tiny and provider-neutral at the value level (strings / byte buffers) so the Twilio SDK's types do not leak into the bridge package.