Member Junction
    Preparing search index...

    The injectable telephony call SDK seam — the minimal per-provider call API a BaseTelephonyBridge drives. Declared as an interface so telephony drivers build and unit-test against an in-memory fake with no network and no real CPaaS client (the same testability pattern the meeting SDK seams use: IZoomMeetingSdk, IDiscordVoiceSdk, …).

    The base bridge owns the lifecycle and media wiring; this seam exposes only the irreducible call primitives each provider (Twilio, Vonage, RingCentral) binds to its own client. None of the provider SDK's types leak through this interface.

    All on* registrations are "latest handler wins" (one bridge instance per call).

    interface ITelephonyCallSdk {
        answer(callId: string): Promise<void>;
        dial(
            toNumber: string,
            fromNumber: string,
            args?: Record<string, unknown>,
        ): Promise<string>;
        flushOutbound?(): void;
        hangup(callId: string): Promise<void>;
        onAudioFrame(cb: (pcm: ArrayBuffer) => void): void;
        onCallEnded(cb: () => void): void;
        onDtmf(cb: (digits: string) => void): void;
        sendAudioFrame(pcm: ArrayBuffer): void;
        sendDtmf(digits: string): Promise<void>;
        transfer(callId: string, toNumber: string): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Answers an inbound call that has routed to the agent's number.

      Parameters

      • callId: string

        The platform-native identifier of the inbound call to answer (from the inbound webhook).

      Returns Promise<void>

      A promise resolving once the call is answered and the media path is live.

    • Places an outbound call FROM the agent's number TO a destination and brings the bot leg online.

      Parameters

      • toNumber: string

        The destination phone number to dial (E.164 recommended).

      • fromNumber: string

        The agent's caller-id / DID the call originates from.

      • Optionalargs: Record<string, unknown>

        Provider-specific dial parameters (resolved credential refs, region, recording flags, …).

      Returns Promise<string>

      The platform-native call identifier (e.g. Twilio Call SID) for the placed call.

    • Discards any outbound audio the provider has QUEUED but not yet played — the agent's not-yet-heard voice — so the agent goes silent immediately on barge-in. Carriers that buffer deeply (Vonage queues up to ~60s) MUST implement this or the agent keeps talking over itself after being interrupted.

      Optional: a provider whose media path plays in near-real-time with no client-side queue has nothing to flush and omits it (the base treats an absent method as a no-op).

      Returns void

    • Registers a callback for inbound raw audio frames from the call — what the agent hears. There is a single remote party, so frames need no per-speaker label (the bridge stamps the caller's id). "Latest handler wins."

      Parameters

      • cb: (pcm: ArrayBuffer) => void

        Invoked with each inbound PCM audio frame.

      Returns void

    • Registers a callback fired when the call ends — the remote party hangs up, the carrier drops it, or the provider tears it down. "Latest handler wins."

      Parameters

      • cb: () => void

        Invoked when the call has ended.

      Returns void

    • Sends DTMF touch-tones on the call (the agent dialing into an IVR, entering a code, …).

      Parameters

      • digits: string

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

      Returns Promise<void>

      A promise resolving once the tones have been sent.

    • Transfers the call to another party (a number or platform endpoint).

      Parameters

      • callId: string

        The platform-native identifier of the call to transfer.

      • toNumber: string

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

      Returns Promise<void>

      A promise resolving once the transfer has been initiated.