sinch-rtc
    Preparing search index...

    Interface CallClient

    interface CallClient {
        addListener(listener: CallClientListener): void;
        callConference(
            conferenceId: string,
            headers?: Record<string, string>,
        ): Promise<Call>;
        callPhoneNumber(
            phoneNumber: string,
            headers?: Record<string, string>,
        ): Promise<Call>;
        callSip(
            sipIdentity: string,
            headers?: Record<string, string>,
        ): Promise<Call>;
        callUser(toUserId: string, headers?: Record<string, string>): Promise<Call>;
        callUserVideo(
            toUserId: string,
            headers?: Record<string, string>,
        ): Promise<Call>;
        getCall(callId: string): undefined | Call;
        removeListener(listener: CallClientListener): void;
        setAudioTrackConstraints(constraints: null | MediaTrackConstraints): void;
        setVideoTrackConstraints(constraints: null | MediaTrackConstraints): void;
    }
    Index

    Methods

    • Calls the conference with the given id and the given headers.

      Parameters

      • conferenceId: string

        Conference ID to dial in to.

      • Optionalheaders: Record<string, string>

        Headers to pass with the call.

      Returns Promise<Call>

      A Call instance.

      InvalidOperationError if SinchClient is not started

      ArgumentError if the size of all header strings exceeds 1024 bytes when encoded as UTF-8.

    • Calls a phone number and terminates the call to the PSTN-network (Publicly Switched Telephone Network).

      Parameters

      • phoneNumber: string

        The phone number to call. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a '+'. E.g. to call the US phone number 415 555 0101, it should be specified as "+14155550101", where the '+' is the required prefix and the US country code '1' added before the local subscriber number.

      • Optionalheaders: Record<string, string>

        Headers to pass with the call.

      Returns Promise<Call>

      A Call instance.

      InvalidOperationError if SinchClient is not started

      ArgumentError if conferenceId exceeds 64 characters

      ArgumentError if the size of all header strings exceeds 1024 bytes when encoded as UTF-8.

    • Makes a SIP call to the user with the given identity. The identity should be in the form "sip:user@server".

      Parameters

      • sipIdentity: string

        SIP identity to dial in to.

      • Optionalheaders: Record<string, string>

      Returns Promise<Call>

      A Call instance.

      InvalidOperationError if SinchClient is not started

      ArgumentError if sipIdentity exceeds 64 characters

      ArgumentError if the size of all header strings exceeds 1024 bytes when encoded as UTF-8.

    • Makes a call to the user with the given id.

      Parameters

      • toUserId: string

        The app specific id of the user to call. May not be null or empty.

      • Optionalheaders: Record<string, string>

        Headers to pass with the call.

      Returns Promise<Call>

      A Call instance.

      InvalidOperationError if SinchClient is not started

      ArgumentError if the size of all header strings exceeds 1024 bytes when encoded as UTF-8.

    • Makes a video call to the user with the given id and adding the given headers.

      Parameters

      • toUserId: string

        The app specific id of the user to call. May not be null or empty.

      • Optionalheaders: Record<string, string>

        Headers to pass with the call.

      Returns Promise<Call>

      A Call instance.

      InvalidOperationError if SinchClient is not started

      ArgumentError if the size of all header strings exceeds 1024 bytes when encoded as UTF-8.

    • Returns the Call object with the identifier callId.

      Parameters

      • callId: string

        The call identifier string.

      Returns undefined | Call

      A Call instance if one matches, otherwise undefined.

    • Sets or removes audio track constraints that are applied to ongoing calls and will also be used for any new Call created.

      Parameters

      • constraints: null | MediaTrackConstraints

        The constraints to apply for the audio track:

        • Provide a MediaTrackConstraints object to apply specific constraints (e.g. { deviceId: { exact: "mic-id" }, echoCancellation: true }).
        • Pass null to remove previously set constraints, falling back to the default device when requesting audio.

      Returns void

      callClient.setAudioTrackConstraints({ echoCancellation: true });
      callClient.setAudioTrackConstraints(null); // remove constraints, use default device
    • Sets or removes audio track constraints that are applied to ongoing calls and will also be used for any new Call created.

      Parameters

      • constraints: null | MediaTrackConstraints

        The constraints to apply for the video track:

        • Provide a MediaTrackConstraints object to apply specific constraints (e.g. { width: 1280, height: 720 }).
        • Pass null to remove previously set constraints, falling back to default constraints (e.g. the DefaultMediaStreamFactory's default video constraints, if provided).

      Returns void

      callClient.setVideoTrackConstraints({ width: 1280, height: 720 });
      callClient.setVideoTrackConstraints(null); // remove constraints, use default/fallback