Dispatches one inbound Media-Streams frame to all registered handlers for the call (or buffers it early).
Cancels every outstanding connect timer (server shutdown).
Tears down a call's channel and closes its socket (called on socket close / call end).
Registers a call MJ accepted or placed, together with the secret token its media socket must present. Creates the call's channel so frames and handlers can be staged before the socket connects.
The Twilio Call SID.
The per-call secret (also embedded in the TwiML <Parameter name="mjToken">).
OptionalttlMs: numberOptional override of how long to wait for the socket.
Whether a channel is currently tracked for the call (test/observability helper).
Whether MJ is still waiting for (or has already authenticated) a socket for the call.
Registers the listener told the moment a call becomes known to MJ (ExpectCall) — for an outbound call that is the instant the carrier REST response yields the Call SID, which is earlier than the bridge session finishing its start. One listener; the latest wins.
Registers the listener told when a call's media socket never connected within its TTL — the call has been dropped from the registry and the owner should end the session. One listener; the latest wins.
Ensures a channel exists for a call (called when a bridge session for the call starts).
Authenticates and binds a connected Media-Streams socket (and its captured stream SID) to a call,
flushing any outbound frames produced while the socket was still connecting. Called by the WSS server
on the start frame. A refused socket is NOT attached and changes no state; the caller closes it.
The Call SID claimed by the start frame.
The mjToken custom parameter from the start frame (absent ⇒ refused).
The connected socket.
The stream SID from the start frame.
{Ok:true}, or why the socket was refused (unknown-call | bad-token | already-attached).
Coordinates Media-Streams sockets with the bridge bindings, keyed by Call SID. One instance per server, shared between the inbound-webhook service (which binds
RealTwilioBindingsover this as theITwilioMediaPump) and the WSS server (which attaches sockets + dispatches inbound frames).