UNPKG

sinch-rtc

Version:

RTC JavaScript/Web SDK

100 lines (99 loc) 3.55 kB
import { SinchError } from "../SinchError"; import { CallEndCause } from "./CallEndCause"; export interface CallDetails { /** * Total duration of the call in milliseconds or `0` if the call has not yet ended. */ duration: number; /** * Flag indicating if video stream was succesfully created for the call. */ hadVideoStream: boolean; /** * Flag indicating if audio stream was succesfully created for the call. */ hadAudioStream: boolean; /** * Flag indicating if caller requested the call to contain video stream. */ requestedVideo: boolean; /** * Flag indicating if caller requested the call to contain audio stream. */ requestedAudio: boolean; /** * The duration (in milliseconds) it took to send the push notification to the callee. * This is the time interval between call start and `onCallProgressing` event. * `0` if the call is inbound or the notification was not yet sent. */ setupDuration: number; /** * The duration (in milliseconds) it took for the callee to receive the push notification after it was sent * This is the time interval between `onCallProgressing` and `onCallRinging` events. * `0` if the call is inbound or the notification was not yet received by the callee. */ notifyingDuration: number; /** * The duration (in milliseconds) the call spent in the `ringing` state. * * - For the caller, it's the duration between: * * The time the callee receives the push notification * and: * * The callee answers or denies the call. * * The caller cancels the call. * This is the time interval between `onCallRinging` and `onCallAnswered` or `onCallEnded` events. * * - For the callee, it's the duration between: * * The time the push notification is received * and: * * The callee answers or denies the call. * * The caller cancels the call. * This is the time interval between the call start and `onCallAnswered` or `onCallEnded` event. * * `0` if the call was not answered or has not ended yet. */ ringingDuration: number; /** * The duration (in milliseconds) it took after the call was answered to be established (ICE connected). * This is the time interval between `onCallAnswered` and `onCallEstablished` events. * * `0` if the call is not yet established or if ICE connectivity was established before the call was answered. */ connectingDuration: number; /** * The time the call was answered. * * `undefined` if call was not answered yet. */ answeredTime?: Date; /** * The time the call was established. * * `undefined` if call was not established yet. */ establishedTime?: Date; /** * The time the call has ended. * * `undefined` if call has not ended yet. */ endedTime?: Date; /** * The time the call entered `Progressing` state. * * `undefined` if call has not yet entered `Progressing` state or if the call is an inbound call. */ progressTime?: Date; /** * The start time of the call. */ startedTime: Date; /** * Error object containing detailed information about the error if it occured. */ get error(): SinchError | undefined; /** * The cause of why the call has ended or `CallEndCause.None` if the call has not ended yet. */ get endCause(): CallEndCause; }