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.
Production ITwilioClientBindings over the real Twilio REST API + Media Streams, expressed against the injected ITwilioRestLike / ITwilioMediaPump surfaces so it builds and unit-tests with no
twilioinstall and no network.createCall→ RESTcalls.createwith the<Connect><Stream>TwiML.acceptInbound→ no REST call (the inbound webhook already returned the connect TwiML); the websocket for the delivered Call SID is what "accepting" means — handled by onStreamAudio.completeCall/redirectCall/playDigits→ RESTcalls(sid).update.pushStreamAudio/onStreamAudio→ Media-Streams frames, transcoded through the T0 codec.