Member Junction
    Preparing search index...

    Coordinates Media-Streams sockets with the bridge bindings, keyed by Call SID. One instance per server, shared between the inbound-webhook service (which binds RealTwilioBindings over this as the ITwilioMediaPump) and the WSS server (which attaches sockets + dispatches inbound frames).

    Implements

    Index

    Constructors

    Methods

    • 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.

      Parameters

      • callSid: string

        The Twilio Call SID.

      • token: string

        The per-call secret (also embedded in the TwiML <Parameter name="mjToken">).

      • OptionalttlMs: number

        Optional override of how long to wait for the socket.

      Returns void

    • 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.

      Parameters

      • listener: (callSid: string) => void

      Returns void

    • 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.

      Parameters

      • listener: (callSid: string) => void

      Returns void

    • 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.

      Parameters

      • callSid: string

        The Call SID claimed by the start frame.

      • token: string | undefined

        The mjToken custom parameter from the start frame (absent ⇒ refused).

      • socket: ITelephonyMediaSocket

        The connected socket.

      • streamSid: string

        The stream SID from the start frame.

      Returns SocketAuthResult

      {Ok:true}, or why the socket was refused (unknown-call | bad-token | already-attached).