Member Junction
    Preparing search index...

    A real, two-way ITelephonyCallSdk over the native Twilio Programmable Voice + Media Streams path.

    Gives the agent both hearing (inbound Media-Streams audio → the seam's audio callback) and a voice (sendAudioFrame → the native Media-Streams send path), plus working DTMF, transfer, and hangup. Construct via BindTwilioNativeCall (the factory the bridge's SetSdkFactory wants), not directly, so config resolution + the lazy loader wire consistently.

    The adapter tracks the active Call SID so per-call REST/websocket operations can be addressed, and re-registers any handlers the bridge set before the call existed once a call comes online.

    Implements

    Index

    Constructors

    Methods

    • Loads the native adapter, constructs a client, wires its callbacks, and answers an inbound call already delivered to the agent's number. Brings BOTH hearing and the agent's voice online.

      Parameters

      • callId: string

        The platform-native identifier of the inbound call to answer.

      Returns Promise<void>

      When the native module specifier is missing or the adapter can't be loaded.

    • Loads the native adapter, constructs a client, wires its callbacks, and places the outbound call. Brings BOTH hearing and the agent's voice online. Resolves the platform-native Call SID.

      Parameters

      • toNumber: string

        The destination phone number to dial.

      • fromNumber: string

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

      • Optionalargs: Record<string, unknown>

        Provider-specific dial parameters.

      Returns Promise<string>

      The Twilio Call SID for the placed call.

      When the native module specifier is missing or the adapter can't be loaded.

    • Registers the inbound audio handler (the agent's hearing path). Wires it to the live client when a call already exists; otherwise it is (re-)registered at bindCall when the call comes online.

      Parameters

      • cb: (pcm: ArrayBuffer) => void

        Invoked with each inbound PCM audio frame.

      Returns void

    • Registers the inbound DTMF handler. Wires it to the live client when a call already exists; otherwise it is (re-)registered at bindCall when the call comes online.

      Parameters

      • cb: (digits: string) => void

        Invoked with each received DTMF digit string.

      Returns void

    • Sends one raw PCM frame as the agent's outbound voice into the call — the agent's real voice on the call, via the native Media-Streams send path. No-ops (without throwing) before a call exists so an early model frame never crashes the session.

      Parameters

      • pcm: ArrayBuffer

        The PCM audio bytes to speak into the call.

      Returns void

    • Transfers the live call to another party via the native client. No-ops (without throwing) before a call exists.

      Parameters

      • callId: string

        The platform-native identifier of the call to transfer.

      • toNumber: string

        The transfer destination.

      Returns Promise<void>