Member Junction
    Preparing search index...

    The minimal RingCentral client surface RingCentralCallSdk drives. A production deployment implements this over the real @ringcentral/sdk (Call Control REST) + a media-stream handler; this package never imports @ringcentral/sdk so it builds and tests with no network. When no bindings are supplied, RingCentralCallSdk throws the explicit "bind the real RingCentral client" error from every operation.

    The shapes are intentionally tiny and provider-neutral at the value level (strings / byte buffers) so the RingCentral SDK's types do not leak into the bridge package.

    interface IRingCentralClientBindings {
        answerSession(sessionId: string): Promise<void>;
        createSession(
            toNumber: string,
            fromNumber: string,
            args?: Record<string, unknown>,
        ): Promise<string>;
        dropSession(sessionId: string): Promise<void>;
        onDigits(sessionId: string, cb: (digits: string) => void): void;
        onSessionStatus(sessionId: string, cb: () => void): void;
        onStreamAudio(sessionId: string, cb: (pcm: ArrayBuffer) => void): void;
        playDigits(sessionId: string, digits: string): Promise<void>;
        pushStreamAudio(sessionId: string, pcm: ArrayBuffer): void;
        transferSession(sessionId: string, toNumber: string): Promise<void>;
    }
    Index

    Methods

    • Accepts the media stream for an inbound telephony session already delivered by the subscription notification (answers the session's party).

      Parameters

      • sessionId: string

        The inbound telephony session id from the notification.

      Returns Promise<void>

    • Places an outbound call via the RingCentral Voice / Call Control API (RingOut or POST /telephony/sessions), opening a telephony session whose media leg streams to the agent.

      Parameters

      • toNumber: string

        Destination number (E.164).

      • fromNumber: string

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

      • Optionalargs: Record<string, unknown>

        Provider-specific options (account/extension id, subscription/webhook URL, recording flags, …).

      Returns Promise<string>

      The created telephony session id.

    • Ends the call (Call Control DELETE .../telephony/sessions/{id} / party drop).

      Parameters

      • sessionId: string

        The telephony session id to end.

      Returns Promise<void>

    • Registers the inbound DTMF callback (DTMF events on the session's media/event stream).

      Parameters

      • sessionId: string

        The telephony session id.

      • cb: (digits: string) => void

        Invoked with each received DTMF digit string.

      Returns void

    • Registers the call-ended callback (telephony-session Disconnected/Finished event or stream stop).

      Parameters

      • sessionId: string

        The telephony session id.

      • cb: () => void

        Invoked when the call ends.

      Returns void

    • Registers the inbound media-stream audio callback for the session (what the agent hears).

      Parameters

      • sessionId: string

        The telephony session id whose inbound stream to subscribe to.

      • cb: (pcm: ArrayBuffer) => void

        Invoked with each inbound PCM audio frame.

      Returns void

    • Sends DTMF digits on the call (Call Control party play / dtmf action).

      Parameters

      • sessionId: string

        The telephony session id.

      • digits: string

        The DTMF digit string.

      Returns Promise<void>

    • Pushes one outbound audio payload onto the session's media stream (the agent's voice).

      Parameters

      • sessionId: string

        The telephony session id whose stream to write to.

      • pcm: ArrayBuffer

        The audio bytes (the adapter encodes to the media-stream PCM frame).

      Returns void

    • Transfers the live call (Call Control party transfer — supervise/transfer to number or extension).

      Parameters

      • sessionId: string

        The telephony session id to transfer.

      • toNumber: string

        The transfer destination.

      Returns Promise<void>