sinch-rtc
    Preparing search index...

    Interface Call

    interface Call {
        details: CallDetails;
        direction: Direction;
        headers: undefined | Record<string, string>;
        id: string;
        incomingStream: undefined | MediaStream;
        isEarlyMedia: boolean;
        outgoingStream: undefined | MediaStream;
        remoteUserDisplayName?: string;
        remoteUserId: string;
        state: CallState;
        addListener(listener: CallListener): void;
        answer(): Promise<void>;
        hangup(): void;
        mute(): void;
        pauseVideo(): void;
        removeListener(listener: CallListener): void;
        resumeVideo(): void;
        sendDtmf(keys: string): void;
        setLocalAudioFrameListener(
            listener: null | LocalAudioFrameListener,
        ): Promise<void>;
        setLocalVideoFrameListener(
            listener: null | LocalVideoFrameListener,
        ): Promise<void>;
        unmute(): void;
    }
    Index

    Properties

    details: CallDetails

    Returns metadata about the call.

    a CallDetails containing metadata about the call.

    direction: Direction

    Returns the Direction of the call.

    the direction of the call.

    headers: undefined | Record<string, string>

    Returns the headers.

    IMPORTANT: Headers may not be immediately available due to push payload size limitations. If it's not immediately available, it will be available after the onCallProgressing or onCallEstablished callbacks for CallListener are called.

    the headers.

    id: string

    Returns the call identifier.

    the call identifier.

    incomingStream: undefined | MediaStream

    Returns the MediaStream that is received to your device from the remote peer during a call.

    the MediaStream that is received to your device from the remote peer during a call

    isEarlyMedia: boolean

    Returns whether early media is available for this call.

    Early media only applies to outgoing calls (see direction). It becomes available when the remote leg — typically a PSTN or SIP destination — starts sending audio before the call is answered, for example a ringback tone or an IVR prompt. When it is true, audio may already be flowing in both directions even though the call has not reached CallState.Established yet. This is only known once the callee has been reached, so check it in the onCallRinging callback of your CallListener and attach incomingStream to an audio output element there instead of waiting for onCallEstablished. Only audio is enabled early; video remains disabled until the call is established.

    This value latches: once it becomes true it stays true for the remaining lifetime of the call. It is always false for incoming calls.

    true if early media is available for this call, otherwise false.

    outgoingStream: undefined | MediaStream

    Returns the MediaStream that is sent from your device to the remote peer during a call.

    the MediaStream that is sent from your device to the remote peer during a call.

    remoteUserDisplayName?: string

    Returns the callers displayName.

    the callers displayName.

    remoteUserId: string

    Returns the identifier of the remote participant in the call.

    the identifier of the remote participant in the call.

    state: CallState

    Returns the CallState the call is currently in.

    the state the call is currently in.

    Methods

    • Answers an incoming call.

      Returns Promise<void>

      InvalidOperationError If the call is not incoming.

      InvalidOperationError If the user hasn't granted required media permissions.

    • Ends the call, regardless of what state it is in. If the call is an incoming call that has not yet been answered, the call will be reported as denied to the caller.

      Returns void

    • Mute audio.

      Returns void

    • Pause the video capturing.

      Returns void

    • Resume the video capturing.

      Returns void

    • Sends one or more DTMF tones for tone dialing. (Only applicable for calls terminated to PSTN (Publicly Switched Telephone Network)).

      Parameters

      • keys: string

        May be a series of DTMF keys. Each key must be in [0-9, #, *, A-D].

      Returns void

      IllegalArgumentException if any of the given DTMF keys is invalid

    • Installs (or clears, when null) an AudioWorklet based processor on the outgoing (local microphone) audio path. The processed audio is what is sent to the remote peer and is reflected by outgoingStream.

      Loading the worklet module is asynchronous; the returned promise resolves once the processor is active. Passing null tears down the graph and restores the raw microphone audio. May be called before or during a call, and repeatedly to swap processors.

      If installing the listener fails, the returned promise rejects and the outgoing audio is left on the unprocessed (native) microphone — any previously installed listener is removed rather than restored. Outbound audio therefore always keeps flowing.

      Parameters

      Returns Promise<void>

      a promise that resolves once the processor has been installed or removed, and rejects if installation failed (leaving unprocessed audio on the wire).

    • Installs (or clears, when null) an Insertable Streams based processor on the outgoing (local camera) video path. The processed video is what is sent to the remote peer and is reflected by outgoingStream.

      The SDK creates a Worker(listener.workerUrl) and waits for it to post { type: 'ready' }. Once ready, the SDK transfers { type: 'transform', readable, writable, options } so the worker can pipe frames through its own TransformStream. Passing null tears down the worker and restores the raw camera video.

      Requires browser support for the Insertable Streams API (MediaStreamTrackProcessor / MediaStreamTrackGenerator). On unsupported browsers the returned promise rejects immediately, before any worker is spawned, and outgoing video is left untouched. May be called before or during a call, and independently of setLocalAudioFrameListener.

      Parameters

      Returns Promise<void>

      a promise that resolves once the processor has been installed or removed, and rejects if installation failed (leaving unprocessed video on the wire).

    • Unmute audio.

      Returns void