Member Junction
    Preparing search index...

    Wraps an SDK so onEnded(callId) fires when the call ends by either route. onEnded may fire more than once for one call (the carrier reports the end, then MJ hangs up); it must be idempotent.

    Implements

    Index

    Constructors

    Properties

    detach?: (callId: string) => Promise<void>

    Stops driving the call without hanging it up (after a transfer the carrier owns it). Present only when the wrapped SDK has one, because the bridge picks "detach" versus a plain hang-up by feature-detecting it.

    playMessageAndHangup?: (callId: string, message: string) => Promise<void>

    Speaks a goodbye at the carrier and ends the call. Present only when the wrapped SDK can — the bridge falls back to a plain hang-up when it is absent.

    Methods

    • 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

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