其它对象的接口及类型
本文介绍 Linkus Windows SDK Core 所使用的其它对象的接口及类型。
Report 对象
通话质量报告对象。
interface Report {
lksTimestamp: string; // 接听来电或发起呼叫时的时间戳字符串
lksDate: string; // 接听来电或发起呼叫时的时间。时间格式 YYYY-MM-DD hh:mm:ss
callId: string; // 通话的唯一 ID
extension: string; // 分机号码
iceResult: string; // ice 类型:local(对应host)、 public(对应srflx或prflx)、 turn(对应relay)
lksNetworkType: string; // 网络类型
lksDeviceType: string; // 客户端类型:目前只有web
lksDuration: string; // 对应 totalSamplesDuration 属性
lksAudioCodec: string; // 音频编码
lksAudioRx: string; // 收到的音频包,对应 packetsReceived 属性
lksAudioRxLost: string; // 音频丢包率,对应 packetsLost属性。计算公式:lksAudioRxLost=(packetsLost / (packetsLost + packetsReceived)).toFixed(6)
lksAudioRxMaxjitter: string; // 音频接收端的最大抖动
lksAudioRxAvgjitter: string; // 音频平均抖动,对应 jitter*1000
lksAudioTx: string; // 发送的音频包
lksAudioTxLost: string; // 发送端的音频丢包率
lksAudioTxMaxjitter: string; // 音频发送端的最大抖动
lksAudioTxAvgjitter: string; // 音频发送端的平均抖动
lksVideoCodec: string; // 视频编码
lksVideoRx: string; // 收到的视频包
lksVideoRxLost: string; // 视频丢包率, 对应 packetsLost 属性,计算公式lksVideoRxLost=(packetsLost / (packetsLost + packetsReceived)).toFixed(6)
lksVideoRxMaxjitter: string; // 视频接收端最大抖动
lksVideoRxAvgjitter: string; // 视频接收端平均抖动
lksVideoTx: string; // 发送的视频包
lksVideoTxLost: string; // 发送端的视频丢包率
lksVideoTxMaxjitter: string; // 视频发送端的最大抖动
lksVideoTxAvgjitter: string; // 视频发送端的平均抖动
}
StaticCallStatus 对象
通话的静态属性对象。
interface StaticCallStatus {
name: string; // 来电者姓名
avatar: string; // 头像
company: string; // 公司名
}
CallStatus 对象
通话状态对象。
interface CallStatus extends StaticCallStatus{
number: string; // 电话号码或分机号
callId: string; // 通话的唯一 ID
communicationType: 'outbound' | 'inbound'; // 通话类型:outbound:去电,inbound:来电
isVideo: boolean; //是否为视频通话
isRing: boolean; //是否正在响铃中
isHold: boolean; //该通话是否处于保持状态
isMute: boolean; //该通话是否处于静音状态
callStatus: 'ringing' | 'calling' | 'talking' | 'connecting';// 通话状态
callStartTime: number; // 通话开始时间
recordStatus: 'stop' | 'recording' | 'pause'; //通话录音状态。stop:未在录音;recording:正在录音;pause:暂停录音
isTransfer: boolean; // 是否为咨询转接通话
transferParent?: TransferParentType; //当是咨询转接通话时,指定咨询转接的父通话
isConference: boolean; // 是否为语音会议室通话
}
type TransferParentType = {
// 咨询转接的父通话
callId: string; //通话的唯一 ID
avatar: string; // 头像
name: string; // 通话转接对象的名称
number: string; // 通话转接对象的号码
callDuration: number; // 通话被接起到挂断的时长
holdDuration: number; // 通话被保持的时长
}
TimerType 类型
通话计时类型。
type TimerType = {
ringDuration: number; // 响铃时长
callingDuration: number; // 呼叫时长:拨号开始到通话被应答的时间。
callDuration: number; // 通话被接起到挂断的时长
holdDuration: number; // 通话被保持的时长
}