Member Junction
    Preparing search index...

    Class BaseRealtimeBridgeAbstract

    Abstract base class for a Realtime Bridge driver — a pluggable media transport that connects the one realtime agent engine to an external endpoint (a Zoom/Teams/Slack/Meet/Webex/Discord meeting, or a Twilio/Vonage/RingCentral/VOIP phone call).

    A concrete driver (ZoomBridge, TwilioBridge, …) implements only the irreducibly platform-specific primitives; everything that can be done generically (session wiring, frame normalization, turn-taking, participant bookkeeping, reconnect/teardown) lives in the engine above. Drivers self-register with the MemberJunction ClassFactory exactly as realtime model drivers do — e.g. @RegisterClass(BaseRealtimeBridge, 'ZoomBridge'). The base class itself is abstract and unregistered; the engine resolves a driver via MJGlobal.ClassFactory.CreateInstance(BaseRealtimeBridge, provider.DriverClass).

    Capability gating (two layers, defense-in-depth). The engine FIRST checks a provider's SupportedFeatures flag and never calls a driver method whose feature is off. The driver's own virtual methods are the SECOND layer: every optional method throws BridgeCapabilityNotSupportedError by default, so a driver that has not overridden a method — or a metadata flag that lied — fails loudly rather than silently degrading. The protected BaseRealtimeBridge.RequireFeature helper lets an overriding driver re-assert the flag at the top of its implementation.

    Media-agnostic. BaseRealtimeBridge.SendMedia / BaseRealtimeBridge.OnMedia carry typed, directional media frames — audio is just one track. Video and screen tracks ride the same two methods, gated by the directional feature flags.

    See /plans/realtime/realtime-bridges-architecture.md §3 and §9 (Phase 0/1).

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    The capability flags for the provider this bridge instance serves. Populated from the RealtimeBridgeContext at BaseRealtimeBridge.Connect time (and may be set by the engine immediately after construction). Drives BaseRealtimeBridge.RequireFeature.

    providerName: string = ''

    The provider's display name for this bridge instance, used in capability-error messages. Populated from the RealtimeBridgeContext; falls back to the driver class name.

    Accessors

    Methods

    • Flushes any outbound media the driver has queued for the endpoint — the agent's not-yet-played voice. The engine calls this on a true barge-in (the user interrupts the agent) so the agent stops talking immediately instead of draining already-buffered audio after the model was cut off.

      No-op by default (NOT capability-gated): a driver with no client-side outbound buffer simply has nothing to flush, so calling this is always safe. Drivers that buffer outbound audio override it.

      Returns void

    • Returns a Meeting Controls event source adapting this driver's native participant / speaking / hand-raise stream into the server-side channel plane, or null when the driver contributes no such surface. Unlike the capability-gated virtuals above this does not throw by default — it is a contribution hook, and most drivers (and all telephony drivers) legitimately contribute nothing. The engine wires the Meeting Controls channel only for drivers that return a non-null source, so the base default of null means "no facilitator surface".

      A meeting driver (e.g. ZoomBridge) overrides this to return an IBridgeMeetingControlsEventSource fed by its roster/speaking/hand-raise events; the engine hands it to the channel plane's MeetingControlsChannelServer so the agent gains the facilitator tool vocabulary + perception. Typically only meaningful when the provider also has SpeakerDiarization (a roster to facilitate).

      Returns IBridgeMeetingControlsEventSource

      The driver's Meeting Controls event source, or null (the default — no facilitator surface).

    • Registers a handler for inbound DTMF tones on a telephony bridge.

      Capability-gated by SupportedFeatures.DTMF. Throws unless overridden.

      Parameters

      • _handler: (digits: string) => void

        Invoked with each received DTMF digit string.

      Returns void

      when not overridden.

    • Sends DTMF tones on a telephony bridge.

      Capability-gated by SupportedFeatures.DTMF. Throws unless overridden by a telephony driver.

      Parameters

      • _digits: string

        The DTMF digit string to send (e.g. '1234#').

      Returns Promise<void>

      A promise that resolves once the tones have been sent.

      when not overridden.

    • Requests that the platform begin recording the session.

      Capability-gated by SupportedFeatures.Recording (and subject to per-jurisdiction consent handling upstream). Throws unless overridden.

      Returns Promise<void>

      A promise that resolves once recording has started.

      when not overridden.

    • Transfers the call to another party on a telephony bridge.

      Capability-gated by SupportedFeatures.CallTransfer. Throws unless overridden.

      Parameters

      • _target: string

        The transfer target (a phone number or platform endpoint identifier).

      Returns Promise<void>

      A promise that resolves once the transfer has been initiated.

      when not overridden.