Member Junction
    Preparing search index...

    Starts Twilio bridge sessions. One instance per server, constructed alongside the telephony router and sharing the TwilioCallMediaRegistry with the Media-Streams WSS server.

    Index

    Constructors

    Methods

    • Handles Twilio's async answering-machine verdict. A machine or fax hangs the call up unless onMachine is 'continue' (then the verdict is only logged). human/unknown verdicts are ignored.

      Parameters

      • callSid: string
      • answeredBy: string | undefined

      Returns Promise<void>

    • Admits an INBOUND call: resolves the dialed DID to a pinned agent, registers the call + its media-socket token, and starts the bridge session in the background. Returns as soon as the call is admitted so the voice webhook can answer inside Twilio's short timeout; the Media-Streams socket (and any audio the caller speaks) is buffered until the session is ready. Returns { accepted:false } (never throws) when no agent identity matches the DID, so the webhook can answer with a polite "no agent" message.

      Parameters

      Returns Promise<InboundCallResult>

    • Handles a Twilio status-callback event. A terminal status (busy, no-answer, failed, canceled, completed) ends the call's bridge session — an unanswered outbound call never opens a media socket, so without this the session would linger. Non-terminal statuses are ignored.

      Parameters

      • callSid: string
      • callStatus: string | undefined

      Returns Promise<void>

    • Places an OUTBOUND call from a given agent identity to a destination number, after the shared outbound gate (agent permission, destination policy, rate limit) has authorized it. The bound RealTwilioBindings.createCall issues the Twilio REST POST /Calls with the <Connect><Stream> TwiML; the returned Call SID is the bridge's external connection id.

      Parameters

      Returns Promise<string>

      The placed Call SID.

      when the gate refuses the call (the message is caller-safe).