Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CallClient

Hierarchy

  • CallClient

Index

Methods

  • callConference(conferenceId: string, headers?: Record<string, string>): Promise<Call>
  • Calls the conference with the given id and the given headers.

    throws

    InvalidOperationError if SinchClient is not started

    throws

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

    Parameters

    • conferenceId: string

      Conference ID to dial in to.

    • Optional headers: Record<string, string>

      Headers to pass with the call.

    Returns Promise<Call>

    A Call instance.

  • callPhoneNumber(phoneNumber: string, headers?: Record<string, string>): Promise<Call>
  • Calls a phone number and terminates the call to the PSTN-network (Publicly Switched Telephone Network).

    throws

    InvalidOperationError if SinchClient is not started

    throws

    ArgumentError if conferenceId exceeds 64 characters

    throws

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

    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.

    • Optional headers: Record<string, string>

      Headers to pass with the call.

    Returns Promise<Call>

    A Call instance.

  • callSip(sipIdentity: string, headers?: Record<string, string>): Promise<Call>
  • Makes a SIP call to the user with the given identity. The identity should be in the form "sip:user@server".

    throws

    InvalidOperationError if SinchClient is not started

    throws

    ArgumentError if sipIdentity exceeds 64 characters

    throws

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

    Parameters

    • sipIdentity: string

      SIP identity to dial in to.

    • Optional headers: Record<string, string>

    Returns Promise<Call>

    A Call instance.

  • callUser(toUserId: string, headers?: Record<string, string>): Promise<Call>
  • Makes a call to the user with the given id.

    throws

    InvalidOperationError if SinchClient is not started

    throws

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

    Parameters

    • toUserId: string

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

    • Optional headers: Record<string, string>

      Headers to pass with the call.

    Returns Promise<Call>

    A Call instance.

  • callUserVideo(toUserId: string, headers?: Record<string, string>): Promise<Call>
  • Makes a video call to the user with the given id and adding the given headers.

    throws

    InvalidOperationError if SinchClient is not started

    throws

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

    Parameters

    • toUserId: string

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

    • Optional headers: Record<string, string>

      Headers to pass with the call.

    Returns Promise<Call>

    A Call instance.

  • getCall(callId: string): undefined | Call
  • 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.

  • setAudioTrackConstraints(constraints: null | MediaTrackConstraints): void
  • Sets or removes audio track constraints that will be applied when creating a new Call.

    remarks

    This method must be called before creating a Call. Changes will not affect calls that have already been created.

    example
    callClient.setAudioTrackConstraints({ echoCancellation: true });
    callClient.setAudioTrackConstraints(null); // remove constraints, use default device

    Parameters

    • constraints: null | MediaTrackConstraints

      The constraints to apply for the audio track:

      • Provide a {@link 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

  • setVideoTrackConstraints(constraints: null | MediaTrackConstraints): void
  • Sets or removes video track constraints that will be applied when creating a new Call.

    remarks

    This method must be called before creating a Call. Changes will not affect calls that have already been created.

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

    Parameters

    • constraints: null | MediaTrackConstraints

      The constraints to apply for the video track:

      • Provide a {@link 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 {@link DefaultMediaStreamFactory}'s default video constraints, if provided).

    Returns void

Generated using TypeDoc