@rongcloud/plugin-call-plus 2.1.3 → 2.1.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3523 -0
- package/index.js +1 -0
- package/package.json +5 -2
- package/wrapper/index.d.ts +68 -63
- package/wrapper/index.esm.js +1 -1
- package/wrapper/index.js +1 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,3523 @@
|
|
|
1
|
+
import { RCConnectionStatus, EventEmitter, BasicLogger, RTCJoinType, EnableLogL, PluginContext, IRuntime, IReceivedMessage, IPluginGenerator } from '@rongcloud/engine';
|
|
2
|
+
import { RCRTCClient, RCRemoteTrack, RCTrack, ISubscribeAttr, RCRTCCode, RCLocalAudioTrack, RCRemoteAudioTrack, RCFrameRate, RCResolution } from '@rongcloud/plugin-rtc';
|
|
3
|
+
export { RCFrameRate as RCCallPlusFrameRate, RCResolution as RCCallPlusResolution } from '@rongcloud/plugin-rtc';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 对话动作
|
|
7
|
+
*/
|
|
8
|
+
declare enum DialogAction {
|
|
9
|
+
/**
|
|
10
|
+
* 请求
|
|
11
|
+
*/
|
|
12
|
+
REQUEST = "request",
|
|
13
|
+
/**
|
|
14
|
+
* 接受
|
|
15
|
+
*/
|
|
16
|
+
ACCEPT = "accept",
|
|
17
|
+
/**
|
|
18
|
+
* 拒绝
|
|
19
|
+
*/
|
|
20
|
+
REFUSE = "refuse",
|
|
21
|
+
/**
|
|
22
|
+
* 请求取消
|
|
23
|
+
*/
|
|
24
|
+
CANCEL = "cancel",
|
|
25
|
+
/**
|
|
26
|
+
* 通知
|
|
27
|
+
*/
|
|
28
|
+
NOTICE = "notice",
|
|
29
|
+
/**
|
|
30
|
+
* 超时
|
|
31
|
+
*/
|
|
32
|
+
TIMEOUT = "timeout"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 呼叫媒体类型
|
|
37
|
+
*/
|
|
38
|
+
declare enum RCCallPlusMediaType {
|
|
39
|
+
/**
|
|
40
|
+
* 音频
|
|
41
|
+
*/
|
|
42
|
+
AUDIO = 0,
|
|
43
|
+
/**
|
|
44
|
+
* 音视频
|
|
45
|
+
*/
|
|
46
|
+
AUDIO_VIDEO = 1,
|
|
47
|
+
/**
|
|
48
|
+
* 视频
|
|
49
|
+
*/
|
|
50
|
+
VIDEO = 2
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 通话状态
|
|
55
|
+
*/
|
|
56
|
+
declare enum RCCallPlusCallState {
|
|
57
|
+
/**
|
|
58
|
+
* 初始状态
|
|
59
|
+
*/
|
|
60
|
+
IDLE = 0,
|
|
61
|
+
/**
|
|
62
|
+
* 正在呼叫
|
|
63
|
+
*/
|
|
64
|
+
CALLING = 100,
|
|
65
|
+
/**
|
|
66
|
+
* 被邀请
|
|
67
|
+
*/
|
|
68
|
+
INVITED = 101,
|
|
69
|
+
/**
|
|
70
|
+
* 响铃
|
|
71
|
+
*/
|
|
72
|
+
RINGING = 102,
|
|
73
|
+
/**
|
|
74
|
+
* 忙线响铃
|
|
75
|
+
*/
|
|
76
|
+
BUSYLINE_RINGING = 103,
|
|
77
|
+
/**
|
|
78
|
+
* 忙线等待
|
|
79
|
+
*/
|
|
80
|
+
BUSYLINE_WAIT = 104,
|
|
81
|
+
/**
|
|
82
|
+
* 通话连接中
|
|
83
|
+
*/
|
|
84
|
+
CONNECTING = 200,
|
|
85
|
+
/**
|
|
86
|
+
* 通话中
|
|
87
|
+
*/
|
|
88
|
+
ONCALL = 300,
|
|
89
|
+
/**
|
|
90
|
+
* 通话结束
|
|
91
|
+
*/
|
|
92
|
+
ENDED = 1000,
|
|
93
|
+
/**
|
|
94
|
+
* 远端未接听
|
|
95
|
+
*/
|
|
96
|
+
NOANSWER = 1001,
|
|
97
|
+
/**
|
|
98
|
+
* 己端未接听
|
|
99
|
+
*/
|
|
100
|
+
MISSED = 1002,
|
|
101
|
+
/**
|
|
102
|
+
* 己端取消通话
|
|
103
|
+
*/
|
|
104
|
+
CANCELED = 1003,
|
|
105
|
+
/**
|
|
106
|
+
* 远端拒绝
|
|
107
|
+
*/
|
|
108
|
+
DECLINED = 1004,
|
|
109
|
+
ERROR = 2000
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 呼叫类型
|
|
114
|
+
*/
|
|
115
|
+
declare enum RCCallPlusType {
|
|
116
|
+
/**
|
|
117
|
+
* 单呼
|
|
118
|
+
*/
|
|
119
|
+
SINGLE = 0,
|
|
120
|
+
/**
|
|
121
|
+
* 多人呼叫
|
|
122
|
+
*/
|
|
123
|
+
MULTI = 1
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare enum RCCallDirection {
|
|
127
|
+
/**
|
|
128
|
+
* 呼出
|
|
129
|
+
*/
|
|
130
|
+
OUT = -1,
|
|
131
|
+
/**
|
|
132
|
+
* 群呼
|
|
133
|
+
*/
|
|
134
|
+
GROUP = 0,
|
|
135
|
+
/**
|
|
136
|
+
* 呼入
|
|
137
|
+
*/
|
|
138
|
+
IN = 1
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 事件类型
|
|
143
|
+
*/
|
|
144
|
+
declare enum CallServerEventType {
|
|
145
|
+
/**
|
|
146
|
+
* 提示窗口
|
|
147
|
+
*/
|
|
148
|
+
PROMPT = 0,
|
|
149
|
+
/**
|
|
150
|
+
* CallServer 下发通话时长变更类型
|
|
151
|
+
*/
|
|
152
|
+
CALL_DURATION = 10,
|
|
153
|
+
/**
|
|
154
|
+
* 收到远端第一帧时间
|
|
155
|
+
*/
|
|
156
|
+
FIRST_FRAME = 20
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 对话类型
|
|
161
|
+
*/
|
|
162
|
+
declare enum DialogType {
|
|
163
|
+
SWITCH_MEDIA_TYPE = 1
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare enum RCCallStage {
|
|
167
|
+
/**
|
|
168
|
+
* 闲置
|
|
169
|
+
*/
|
|
170
|
+
NONE = 0,
|
|
171
|
+
/**
|
|
172
|
+
* 呼叫中
|
|
173
|
+
*/
|
|
174
|
+
CALLING = 1,
|
|
175
|
+
/**
|
|
176
|
+
* 通话中
|
|
177
|
+
*/
|
|
178
|
+
ONCALL = 2
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare enum RCCallUserType {
|
|
182
|
+
/**
|
|
183
|
+
* 普通用户
|
|
184
|
+
*/
|
|
185
|
+
NORMAL = 0,
|
|
186
|
+
/**
|
|
187
|
+
* 观察者(只订阅其他人的资源,不发流)
|
|
188
|
+
*/
|
|
189
|
+
OBSERVER = 1
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* 通话额外类型(移动端特有)
|
|
194
|
+
*/
|
|
195
|
+
declare enum SecretCallType {
|
|
196
|
+
/**
|
|
197
|
+
* 普通通话
|
|
198
|
+
*/
|
|
199
|
+
NORMAL = 0,
|
|
200
|
+
/**
|
|
201
|
+
* 密聊
|
|
202
|
+
*/
|
|
203
|
+
SECRET = 1
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
declare enum RCCallPlusSessionUserState {
|
|
207
|
+
/**
|
|
208
|
+
* IDLE
|
|
209
|
+
*/
|
|
210
|
+
IDLE = 0,
|
|
211
|
+
/**
|
|
212
|
+
* 发起呼叫
|
|
213
|
+
*/
|
|
214
|
+
CALLING = 100,
|
|
215
|
+
/**
|
|
216
|
+
* 被邀请
|
|
217
|
+
*/
|
|
218
|
+
INVITED = 101,
|
|
219
|
+
/**
|
|
220
|
+
* 响铃
|
|
221
|
+
*/
|
|
222
|
+
RINGING = 102,
|
|
223
|
+
/**
|
|
224
|
+
* 己方忙碌直接挂断
|
|
225
|
+
*/
|
|
226
|
+
BUSYLINE_RINGING = 103,
|
|
227
|
+
/**
|
|
228
|
+
* 己方忙碌等待接听其他通话
|
|
229
|
+
*/
|
|
230
|
+
BUSYLINE_WAIT = 104,
|
|
231
|
+
/**
|
|
232
|
+
* 通话连接中
|
|
233
|
+
*/
|
|
234
|
+
CONNECTING = 200,
|
|
235
|
+
/**
|
|
236
|
+
* 正在通话中
|
|
237
|
+
*/
|
|
238
|
+
ONCALL = 300,
|
|
239
|
+
/**
|
|
240
|
+
* 正在系统通话中
|
|
241
|
+
*/
|
|
242
|
+
ONPHONE = 301,
|
|
243
|
+
/**
|
|
244
|
+
* 通话结束
|
|
245
|
+
*/
|
|
246
|
+
ENDED = 1000,
|
|
247
|
+
/**
|
|
248
|
+
* 远端未接听
|
|
249
|
+
*/
|
|
250
|
+
NO_ANSWER = 1001,
|
|
251
|
+
/**
|
|
252
|
+
* 己端超时未接听
|
|
253
|
+
*/
|
|
254
|
+
MISSED = 1002,
|
|
255
|
+
/**
|
|
256
|
+
* 通话取消
|
|
257
|
+
*/
|
|
258
|
+
CANCELLED = 1003,
|
|
259
|
+
/**
|
|
260
|
+
* 通话拒绝
|
|
261
|
+
*/
|
|
262
|
+
DECLINED = 1004,
|
|
263
|
+
/**
|
|
264
|
+
* 异常
|
|
265
|
+
*/
|
|
266
|
+
ERROR = 2000
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare enum RCCallTargetType {
|
|
270
|
+
SIGNAL = 0,
|
|
271
|
+
GROUP = 1,
|
|
272
|
+
DEPARTMENT = 2
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
declare enum ForwardType {
|
|
276
|
+
/**
|
|
277
|
+
* 通过下一次人员状态 userState 的下发同步带下去
|
|
278
|
+
*/
|
|
279
|
+
SOON_AFETER = 0,
|
|
280
|
+
/**
|
|
281
|
+
* 立即转发
|
|
282
|
+
*/
|
|
283
|
+
CURRENT = 1
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare enum RCCallPlusReason {
|
|
287
|
+
IDLE = 0,
|
|
288
|
+
CALLING = 100,
|
|
289
|
+
INVITED = 101,
|
|
290
|
+
RINGING = 102,
|
|
291
|
+
BUSYLINE_RINGING = 103,
|
|
292
|
+
BUSYLINE_WAIT = 104,
|
|
293
|
+
CONNECTING = 200,
|
|
294
|
+
ONCALL = 300,
|
|
295
|
+
ON_PHONE = 301,
|
|
296
|
+
ON_PHONE_END = 302,
|
|
297
|
+
/**
|
|
298
|
+
* 输入设备不可用
|
|
299
|
+
*/
|
|
300
|
+
ON_DEVICE_DISABLE = 303,
|
|
301
|
+
/**
|
|
302
|
+
* 输入设备可用
|
|
303
|
+
*/
|
|
304
|
+
ON_DEVICE_ENABLE = 304,
|
|
305
|
+
/**
|
|
306
|
+
* 本端异常离开
|
|
307
|
+
*/
|
|
308
|
+
ABNORMAL_END = 999,
|
|
309
|
+
/**
|
|
310
|
+
* 通话结束
|
|
311
|
+
*/
|
|
312
|
+
ENDED = 1000,
|
|
313
|
+
/**
|
|
314
|
+
* 远端未接听
|
|
315
|
+
*/
|
|
316
|
+
NO_ANSWER = 1001,
|
|
317
|
+
/**
|
|
318
|
+
* 己端未接听
|
|
319
|
+
*/
|
|
320
|
+
MISSED = 1002,
|
|
321
|
+
/**
|
|
322
|
+
* 己端通话取消
|
|
323
|
+
*/
|
|
324
|
+
CANCELLED = 1003,
|
|
325
|
+
/**
|
|
326
|
+
* 远端拒绝
|
|
327
|
+
*/
|
|
328
|
+
DECLINED = 1004,
|
|
329
|
+
/**
|
|
330
|
+
* 其他端呼出(当前端被踢)
|
|
331
|
+
*/
|
|
332
|
+
OTHER_CLIENT_CALLING = 1010,
|
|
333
|
+
/**
|
|
334
|
+
* 其他端已接听
|
|
335
|
+
*/
|
|
336
|
+
OTHER_CLIENT_ACCEPT = 1011,
|
|
337
|
+
/**
|
|
338
|
+
* 加入 RTC 房间失败
|
|
339
|
+
*/
|
|
340
|
+
JOIN_ROOM_ERR = 1105,
|
|
341
|
+
/**
|
|
342
|
+
* 发布资源失败
|
|
343
|
+
*/
|
|
344
|
+
PUBLISH_ERR = 1106,
|
|
345
|
+
/**
|
|
346
|
+
* 订阅资源失败
|
|
347
|
+
*/
|
|
348
|
+
SUBSCRIBE_ERR = 1107,
|
|
349
|
+
/**
|
|
350
|
+
* 接听系统通话
|
|
351
|
+
*/
|
|
352
|
+
ACCEPT_CARRIER = 1108,
|
|
353
|
+
/**
|
|
354
|
+
* 被禁止通话
|
|
355
|
+
*/
|
|
356
|
+
KICKED_BY_SERVER = 1109,
|
|
357
|
+
/**
|
|
358
|
+
* RTC Ping 失败被踢出房间
|
|
359
|
+
*/
|
|
360
|
+
CONNECTION_ERR = 1110,
|
|
361
|
+
/**
|
|
362
|
+
* 用户退出登录被踢出房间
|
|
363
|
+
*/
|
|
364
|
+
LOGOUT = 1111,
|
|
365
|
+
/**
|
|
366
|
+
* 用户被其他端登录挤下线
|
|
367
|
+
*/
|
|
368
|
+
OTHER_CLIENT_LOGIN = 1112,
|
|
369
|
+
/**
|
|
370
|
+
* 其他端加入新通话
|
|
371
|
+
*/
|
|
372
|
+
OTHER_CLIENT_JOINED = 1113,
|
|
373
|
+
/**
|
|
374
|
+
* 其他端已在其他通话中(己端 A1 其他端正在通话中,A2 多端又加入房间被拒绝后通话结束 A2 的状态)
|
|
375
|
+
*/
|
|
376
|
+
OTHER_CLIENT_IN_ROOM = 1114,
|
|
377
|
+
/**
|
|
378
|
+
* 其他端已挂断
|
|
379
|
+
*/
|
|
380
|
+
OTHER_CLIENT_HANGUP = 1151,
|
|
381
|
+
/**
|
|
382
|
+
* 远端用户加入房间失败
|
|
383
|
+
*/
|
|
384
|
+
REMOTE_JOIN_RTC_ERROR = 1205,
|
|
385
|
+
/**
|
|
386
|
+
* 远端用户发布资源失败
|
|
387
|
+
*/
|
|
388
|
+
REMOTE_PUBLISH_ERROR = 1206,
|
|
389
|
+
/**
|
|
390
|
+
* 远端用户订阅资源失败
|
|
391
|
+
*/
|
|
392
|
+
REMOTE_SUBSCRIBE_ERROR = 1207,
|
|
393
|
+
/**
|
|
394
|
+
* 远端用户已被(封禁)禁止通话
|
|
395
|
+
*/
|
|
396
|
+
REMOTE_KICKED_BY_SERVER = 1209,
|
|
397
|
+
/**
|
|
398
|
+
* 远端用户UDP连接断开
|
|
399
|
+
*/
|
|
400
|
+
REMOTE_CONNECTION_ERROR = 1210,
|
|
401
|
+
/**
|
|
402
|
+
* 远端用户退出IM登录
|
|
403
|
+
*/
|
|
404
|
+
REMOTE_LOGOUT = 1211,
|
|
405
|
+
/**
|
|
406
|
+
* 远端用户被其他端登录挤下线
|
|
407
|
+
*/
|
|
408
|
+
REMOTE_OTHER_CLIENT_LOGIN = 1212,
|
|
409
|
+
/**
|
|
410
|
+
* 远端用户被其他端加入房间 joinRoom 踢出
|
|
411
|
+
*/
|
|
412
|
+
REMOTE_OTHER_JOINED_RTC = 1213,
|
|
413
|
+
/**
|
|
414
|
+
* 远端用户的其他端已经在房间中,不允许 joinRoom 进行音视频通话
|
|
415
|
+
*/
|
|
416
|
+
REMOTE_OTHER_CLIENT_IN_RTC = 1214
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 用户信息
|
|
421
|
+
*/
|
|
422
|
+
interface IUser {
|
|
423
|
+
/**
|
|
424
|
+
* 用户 ID
|
|
425
|
+
*/
|
|
426
|
+
userId: string;
|
|
427
|
+
/**
|
|
428
|
+
* 用户类型 (0:正常用户 1:观察者)
|
|
429
|
+
*/
|
|
430
|
+
userType?: RCCallUserType;
|
|
431
|
+
/**
|
|
432
|
+
* 来源对象类型
|
|
433
|
+
*/
|
|
434
|
+
targetType?: RCCallTargetType;
|
|
435
|
+
/**
|
|
436
|
+
* 来源对象 ID
|
|
437
|
+
*/
|
|
438
|
+
targetId?: string;
|
|
439
|
+
/**
|
|
440
|
+
* 用户昵称(可传手机号)
|
|
441
|
+
*/
|
|
442
|
+
nickName?: string;
|
|
443
|
+
/**
|
|
444
|
+
* 组织ID
|
|
445
|
+
*/
|
|
446
|
+
orgId?: string;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* 忙线用户列表
|
|
450
|
+
*/
|
|
451
|
+
interface IBusylineUser {
|
|
452
|
+
/**
|
|
453
|
+
* 用户 ID
|
|
454
|
+
*/
|
|
455
|
+
userId: string;
|
|
456
|
+
/**
|
|
457
|
+
* 用户状态
|
|
458
|
+
*/
|
|
459
|
+
sessionStatus: RCCallPlusSessionUserState;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* base singal content
|
|
463
|
+
*/
|
|
464
|
+
interface IBaseSingalCon {
|
|
465
|
+
/**
|
|
466
|
+
* 服务返回的呼叫 ID
|
|
467
|
+
*/
|
|
468
|
+
callId: string;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* 开始呼叫信令内容
|
|
472
|
+
*/
|
|
473
|
+
interface IStartCallCon {
|
|
474
|
+
/**
|
|
475
|
+
* 用户生成 callId
|
|
476
|
+
*/
|
|
477
|
+
clientCallId: string;
|
|
478
|
+
/**
|
|
479
|
+
* 目标用户信息列表
|
|
480
|
+
*/
|
|
481
|
+
toUsers: IUser[];
|
|
482
|
+
/**
|
|
483
|
+
* 呼叫类型
|
|
484
|
+
*/
|
|
485
|
+
callType: RCCallPlusType;
|
|
486
|
+
/**
|
|
487
|
+
* 通话媒体类型
|
|
488
|
+
*/
|
|
489
|
+
mediaType: RCCallPlusMediaType;
|
|
490
|
+
/**
|
|
491
|
+
* 是否密聊
|
|
492
|
+
*/
|
|
493
|
+
secretChat: SecretCallType;
|
|
494
|
+
/**
|
|
495
|
+
* 当前用户的来源组 ID 类型
|
|
496
|
+
*/
|
|
497
|
+
targetType?: RCCallTargetType;
|
|
498
|
+
/**
|
|
499
|
+
* 当前用户的来源组 ID
|
|
500
|
+
*/
|
|
501
|
+
targetId?: string;
|
|
502
|
+
/**
|
|
503
|
+
* 发起人用户昵称(可为手机号)
|
|
504
|
+
*/
|
|
505
|
+
nickName?: string;
|
|
506
|
+
/**
|
|
507
|
+
* 正在通话中的老版房间 ID (老版 call 或 meeting)
|
|
508
|
+
*/
|
|
509
|
+
oldRoomId?: string;
|
|
510
|
+
/**
|
|
511
|
+
* 服务端接收的推送扩展
|
|
512
|
+
*/
|
|
513
|
+
pushExt?: string;
|
|
514
|
+
/**
|
|
515
|
+
* 附加信息,服务器透传
|
|
516
|
+
*/
|
|
517
|
+
extra?: string;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* 单呼信令内容
|
|
521
|
+
*/
|
|
522
|
+
interface IStartSingleCon {
|
|
523
|
+
/**
|
|
524
|
+
* 用户生成 callId
|
|
525
|
+
*/
|
|
526
|
+
clientCallId: string;
|
|
527
|
+
/**
|
|
528
|
+
* 被叫用户 ID
|
|
529
|
+
*/
|
|
530
|
+
toUserId: string;
|
|
531
|
+
/**
|
|
532
|
+
* 媒体类型
|
|
533
|
+
*/
|
|
534
|
+
mediaType: RCCallPlusMediaType;
|
|
535
|
+
/**
|
|
536
|
+
* 用户来源组 ID 类型
|
|
537
|
+
*/
|
|
538
|
+
targetType?: RCCallTargetType;
|
|
539
|
+
/**
|
|
540
|
+
* 来源组 ID
|
|
541
|
+
*/
|
|
542
|
+
targetId?: string;
|
|
543
|
+
/**
|
|
544
|
+
* 是否密聊(0: 否;1: 是)
|
|
545
|
+
* PC 目前无密聊,写死 0
|
|
546
|
+
*/
|
|
547
|
+
secretChat: SecretCallType;
|
|
548
|
+
/**
|
|
549
|
+
* 单聊加密 key
|
|
550
|
+
*/
|
|
551
|
+
secretChatKey?: string;
|
|
552
|
+
/**
|
|
553
|
+
* 正在通话中的老版房间 ID (老版 call 或 meeting)
|
|
554
|
+
*/
|
|
555
|
+
oldRoomId?: string;
|
|
556
|
+
/**
|
|
557
|
+
* 组织ID
|
|
558
|
+
*/
|
|
559
|
+
toOrgId?: string;
|
|
560
|
+
/**
|
|
561
|
+
* 附加信息,服务器透传
|
|
562
|
+
*/
|
|
563
|
+
extra?: string;
|
|
564
|
+
/**
|
|
565
|
+
* 服务端接收的推送扩展
|
|
566
|
+
*/
|
|
567
|
+
pushExt?: string;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* 群呼信令内容
|
|
571
|
+
*/
|
|
572
|
+
interface IStartGroupCon {
|
|
573
|
+
/**
|
|
574
|
+
* 用户生成 callId
|
|
575
|
+
*/
|
|
576
|
+
clientCallId: string;
|
|
577
|
+
/**
|
|
578
|
+
* 目标用户列表
|
|
579
|
+
*/
|
|
580
|
+
toUsers: IUser[];
|
|
581
|
+
/**
|
|
582
|
+
* 通话媒体类型
|
|
583
|
+
*/
|
|
584
|
+
mediaType: RCCallPlusMediaType;
|
|
585
|
+
/**
|
|
586
|
+
* 用户来源组 ID 类型
|
|
587
|
+
*/
|
|
588
|
+
targetType?: RCCallTargetType;
|
|
589
|
+
/**
|
|
590
|
+
* 来源组 ID
|
|
591
|
+
*/
|
|
592
|
+
targetId?: string;
|
|
593
|
+
/**
|
|
594
|
+
* 发起人用户昵称(可为手机号)
|
|
595
|
+
*/
|
|
596
|
+
nickName?: string;
|
|
597
|
+
/**
|
|
598
|
+
* 正在通话中的老版房间 ID (老版 call 或 meeting)
|
|
599
|
+
*/
|
|
600
|
+
oldRoomId?: string;
|
|
601
|
+
/**
|
|
602
|
+
* 附加信息,服务器透传
|
|
603
|
+
*/
|
|
604
|
+
extra?: string;
|
|
605
|
+
/**
|
|
606
|
+
* 服务端接收的推送扩展
|
|
607
|
+
*/
|
|
608
|
+
pushExt?: string;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* 开始呼叫 Server 返回
|
|
612
|
+
*/
|
|
613
|
+
interface IStartCallRes extends IBaseSingalCon {
|
|
614
|
+
/**
|
|
615
|
+
* 传入的 clientCallId
|
|
616
|
+
*/
|
|
617
|
+
clientCallId: string;
|
|
618
|
+
/**
|
|
619
|
+
* 人员支持情况,后期可能废弃谨慎使用
|
|
620
|
+
*/
|
|
621
|
+
toUsersSupport?: {
|
|
622
|
+
[userId: string]: 0 | 1;
|
|
623
|
+
};
|
|
624
|
+
/**
|
|
625
|
+
* 占线用户列表
|
|
626
|
+
*/
|
|
627
|
+
busylineUsers?: IBusylineUser[];
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* 邀请好友加入信令内容
|
|
631
|
+
*/
|
|
632
|
+
interface IInviteCallCon extends IBaseSingalCon {
|
|
633
|
+
/**
|
|
634
|
+
* 目标用户列表
|
|
635
|
+
*/
|
|
636
|
+
toUsers: IUser[];
|
|
637
|
+
/**
|
|
638
|
+
* 附加信息,服务器透传
|
|
639
|
+
*/
|
|
640
|
+
extra?: string;
|
|
641
|
+
/**
|
|
642
|
+
* 服务端接收的推送扩展
|
|
643
|
+
*/
|
|
644
|
+
pushExt?: string;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* 邀请好友加入信令结果
|
|
648
|
+
*/
|
|
649
|
+
interface IInviteCallRes extends IBaseSingalCon {
|
|
650
|
+
/**
|
|
651
|
+
* 呼叫类型
|
|
652
|
+
*/
|
|
653
|
+
callType: RCCallPlusType;
|
|
654
|
+
/**
|
|
655
|
+
* 占线用户列表
|
|
656
|
+
*/
|
|
657
|
+
busylineUsers?: IBusylineUser[];
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* server 通话用户列表
|
|
661
|
+
*/
|
|
662
|
+
interface ICallSessionUser {
|
|
663
|
+
/**
|
|
664
|
+
* 用户 ID
|
|
665
|
+
*/
|
|
666
|
+
userId: string;
|
|
667
|
+
/**
|
|
668
|
+
* 用户状态
|
|
669
|
+
*/
|
|
670
|
+
sessionStatus: RCCallPlusSessionUserState;
|
|
671
|
+
/**
|
|
672
|
+
* 状态发生时间
|
|
673
|
+
*/
|
|
674
|
+
statusTime: number;
|
|
675
|
+
/**
|
|
676
|
+
* 通话时长(单位:s)群组各人通话时长不同
|
|
677
|
+
*/
|
|
678
|
+
duration: number;
|
|
679
|
+
/**
|
|
680
|
+
* 是否变化(否:0、是:1)
|
|
681
|
+
*/
|
|
682
|
+
changed: 0 | 1;
|
|
683
|
+
/**
|
|
684
|
+
* 邀请 userId 的用户 ID
|
|
685
|
+
*/
|
|
686
|
+
inviteUserId: string;
|
|
687
|
+
/**
|
|
688
|
+
* 用户系统状态
|
|
689
|
+
*/
|
|
690
|
+
sysStatus: RCCallPlusReason;
|
|
691
|
+
/**
|
|
692
|
+
* 当前用户的来源组 ID 类型 (来源用户的群组、通讯录等等)
|
|
693
|
+
*/
|
|
694
|
+
targetType?: RCCallTargetType;
|
|
695
|
+
/**
|
|
696
|
+
* 当前用户的来源组 ID
|
|
697
|
+
*/
|
|
698
|
+
targetId?: string;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* 通话邀请下发信令内容
|
|
702
|
+
*/
|
|
703
|
+
interface IPubInviteCon extends IBaseSingalCon {
|
|
704
|
+
/**
|
|
705
|
+
* deviceId
|
|
706
|
+
*/
|
|
707
|
+
toDeviceId: string;
|
|
708
|
+
/**
|
|
709
|
+
* 通话发起人
|
|
710
|
+
*/
|
|
711
|
+
callingUserId: string;
|
|
712
|
+
/**
|
|
713
|
+
* 本次邀请人
|
|
714
|
+
*/
|
|
715
|
+
inviteUserId: string;
|
|
716
|
+
/**
|
|
717
|
+
* 呼叫类型
|
|
718
|
+
*/
|
|
719
|
+
callType: RCCallPlusType;
|
|
720
|
+
/**
|
|
721
|
+
* 媒体类型
|
|
722
|
+
*/
|
|
723
|
+
mediaType: RCCallPlusMediaType;
|
|
724
|
+
/**
|
|
725
|
+
* 是否密聊
|
|
726
|
+
*/
|
|
727
|
+
secretChat?: SecretCallType;
|
|
728
|
+
/**
|
|
729
|
+
* 通话用户列表
|
|
730
|
+
*/
|
|
731
|
+
callSessionUsers: ICallSessionUser[];
|
|
732
|
+
/**
|
|
733
|
+
* 来源组 ID 类型
|
|
734
|
+
*/
|
|
735
|
+
targetType?: RCCallTargetType;
|
|
736
|
+
/**
|
|
737
|
+
* 来源组 ID
|
|
738
|
+
*/
|
|
739
|
+
targetId?: string;
|
|
740
|
+
/**
|
|
741
|
+
* 附加信息
|
|
742
|
+
*/
|
|
743
|
+
extra?: string;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* 通话响铃信令内容
|
|
747
|
+
*/
|
|
748
|
+
interface IRingingCallCon extends IBaseSingalCon {
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* 通话接听信令内容
|
|
752
|
+
*/
|
|
753
|
+
interface IAcceptCallCon extends IBaseSingalCon {
|
|
754
|
+
/**
|
|
755
|
+
* 服务端接收的推送扩展
|
|
756
|
+
*/
|
|
757
|
+
pushExt?: string;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* 直接加入通话信令内容
|
|
761
|
+
*/
|
|
762
|
+
interface IJoinCallCon extends IBaseSingalCon {
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* 通话挂断信令内容
|
|
766
|
+
*/
|
|
767
|
+
interface IHangupCallCon extends IBaseSingalCon {
|
|
768
|
+
sysStatus?: RCCallPlusReason;
|
|
769
|
+
/**
|
|
770
|
+
* 服务端接收的推送扩展
|
|
771
|
+
*/
|
|
772
|
+
pushExt?: string;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* 通话状态上报信令内容
|
|
776
|
+
*/
|
|
777
|
+
interface IStatusUpCon extends IBaseSingalCon {
|
|
778
|
+
/**
|
|
779
|
+
* call server 用户状态
|
|
780
|
+
*/
|
|
781
|
+
sessionStatus: RCCallPlusSessionUserState;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* 通话状态下发信令内容
|
|
785
|
+
*/
|
|
786
|
+
interface IStatusDownCont extends IBaseSingalCon {
|
|
787
|
+
/**
|
|
788
|
+
* deviceId
|
|
789
|
+
*/
|
|
790
|
+
toDeviceId: string;
|
|
791
|
+
/**
|
|
792
|
+
* server 通话状态
|
|
793
|
+
*/
|
|
794
|
+
callStatus: RCCallPlusCallState;
|
|
795
|
+
/**
|
|
796
|
+
* 通话时长
|
|
797
|
+
*/
|
|
798
|
+
duration: number;
|
|
799
|
+
/**
|
|
800
|
+
* call server 用户信息列表
|
|
801
|
+
*/
|
|
802
|
+
callSessionUsers: ICallSessionUser[];
|
|
803
|
+
/**
|
|
804
|
+
* 通话开始时间
|
|
805
|
+
*/
|
|
806
|
+
startTime?: number;
|
|
807
|
+
/**
|
|
808
|
+
* 同步服务端时间
|
|
809
|
+
*/
|
|
810
|
+
syncTime?: number;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* 通话事件上报
|
|
814
|
+
*/
|
|
815
|
+
interface IEventUpCallCon extends IBaseSingalCon {
|
|
816
|
+
/**
|
|
817
|
+
* 事件类型,10 打开摄像头、11 关闭摄像头
|
|
818
|
+
*/
|
|
819
|
+
eventType: CallServerEventType;
|
|
820
|
+
/**
|
|
821
|
+
* 目标用户 Id 列表
|
|
822
|
+
*/
|
|
823
|
+
toUserIds?: string[];
|
|
824
|
+
/**
|
|
825
|
+
* 事件参数
|
|
826
|
+
*/
|
|
827
|
+
eventArgs?: Object;
|
|
828
|
+
/**
|
|
829
|
+
* 事件发生时间戳
|
|
830
|
+
*/
|
|
831
|
+
eventTime: number;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* 通话事件下发
|
|
835
|
+
*/
|
|
836
|
+
interface IEventDownCallCon extends IBaseSingalCon {
|
|
837
|
+
/**
|
|
838
|
+
* 事件类型,10 打开摄像头、11 关闭摄像头
|
|
839
|
+
*/
|
|
840
|
+
eventType: CallServerEventType;
|
|
841
|
+
/**
|
|
842
|
+
* 事件参数
|
|
843
|
+
*/
|
|
844
|
+
eventArgs?: Object;
|
|
845
|
+
/**
|
|
846
|
+
* 事件发起用户 ID
|
|
847
|
+
*/
|
|
848
|
+
fromUserId: string;
|
|
849
|
+
/**
|
|
850
|
+
* 事件发生时间戳
|
|
851
|
+
*/
|
|
852
|
+
eventTime: number;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* 对话数据上行
|
|
856
|
+
*/
|
|
857
|
+
interface IDialogUpCallCon extends IBaseSingalCon {
|
|
858
|
+
/**
|
|
859
|
+
* 事务 ID
|
|
860
|
+
*/
|
|
861
|
+
transactionId?: string;
|
|
862
|
+
/**
|
|
863
|
+
* 对话类型
|
|
864
|
+
*/
|
|
865
|
+
dialogType: DialogType;
|
|
866
|
+
/**
|
|
867
|
+
* 对话动作
|
|
868
|
+
*/
|
|
869
|
+
action: DialogAction;
|
|
870
|
+
/**
|
|
871
|
+
* 附加数据,上传为可选
|
|
872
|
+
*/
|
|
873
|
+
extraKeyVal?: {
|
|
874
|
+
mediaType: RCCallPlusMediaType;
|
|
875
|
+
reason?: DialogAction;
|
|
876
|
+
} | {
|
|
877
|
+
cameraOn: 0 | 1;
|
|
878
|
+
};
|
|
879
|
+
/**
|
|
880
|
+
* 目标用户 Id
|
|
881
|
+
*/
|
|
882
|
+
toUserIds?: string[];
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* 对话数据下行信令内容
|
|
886
|
+
*/
|
|
887
|
+
interface IDialogDownCallCon extends IDialogUpCallCon {
|
|
888
|
+
/**
|
|
889
|
+
* 操作者 ID
|
|
890
|
+
*/
|
|
891
|
+
promoterId: string;
|
|
892
|
+
/**
|
|
893
|
+
* 同步时间戳
|
|
894
|
+
*/
|
|
895
|
+
syncTime: number;
|
|
896
|
+
/**
|
|
897
|
+
* 附加数据
|
|
898
|
+
*/
|
|
899
|
+
extraKeyVal: {
|
|
900
|
+
mediaType: RCCallPlusMediaType;
|
|
901
|
+
reason?: DialogAction;
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* 日志记录获取
|
|
906
|
+
*/
|
|
907
|
+
interface ISyncCallLogCon {
|
|
908
|
+
/**
|
|
909
|
+
* 要获取的 userId
|
|
910
|
+
*/
|
|
911
|
+
userId: string;
|
|
912
|
+
/**
|
|
913
|
+
* 同步时间戳
|
|
914
|
+
*/
|
|
915
|
+
syncTime: number;
|
|
916
|
+
/**
|
|
917
|
+
* 每页记录数 默认 30
|
|
918
|
+
*/
|
|
919
|
+
count?: number;
|
|
920
|
+
/**
|
|
921
|
+
* 正序或倒序
|
|
922
|
+
*/
|
|
923
|
+
order?: 0 | 1;
|
|
924
|
+
}
|
|
925
|
+
interface ISyncCallLogRes extends IBaseSingalCon {
|
|
926
|
+
callType: RCCallPlusType;
|
|
927
|
+
callDir: RCCallDirection;
|
|
928
|
+
mediaType: RCCallPlusMediaType;
|
|
929
|
+
/**
|
|
930
|
+
* 是否为密聊: 否 0、是 1
|
|
931
|
+
*/
|
|
932
|
+
secretChat: 0 | 1;
|
|
933
|
+
/**
|
|
934
|
+
* 用户 ID
|
|
935
|
+
*/
|
|
936
|
+
userId: string;
|
|
937
|
+
/**
|
|
938
|
+
* 目标 ID
|
|
939
|
+
*/
|
|
940
|
+
targetId: string;
|
|
941
|
+
/**
|
|
942
|
+
* 呼叫发起者 ID
|
|
943
|
+
*/
|
|
944
|
+
callingUserId: string;
|
|
945
|
+
/**
|
|
946
|
+
* 参与者 ID 列表
|
|
947
|
+
*/
|
|
948
|
+
callUserIds: string[];
|
|
949
|
+
/**
|
|
950
|
+
* 通话状态
|
|
951
|
+
*/
|
|
952
|
+
callStatus: RCCallPlusCallState;
|
|
953
|
+
/**
|
|
954
|
+
* 用户通话状态
|
|
955
|
+
*/
|
|
956
|
+
sessionStatus: RCCallPlusSessionUserState;
|
|
957
|
+
/**
|
|
958
|
+
* 用户系统状态
|
|
959
|
+
*/
|
|
960
|
+
sysStatus: RCCallPlusReason;
|
|
961
|
+
startTime: number;
|
|
962
|
+
endTime: number;
|
|
963
|
+
duration: number;
|
|
964
|
+
/**
|
|
965
|
+
* 通话创建时间
|
|
966
|
+
*/
|
|
967
|
+
crtTime: number;
|
|
968
|
+
/**
|
|
969
|
+
* 同步数据
|
|
970
|
+
*/
|
|
971
|
+
syncTime: number;
|
|
972
|
+
}
|
|
973
|
+
interface ISyncCallLogResList {
|
|
974
|
+
hasMore: 0 | 1;
|
|
975
|
+
callLogList: ISyncCallLogRes[];
|
|
976
|
+
/**
|
|
977
|
+
* 列表中最大时间戳
|
|
978
|
+
*/
|
|
979
|
+
maxTime: number;
|
|
980
|
+
/**
|
|
981
|
+
* 通话记录列表中最小的时间戳
|
|
982
|
+
*/
|
|
983
|
+
minTime: number;
|
|
984
|
+
/**
|
|
985
|
+
* 删除的列表
|
|
986
|
+
*/
|
|
987
|
+
delLogList: {
|
|
988
|
+
callId: string;
|
|
989
|
+
/**
|
|
990
|
+
* 当前用户 ID
|
|
991
|
+
*/
|
|
992
|
+
userId: string;
|
|
993
|
+
}[];
|
|
994
|
+
/**
|
|
995
|
+
* 最后已读的 callId
|
|
996
|
+
*/
|
|
997
|
+
lastReadedCallId: string;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* 日志记录下发信令内容
|
|
1001
|
+
*/
|
|
1002
|
+
interface IPubCallLog extends ISyncCallLogRes {
|
|
1003
|
+
}
|
|
1004
|
+
interface ISignalTransporterListener {
|
|
1005
|
+
/**
|
|
1006
|
+
* 收到 call 邀请
|
|
1007
|
+
* @param isDirectly 是否为直发信令
|
|
1008
|
+
*/
|
|
1009
|
+
onInvite(data: IPubInviteCon, isDirectly: boolean, traceId: string): void;
|
|
1010
|
+
/**
|
|
1011
|
+
* 收到通话状态变更
|
|
1012
|
+
*/
|
|
1013
|
+
onStatusDown(data: IStatusDownCont, traceId: string, sessionId?: string): void;
|
|
1014
|
+
/**
|
|
1015
|
+
* 其他端通话状态变更
|
|
1016
|
+
*/
|
|
1017
|
+
onOtherClientStatusDown(data: IStatusDownCont, traceId: string): void;
|
|
1018
|
+
/**
|
|
1019
|
+
* 收到设备变更相关事件
|
|
1020
|
+
*/
|
|
1021
|
+
onEventDown(data: IEventDownCallCon, traceId: string): void;
|
|
1022
|
+
/**
|
|
1023
|
+
* 收到通话结束日志
|
|
1024
|
+
*/
|
|
1025
|
+
onRecvCallEndLog(data: IPubCallLog, traceId: string): void;
|
|
1026
|
+
/**
|
|
1027
|
+
* 收到媒体类型变更
|
|
1028
|
+
*/
|
|
1029
|
+
onSwitchMediaType(data: IDialogDownCallCon, traceId: string): void;
|
|
1030
|
+
/**
|
|
1031
|
+
* IM 状态变更
|
|
1032
|
+
*/
|
|
1033
|
+
onIMStateChange(state: RCConnectionStatus): void;
|
|
1034
|
+
}
|
|
1035
|
+
interface IQryUserHasCallRes extends IBaseSingalCon {
|
|
1036
|
+
/**
|
|
1037
|
+
* 通话阶段
|
|
1038
|
+
*/
|
|
1039
|
+
hasCallStage: RCCallStage;
|
|
1040
|
+
}
|
|
1041
|
+
interface IGetUserCallStateListRes {
|
|
1042
|
+
callStateList: {
|
|
1043
|
+
callId: string;
|
|
1044
|
+
callType: RCCallPlusType;
|
|
1045
|
+
mediaType: RCCallPlusMediaType;
|
|
1046
|
+
/**
|
|
1047
|
+
* 呼叫发起者 ID
|
|
1048
|
+
*/
|
|
1049
|
+
callingUserId: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* 通话参与用户 ID 列表
|
|
1052
|
+
*/
|
|
1053
|
+
callUserIds: string[];
|
|
1054
|
+
/**
|
|
1055
|
+
* 通话状态
|
|
1056
|
+
*/
|
|
1057
|
+
callStatus: RCCallPlusCallState;
|
|
1058
|
+
/**
|
|
1059
|
+
* 用户会话状态
|
|
1060
|
+
*/
|
|
1061
|
+
userSessionStatus: RCCallPlusSessionUserState;
|
|
1062
|
+
/**
|
|
1063
|
+
* 生成时间
|
|
1064
|
+
*/
|
|
1065
|
+
crtTime: number;
|
|
1066
|
+
/**
|
|
1067
|
+
* 最后一次变更时间
|
|
1068
|
+
*/
|
|
1069
|
+
syncTime: number;
|
|
1070
|
+
/**
|
|
1071
|
+
* 来源对象类型
|
|
1072
|
+
*/
|
|
1073
|
+
targetType: RCCallTargetType;
|
|
1074
|
+
/**
|
|
1075
|
+
* 来源对象ID(根据targetType分别指定个人,群组ID,默认值为userId)
|
|
1076
|
+
*/
|
|
1077
|
+
targetId: string;
|
|
1078
|
+
startTime: number;
|
|
1079
|
+
}[];
|
|
1080
|
+
}
|
|
1081
|
+
interface IClearCallLogRes {
|
|
1082
|
+
/**
|
|
1083
|
+
* 删除数量
|
|
1084
|
+
*/
|
|
1085
|
+
rowCount: number;
|
|
1086
|
+
}
|
|
1087
|
+
interface IGetCallSessionServerRes extends IBaseSingalCon {
|
|
1088
|
+
/**
|
|
1089
|
+
* 发起人
|
|
1090
|
+
*/
|
|
1091
|
+
callingUserId: string;
|
|
1092
|
+
/**
|
|
1093
|
+
* callType
|
|
1094
|
+
*/
|
|
1095
|
+
callType: RCCallPlusType;
|
|
1096
|
+
/**
|
|
1097
|
+
* 媒体类型
|
|
1098
|
+
*/
|
|
1099
|
+
mediaType: RCCallPlusMediaType;
|
|
1100
|
+
/**
|
|
1101
|
+
* 通话状态
|
|
1102
|
+
*/
|
|
1103
|
+
callStatus: RCCallPlusCallState;
|
|
1104
|
+
/**
|
|
1105
|
+
* 通话用户人员列表信息
|
|
1106
|
+
*/
|
|
1107
|
+
callSessionUsers: {
|
|
1108
|
+
userId: string;
|
|
1109
|
+
sessionStatus: RCCallPlusSessionUserState;
|
|
1110
|
+
statusReason: string;
|
|
1111
|
+
statusTime: number;
|
|
1112
|
+
sysStatus: RCCallPlusReason;
|
|
1113
|
+
targetType: RCCallTargetType;
|
|
1114
|
+
targetId: string;
|
|
1115
|
+
}[];
|
|
1116
|
+
/**
|
|
1117
|
+
* 开始通话时间戳
|
|
1118
|
+
*/
|
|
1119
|
+
startTime: number;
|
|
1120
|
+
/**
|
|
1121
|
+
* 通话时长(单位:s)
|
|
1122
|
+
*/
|
|
1123
|
+
duration: number;
|
|
1124
|
+
/**
|
|
1125
|
+
* 同步时间戳
|
|
1126
|
+
*/
|
|
1127
|
+
syncTime: number;
|
|
1128
|
+
}
|
|
1129
|
+
interface IGetCallTimeInfoRes extends IBaseSingalCon {
|
|
1130
|
+
/**
|
|
1131
|
+
* 开始通话时间戳
|
|
1132
|
+
*/
|
|
1133
|
+
startTime: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* 服务器当前时间
|
|
1136
|
+
*/
|
|
1137
|
+
syncTime: number;
|
|
1138
|
+
/**
|
|
1139
|
+
* 通话时长(单位:s)
|
|
1140
|
+
*/
|
|
1141
|
+
duration: number;
|
|
1142
|
+
/**
|
|
1143
|
+
* 首帧时间
|
|
1144
|
+
*/
|
|
1145
|
+
firstFrametime: number;
|
|
1146
|
+
}
|
|
1147
|
+
interface ISysStatusUpOpts extends IBaseSingalCon {
|
|
1148
|
+
/**
|
|
1149
|
+
* 人员系统状态
|
|
1150
|
+
*/
|
|
1151
|
+
sysStatus: RCCallPlusReason;
|
|
1152
|
+
/**
|
|
1153
|
+
* 是否立即转发(0:否 1是)
|
|
1154
|
+
* 否的话会通过下一次人员状态 userState 的下发同步带下去
|
|
1155
|
+
*/
|
|
1156
|
+
forward: ForwardType;
|
|
1157
|
+
}
|
|
1158
|
+
interface IEndAbnormalCallOpts {
|
|
1159
|
+
/**
|
|
1160
|
+
* 0 当前端;1 所有端
|
|
1161
|
+
*/
|
|
1162
|
+
allDevice: 0 | 1;
|
|
1163
|
+
/**
|
|
1164
|
+
* 异常的 callId 列表
|
|
1165
|
+
*/
|
|
1166
|
+
callIds: string[];
|
|
1167
|
+
}
|
|
1168
|
+
interface IGetDelayTimeInfoRes {
|
|
1169
|
+
/**
|
|
1170
|
+
* 获取 CallServer 与用户本地时间的差值,用于矫正与 CallServer 的时间
|
|
1171
|
+
*/
|
|
1172
|
+
delayTime: number;
|
|
1173
|
+
/**
|
|
1174
|
+
* callServer 接口返回时间
|
|
1175
|
+
*/
|
|
1176
|
+
rtt: number;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
interface ICallId {
|
|
1180
|
+
/**
|
|
1181
|
+
* 通话唯一 ID
|
|
1182
|
+
*/
|
|
1183
|
+
callId: string;
|
|
1184
|
+
}
|
|
1185
|
+
interface ISessionUser {
|
|
1186
|
+
/**
|
|
1187
|
+
* 成员 ID
|
|
1188
|
+
*/
|
|
1189
|
+
userId: string;
|
|
1190
|
+
/**
|
|
1191
|
+
* 成员状态
|
|
1192
|
+
*/
|
|
1193
|
+
userState: RCCallPlusSessionUserState;
|
|
1194
|
+
/**
|
|
1195
|
+
* 成员系统状态
|
|
1196
|
+
*/
|
|
1197
|
+
systemState: RCCallPlusReason;
|
|
1198
|
+
/**
|
|
1199
|
+
* 摄像头是否可用
|
|
1200
|
+
*/
|
|
1201
|
+
cameraEnable: boolean;
|
|
1202
|
+
/**
|
|
1203
|
+
* 麦克风是否可用
|
|
1204
|
+
*/
|
|
1205
|
+
microphoneEnable: boolean;
|
|
1206
|
+
/**
|
|
1207
|
+
* 来源组 ID 类型
|
|
1208
|
+
*/
|
|
1209
|
+
targetType?: RCCallTargetType;
|
|
1210
|
+
/**
|
|
1211
|
+
* 来源组 ID
|
|
1212
|
+
*/
|
|
1213
|
+
targetId?: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* 用户类型 (0:正常用户 1:观察者)
|
|
1216
|
+
*/
|
|
1217
|
+
userType?: RCCallUserType;
|
|
1218
|
+
/**
|
|
1219
|
+
* 状态时间
|
|
1220
|
+
*/
|
|
1221
|
+
stateTime?: number;
|
|
1222
|
+
}
|
|
1223
|
+
interface IRCCallPlusCallRecord {
|
|
1224
|
+
/**
|
|
1225
|
+
* 呼叫 ID
|
|
1226
|
+
*/
|
|
1227
|
+
callId: string;
|
|
1228
|
+
/**
|
|
1229
|
+
* 通话类型
|
|
1230
|
+
*/
|
|
1231
|
+
callType: RCCallPlusType;
|
|
1232
|
+
/**
|
|
1233
|
+
* 呼叫方向
|
|
1234
|
+
*/
|
|
1235
|
+
callDirection: RCCallDirection;
|
|
1236
|
+
/**
|
|
1237
|
+
* 通话媒体类型
|
|
1238
|
+
*/
|
|
1239
|
+
mediaType: RCCallPlusMediaType;
|
|
1240
|
+
/**
|
|
1241
|
+
* 呼叫发起者 ID
|
|
1242
|
+
*/
|
|
1243
|
+
callerUserId: string;
|
|
1244
|
+
/**
|
|
1245
|
+
* 参与者 ID
|
|
1246
|
+
*/
|
|
1247
|
+
callUserIds: string[];
|
|
1248
|
+
/**
|
|
1249
|
+
* 通话状态
|
|
1250
|
+
*/
|
|
1251
|
+
sessionState: RCCallPlusCallState;
|
|
1252
|
+
/**
|
|
1253
|
+
* 用户状态
|
|
1254
|
+
*/
|
|
1255
|
+
userState: RCCallPlusSessionUserState;
|
|
1256
|
+
/**
|
|
1257
|
+
* 通话开始时间戳
|
|
1258
|
+
*/
|
|
1259
|
+
startTimestamp: number;
|
|
1260
|
+
/**
|
|
1261
|
+
* 通话结束时间戳
|
|
1262
|
+
*/
|
|
1263
|
+
endTimestamp: number;
|
|
1264
|
+
/**
|
|
1265
|
+
* 通话时长(单位:s)
|
|
1266
|
+
*/
|
|
1267
|
+
duration: number;
|
|
1268
|
+
/**
|
|
1269
|
+
* 同步时间戳
|
|
1270
|
+
*/
|
|
1271
|
+
syncTimestamp: number;
|
|
1272
|
+
/**
|
|
1273
|
+
* 用户系统状态
|
|
1274
|
+
*/
|
|
1275
|
+
systemState: RCCallPlusReason;
|
|
1276
|
+
/**
|
|
1277
|
+
* 创建时间
|
|
1278
|
+
*/
|
|
1279
|
+
createTimestamp: number;
|
|
1280
|
+
}
|
|
1281
|
+
interface IUserInfo {
|
|
1282
|
+
/**
|
|
1283
|
+
* 用户 ID
|
|
1284
|
+
*/
|
|
1285
|
+
userId: string;
|
|
1286
|
+
/**
|
|
1287
|
+
* 用户类型 (0:正常用户 1:观察者)
|
|
1288
|
+
*/
|
|
1289
|
+
userType?: RCCallUserType;
|
|
1290
|
+
/**
|
|
1291
|
+
* 来源对象类型
|
|
1292
|
+
*/
|
|
1293
|
+
targetType?: RCCallTargetType;
|
|
1294
|
+
/**
|
|
1295
|
+
* 来源对象 ID
|
|
1296
|
+
*/
|
|
1297
|
+
targetId?: string;
|
|
1298
|
+
/**
|
|
1299
|
+
* 组织 ID
|
|
1300
|
+
*/
|
|
1301
|
+
orgId?: string;
|
|
1302
|
+
}
|
|
1303
|
+
interface IStartCallOpts extends ICallId {
|
|
1304
|
+
/**
|
|
1305
|
+
* 被邀请人信息
|
|
1306
|
+
*/
|
|
1307
|
+
toUsers: IUserInfo[];
|
|
1308
|
+
/**
|
|
1309
|
+
* 通话类型
|
|
1310
|
+
*/
|
|
1311
|
+
callType: RCCallPlusType;
|
|
1312
|
+
/**
|
|
1313
|
+
* 通话媒体类型
|
|
1314
|
+
*/
|
|
1315
|
+
mediaType: RCCallPlusMediaType;
|
|
1316
|
+
/**
|
|
1317
|
+
* 当前用户来源组 ID 类型
|
|
1318
|
+
*/
|
|
1319
|
+
targetType?: RCCallTargetType;
|
|
1320
|
+
/**
|
|
1321
|
+
* 当前用户来源组 ID
|
|
1322
|
+
*/
|
|
1323
|
+
targetId?: string;
|
|
1324
|
+
/**
|
|
1325
|
+
* 正在通话中的老版房间 ID (老版 call 或 meeting)
|
|
1326
|
+
* 传入后,会将此房间中的多端中的自己直接踢掉
|
|
1327
|
+
*/
|
|
1328
|
+
oldRoomId?: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* 推送扩展
|
|
1331
|
+
*/
|
|
1332
|
+
pushConfig?: IRCCallPlusPushConfig;
|
|
1333
|
+
/**
|
|
1334
|
+
* 附加信息,服务器透传
|
|
1335
|
+
*/
|
|
1336
|
+
extra?: string;
|
|
1337
|
+
}
|
|
1338
|
+
interface IStartCallResult {
|
|
1339
|
+
/**
|
|
1340
|
+
* 通话唯一 ID
|
|
1341
|
+
*/
|
|
1342
|
+
callId: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* 传入的 clientCallId
|
|
1345
|
+
*/
|
|
1346
|
+
clientCallId: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* 人员支持情况,后期可能废弃谨慎使用
|
|
1349
|
+
*/
|
|
1350
|
+
toUsersSupport?: {
|
|
1351
|
+
[userId: string]: 0 | 1;
|
|
1352
|
+
};
|
|
1353
|
+
/**
|
|
1354
|
+
* 占线用户列表
|
|
1355
|
+
*/
|
|
1356
|
+
busylineUsers?: IBusylineUser[];
|
|
1357
|
+
}
|
|
1358
|
+
interface IInviteOpts {
|
|
1359
|
+
/**
|
|
1360
|
+
* 被邀请人信息
|
|
1361
|
+
*/
|
|
1362
|
+
toUsers: IUserInfo[];
|
|
1363
|
+
/**
|
|
1364
|
+
* 来源组 ID 类型
|
|
1365
|
+
*/
|
|
1366
|
+
targetType?: RCCallTargetType;
|
|
1367
|
+
/**
|
|
1368
|
+
* 来源组 ID
|
|
1369
|
+
*/
|
|
1370
|
+
targetId?: string;
|
|
1371
|
+
/**
|
|
1372
|
+
* 推送扩展
|
|
1373
|
+
*/
|
|
1374
|
+
pushConfig?: IRCCallPlusPushConfig;
|
|
1375
|
+
/**
|
|
1376
|
+
* 附加信息,服务器透传
|
|
1377
|
+
*/
|
|
1378
|
+
extra?: string;
|
|
1379
|
+
}
|
|
1380
|
+
interface IInviteRes extends ICallId {
|
|
1381
|
+
callType: RCCallPlusType;
|
|
1382
|
+
busylineUsers?: IBusylineUser[];
|
|
1383
|
+
}
|
|
1384
|
+
interface IAcceptOpts extends ICallId {
|
|
1385
|
+
/**
|
|
1386
|
+
* 推送扩展
|
|
1387
|
+
*/
|
|
1388
|
+
pushConfig?: IRCCallPlusPushConfig;
|
|
1389
|
+
}
|
|
1390
|
+
interface IHangupForBusyOpts extends ICallId {
|
|
1391
|
+
/**
|
|
1392
|
+
* 用户系统状态
|
|
1393
|
+
*/
|
|
1394
|
+
systemState: RCCallPlusReason;
|
|
1395
|
+
/**
|
|
1396
|
+
* 推送扩展
|
|
1397
|
+
*/
|
|
1398
|
+
pushConfig?: IRCCallPlusPushConfig;
|
|
1399
|
+
}
|
|
1400
|
+
interface IJoinCallOpts {
|
|
1401
|
+
callId: string;
|
|
1402
|
+
mediaType: RCCallPlusMediaType;
|
|
1403
|
+
}
|
|
1404
|
+
interface IGetCallLogListOpts {
|
|
1405
|
+
/**
|
|
1406
|
+
* 获取时间戳之后的数据
|
|
1407
|
+
*/
|
|
1408
|
+
timestamp: number;
|
|
1409
|
+
/**
|
|
1410
|
+
* 获取数量
|
|
1411
|
+
*/
|
|
1412
|
+
count?: number;
|
|
1413
|
+
/**
|
|
1414
|
+
* 正序或倒序
|
|
1415
|
+
*/
|
|
1416
|
+
order?: 0 | 1;
|
|
1417
|
+
}
|
|
1418
|
+
interface IRCCallPlusGetCallRecordRes {
|
|
1419
|
+
/**
|
|
1420
|
+
* 是否有更多通话记录
|
|
1421
|
+
*/
|
|
1422
|
+
hasMore: boolean;
|
|
1423
|
+
/**
|
|
1424
|
+
* 通话记录列表
|
|
1425
|
+
*/
|
|
1426
|
+
list: IRCCallPlusCallRecord[];
|
|
1427
|
+
/**
|
|
1428
|
+
* hasMore 为 true 时,继续获取通话记录需传入的时间戳
|
|
1429
|
+
*/
|
|
1430
|
+
syncTime: number;
|
|
1431
|
+
}
|
|
1432
|
+
interface IReqChangeMediaTypeOpts {
|
|
1433
|
+
/**
|
|
1434
|
+
* 通话媒体类型
|
|
1435
|
+
*/
|
|
1436
|
+
mediaType: RCCallPlusMediaType;
|
|
1437
|
+
/**
|
|
1438
|
+
* 需要接收的用户 ID 列表
|
|
1439
|
+
*/
|
|
1440
|
+
toUserIds: string[];
|
|
1441
|
+
}
|
|
1442
|
+
interface IResChangeMediaTypeOpts {
|
|
1443
|
+
/**
|
|
1444
|
+
* 事务 ID
|
|
1445
|
+
*/
|
|
1446
|
+
transactionId: string;
|
|
1447
|
+
/**
|
|
1448
|
+
* 是否同意
|
|
1449
|
+
*/
|
|
1450
|
+
agree: boolean;
|
|
1451
|
+
}
|
|
1452
|
+
interface ICancelChangeMediaTypeOpts {
|
|
1453
|
+
/**
|
|
1454
|
+
* 事务 ID
|
|
1455
|
+
*/
|
|
1456
|
+
transactionId: string;
|
|
1457
|
+
}
|
|
1458
|
+
interface IReqChangeMediaTypeRes {
|
|
1459
|
+
/**
|
|
1460
|
+
* 事务 ID
|
|
1461
|
+
*/
|
|
1462
|
+
transactionId: string;
|
|
1463
|
+
}
|
|
1464
|
+
interface IGetCallSessionRes extends ICallId {
|
|
1465
|
+
/**
|
|
1466
|
+
* 呼叫发起者
|
|
1467
|
+
*/
|
|
1468
|
+
startCallerId: string;
|
|
1469
|
+
/**
|
|
1470
|
+
* callType
|
|
1471
|
+
*/
|
|
1472
|
+
callType: RCCallPlusType;
|
|
1473
|
+
/**
|
|
1474
|
+
* 媒体类型
|
|
1475
|
+
*/
|
|
1476
|
+
mediaType: RCCallPlusMediaType;
|
|
1477
|
+
/**
|
|
1478
|
+
* 通话状态
|
|
1479
|
+
*/
|
|
1480
|
+
sessionState: RCCallPlusCallState;
|
|
1481
|
+
/**
|
|
1482
|
+
* 通话用户人员列表
|
|
1483
|
+
*/
|
|
1484
|
+
callSessionUsers: ISessionUser[];
|
|
1485
|
+
/**
|
|
1486
|
+
* 开始通话时间戳
|
|
1487
|
+
*/
|
|
1488
|
+
startTime: number;
|
|
1489
|
+
/**
|
|
1490
|
+
* 通话时长(单位:s)
|
|
1491
|
+
*/
|
|
1492
|
+
duration: number;
|
|
1493
|
+
/**
|
|
1494
|
+
* 同步时间戳
|
|
1495
|
+
*/
|
|
1496
|
+
syncTime: number;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
declare enum CallTimerEventType {
|
|
1500
|
+
INVITER = "inviter",
|
|
1501
|
+
INVITEE = "invitee"
|
|
1502
|
+
}
|
|
1503
|
+
interface IOldDialogData {
|
|
1504
|
+
transactionId?: string;
|
|
1505
|
+
action: DialogAction;
|
|
1506
|
+
mediaType: RCCallPlusMediaType;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* SDK 内部使用 Session 实例
|
|
1510
|
+
*/
|
|
1511
|
+
declare class RCCallInnerSession extends EventEmitter {
|
|
1512
|
+
/**
|
|
1513
|
+
* Call ID
|
|
1514
|
+
*/
|
|
1515
|
+
private readonly _callId;
|
|
1516
|
+
/**
|
|
1517
|
+
* session 状态
|
|
1518
|
+
*/
|
|
1519
|
+
private _state;
|
|
1520
|
+
/**
|
|
1521
|
+
* 通话类型
|
|
1522
|
+
*/
|
|
1523
|
+
private _callType;
|
|
1524
|
+
/**
|
|
1525
|
+
* 通话媒体类型
|
|
1526
|
+
*/
|
|
1527
|
+
private _mediaType;
|
|
1528
|
+
/**
|
|
1529
|
+
* session 呼叫发起者
|
|
1530
|
+
*/
|
|
1531
|
+
private _startCallerId;
|
|
1532
|
+
/**
|
|
1533
|
+
* 本次 session 的邀请者
|
|
1534
|
+
*/
|
|
1535
|
+
private _callerId;
|
|
1536
|
+
/**
|
|
1537
|
+
* 当前 session 人员信息列表
|
|
1538
|
+
*/
|
|
1539
|
+
private _callUsers;
|
|
1540
|
+
private readonly _logger;
|
|
1541
|
+
/**
|
|
1542
|
+
* 请求更新的 mediaType
|
|
1543
|
+
*/
|
|
1544
|
+
private _reqMediaType;
|
|
1545
|
+
/**
|
|
1546
|
+
* 邀请者超时计时器
|
|
1547
|
+
*/
|
|
1548
|
+
private _inviterTimerId;
|
|
1549
|
+
/**
|
|
1550
|
+
* 被邀请者超时计时器
|
|
1551
|
+
*/
|
|
1552
|
+
private _inviteeTimerId;
|
|
1553
|
+
/**
|
|
1554
|
+
* 当前 session 人员信息列表
|
|
1555
|
+
*/
|
|
1556
|
+
/**
|
|
1557
|
+
* 旧 dialog 数据,用于对比
|
|
1558
|
+
*/
|
|
1559
|
+
private _oldDialogData;
|
|
1560
|
+
/**
|
|
1561
|
+
* 记录是否本地有挂断
|
|
1562
|
+
*/
|
|
1563
|
+
private isLocalClientHangup;
|
|
1564
|
+
/**
|
|
1565
|
+
* 构造器
|
|
1566
|
+
*/
|
|
1567
|
+
constructor(
|
|
1568
|
+
/**
|
|
1569
|
+
* Call ID
|
|
1570
|
+
*/
|
|
1571
|
+
_callId: string,
|
|
1572
|
+
/**
|
|
1573
|
+
* session 状态
|
|
1574
|
+
*/
|
|
1575
|
+
_state: RCCallPlusCallState,
|
|
1576
|
+
/**
|
|
1577
|
+
* 通话类型
|
|
1578
|
+
*/
|
|
1579
|
+
_callType: RCCallPlusType,
|
|
1580
|
+
/**
|
|
1581
|
+
* 通话媒体类型
|
|
1582
|
+
*/
|
|
1583
|
+
_mediaType: RCCallPlusMediaType,
|
|
1584
|
+
/**
|
|
1585
|
+
* session 呼叫发起者
|
|
1586
|
+
*/
|
|
1587
|
+
_startCallerId: string,
|
|
1588
|
+
/**
|
|
1589
|
+
* 本次 session 的邀请者
|
|
1590
|
+
*/
|
|
1591
|
+
_callerId: string,
|
|
1592
|
+
/**
|
|
1593
|
+
* 当前 session 人员信息列表
|
|
1594
|
+
*/
|
|
1595
|
+
_callUsers: ISessionUser[], _logger: BasicLogger);
|
|
1596
|
+
/**
|
|
1597
|
+
* 获取 CallID
|
|
1598
|
+
*/
|
|
1599
|
+
getCallId(): string;
|
|
1600
|
+
/**
|
|
1601
|
+
* 获取状态
|
|
1602
|
+
*/
|
|
1603
|
+
getSessionState(): RCCallPlusCallState;
|
|
1604
|
+
/**
|
|
1605
|
+
* 获取通话类型
|
|
1606
|
+
*/
|
|
1607
|
+
getCallType(): RCCallPlusType;
|
|
1608
|
+
/**
|
|
1609
|
+
* 获取媒体类型
|
|
1610
|
+
*/
|
|
1611
|
+
getMediaType(): RCCallPlusMediaType;
|
|
1612
|
+
/**
|
|
1613
|
+
* 获取 session 发起者
|
|
1614
|
+
*/
|
|
1615
|
+
getStartCallerId(): string;
|
|
1616
|
+
/**
|
|
1617
|
+
* 本次 session 邀请者
|
|
1618
|
+
*/
|
|
1619
|
+
getCallerId(): string;
|
|
1620
|
+
/**
|
|
1621
|
+
* 获取 session user list
|
|
1622
|
+
*/
|
|
1623
|
+
getUserList(): ISessionUser[];
|
|
1624
|
+
/**
|
|
1625
|
+
* 请求更新的 mediaType
|
|
1626
|
+
*/
|
|
1627
|
+
getReqMediaType(): RCCallPlusMediaType | null;
|
|
1628
|
+
/**
|
|
1629
|
+
* inviterTimerId
|
|
1630
|
+
*/
|
|
1631
|
+
getInviterTimerId(): number;
|
|
1632
|
+
/**
|
|
1633
|
+
* inviteeTimerId
|
|
1634
|
+
*/
|
|
1635
|
+
getInviteeTimerId(): number;
|
|
1636
|
+
getAllTimerIds(): number[];
|
|
1637
|
+
setUserDeviceEnable(userId: string, mediaType: RCCallPlusMediaType, enable: boolean, traceId: string): void;
|
|
1638
|
+
/**
|
|
1639
|
+
* 更新人员列表, 并返回更新的人员列表
|
|
1640
|
+
* 根据人员状态去添加、删除、更新
|
|
1641
|
+
* 根据状态时间,判断是否更新,无时间戳的为本地状态调整,直接更新
|
|
1642
|
+
*/
|
|
1643
|
+
updateUserList(users: ISessionUser[], traceId: string): ISessionUser[];
|
|
1644
|
+
setOldDialogData(data: IOldDialogData): void;
|
|
1645
|
+
/** ======私有方法============================================================================================= */
|
|
1646
|
+
/**
|
|
1647
|
+
* 更新 session 状态
|
|
1648
|
+
*/
|
|
1649
|
+
updateSessionState(state: RCCallPlusCallState): void;
|
|
1650
|
+
/**
|
|
1651
|
+
* 更新通话类型(升降级设置)
|
|
1652
|
+
*/
|
|
1653
|
+
updateCallType(callType: RCCallPlusType): void;
|
|
1654
|
+
/**
|
|
1655
|
+
* 更新媒体类型(升降级)
|
|
1656
|
+
*/
|
|
1657
|
+
updateMediaType(mediaType: RCCallPlusMediaType): void;
|
|
1658
|
+
/**
|
|
1659
|
+
* 更新请求的媒体类型(升降级)
|
|
1660
|
+
*/
|
|
1661
|
+
updateReqMediaType(mediaType: RCCallPlusMediaType | null): void;
|
|
1662
|
+
/**
|
|
1663
|
+
* 更新 invter timer id
|
|
1664
|
+
*/
|
|
1665
|
+
updateTimerId(type: CallTimerEventType, timerId: number): void;
|
|
1666
|
+
/**
|
|
1667
|
+
* 获取
|
|
1668
|
+
*/
|
|
1669
|
+
getOldDialogData(): IOldDialogData;
|
|
1670
|
+
/**
|
|
1671
|
+
* 设置是否是己端挂断
|
|
1672
|
+
*/
|
|
1673
|
+
setIsLocalClientHangup(isLocalClientHangup: boolean): void;
|
|
1674
|
+
getIsLocalClientHangup(): boolean;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
interface IRCCallInitOptions {
|
|
1678
|
+
/**
|
|
1679
|
+
* RTC 实例
|
|
1680
|
+
*/
|
|
1681
|
+
rtcClient: RCRTCClient;
|
|
1682
|
+
/**
|
|
1683
|
+
* RTC 房间加入类型
|
|
1684
|
+
*/
|
|
1685
|
+
joinType?: RTCJoinType;
|
|
1686
|
+
/**
|
|
1687
|
+
* 控制台日志输出等级
|
|
1688
|
+
*/
|
|
1689
|
+
outputLogLevel?: EnableLogL;
|
|
1690
|
+
/**
|
|
1691
|
+
* 修改默认的 log 输出函数
|
|
1692
|
+
* @deprecated
|
|
1693
|
+
*/
|
|
1694
|
+
logStdout?: (logLevel: EnableLogL, content: string) => void;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
declare enum CallServerAction {
|
|
1698
|
+
/**
|
|
1699
|
+
* 开始单人呼叫
|
|
1700
|
+
*/
|
|
1701
|
+
START_SINGLE_CALL = "startSingleCall",
|
|
1702
|
+
/**
|
|
1703
|
+
* 开始多人呼叫
|
|
1704
|
+
*/
|
|
1705
|
+
START_GROUP_CALL = "startGroupCall",
|
|
1706
|
+
/**
|
|
1707
|
+
* 邀请好友加入通话
|
|
1708
|
+
*/
|
|
1709
|
+
INVITE_CALL = "inviteCall",
|
|
1710
|
+
/**
|
|
1711
|
+
* 下发邀请通话数据
|
|
1712
|
+
*/
|
|
1713
|
+
PUB_INVITE_CALL = "pubInviteCall",
|
|
1714
|
+
/**
|
|
1715
|
+
* 通话响铃
|
|
1716
|
+
*/
|
|
1717
|
+
RINGING_CALL = "ringCall",
|
|
1718
|
+
/**
|
|
1719
|
+
* 接受通话
|
|
1720
|
+
*/
|
|
1721
|
+
ACCEPT_CALL = "acceptCall",
|
|
1722
|
+
/**
|
|
1723
|
+
* 加入通话
|
|
1724
|
+
*/
|
|
1725
|
+
JOIN_CALL = "joinCall",
|
|
1726
|
+
/**
|
|
1727
|
+
* 挂断通话
|
|
1728
|
+
*/
|
|
1729
|
+
HANGUP_CALL = "hangupCall",
|
|
1730
|
+
/**
|
|
1731
|
+
* 通话状态上报
|
|
1732
|
+
*/
|
|
1733
|
+
STATUS_UP_CALL = "statusUpCall",
|
|
1734
|
+
/**
|
|
1735
|
+
* 通话状态下发
|
|
1736
|
+
*/
|
|
1737
|
+
STATUS_DOWN_CALL = "statusDownCall",
|
|
1738
|
+
/**
|
|
1739
|
+
* 通话事件上报
|
|
1740
|
+
*/
|
|
1741
|
+
EVENT_UP_CALL = "eventUpCall",
|
|
1742
|
+
/**
|
|
1743
|
+
* 通话事件下发
|
|
1744
|
+
*/
|
|
1745
|
+
EVENT_DOWN_CALL = "eventDownCall",
|
|
1746
|
+
/**
|
|
1747
|
+
* 对话数据上行
|
|
1748
|
+
*/
|
|
1749
|
+
DIALOG_UP_CALL = "dialogUpCall",
|
|
1750
|
+
/**
|
|
1751
|
+
* 对话数据下行
|
|
1752
|
+
*/
|
|
1753
|
+
DIALOG_DOWN_CALL = "dialogDownCall",
|
|
1754
|
+
/**
|
|
1755
|
+
* 获取用户会话数据列表
|
|
1756
|
+
*/
|
|
1757
|
+
GET_CALL_USER_SESSION_LIST = "getCallUSerSessionList",
|
|
1758
|
+
/**
|
|
1759
|
+
* 日志记录同步
|
|
1760
|
+
*/
|
|
1761
|
+
SYNC_CALL_LOG = "syncCallLog",
|
|
1762
|
+
/**
|
|
1763
|
+
* 日志记录下发
|
|
1764
|
+
*/
|
|
1765
|
+
PUB_CALL_LOG = "pubCallLog",
|
|
1766
|
+
/**
|
|
1767
|
+
* 批量删除通话记录
|
|
1768
|
+
*/
|
|
1769
|
+
DEL_CALL_LOG = "deleteCallLog",
|
|
1770
|
+
/**
|
|
1771
|
+
* 查询当前用户已有的 call 状态
|
|
1772
|
+
*/
|
|
1773
|
+
QRY_CALL_STATE = "queryUserHasCall",
|
|
1774
|
+
/**
|
|
1775
|
+
* 查询 callServer 当前时间戳
|
|
1776
|
+
*/
|
|
1777
|
+
QRY_SRV_TIMESTAMP = "getCallSrvTimeStamp",
|
|
1778
|
+
/**
|
|
1779
|
+
* 获取当前用户进行的 call 列表
|
|
1780
|
+
*/
|
|
1781
|
+
GET_CALL_STATE_LIST = "getUserCallStateList",
|
|
1782
|
+
/**
|
|
1783
|
+
* 清除当前用户通话记录
|
|
1784
|
+
*/
|
|
1785
|
+
CLEAR_CALL_LOG = "cleanCallLog",
|
|
1786
|
+
/**
|
|
1787
|
+
* 获取 call 会话信息
|
|
1788
|
+
*/
|
|
1789
|
+
GET_CALL_SESSION = "getCallSession",
|
|
1790
|
+
/**
|
|
1791
|
+
* 获取 call 时间信息
|
|
1792
|
+
*/
|
|
1793
|
+
GET_CALL_TIME_INFO = "getCallTimeInfo",
|
|
1794
|
+
/**
|
|
1795
|
+
* 结束当前用户异常的callSession(包含各个阶段),主要用于应用异常退出再启动、各种通话异常当中。酌情调用
|
|
1796
|
+
*/
|
|
1797
|
+
END_ABNORMAL_CALL = "endUserAbnormalCalls",
|
|
1798
|
+
/**
|
|
1799
|
+
* 用户系统状态上报
|
|
1800
|
+
*/
|
|
1801
|
+
SYS_STATUS_UP = "sysStatusUp",
|
|
1802
|
+
/**
|
|
1803
|
+
* 上报通话记录已读状态
|
|
1804
|
+
*/
|
|
1805
|
+
UP_CALL_LOG_READED = "upCallLogReaded",
|
|
1806
|
+
/**
|
|
1807
|
+
* 下发通话记录已读状态
|
|
1808
|
+
*/
|
|
1809
|
+
PUB_CALL_LOG_READED = "pubCallLogReaded",
|
|
1810
|
+
/**
|
|
1811
|
+
* 下发下行信令数据序号Id (弱网补偿方法,移动端已实现,PC 未实现)
|
|
1812
|
+
*/
|
|
1813
|
+
PUB_NACK_SEQ_ID = "pubNACKSeqId",
|
|
1814
|
+
/**
|
|
1815
|
+
* 查询当前用户参与的未结束的callSession的CallId列表,group专用,可在groupcall结束时,补偿各端的快捷入口是否消失的判断
|
|
1816
|
+
*/
|
|
1817
|
+
GET_USER_CALL_SESSION_ID_LIST = "getUserCallSessionIdList"
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
declare enum RCCallPlusInnerCode {
|
|
1821
|
+
SUCCESS = 0,
|
|
1822
|
+
/**
|
|
1823
|
+
* 无效的响应时间(接口响应时间过长)
|
|
1824
|
+
*/
|
|
1825
|
+
INVALID_RESPONSE_TIME = 80170,
|
|
1826
|
+
/**
|
|
1827
|
+
* 非最优响应时间
|
|
1828
|
+
*/
|
|
1829
|
+
NONOPTIMAL_RES_TIME = 80171
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* 校时模块
|
|
1834
|
+
*/
|
|
1835
|
+
declare class TimeCorrectioner {
|
|
1836
|
+
private readonly _callEngine;
|
|
1837
|
+
private readonly _logger;
|
|
1838
|
+
private readonly _singleCallDurationEv;
|
|
1839
|
+
/**
|
|
1840
|
+
* 接口响应时间
|
|
1841
|
+
*/
|
|
1842
|
+
private _RTT;
|
|
1843
|
+
/**
|
|
1844
|
+
* 可用的接口响应时间下限(单位: ms)
|
|
1845
|
+
*/
|
|
1846
|
+
private _validMinRTT;
|
|
1847
|
+
/**
|
|
1848
|
+
* 可用的接口响应时间上限(单位: ms)
|
|
1849
|
+
*/
|
|
1850
|
+
private _validMaxRTT;
|
|
1851
|
+
/**
|
|
1852
|
+
* 与 callServer 的时间偏差时间(单位: ms)
|
|
1853
|
+
*/
|
|
1854
|
+
private _deltaTime;
|
|
1855
|
+
/**
|
|
1856
|
+
* timerId
|
|
1857
|
+
*/
|
|
1858
|
+
private _timerId;
|
|
1859
|
+
/**
|
|
1860
|
+
* 轮训时间间隔(单位: ms)
|
|
1861
|
+
*/
|
|
1862
|
+
private readonly _interval;
|
|
1863
|
+
/**
|
|
1864
|
+
* 最大重试次数
|
|
1865
|
+
*/
|
|
1866
|
+
private readonly _maxRetryTimes;
|
|
1867
|
+
constructor(_callEngine: RCCallEngine, _logger: BasicLogger, _singleCallDurationEv: (callId: string, clientStartTime: number, clientFirstFrameTime: number, traceId: string) => void);
|
|
1868
|
+
/**
|
|
1869
|
+
* 从服务端获取通话时长、通话开始时间
|
|
1870
|
+
*/
|
|
1871
|
+
getCallClientTimeByServer(callId: string, traceId: string): Promise<{
|
|
1872
|
+
code: number;
|
|
1873
|
+
duration?: number;
|
|
1874
|
+
clientStartTime?: number;
|
|
1875
|
+
}>;
|
|
1876
|
+
/**
|
|
1877
|
+
* 直接计算客户端开始时间
|
|
1878
|
+
*/
|
|
1879
|
+
calcClientStartTime(callId: string, startTime: number, traceId: string): {
|
|
1880
|
+
code: RCCallPlusInnerCode;
|
|
1881
|
+
clientStartTime?: number;
|
|
1882
|
+
};
|
|
1883
|
+
private _startTimes;
|
|
1884
|
+
/**
|
|
1885
|
+
* 开始定时递归获取与 CallServer 的时间偏差值
|
|
1886
|
+
*/
|
|
1887
|
+
start(traceId: string): void;
|
|
1888
|
+
/**
|
|
1889
|
+
* 停止定时轮训
|
|
1890
|
+
*/
|
|
1891
|
+
stop(traceId: string): void;
|
|
1892
|
+
/**
|
|
1893
|
+
* 重新定时轮训
|
|
1894
|
+
*/
|
|
1895
|
+
restart(traceId: string): void;
|
|
1896
|
+
getLocalDelayTime(): number;
|
|
1897
|
+
getRTT(): number;
|
|
1898
|
+
/**
|
|
1899
|
+
* 获取与 CallServer 的时间偏差值,非通话中的计算
|
|
1900
|
+
*/
|
|
1901
|
+
private _getDeltaTime;
|
|
1902
|
+
/**
|
|
1903
|
+
* 通话中获取开始时间
|
|
1904
|
+
*/
|
|
1905
|
+
private _getDeltaTimeInCall;
|
|
1906
|
+
private _retryTimesInCall;
|
|
1907
|
+
private readonly _maxRetryTimesInCall;
|
|
1908
|
+
/**
|
|
1909
|
+
* 多次校正抛给业务层的通话开始时间、首帧时间
|
|
1910
|
+
*/
|
|
1911
|
+
private _loopCorrectClientTime;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
declare enum RCCallPlusMediaTypeChangeResult {
|
|
1915
|
+
/**
|
|
1916
|
+
* 请求方取消媒体类型变更
|
|
1917
|
+
*/
|
|
1918
|
+
CANCEL_CHANGE_MEDIA_TYPE = 0,
|
|
1919
|
+
/**
|
|
1920
|
+
* 应答方拒绝媒体类型切换
|
|
1921
|
+
*/
|
|
1922
|
+
REFUSE_CHANGE_MEDIA_TYPE = 1,
|
|
1923
|
+
/**
|
|
1924
|
+
* 服务仲裁允许媒体类型切换
|
|
1925
|
+
*/
|
|
1926
|
+
SERVER_ALLOW_MEDIA_TYPE = 2,
|
|
1927
|
+
/**
|
|
1928
|
+
* 媒体类型切换超时
|
|
1929
|
+
*/
|
|
1930
|
+
CHANGE_MEDIA_TYPE_TIMEOUT = 3
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
declare class RCCallPlusReportModule {
|
|
1934
|
+
private readonly _logger;
|
|
1935
|
+
private _listener;
|
|
1936
|
+
constructor(_logger: BasicLogger);
|
|
1937
|
+
/**
|
|
1938
|
+
* 状态机事件注册
|
|
1939
|
+
*/
|
|
1940
|
+
registerEventListener(listener: ICallPlusEventListener): void;
|
|
1941
|
+
/**
|
|
1942
|
+
* 回调应用层事件
|
|
1943
|
+
* @param eventName
|
|
1944
|
+
* @param attrs
|
|
1945
|
+
* @returns
|
|
1946
|
+
*/
|
|
1947
|
+
private _callAppListener;
|
|
1948
|
+
onReceivedCall(session: RCCallPlusSession, traceId: string, extra?: string): void;
|
|
1949
|
+
onRemoteUserInvited(inviteeUserList: string[], inviterUserId: string, callId: string): void;
|
|
1950
|
+
onCallConnected(session: RCCallPlusSession): void;
|
|
1951
|
+
onCallTypeChanged(callType: RCCallPlusType, callId: string, traceId: string): void;
|
|
1952
|
+
/**
|
|
1953
|
+
* 增量上报远端人员状态变化
|
|
1954
|
+
*/
|
|
1955
|
+
onRemoteUserStateChanged(data: {
|
|
1956
|
+
callId: string;
|
|
1957
|
+
userId: string;
|
|
1958
|
+
userState: RCCallPlusSessionUserState;
|
|
1959
|
+
reason?: RCCallPlusReason;
|
|
1960
|
+
}, traceId: string): void;
|
|
1961
|
+
onCallEnded(session: RCCallPlusSession, reason: RCCallPlusReason, traceId: string): void;
|
|
1962
|
+
onRemoteCameraStateChanged(callId: string, track: RCRemoteTrack): void;
|
|
1963
|
+
onRemoteMicrophoneStateChanged(callId: string, track: RCRemoteTrack): void;
|
|
1964
|
+
onReceivedCallRecord(record: IRCCallPlusCallRecord, traceId: string): void;
|
|
1965
|
+
onReceivedChangeMediaTypeRequest(userId: string, transactionId: string, mediaType: RCCallPlusMediaType, traceId: string): void;
|
|
1966
|
+
onReceivedChangeMediaTypeResult(info: {
|
|
1967
|
+
userId: string;
|
|
1968
|
+
transactionId: string;
|
|
1969
|
+
mediaType: RCCallPlusMediaType;
|
|
1970
|
+
code: RCCallPlusMediaTypeChangeResult;
|
|
1971
|
+
}, traceId: string): void;
|
|
1972
|
+
onReceivedCallStartTime(info: {
|
|
1973
|
+
callId: string;
|
|
1974
|
+
callStartTime: number;
|
|
1975
|
+
}, traceId: string): void;
|
|
1976
|
+
onReceivedCallFirstFrameTime(callId: string, callFirstFrameTime: number, traceId: string): void;
|
|
1977
|
+
onUserMediaAvailable(tracks: RCTrack[], traceId?: string): void;
|
|
1978
|
+
onFetchRemoteMediaError(tracks: ISubscribeAttr[], code: RCRTCCode): void;
|
|
1979
|
+
onUserAudioLevelChanged(audioLevelReportList: {
|
|
1980
|
+
track: RCLocalAudioTrack | RCRemoteAudioTrack;
|
|
1981
|
+
audioLevel: number;
|
|
1982
|
+
}[]): void;
|
|
1983
|
+
onReceivedCallPlusSummaryMessage(message: IRCCallPlusReceivedSummaryMessage): void;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
declare class SignalTransporter extends EventEmitter {
|
|
1987
|
+
private readonly _context;
|
|
1988
|
+
private readonly _runtime;
|
|
1989
|
+
private readonly _initOpts;
|
|
1990
|
+
private readonly _timeCorrectioner;
|
|
1991
|
+
private readonly _logger;
|
|
1992
|
+
private readonly _reportAppEventModule;
|
|
1993
|
+
/**
|
|
1994
|
+
* 监听对象
|
|
1995
|
+
*/
|
|
1996
|
+
_listener: ISignalTransporterListener;
|
|
1997
|
+
/**
|
|
1998
|
+
* 需要重试的 action
|
|
1999
|
+
*/
|
|
2000
|
+
_needRetryActions: CallServerAction[];
|
|
2001
|
+
_sessionId: string;
|
|
2002
|
+
/**
|
|
2003
|
+
* constructor
|
|
2004
|
+
*/
|
|
2005
|
+
constructor(_context: PluginContext, _runtime: IRuntime, _initOpts: IRCCallInitOptions, _timeCorrectioner: TimeCorrectioner, _logger: BasicLogger, _reportAppEventModule: RCCallPlusReportModule);
|
|
2006
|
+
private _onMessage;
|
|
2007
|
+
getSessionId(): string;
|
|
2008
|
+
registerListener(listener: ISignalTransporterListener): void;
|
|
2009
|
+
startCall(msg: IStartCallCon, traceId: string): Promise<{
|
|
2010
|
+
code: number;
|
|
2011
|
+
data?: IStartCallRes;
|
|
2012
|
+
}>;
|
|
2013
|
+
startSingleCall(msg: IStartSingleCon, traceId: string): Promise<{
|
|
2014
|
+
code: number;
|
|
2015
|
+
data?: IStartCallRes;
|
|
2016
|
+
}>;
|
|
2017
|
+
startGroupCall(msg: IStartGroupCon, traceId: string): Promise<{
|
|
2018
|
+
code: number;
|
|
2019
|
+
data?: IStartCallRes;
|
|
2020
|
+
}>;
|
|
2021
|
+
inviteCall(msg: IInviteCallCon, traceId: string): Promise<{
|
|
2022
|
+
code: number;
|
|
2023
|
+
data?: IInviteCallRes;
|
|
2024
|
+
}>;
|
|
2025
|
+
ringingCall(msg: IRingingCallCon, traceId: string): Promise<{
|
|
2026
|
+
code: number;
|
|
2027
|
+
}>;
|
|
2028
|
+
acceptCall(msg: IAcceptCallCon, traceId: string): Promise<{
|
|
2029
|
+
code: number;
|
|
2030
|
+
}>;
|
|
2031
|
+
joinCall(msg: IJoinCallCon, traceId: string): Promise<{
|
|
2032
|
+
code: number;
|
|
2033
|
+
}>;
|
|
2034
|
+
hangupCall(msg: IHangupCallCon, traceId: string): Promise<{
|
|
2035
|
+
code: number;
|
|
2036
|
+
}>;
|
|
2037
|
+
statusUpCall(msg: IStatusUpCon, traceId: string): Promise<{
|
|
2038
|
+
code: number;
|
|
2039
|
+
}>;
|
|
2040
|
+
eventUpCall(msg: IEventUpCallCon, traceId: string): Promise<{
|
|
2041
|
+
code: number;
|
|
2042
|
+
}>;
|
|
2043
|
+
dialogUpCall(msg: IDialogUpCallCon, traceId: string): Promise<{
|
|
2044
|
+
code: number;
|
|
2045
|
+
}>;
|
|
2046
|
+
deleteCallRecord(userId: string, callIds: string[], traceId: string): Promise<{
|
|
2047
|
+
code: number;
|
|
2048
|
+
}>;
|
|
2049
|
+
syncCallLog(msg: ISyncCallLogCon, traceId: string): Promise<{
|
|
2050
|
+
code: number;
|
|
2051
|
+
data?: ISyncCallLogResList;
|
|
2052
|
+
}>;
|
|
2053
|
+
queryUserHasCall(): Promise<{
|
|
2054
|
+
code: number;
|
|
2055
|
+
data?: IQryUserHasCallRes;
|
|
2056
|
+
}>;
|
|
2057
|
+
getCallServerTimestamp(traceId: string): Promise<{
|
|
2058
|
+
code: number;
|
|
2059
|
+
data?: {
|
|
2060
|
+
syncTime: number;
|
|
2061
|
+
};
|
|
2062
|
+
}>;
|
|
2063
|
+
getCallTimeInfo(callId: string, traceId: string): Promise<{
|
|
2064
|
+
code: number;
|
|
2065
|
+
data?: IGetCallTimeInfoRes;
|
|
2066
|
+
}>;
|
|
2067
|
+
getUserCallStateList(traceId: string): Promise<{
|
|
2068
|
+
code: number;
|
|
2069
|
+
data?: IGetUserCallStateListRes;
|
|
2070
|
+
}>;
|
|
2071
|
+
clearCallRecord(traceId: string): Promise<{
|
|
2072
|
+
code: number;
|
|
2073
|
+
data?: IClearCallLogRes;
|
|
2074
|
+
}>;
|
|
2075
|
+
getCallSession(opts: IBaseSingalCon, traceId: string): Promise<{
|
|
2076
|
+
code: number;
|
|
2077
|
+
data?: IGetCallSessionServerRes;
|
|
2078
|
+
}>;
|
|
2079
|
+
sysStatusUp(opts: ISysStatusUpOpts, traceId: string): Promise<{
|
|
2080
|
+
code: number;
|
|
2081
|
+
}>;
|
|
2082
|
+
upCallLogReaded(opts: IBaseSingalCon): Promise<{
|
|
2083
|
+
code: number;
|
|
2084
|
+
}>;
|
|
2085
|
+
/**
|
|
2086
|
+
* 清除用户正在呼叫中的通话会话(*非暴露接口,供调试酌情调用)
|
|
2087
|
+
*/
|
|
2088
|
+
endUserAbnormalCalls(opts: IEndAbnormalCallOpts): Promise<{
|
|
2089
|
+
code: number;
|
|
2090
|
+
}>;
|
|
2091
|
+
/** ======私有方法============================================================================================= */
|
|
2092
|
+
private _onIMConnectionStateChange;
|
|
2093
|
+
/**
|
|
2094
|
+
* call 信令发送
|
|
2095
|
+
* @param targetId 获取 call log (syncCallLog) 时传 userId, 其他 action 传 callId
|
|
2096
|
+
* @param key call server 定义 action
|
|
2097
|
+
* @param options action 携带参数,无参数传空字符串
|
|
2098
|
+
*/
|
|
2099
|
+
private _sendCallSignal;
|
|
2100
|
+
/**
|
|
2101
|
+
* call 信令接收
|
|
2102
|
+
*/
|
|
2103
|
+
private _onRecvCallSignal;
|
|
2104
|
+
/**
|
|
2105
|
+
* 根据 deviceId 判断数据是否应该下发
|
|
2106
|
+
* deviceId 为空字符串或 null 直接下发
|
|
2107
|
+
* deviceId 有具体的值,根据 deviceId 判断是否是己端的 deviceId
|
|
2108
|
+
*/
|
|
2109
|
+
private _isValidData;
|
|
2110
|
+
/**
|
|
2111
|
+
* 收到邀请
|
|
2112
|
+
* @param isDirectly 是否为直发信令
|
|
2113
|
+
*/
|
|
2114
|
+
private _onPubInviteCall;
|
|
2115
|
+
/**
|
|
2116
|
+
* 收到状态变更:响铃、忙碌、通话等待、对方未接听、己方未接听
|
|
2117
|
+
*/
|
|
2118
|
+
private _onStatusDownCall;
|
|
2119
|
+
/**
|
|
2120
|
+
* 收到通话事件变更:打开|关闭 摄像头
|
|
2121
|
+
*/
|
|
2122
|
+
private _onEventDownCall;
|
|
2123
|
+
/**
|
|
2124
|
+
* 收到通话调整事件及结果
|
|
2125
|
+
* 事件:媒体类型切换
|
|
2126
|
+
* 动作:请求、接受、拒绝、取消
|
|
2127
|
+
*/
|
|
2128
|
+
private _onDialogDownCall;
|
|
2129
|
+
/**
|
|
2130
|
+
* 通话结束后,日志下发
|
|
2131
|
+
*/
|
|
2132
|
+
private _onPubCallLog;
|
|
2133
|
+
/**
|
|
2134
|
+
* 补偿数据处理
|
|
2135
|
+
*/
|
|
2136
|
+
private _onConpensationData;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* 异常结束 call 处理存储类
|
|
2141
|
+
* 在呼出或呼入阶段的 call 进行本地存储,正常结束后清除
|
|
2142
|
+
* 异常结束后,本地取未清除的 callId, 通过服务接口清除异常结束的 call ,防止无法呼出或呼入
|
|
2143
|
+
*/
|
|
2144
|
+
declare class AbnormalCall {
|
|
2145
|
+
private readonly _logger;
|
|
2146
|
+
private _localStore;
|
|
2147
|
+
private static _STORAGE_KEY;
|
|
2148
|
+
constructor(runtime: IRuntime, _logger: BasicLogger);
|
|
2149
|
+
/**
|
|
2150
|
+
* 添加异常 callId
|
|
2151
|
+
*/
|
|
2152
|
+
addAbnormallCallId(userId: string, callId: string): void;
|
|
2153
|
+
/**
|
|
2154
|
+
* 删除异常 callId
|
|
2155
|
+
*/
|
|
2156
|
+
removeAbnormalCallIds(userId: string, callIds: string[]): void;
|
|
2157
|
+
/**
|
|
2158
|
+
* 获取异常结束的 callId 列表
|
|
2159
|
+
*/
|
|
2160
|
+
getAbnormalCallIds(userId: string): Promise<string[] | null>;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
declare class RCCallEngine extends EventEmitter {
|
|
2164
|
+
private readonly _context;
|
|
2165
|
+
private readonly _runtime;
|
|
2166
|
+
private readonly _initOpts;
|
|
2167
|
+
private readonly _logger;
|
|
2168
|
+
private readonly _reportAppEventModule;
|
|
2169
|
+
static __INNER_SESSION_CLOSE__: string;
|
|
2170
|
+
static __INNER_SESSION_CONNECT__: string;
|
|
2171
|
+
static __INNER_CHANGE_MEDIA_TYPE__: string;
|
|
2172
|
+
static __INNER_INVITE__: string;
|
|
2173
|
+
/**
|
|
2174
|
+
* 主 session
|
|
2175
|
+
*/
|
|
2176
|
+
private _mainSession;
|
|
2177
|
+
/**
|
|
2178
|
+
* 在通话中收到的 邀请 session
|
|
2179
|
+
*/
|
|
2180
|
+
private _holdSessions;
|
|
2181
|
+
/**
|
|
2182
|
+
* 信令模块
|
|
2183
|
+
*/
|
|
2184
|
+
_signalModule: SignalTransporter;
|
|
2185
|
+
/**
|
|
2186
|
+
* 异常结束 call 处理器
|
|
2187
|
+
*/
|
|
2188
|
+
_abnormalModule: AbnormalCall;
|
|
2189
|
+
/**
|
|
2190
|
+
* 记录单呼中,是否上报过第一帧
|
|
2191
|
+
* 置 true 时机:收到远端第一帧,成功上报 Server
|
|
2192
|
+
* 置 false 时机:通话结束
|
|
2193
|
+
*/
|
|
2194
|
+
private _isUpFirstFrameTime;
|
|
2195
|
+
/**
|
|
2196
|
+
* 通话为 ONCALL 时,SDK 需给业务层上报通话开始计时事件
|
|
2197
|
+
* 会收到多次 ONCALL,所以需要标识是否已抛过事件
|
|
2198
|
+
*/
|
|
2199
|
+
private _callStartMap;
|
|
2200
|
+
/**
|
|
2201
|
+
* 校时器
|
|
2202
|
+
*/
|
|
2203
|
+
_timeCorrectioner: TimeCorrectioner;
|
|
2204
|
+
/**
|
|
2205
|
+
* client callId
|
|
2206
|
+
*/
|
|
2207
|
+
private _clientCallId;
|
|
2208
|
+
/**
|
|
2209
|
+
* 构造器
|
|
2210
|
+
*/
|
|
2211
|
+
constructor(_context: PluginContext, _runtime: IRuntime, _initOpts: IRCCallInitOptions, _logger: BasicLogger, _reportAppEventModule: RCCallPlusReportModule);
|
|
2212
|
+
/**
|
|
2213
|
+
* 发起呼叫
|
|
2214
|
+
*/
|
|
2215
|
+
startCall(opts: IStartCallOpts, traceId: string): Promise<{
|
|
2216
|
+
code: number;
|
|
2217
|
+
data?: IStartCallResult;
|
|
2218
|
+
}>;
|
|
2219
|
+
/**
|
|
2220
|
+
* 通话中邀请
|
|
2221
|
+
*/
|
|
2222
|
+
invite(opts: IInviteOpts, traceId: string): Promise<{
|
|
2223
|
+
code: number;
|
|
2224
|
+
data?: IInviteRes;
|
|
2225
|
+
}>;
|
|
2226
|
+
/**
|
|
2227
|
+
* beforeHangup
|
|
2228
|
+
*/
|
|
2229
|
+
clearAllTimer(callId: string, traceId: string): void;
|
|
2230
|
+
/**
|
|
2231
|
+
* 挂断
|
|
2232
|
+
* 通话请求取消、通话拒绝
|
|
2233
|
+
*/
|
|
2234
|
+
hangup(opts: IHangupForBusyOpts, traceId: string): Promise<{
|
|
2235
|
+
code: number;
|
|
2236
|
+
}>;
|
|
2237
|
+
/**
|
|
2238
|
+
* 接收邀请
|
|
2239
|
+
* 通话中又收到新来电后,接听新来电时,必须先挂断之前的通话(mainSession)
|
|
2240
|
+
*/
|
|
2241
|
+
accept(opts: IAcceptOpts, traceId: string): Promise<{
|
|
2242
|
+
code: number;
|
|
2243
|
+
}>;
|
|
2244
|
+
/**
|
|
2245
|
+
* 直接加入
|
|
2246
|
+
*/
|
|
2247
|
+
joinCall(opts: IJoinCallOpts, traceId: string): Promise<{
|
|
2248
|
+
code: number;
|
|
2249
|
+
}>;
|
|
2250
|
+
/**
|
|
2251
|
+
* 通话媒体变更请求
|
|
2252
|
+
*/
|
|
2253
|
+
requestChangeMediaType(opts: IReqChangeMediaTypeOpts, traceId: string): Promise<{
|
|
2254
|
+
code: number;
|
|
2255
|
+
data?: IReqChangeMediaTypeRes;
|
|
2256
|
+
}>;
|
|
2257
|
+
/**
|
|
2258
|
+
* 通话媒体类型变更请求响应
|
|
2259
|
+
*/
|
|
2260
|
+
responseChangeMediaType(opts: IResChangeMediaTypeOpts, traceId: string): Promise<{
|
|
2261
|
+
code: number;
|
|
2262
|
+
}>;
|
|
2263
|
+
/**
|
|
2264
|
+
* 取消通话媒体类型切换请求
|
|
2265
|
+
*/
|
|
2266
|
+
cancelChangeMediaType(opts: ICancelChangeMediaTypeOpts, traceId: string): Promise<{
|
|
2267
|
+
code: number;
|
|
2268
|
+
}>;
|
|
2269
|
+
/**
|
|
2270
|
+
* 获取 call log 列表
|
|
2271
|
+
*/
|
|
2272
|
+
getCallLogList(opts: IGetCallLogListOpts, traceId: string): Promise<{
|
|
2273
|
+
code: number;
|
|
2274
|
+
data?: IRCCallPlusGetCallRecordRes;
|
|
2275
|
+
}>;
|
|
2276
|
+
/**
|
|
2277
|
+
* 批量删除通话日志
|
|
2278
|
+
*/
|
|
2279
|
+
deleteCallLog(callIds: string[], traceId: string): Promise<{
|
|
2280
|
+
code: number;
|
|
2281
|
+
}>;
|
|
2282
|
+
/**
|
|
2283
|
+
* 获取 call server 当前时间戳
|
|
2284
|
+
*/
|
|
2285
|
+
getCallServerTimestamp(traceId: string): Promise<{
|
|
2286
|
+
code: number;
|
|
2287
|
+
data?: number;
|
|
2288
|
+
}>;
|
|
2289
|
+
/**
|
|
2290
|
+
* 获取 call 时间信息
|
|
2291
|
+
*/
|
|
2292
|
+
getCallTimeInfo(callId: string, traceId: string): Promise<{
|
|
2293
|
+
code: number;
|
|
2294
|
+
data?: IGetCallTimeInfoRes;
|
|
2295
|
+
}>;
|
|
2296
|
+
/**
|
|
2297
|
+
* 获取未结束的通话列表
|
|
2298
|
+
*/
|
|
2299
|
+
getOpenCallList(traceId: string): Promise<{
|
|
2300
|
+
code: number;
|
|
2301
|
+
data?: IRCCallPlusCallRecord[];
|
|
2302
|
+
}>;
|
|
2303
|
+
/**
|
|
2304
|
+
* 清除当前用户的 call log
|
|
2305
|
+
*/
|
|
2306
|
+
removeAllCallLog(traceId: string): Promise<{
|
|
2307
|
+
code: number;
|
|
2308
|
+
}>;
|
|
2309
|
+
/**
|
|
2310
|
+
* 通过 callId 获取 session 详细信息
|
|
2311
|
+
*/
|
|
2312
|
+
getCallSession(opts: ICallId, traceId: string): Promise<{
|
|
2313
|
+
code: number;
|
|
2314
|
+
data?: IGetCallSessionRes;
|
|
2315
|
+
}>;
|
|
2316
|
+
getHoldSession(callId: string): RCCallPlusSession | null;
|
|
2317
|
+
/**
|
|
2318
|
+
* 获取当前主 session
|
|
2319
|
+
*/
|
|
2320
|
+
getLocalMainSession(): RCCallPlusSession | null;
|
|
2321
|
+
/**
|
|
2322
|
+
* 设置主 session 状态
|
|
2323
|
+
*/
|
|
2324
|
+
updateMainSessionState(state: RCCallPlusCallState): void;
|
|
2325
|
+
/**
|
|
2326
|
+
* 记录是否是本端挂断
|
|
2327
|
+
*/
|
|
2328
|
+
setIsLocalClientHangup(isLocalClientHangup: boolean): void;
|
|
2329
|
+
/**
|
|
2330
|
+
* 通知人员状态
|
|
2331
|
+
* CallClient 也需要更新人员状态,定义为公共函数
|
|
2332
|
+
*/
|
|
2333
|
+
updateUsersState(callId: string, users: ISessionUser[], traceId: string): void;
|
|
2334
|
+
setUserDeviceEnable(userId: string, mediaType: RCCallPlusMediaType, enable: boolean, traceId: string): void;
|
|
2335
|
+
/**
|
|
2336
|
+
* 获取通话开始时间
|
|
2337
|
+
*/
|
|
2338
|
+
getCallStaringTime(opts: ICallId, traceId: string): Promise<{
|
|
2339
|
+
code: number;
|
|
2340
|
+
duration?: number;
|
|
2341
|
+
clientStartTime?: number;
|
|
2342
|
+
}>;
|
|
2343
|
+
/**
|
|
2344
|
+
* 人员系统状态上报
|
|
2345
|
+
*/
|
|
2346
|
+
systemStatusUp(opts: ISysStatusUpOpts, traceId: string): Promise<{
|
|
2347
|
+
code: number;
|
|
2348
|
+
}>;
|
|
2349
|
+
/**
|
|
2350
|
+
* 单呼中收到远端流后,给 CallServer 上报,用于处理计时逻辑
|
|
2351
|
+
*/
|
|
2352
|
+
upFirstFrameTime(traceId: string): Promise<{
|
|
2353
|
+
code: number;
|
|
2354
|
+
}>;
|
|
2355
|
+
/**
|
|
2356
|
+
* 上层模拟 statusDownCall, 结束 session
|
|
2357
|
+
* 通话建立后,只能结束 mainSession
|
|
2358
|
+
*/
|
|
2359
|
+
endCurrentSession(currentUserSystemState: RCCallPlusReason, callId: string, traceId: string): void;
|
|
2360
|
+
/**
|
|
2361
|
+
* 上层 RTC 加入房间后重新开始校时
|
|
2362
|
+
*/
|
|
2363
|
+
startTimeCorrection(traceId: string): void;
|
|
2364
|
+
getDelayTimeInfo(): IGetDelayTimeInfoRes;
|
|
2365
|
+
/**
|
|
2366
|
+
* holdSession 升级为 mainSession
|
|
2367
|
+
*/
|
|
2368
|
+
upgradeMainSession(holdCallId: string): void;
|
|
2369
|
+
/**
|
|
2370
|
+
* 清除异常结束的 call
|
|
2371
|
+
*/
|
|
2372
|
+
endCurrentUserAbnormalCalls(allDevice: boolean): Promise<{
|
|
2373
|
+
code: number;
|
|
2374
|
+
}>;
|
|
2375
|
+
/** ======私有方法============================================================================================= */
|
|
2376
|
+
/**
|
|
2377
|
+
* IM 状态变更处理
|
|
2378
|
+
*/
|
|
2379
|
+
private _onIMStateChange;
|
|
2380
|
+
/**
|
|
2381
|
+
* 处理发起邀请、收到邀请后计时超时
|
|
2382
|
+
* 提前模拟 _onStatusDown, 不再依赖 CallServer 下发的 _onStatusDown
|
|
2383
|
+
* 处理网络异常情况下上报 CallServer 失败,CallServer 不会下发 _onStatusDown 情况
|
|
2384
|
+
*/
|
|
2385
|
+
private _handleCallTimeout;
|
|
2386
|
+
/**
|
|
2387
|
+
* 开启超时计时器
|
|
2388
|
+
*/
|
|
2389
|
+
private _startTimer;
|
|
2390
|
+
/**
|
|
2391
|
+
* 停止超时计时器
|
|
2392
|
+
*/
|
|
2393
|
+
private _stopTimer;
|
|
2394
|
+
/**
|
|
2395
|
+
* 收到 通话邀请
|
|
2396
|
+
*/
|
|
2397
|
+
private _onInvite;
|
|
2398
|
+
/**
|
|
2399
|
+
* 本端被邀请处理
|
|
2400
|
+
*/
|
|
2401
|
+
private _selfIsInviteeHandle;
|
|
2402
|
+
/**
|
|
2403
|
+
* 其他人被邀请处理
|
|
2404
|
+
*/
|
|
2405
|
+
private _othersIsInviteeHandle;
|
|
2406
|
+
/**
|
|
2407
|
+
* 收到 挂断(对方通话取消、通话拒绝)
|
|
2408
|
+
*/
|
|
2409
|
+
private _onHangup;
|
|
2410
|
+
/**
|
|
2411
|
+
* 收到 接听
|
|
2412
|
+
*/
|
|
2413
|
+
private _onAccept;
|
|
2414
|
+
/**
|
|
2415
|
+
* 收到状态下发
|
|
2416
|
+
*/
|
|
2417
|
+
private _onStatusDown;
|
|
2418
|
+
/**
|
|
2419
|
+
* 收到其他端的状态下发
|
|
2420
|
+
*/
|
|
2421
|
+
private _onOtherClientStatusDown;
|
|
2422
|
+
/**
|
|
2423
|
+
* 收到事件下发
|
|
2424
|
+
*/
|
|
2425
|
+
private _onEventDown;
|
|
2426
|
+
/**
|
|
2427
|
+
* 通知单呼 duration 变更
|
|
2428
|
+
*/
|
|
2429
|
+
private _onRecvSinCallDuration;
|
|
2430
|
+
/**
|
|
2431
|
+
* 收到媒体变更相关事件
|
|
2432
|
+
*/
|
|
2433
|
+
private _onSwitchMediaType;
|
|
2434
|
+
/**
|
|
2435
|
+
* 收到 call log 日志
|
|
2436
|
+
*/
|
|
2437
|
+
private _onRecvCallEndLog;
|
|
2438
|
+
/**
|
|
2439
|
+
* 通话结束
|
|
2440
|
+
*/
|
|
2441
|
+
private _onSessionClose;
|
|
2442
|
+
/**
|
|
2443
|
+
* 上报在线通话结束的 summary 消息
|
|
2444
|
+
*/
|
|
2445
|
+
private _reportCallPlusSummaryMessage;
|
|
2446
|
+
/**
|
|
2447
|
+
* 根据 callId 移除 session
|
|
2448
|
+
*/
|
|
2449
|
+
private _removeSession;
|
|
2450
|
+
/**
|
|
2451
|
+
* 不存在 mainSession 时,从服务端获取数据生成 mainSession, 并通知人员状态变更
|
|
2452
|
+
*/
|
|
2453
|
+
private _createSessionByServer;
|
|
2454
|
+
/**
|
|
2455
|
+
* 兼容移动端 onPhone 无法消除问题
|
|
2456
|
+
* A1 移动端和 B 正在 call 中,且 onPhone 状态, A1 杀进程后,B 端展示的 onPhone 状态无法消失
|
|
2457
|
+
* A2 多端在接听和直接加入 call 时,上报 onPhoneEnd 状态,消除 B 端展示的 onPhone 状态
|
|
2458
|
+
*/
|
|
2459
|
+
private _clearMobileOnPhone;
|
|
2460
|
+
private _onUserStateChange;
|
|
2461
|
+
private _onOtherMemberInvite;
|
|
2462
|
+
private _onRequestChangeMediaType;
|
|
2463
|
+
private _receiveMediaTypeChangeResult;
|
|
2464
|
+
private _onCallTypeChange;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
/**
|
|
2468
|
+
* 对外 session 实例,仅有获取方法,无法修改
|
|
2469
|
+
*/
|
|
2470
|
+
declare class RCCallPlusSession {
|
|
2471
|
+
private readonly _session;
|
|
2472
|
+
private readonly _callEngine;
|
|
2473
|
+
private readonly _logger;
|
|
2474
|
+
private _startTime;
|
|
2475
|
+
private _duration;
|
|
2476
|
+
private _callId;
|
|
2477
|
+
constructor(_session: RCCallInnerSession, _callEngine: RCCallEngine, _logger: BasicLogger);
|
|
2478
|
+
/**
|
|
2479
|
+
* 获取 CallId
|
|
2480
|
+
*/
|
|
2481
|
+
getCallId(): string;
|
|
2482
|
+
/**
|
|
2483
|
+
* 获取 session 状态
|
|
2484
|
+
*/
|
|
2485
|
+
getState(): RCCallPlusCallState;
|
|
2486
|
+
/**
|
|
2487
|
+
* 获取通话类型
|
|
2488
|
+
*/
|
|
2489
|
+
getCallType(): RCCallPlusType;
|
|
2490
|
+
/**
|
|
2491
|
+
* 获取通话媒体类型
|
|
2492
|
+
*/
|
|
2493
|
+
getMediaType(): RCCallPlusMediaType;
|
|
2494
|
+
/**
|
|
2495
|
+
* 获取通话人员列表
|
|
2496
|
+
*/
|
|
2497
|
+
getUserList(): {
|
|
2498
|
+
userId: string;
|
|
2499
|
+
state: RCCallPlusSessionUserState;
|
|
2500
|
+
}[];
|
|
2501
|
+
/**
|
|
2502
|
+
* 获取通话发起者 userId
|
|
2503
|
+
*/
|
|
2504
|
+
getCreatorUserId(): string;
|
|
2505
|
+
/**
|
|
2506
|
+
* 获取通话邀请者 userId
|
|
2507
|
+
* 呼入有值,呼出时,值为本地用户 UserId
|
|
2508
|
+
*/
|
|
2509
|
+
getInviterUserId(): string;
|
|
2510
|
+
/**
|
|
2511
|
+
* 获取通话起始时间
|
|
2512
|
+
*/
|
|
2513
|
+
getCreateTimestamp(): Promise<{
|
|
2514
|
+
code: number;
|
|
2515
|
+
startTime?: number;
|
|
2516
|
+
}>;
|
|
2517
|
+
/**
|
|
2518
|
+
* 获取通话时长
|
|
2519
|
+
* 通话未结束前,值为 0
|
|
2520
|
+
*/
|
|
2521
|
+
getDuration(): Promise<{
|
|
2522
|
+
code: number;
|
|
2523
|
+
duration?: number;
|
|
2524
|
+
}>;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* @enum
|
|
2529
|
+
*/
|
|
2530
|
+
declare const RCCallPlusCode: {
|
|
2531
|
+
/**
|
|
2532
|
+
* 成功
|
|
2533
|
+
*/
|
|
2534
|
+
readonly SUCCESS: 0;
|
|
2535
|
+
/**
|
|
2536
|
+
* 参数错误
|
|
2537
|
+
*/
|
|
2538
|
+
readonly PARAM_ERROR: 80001;
|
|
2539
|
+
/**
|
|
2540
|
+
* 存在未结束的 session
|
|
2541
|
+
*/
|
|
2542
|
+
readonly SESSION_EXIST: 80002;
|
|
2543
|
+
/**
|
|
2544
|
+
* 未加入通话
|
|
2545
|
+
*/
|
|
2546
|
+
readonly NOT_IN_CALL: 80003;
|
|
2547
|
+
/**
|
|
2548
|
+
* 媒体类型被禁止
|
|
2549
|
+
*/
|
|
2550
|
+
readonly MEDIATYPE_INVALID: 80004;
|
|
2551
|
+
/**
|
|
2552
|
+
* 当前不是视频通话
|
|
2553
|
+
*/
|
|
2554
|
+
readonly NOT_VIDEO_CALL: 80005;
|
|
2555
|
+
/**
|
|
2556
|
+
* 开通的音视频服务没有及时生效或音视频服务已关闭
|
|
2557
|
+
*/
|
|
2558
|
+
readonly RTC_SERVICE_UNAVAILABLE: 80006;
|
|
2559
|
+
/**
|
|
2560
|
+
* 调用函数时,传入的用户列表为空错误
|
|
2561
|
+
*/
|
|
2562
|
+
readonly USER_LIST_INVAILD: 80007;
|
|
2563
|
+
/**
|
|
2564
|
+
* 调用函数时,传入的通话 Id 为空错误
|
|
2565
|
+
*/
|
|
2566
|
+
readonly CALL_ID_INVALID: 80008;
|
|
2567
|
+
/**
|
|
2568
|
+
* 事务 Id 为空错误
|
|
2569
|
+
*/
|
|
2570
|
+
readonly TRANSACTION_ID_INVALID: 80009;
|
|
2571
|
+
/**
|
|
2572
|
+
* 调用函数时,传入的用户 Id 为空错误
|
|
2573
|
+
*/
|
|
2574
|
+
readonly USER_ID_INVALID: 80010;
|
|
2575
|
+
/**
|
|
2576
|
+
* 发起单人呼叫时,人员列表中只能有一个人
|
|
2577
|
+
*/
|
|
2578
|
+
readonly SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON: 80011;
|
|
2579
|
+
/**
|
|
2580
|
+
* im 未连接
|
|
2581
|
+
*/
|
|
2582
|
+
readonly SIGNAL_DISCONNECTED: 80012;
|
|
2583
|
+
/**
|
|
2584
|
+
* 摄像头未打开
|
|
2585
|
+
*/
|
|
2586
|
+
readonly CAMERA_CLOSED: 80100;
|
|
2587
|
+
/**
|
|
2588
|
+
* 麦克风未打开
|
|
2589
|
+
*/
|
|
2590
|
+
readonly MICROPHONE_CLOSED: 80101;
|
|
2591
|
+
/**
|
|
2592
|
+
* 无媒体资源
|
|
2593
|
+
*/
|
|
2594
|
+
readonly MEDIA_RESOURCE_INVALIED: 80102;
|
|
2595
|
+
/**
|
|
2596
|
+
* 未 install RTC 插件
|
|
2597
|
+
*/
|
|
2598
|
+
readonly NOT_INSTALL_RTC_PLUGIN: 80103;
|
|
2599
|
+
/**
|
|
2600
|
+
* 播放异常
|
|
2601
|
+
*/
|
|
2602
|
+
readonly PLAY_MEDIA_FAILED: 80104;
|
|
2603
|
+
/**
|
|
2604
|
+
* 播放视频需要 video 元素
|
|
2605
|
+
*/
|
|
2606
|
+
readonly VIDEO_VIEW_NOT_SET: 80105;
|
|
2607
|
+
};
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* callPlus 初始化参数
|
|
2611
|
+
*/
|
|
2612
|
+
interface ICallPlusInitOpts {
|
|
2613
|
+
/**
|
|
2614
|
+
* Web RTCLib 实例引用,必填
|
|
2615
|
+
*/
|
|
2616
|
+
rtcClient: RCRTCClient;
|
|
2617
|
+
/**
|
|
2618
|
+
* 定义 callplus SDK 内部的日志输出等级,默认值 LogL.WARN
|
|
2619
|
+
*/
|
|
2620
|
+
logOutputLevel?: EnableLogL;
|
|
2621
|
+
/**
|
|
2622
|
+
* 是否发布小流
|
|
2623
|
+
*/
|
|
2624
|
+
isPubTiny?: boolean;
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* 通话记录的消息 content 字段
|
|
2628
|
+
*/
|
|
2629
|
+
interface IRCCallPlusSummaryMessageContent {
|
|
2630
|
+
/**
|
|
2631
|
+
* 唯一通话标识
|
|
2632
|
+
*/
|
|
2633
|
+
callId: string;
|
|
2634
|
+
/**
|
|
2635
|
+
* 通话发起者 userId
|
|
2636
|
+
*/
|
|
2637
|
+
callerUserId: string;
|
|
2638
|
+
/**
|
|
2639
|
+
* 通话对方 targetId
|
|
2640
|
+
*/
|
|
2641
|
+
targetId: string;
|
|
2642
|
+
/**
|
|
2643
|
+
* 媒体类型:0 音频、1 音视频
|
|
2644
|
+
*/
|
|
2645
|
+
mediaType: RCCallPlusMediaType;
|
|
2646
|
+
/**
|
|
2647
|
+
* 收到首帧时间
|
|
2648
|
+
*/
|
|
2649
|
+
firstFrameTime: number;
|
|
2650
|
+
/**
|
|
2651
|
+
* 通话开始时间
|
|
2652
|
+
*/
|
|
2653
|
+
callStartTime: number;
|
|
2654
|
+
/**
|
|
2655
|
+
* 通话结束时间
|
|
2656
|
+
*/
|
|
2657
|
+
callEndTime: number;
|
|
2658
|
+
/**
|
|
2659
|
+
* 通话挂断原因
|
|
2660
|
+
*/
|
|
2661
|
+
hangupReason: RCCallPlusReason;
|
|
2662
|
+
}
|
|
2663
|
+
/**
|
|
2664
|
+
* 通话记录的消息结构定义
|
|
2665
|
+
*/
|
|
2666
|
+
interface IRCCallPlusReceivedSummaryMessage extends IReceivedMessage {
|
|
2667
|
+
}
|
|
2668
|
+
/**
|
|
2669
|
+
* callPlus 对外事件定义
|
|
2670
|
+
*/
|
|
2671
|
+
interface ICallPlusEventListener {
|
|
2672
|
+
/**
|
|
2673
|
+
* 呼入通知
|
|
2674
|
+
* 收到呼入时,可选择接听或挂断通话
|
|
2675
|
+
* @param session 通话实例
|
|
2676
|
+
* @param extra 透传呼叫方发起呼叫时携带的附加信息
|
|
2677
|
+
*/
|
|
2678
|
+
onReceivedCall(session: RCCallPlusSession, extra?: string): void;
|
|
2679
|
+
/**
|
|
2680
|
+
* 群组通话收到远端人员被邀请加入通话通知,如 A 与 B 通话中,A 邀请 C,则 B 会收到此回调
|
|
2681
|
+
* @param inviteeUserList - 受邀人用户 ID 列表
|
|
2682
|
+
* @param inviterUserId - 邀请者用户 ID
|
|
2683
|
+
* @param callId - 所属通话;群聊中,己方已不在通话中的情况下,也会收到服务侧的事件通知
|
|
2684
|
+
*/
|
|
2685
|
+
onRemoteUserInvited(inviteeUserList: string[], inviterUserId: string, callId: string): void;
|
|
2686
|
+
/**
|
|
2687
|
+
* 通话已建立,sdk 内部会发布音视频资源
|
|
2688
|
+
*/
|
|
2689
|
+
onCallConnected(session: RCCallPlusSession): void;
|
|
2690
|
+
/**
|
|
2691
|
+
* 收到某个人的音频或视频可播放
|
|
2692
|
+
* 业务层可调 playMedia(userId, mediaType) 播放
|
|
2693
|
+
* @param userId 用户 id
|
|
2694
|
+
* @param mediaType 媒体类型
|
|
2695
|
+
*/
|
|
2696
|
+
onUserMediaAvailable(userId: string, mediaType: RCCallPlusMediaType): void;
|
|
2697
|
+
/**
|
|
2698
|
+
* 通话结束(群组通话时,客户端挂断不代表通话结束)
|
|
2699
|
+
* @param session 通话实例
|
|
2700
|
+
* @param reason 通话结束原因
|
|
2701
|
+
*/
|
|
2702
|
+
onCallEnded(session: RCCallPlusSession, reason: RCCallPlusReason): void;
|
|
2703
|
+
/**
|
|
2704
|
+
* 通话类型变更
|
|
2705
|
+
* @param type 单呼或群呼
|
|
2706
|
+
* @param callId 通话 id
|
|
2707
|
+
*/
|
|
2708
|
+
onCallTypeChanged?(type: RCCallPlusType, callId: string): void;
|
|
2709
|
+
/**
|
|
2710
|
+
* 人员状态变更
|
|
2711
|
+
* @param callId 通话 id
|
|
2712
|
+
* @param userId 状态变更人员 id
|
|
2713
|
+
* @param state 人员变更后状态
|
|
2714
|
+
* @param reason 变更原因
|
|
2715
|
+
* @param extra 透传远端人员接听、挂断时携带的附加信息
|
|
2716
|
+
*/
|
|
2717
|
+
onRemoteUserStateChanged?(callId: string, userId: string, state: RCCallPlusSessionUserState, reason?: RCCallPlusReason): void;
|
|
2718
|
+
/**
|
|
2719
|
+
* 远端摄像头开、关通知
|
|
2720
|
+
* @param callId 通话 id
|
|
2721
|
+
* @param userId 用户 id
|
|
2722
|
+
* @param disabled 是否关闭
|
|
2723
|
+
*/
|
|
2724
|
+
onRemoteCameraStateChanged?(callId: string, userId: string, disabled: boolean): void;
|
|
2725
|
+
/**
|
|
2726
|
+
* 远端麦克风开、关通知
|
|
2727
|
+
* @param callId 通话 id
|
|
2728
|
+
* @param userId 用户 id
|
|
2729
|
+
* @param disabled 是否关闭
|
|
2730
|
+
*/
|
|
2731
|
+
onRemoteMicrophoneStateChanged?(callId: string, userId: string, disabled: boolean): void;
|
|
2732
|
+
/**
|
|
2733
|
+
* 单呼或群呼结束后,服务器下发的通话日志
|
|
2734
|
+
* @param record 数据接口定义为:IRCCallPlusCallRecord,可通过 apiDoc 查看具体包含字段
|
|
2735
|
+
*/
|
|
2736
|
+
onReceivedCallRecord?(record: IRCCallPlusCallRecord): void;
|
|
2737
|
+
/**
|
|
2738
|
+
* 收到媒体类型变更请求(仅单聊)
|
|
2739
|
+
* @param userId 请求发起人
|
|
2740
|
+
* @param transactionId 事物 id,本次请求和应答的唯一标识
|
|
2741
|
+
* @param mediaType 请求变更的媒体类型
|
|
2742
|
+
*/
|
|
2743
|
+
onReceivedChangeMediaTypeRequest?(userId: string, transactionId: string, mediaType: RCCallPlusMediaType): void;
|
|
2744
|
+
/**
|
|
2745
|
+
* 媒体类型变更结果(仅单聊)
|
|
2746
|
+
* @param info.userId
|
|
2747
|
+
* @param info.transactionId 事物 id,本次请求和应答的唯一标识
|
|
2748
|
+
* @param info.mediaType 最终的媒体类型
|
|
2749
|
+
* @param info.code - 升级结果
|
|
2750
|
+
* - 请求方取消媒体类型变更
|
|
2751
|
+
* - 应答方拒绝媒体类型切换
|
|
2752
|
+
* - 服务仲裁允许媒体类型切换
|
|
2753
|
+
*/
|
|
2754
|
+
onReceivedChangeMediaTypeResult?(info: {
|
|
2755
|
+
userId: string;
|
|
2756
|
+
transactionId: string;
|
|
2757
|
+
mediaType: RCCallPlusMediaType;
|
|
2758
|
+
code: RCCallPlusMediaTypeChangeResult;
|
|
2759
|
+
}): void;
|
|
2760
|
+
/**
|
|
2761
|
+
* 收到通话开始计时
|
|
2762
|
+
* @param info.callId 通话 id
|
|
2763
|
+
* @param info.callType 单聊或群聊
|
|
2764
|
+
* @param info.callStartTime 通话开始时间
|
|
2765
|
+
*/
|
|
2766
|
+
onReceivedCallStartTime?(info: {
|
|
2767
|
+
callId: string;
|
|
2768
|
+
callType: RCCallPlusType;
|
|
2769
|
+
callStartTime: number;
|
|
2770
|
+
}): void;
|
|
2771
|
+
/**
|
|
2772
|
+
* 收到首帧时间
|
|
2773
|
+
* 收到首帧开始计费
|
|
2774
|
+
* @param callId 通话 id
|
|
2775
|
+
* @param callFirstFrameTime 通话首帧到达时间
|
|
2776
|
+
*/
|
|
2777
|
+
onReceivedCallFirstFrameTime?(callId: string, callFirstFrameTime: number): void;
|
|
2778
|
+
/**
|
|
2779
|
+
* 获取远端媒体资源失败
|
|
2780
|
+
* @param userId 远端人员 id
|
|
2781
|
+
* @param code 失败原因
|
|
2782
|
+
*/
|
|
2783
|
+
onFetchRemoteMediaError?(userId: string, code: number): void;
|
|
2784
|
+
/**
|
|
2785
|
+
* 人员音量变化
|
|
2786
|
+
* @param userId 本端或远端人员 id
|
|
2787
|
+
* @param audioLevel 音量值(0-100)
|
|
2788
|
+
*/
|
|
2789
|
+
onUserAudioLevelChanged?(userId: string, audioLevel: number): void;
|
|
2790
|
+
/**
|
|
2791
|
+
* 收到通话结束的消息记录,可用于在 IM 聊天界面插入通话结束消息
|
|
2792
|
+
* 仅单聊可收到
|
|
2793
|
+
* 触发时机:
|
|
2794
|
+
* 1.单聊在线通话结束后
|
|
2795
|
+
* 2.离线时收到单聊呼叫,通话结束后,重新连接 IM 在线时
|
|
2796
|
+
* @param message 通话记录的消息体
|
|
2797
|
+
*/
|
|
2798
|
+
onReceivedCallPlusSummaryMessage?(message: IRCCallPlusReceivedSummaryMessage): void;
|
|
2799
|
+
}
|
|
2800
|
+
/**
|
|
2801
|
+
* 通话前视频配置
|
|
2802
|
+
*/
|
|
2803
|
+
interface IVideoConfig {
|
|
2804
|
+
/**
|
|
2805
|
+
* 摄像头设备 ID
|
|
2806
|
+
*/
|
|
2807
|
+
cameraId?: string;
|
|
2808
|
+
/**
|
|
2809
|
+
* 帧率
|
|
2810
|
+
*/
|
|
2811
|
+
frameRate: RCFrameRate;
|
|
2812
|
+
/**
|
|
2813
|
+
* 分辨率
|
|
2814
|
+
*/
|
|
2815
|
+
resolution: RCResolution;
|
|
2816
|
+
/**
|
|
2817
|
+
* 最小码率
|
|
2818
|
+
*/
|
|
2819
|
+
minBitrate?: number;
|
|
2820
|
+
/**
|
|
2821
|
+
* 最大码率
|
|
2822
|
+
*/
|
|
2823
|
+
maxBitrate?: number;
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* 通话前音频配置
|
|
2827
|
+
*/
|
|
2828
|
+
interface IAudioConfig {
|
|
2829
|
+
/**
|
|
2830
|
+
* 麦克风设备 ID
|
|
2831
|
+
*/
|
|
2832
|
+
microphoneId?: string;
|
|
2833
|
+
/**
|
|
2834
|
+
* 采样率
|
|
2835
|
+
*/
|
|
2836
|
+
sampleRate?: number;
|
|
2837
|
+
/**
|
|
2838
|
+
* 最小码率
|
|
2839
|
+
*/
|
|
2840
|
+
minBitrate?: number;
|
|
2841
|
+
/**
|
|
2842
|
+
* 最大码率
|
|
2843
|
+
*/
|
|
2844
|
+
maxBitrate?: number;
|
|
2845
|
+
}
|
|
2846
|
+
/**
|
|
2847
|
+
* 视频配置构建器
|
|
2848
|
+
*/
|
|
2849
|
+
interface IVideoConfigBuilder {
|
|
2850
|
+
/**
|
|
2851
|
+
* 针对不同视频流分别配置帧率
|
|
2852
|
+
*/
|
|
2853
|
+
setFrameRate(fps: number, tag: string): IVideoConfigBuilder;
|
|
2854
|
+
/**
|
|
2855
|
+
* 针对不同视频流分别配置分辨率
|
|
2856
|
+
*/
|
|
2857
|
+
setVideoResolution(width: number, height: number, tag: string): IVideoConfigBuilder;
|
|
2858
|
+
/**
|
|
2859
|
+
* 设置默认 cameraId,作用域预览功能、呼叫取流等
|
|
2860
|
+
*/
|
|
2861
|
+
setDefaultCameraId(cameraId: string): IVideoConfigBuilder;
|
|
2862
|
+
setBitrate(min: number, max: number, tag: string): IVideoConfigBuilder;
|
|
2863
|
+
build(): IVideoConfig;
|
|
2864
|
+
}
|
|
2865
|
+
/**
|
|
2866
|
+
* 音频配置构建器
|
|
2867
|
+
*/
|
|
2868
|
+
interface IAudioConfigBuilder {
|
|
2869
|
+
/**
|
|
2870
|
+
* 指定默认麦克风
|
|
2871
|
+
*/
|
|
2872
|
+
setDefaultMicrophoneId(microphoneId: string): IAudioConfigBuilder;
|
|
2873
|
+
setBitrate(min: number, max: number, tag: string): IAudioConfigBuilder;
|
|
2874
|
+
/**
|
|
2875
|
+
* 构建配置
|
|
2876
|
+
*/
|
|
2877
|
+
build(): IAudioConfig;
|
|
2878
|
+
}
|
|
2879
|
+
interface ICallOpts {
|
|
2880
|
+
/**
|
|
2881
|
+
* 被叫人员 UserId 列表,单聊时需要验证长度为 1
|
|
2882
|
+
*/
|
|
2883
|
+
userIds: string[];
|
|
2884
|
+
/**
|
|
2885
|
+
* 通话媒体类型:音频 or 音视频
|
|
2886
|
+
*/
|
|
2887
|
+
mediaType: RCCallPlusMediaType;
|
|
2888
|
+
/**
|
|
2889
|
+
* 单人呼叫 or 多人呼叫
|
|
2890
|
+
*/
|
|
2891
|
+
type: RCCallPlusType;
|
|
2892
|
+
}
|
|
2893
|
+
interface RCCallPlusPacketLossStats {
|
|
2894
|
+
/**
|
|
2895
|
+
* 丢包率:取值范围是 0-100
|
|
2896
|
+
*/
|
|
2897
|
+
packetLostRate: number;
|
|
2898
|
+
/**
|
|
2899
|
+
* 码率大小,单位是 kbps
|
|
2900
|
+
*/
|
|
2901
|
+
bitRate: number;
|
|
2902
|
+
}
|
|
2903
|
+
/**
|
|
2904
|
+
* RTC 音视频质量数据、音量上报接口
|
|
2905
|
+
*/
|
|
2906
|
+
interface IStatusReportListener {
|
|
2907
|
+
/**
|
|
2908
|
+
* 发送丢包率信息回调,每秒回调一次
|
|
2909
|
+
* @param packetLostRate 丢包率,0-100
|
|
2910
|
+
* @param delay 发送端的网络延迟,单位毫秒
|
|
2911
|
+
*/
|
|
2912
|
+
onSendPacketLoss(packetLostRate: number, delay: number): void;
|
|
2913
|
+
/**
|
|
2914
|
+
* 接收丢包率信息回调,每秒回调一次
|
|
2915
|
+
* @param data key: userId, value: 接收丢包统计数据
|
|
2916
|
+
* @param data[userId].packetLostRate 丢包率:取值范围是 0-100
|
|
2917
|
+
* @param data[userId].bitRate 码率大小,单位是 kbps
|
|
2918
|
+
*/
|
|
2919
|
+
onReceivePacketLoss(data: {
|
|
2920
|
+
[userId: string]: RCCallPlusPacketLossStats;
|
|
2921
|
+
}): void;
|
|
2922
|
+
}
|
|
2923
|
+
/**
|
|
2924
|
+
* 人员及人员状态
|
|
2925
|
+
*/
|
|
2926
|
+
interface RCCallPlusCallUser {
|
|
2927
|
+
userId: string;
|
|
2928
|
+
state: RCCallPlusSessionUserState;
|
|
2929
|
+
}
|
|
2930
|
+
/**
|
|
2931
|
+
* 推送信息配置项
|
|
2932
|
+
*/
|
|
2933
|
+
interface IRCCallPlusPushConfig {
|
|
2934
|
+
/**
|
|
2935
|
+
* 推送标题
|
|
2936
|
+
*/
|
|
2937
|
+
pushTitle: string;
|
|
2938
|
+
/**
|
|
2939
|
+
* iOSConfig
|
|
2940
|
+
*/
|
|
2941
|
+
iOSConfig?: IiOSPushConfig;
|
|
2942
|
+
/**
|
|
2943
|
+
* androidConfig
|
|
2944
|
+
*/
|
|
2945
|
+
androidConfig?: IAndroidPushConfig;
|
|
2946
|
+
/**
|
|
2947
|
+
* 是否显示推送标题. 仅针对 iOS 平台有效
|
|
2948
|
+
*/
|
|
2949
|
+
disablePushTitle?: boolean;
|
|
2950
|
+
/**
|
|
2951
|
+
* 推送模板id
|
|
2952
|
+
*/
|
|
2953
|
+
templateId?: string;
|
|
2954
|
+
}
|
|
2955
|
+
/**
|
|
2956
|
+
* ios 推送配置
|
|
2957
|
+
*/
|
|
2958
|
+
interface IiOSPushConfig {
|
|
2959
|
+
/**
|
|
2960
|
+
* iOS 用于通知分组的 id
|
|
2961
|
+
*/
|
|
2962
|
+
threadId?: string;
|
|
2963
|
+
/**
|
|
2964
|
+
* iOS 用于通知覆盖的 id
|
|
2965
|
+
*/
|
|
2966
|
+
apnsCollapseId?: string;
|
|
2967
|
+
/**
|
|
2968
|
+
* 和 category 对应
|
|
2969
|
+
*/
|
|
2970
|
+
richMediaUri?: string;
|
|
2971
|
+
}
|
|
2972
|
+
/**
|
|
2973
|
+
* 安卓推送配置
|
|
2974
|
+
*/
|
|
2975
|
+
interface IAndroidPushConfig {
|
|
2976
|
+
/**
|
|
2977
|
+
* 小米的 channelId
|
|
2978
|
+
*/
|
|
2979
|
+
channelIdMi?: string;
|
|
2980
|
+
/**
|
|
2981
|
+
* 小米 Large icon 链接
|
|
2982
|
+
* Large icon 可以出现在大图版和多字版消息中,显示在右边。
|
|
2983
|
+
* 国内版仅 MIUI12 以上版本支持,以下版本均不支持;国际版支持。
|
|
2984
|
+
* 图片要求:大小 120 * 120px,格式为 png 或者 jpg 格式。
|
|
2985
|
+
* @deprecated 由于小米官方已停止支持该能力,该字段已失效
|
|
2986
|
+
*/
|
|
2987
|
+
miLargeIconUrl?: string;
|
|
2988
|
+
/**
|
|
2989
|
+
* 华为的 channelId
|
|
2990
|
+
*/
|
|
2991
|
+
channelIdHW?: string;
|
|
2992
|
+
/**
|
|
2993
|
+
* 华为推送消息分类
|
|
2994
|
+
* 更多信息请参考华为消息分类标准文档: https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/message-classification-0000001149358835
|
|
2995
|
+
*/
|
|
2996
|
+
categoryHW?: string;
|
|
2997
|
+
/**
|
|
2998
|
+
* 华为推送消息级别
|
|
2999
|
+
* LOW: 表示消息为资讯营销
|
|
3000
|
+
* NORMAL: 消息为服务与通讯
|
|
3001
|
+
*/
|
|
3002
|
+
importanceHW?: 'NORMAL' | 'LOW';
|
|
3003
|
+
/**
|
|
3004
|
+
* 华为通知类型的推送所使用的通知图片 url
|
|
3005
|
+
*/
|
|
3006
|
+
imageUrlHW?: string;
|
|
3007
|
+
/**
|
|
3008
|
+
* OPPO 的 channelId
|
|
3009
|
+
*/
|
|
3010
|
+
channelIdOPPO?: string;
|
|
3011
|
+
/**
|
|
3012
|
+
* vivo 的类型
|
|
3013
|
+
*/
|
|
3014
|
+
typeVivo?: string;
|
|
3015
|
+
/**
|
|
3016
|
+
* Vivo 分类
|
|
3017
|
+
* 即时消息[IM],账号与资产[ACCOUNT],日程待办[TODO],设备信息[DEVICE_REMINDER],订单与物流[ORDER],订阅提醒[SUBSCRIPTION]
|
|
3018
|
+
* 运营消息分类
|
|
3019
|
+
* 新闻[NEWS],内容推荐[CONTENT],运营活动[MARKETING],社交动态[SOCIAL]
|
|
3020
|
+
*/
|
|
3021
|
+
categoryVivo?: string;
|
|
3022
|
+
/**
|
|
3023
|
+
* FCM 推送平台渠道 ID
|
|
3024
|
+
*/
|
|
3025
|
+
fcmChannelId?: string;
|
|
3026
|
+
/**
|
|
3027
|
+
* FCM 通知类型推送时所使用的分组 id
|
|
3028
|
+
*/
|
|
3029
|
+
fcmCollapseKey?: string;
|
|
3030
|
+
/**
|
|
3031
|
+
* FCM 通知类型的推送所使用的通知图片 url
|
|
3032
|
+
*/
|
|
3033
|
+
fcmImageUrl?: string;
|
|
3034
|
+
/**
|
|
3035
|
+
* HONOR 推送级别
|
|
3036
|
+
* LOW: 资讯营销类消息,NORMAL: 服务与通讯类消息
|
|
3037
|
+
*/
|
|
3038
|
+
importanceHonor?: 'NORMAL' | 'LOW';
|
|
3039
|
+
/**
|
|
3040
|
+
* HONOR 推送所使用的通知图片 url
|
|
3041
|
+
*/
|
|
3042
|
+
imageUrlHonor?: string;
|
|
3043
|
+
}
|
|
3044
|
+
/**
|
|
3045
|
+
* 服务端需要的 pushConfig 数据格式
|
|
3046
|
+
*/
|
|
3047
|
+
interface IServerPushExt {
|
|
3048
|
+
title: string;
|
|
3049
|
+
templateId: string;
|
|
3050
|
+
pushId: string;
|
|
3051
|
+
disableTitle: boolean;
|
|
3052
|
+
forceShowPushContent: boolean;
|
|
3053
|
+
pushConfigs: {
|
|
3054
|
+
[key: string]: any;
|
|
3055
|
+
}[];
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
declare class RCAudioConfigBuilder {
|
|
3059
|
+
private _logger;
|
|
3060
|
+
private _audioConfig;
|
|
3061
|
+
constructor(_logger: BasicLogger);
|
|
3062
|
+
/**
|
|
3063
|
+
* 指定默认麦克风
|
|
3064
|
+
* microphoneId 取值可参考 https://doc.rongcloud.cn/rtc/Web/5.X/device#%E8%8E%B7%E5%8F%96%E9%BA%A6%E5%85%8B%E9%A3%8E%E8%AE%BE%E5%A4%87%E5%88%97%E8%A1%A8
|
|
3065
|
+
*/
|
|
3066
|
+
setDefaultMicrophoneId(microphoneId: string): RCAudioConfigBuilder;
|
|
3067
|
+
/**
|
|
3068
|
+
* 设置最小、最大码率
|
|
3069
|
+
* 单位 kbps
|
|
3070
|
+
* 不设置时,取动态码率计算结果
|
|
3071
|
+
* @param min 最小码率
|
|
3072
|
+
* @param max 最大码率
|
|
3073
|
+
*/
|
|
3074
|
+
setBitrate(min: number, max: number): RCAudioConfigBuilder;
|
|
3075
|
+
/**
|
|
3076
|
+
* 设置音频采样率,不建议自行修改
|
|
3077
|
+
* @param sampleRate 采样率
|
|
3078
|
+
*/
|
|
3079
|
+
setSampleRate(sampleRate: number): RCAudioConfigBuilder;
|
|
3080
|
+
/** 构建配置 */
|
|
3081
|
+
build(): IAudioConfig;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
declare class RCVideoConfigBuilder {
|
|
3085
|
+
private _logger;
|
|
3086
|
+
private _videoConfig;
|
|
3087
|
+
constructor(_logger: BasicLogger);
|
|
3088
|
+
/** 针对不同视频流分别配置帧率 */
|
|
3089
|
+
setFrameRate(fps: RCFrameRate): RCVideoConfigBuilder;
|
|
3090
|
+
/** 针对不同视频流分别配置分辨率 */
|
|
3091
|
+
setVideoResolution(resolution: RCResolution): RCVideoConfigBuilder;
|
|
3092
|
+
/**
|
|
3093
|
+
* 设置默认 cameraId
|
|
3094
|
+
* cameraId 取值可参考 https://doc.rongcloud.cn/rtc/Web/5.X/device#%E8%8E%B7%E5%8F%96%E6%91%84%E5%83%8F%E5%A4%B4%E8%AE%BE%E5%A4%87%E5%88%97%E8%A1%A8
|
|
3095
|
+
* 作用于预览功能、呼叫取流等
|
|
3096
|
+
*/
|
|
3097
|
+
setDefaultCameraId(cameraId: string): RCVideoConfigBuilder;
|
|
3098
|
+
/**
|
|
3099
|
+
* 设置最小、最大码率
|
|
3100
|
+
* 单位 kbps
|
|
3101
|
+
* 不设置时,取动态码率计算结果
|
|
3102
|
+
* @param min 最小码率
|
|
3103
|
+
* @param max 最大码率
|
|
3104
|
+
*/
|
|
3105
|
+
setBitrate(min: number, max: number): RCVideoConfigBuilder;
|
|
3106
|
+
build(): IVideoConfig;
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
declare class RCCallPlusAndroidPushConfigBuilder {
|
|
3110
|
+
private _logger;
|
|
3111
|
+
private _androidPushConfig;
|
|
3112
|
+
constructor(_logger: BasicLogger);
|
|
3113
|
+
/**
|
|
3114
|
+
* 设置小米的 channelId
|
|
3115
|
+
*/
|
|
3116
|
+
setChannelIdMi(channelIdMi: string): this;
|
|
3117
|
+
/**
|
|
3118
|
+
* 设置小米 Large icon 链接
|
|
3119
|
+
* @deprecated 由于小米官方已停止支持该能力,该方法已失效
|
|
3120
|
+
*/
|
|
3121
|
+
setMiLargeIconUrl(miLargeIconUrl: string): this;
|
|
3122
|
+
/**
|
|
3123
|
+
* 设置华为的 channelId
|
|
3124
|
+
*/
|
|
3125
|
+
setChannelIdHW(channelIdHW: string): this;
|
|
3126
|
+
/**
|
|
3127
|
+
* 设置华为推送消息分类
|
|
3128
|
+
*/
|
|
3129
|
+
setCategoryHW(categoryHW: string): this;
|
|
3130
|
+
/**
|
|
3131
|
+
* 设置华为推送消息级别
|
|
3132
|
+
*/
|
|
3133
|
+
setImportanceHW(importanceHW: 'NORMAL' | 'LOW'): this;
|
|
3134
|
+
/**
|
|
3135
|
+
* 设置华为通知类型的推送所使用的通知图片 url
|
|
3136
|
+
*/
|
|
3137
|
+
setImageUrlHW(imageUrlHW: string): this;
|
|
3138
|
+
/**
|
|
3139
|
+
* 设置 OPPO 的 channelId
|
|
3140
|
+
*/
|
|
3141
|
+
setChannelIdOPPO(channelIdOPPO: string): this;
|
|
3142
|
+
/**
|
|
3143
|
+
* 设置 vivo 的类型
|
|
3144
|
+
*/
|
|
3145
|
+
setTypeVivo(typeVivo: string): this;
|
|
3146
|
+
/**
|
|
3147
|
+
* 设置 Vivo 分类
|
|
3148
|
+
*/
|
|
3149
|
+
setCategoryVivo(categoryVivo: string): this;
|
|
3150
|
+
/**
|
|
3151
|
+
* 设置 FCM 推送平台渠道 ID
|
|
3152
|
+
*/
|
|
3153
|
+
setFcmChannelId(fcmChannelId: string): this;
|
|
3154
|
+
/**
|
|
3155
|
+
* 设置 FCM 通知类型推送时所使用的分组 id
|
|
3156
|
+
*/
|
|
3157
|
+
setFcmCollapseKey(fcmCollapseKey: string): this;
|
|
3158
|
+
/**
|
|
3159
|
+
* 设置 FCM 通知类型的推送所使用的通知图片 url
|
|
3160
|
+
*/
|
|
3161
|
+
setFcmImageUrl(fcmImageUrl: string): this;
|
|
3162
|
+
/**
|
|
3163
|
+
* 设置 HONOR 推送级别
|
|
3164
|
+
* LOW: 资讯营销类消息,NORMAL: 服务与通讯类消息
|
|
3165
|
+
*/
|
|
3166
|
+
setimportanceHonor(importanceHonor: 'NORMAL' | 'LOW'): this;
|
|
3167
|
+
/**
|
|
3168
|
+
* 设置 HONOR 推送所使用的通知图片 url
|
|
3169
|
+
*/
|
|
3170
|
+
setimageUrlHonor(imageUrlHonor: string): this;
|
|
3171
|
+
/**
|
|
3172
|
+
* 构建 IAndroidPushConfig
|
|
3173
|
+
<<<<<<< HEAD
|
|
3174
|
+
=======
|
|
3175
|
+
* @returns IAndroidPushConfig 安卓推送配置数据
|
|
3176
|
+
* 返回值需传入 startCall、invite、hangup 方法的 pushConfig.androidConfig 中
|
|
3177
|
+
>>>>>>> develop
|
|
3178
|
+
*/
|
|
3179
|
+
build(): IAndroidPushConfig;
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
declare class RCCallPlusClient {
|
|
3183
|
+
private readonly _context;
|
|
3184
|
+
private readonly _logger;
|
|
3185
|
+
private readonly _runtime;
|
|
3186
|
+
private readonly _initOpts;
|
|
3187
|
+
/**
|
|
3188
|
+
* 摄像头采集配置
|
|
3189
|
+
*/
|
|
3190
|
+
private _videoConfig;
|
|
3191
|
+
/**
|
|
3192
|
+
* 麦克风采集配置
|
|
3193
|
+
*/
|
|
3194
|
+
private _audioConfig;
|
|
3195
|
+
/**
|
|
3196
|
+
* 统计埋点类
|
|
3197
|
+
*/
|
|
3198
|
+
private _callPlusStatistics;
|
|
3199
|
+
/**
|
|
3200
|
+
* client callId
|
|
3201
|
+
*/
|
|
3202
|
+
private _clientCallId;
|
|
3203
|
+
/**
|
|
3204
|
+
* 是否为主动挂断
|
|
3205
|
+
*/
|
|
3206
|
+
private _isLaunchHangup;
|
|
3207
|
+
/**
|
|
3208
|
+
* 呼叫过程中挂断
|
|
3209
|
+
*/
|
|
3210
|
+
private _needHangupCallId;
|
|
3211
|
+
private _callEngine;
|
|
3212
|
+
private _rtcModule;
|
|
3213
|
+
/**
|
|
3214
|
+
* 上报应用层事件模块
|
|
3215
|
+
*/
|
|
3216
|
+
_reportAppEventModule: RCCallPlusReportModule;
|
|
3217
|
+
constructor(_context: PluginContext, _logger: BasicLogger, _runtime: IRuntime, _initOpts: ICallPlusInitOpts);
|
|
3218
|
+
/**
|
|
3219
|
+
* 加房间、发布、订阅失败时需结束通话,并上报原因
|
|
3220
|
+
*/
|
|
3221
|
+
private _rtcProcessFailHandle;
|
|
3222
|
+
/**
|
|
3223
|
+
* rtc peerConnection 异常断开时需结束通话,并上报原因
|
|
3224
|
+
*/
|
|
3225
|
+
private _peerConnectionAbnormalClose;
|
|
3226
|
+
/**
|
|
3227
|
+
* 本端加入 RTC 房间,需更新本人 ONCALL 状态,重新校时
|
|
3228
|
+
*/
|
|
3229
|
+
private _selfJoinedHandle;
|
|
3230
|
+
/**
|
|
3231
|
+
* 远端人员加入房间,更新远端人员状态和通话状态为 ONCALL
|
|
3232
|
+
*/
|
|
3233
|
+
private _otherJoinedHandle;
|
|
3234
|
+
/**
|
|
3235
|
+
* 收到首帧上报给业务层
|
|
3236
|
+
*/
|
|
3237
|
+
private _receiveFirstFrameHandle;
|
|
3238
|
+
/**
|
|
3239
|
+
* 被踢出房间时,需结束通话
|
|
3240
|
+
*/
|
|
3241
|
+
private _kickoffHandle;
|
|
3242
|
+
/**
|
|
3243
|
+
* 远端资源音视频状态变化,需更新 session 中人员的设备状态
|
|
3244
|
+
*/
|
|
3245
|
+
private _receiveDeviceEnableChangeHandle;
|
|
3246
|
+
/**
|
|
3247
|
+
* 通话挂断时,需清空内存,离开房间
|
|
3248
|
+
*/
|
|
3249
|
+
private _sessionCloseHandle;
|
|
3250
|
+
/**
|
|
3251
|
+
* 注册应用层事件
|
|
3252
|
+
* 包含“收到呼叫、通话结束、通话人员状态变更、通话类型变更”等事件
|
|
3253
|
+
* ICallPlusEventListener 对象请参考 apiDoc
|
|
3254
|
+
*/
|
|
3255
|
+
setCallPlusEventListener(listener: ICallPlusEventListener): void;
|
|
3256
|
+
/**
|
|
3257
|
+
* 注册音视频上下行丢包数据监听
|
|
3258
|
+
* 每秒上报一次
|
|
3259
|
+
* @param listener 类型为 IStatusReportListener,详细定义可参考 apiDoc
|
|
3260
|
+
* @param listener.onSendPacketLoss 发送丢包率信息回调
|
|
3261
|
+
* @param listener.onReceivePacketLoss 接收丢包率信息回调
|
|
3262
|
+
*/
|
|
3263
|
+
setStatusReportListener(listener: IStatusReportListener): void;
|
|
3264
|
+
/**
|
|
3265
|
+
* 设置要观看人员(包括自己和对方)的媒体播放器
|
|
3266
|
+
* @param list 为一个列表,可传入多人的媒体播放器
|
|
3267
|
+
* @param item.userId 用户 id
|
|
3268
|
+
* @param item.videoElement 一个 video 元素,用于播放视频,需要挂载在业务层页面上
|
|
3269
|
+
* @param item.isTiny 是否观看别人的小流,小窗口时可以配置为 true,可节省带宽,userId 为远端用户时有效
|
|
3270
|
+
* @returns code 返回是否设置成功
|
|
3271
|
+
*/
|
|
3272
|
+
setVideoView(list: {
|
|
3273
|
+
userId: string;
|
|
3274
|
+
videoElement: HTMLVideoElement;
|
|
3275
|
+
isTiny?: boolean;
|
|
3276
|
+
}[]): {
|
|
3277
|
+
code: number;
|
|
3278
|
+
};
|
|
3279
|
+
/**
|
|
3280
|
+
* 删除某个人的媒体播放器
|
|
3281
|
+
* 不观看某个人的视频时,业务层可以直接移除对应的 video 标签,
|
|
3282
|
+
* 调 removeVideoView 方法,SDK 内部会停止接收对方的媒体传输
|
|
3283
|
+
* @param userIds 用户 id 列表
|
|
3284
|
+
* @returns code 返回是否删除成功
|
|
3285
|
+
*/
|
|
3286
|
+
removeVideoView(userIds: string[]): {
|
|
3287
|
+
code: number;
|
|
3288
|
+
};
|
|
3289
|
+
/**
|
|
3290
|
+
* 播放指定人员的音视频媒体
|
|
3291
|
+
* 播放某个人的视频前,请确保已经调用 `setVideoView` 方法为其设置视频视图
|
|
3292
|
+
* @param userId 指定要查看某个人的媒体资源
|
|
3293
|
+
* @param mediaType 指定播放音频还是视频
|
|
3294
|
+
* @returns 返回是否播放成功
|
|
3295
|
+
*/
|
|
3296
|
+
playMedia(userId: string, mediaType: RCCallPlusMediaType): Promise<{
|
|
3297
|
+
code: number;
|
|
3298
|
+
}>;
|
|
3299
|
+
/**
|
|
3300
|
+
* 创建视频配置构建器
|
|
3301
|
+
* @returns RCVideoConfigBuilder 用于构造视频采集时的配置项,可以设置摄像头设备 id、帧率、分辨率等,
|
|
3302
|
+
* 设置完需调 build 方法,最终在 setVideoConfig 后生效
|
|
3303
|
+
*/
|
|
3304
|
+
createVideoConfigBuilder(): RCVideoConfigBuilder;
|
|
3305
|
+
/**
|
|
3306
|
+
* 设置视频配置
|
|
3307
|
+
* 下次采集时生效,如切换摄像头、重新建立通话
|
|
3308
|
+
*/
|
|
3309
|
+
setVideoConfig(cfg: IVideoConfig): {
|
|
3310
|
+
code: number;
|
|
3311
|
+
};
|
|
3312
|
+
/**
|
|
3313
|
+
* 创建音频配置构建器
|
|
3314
|
+
* @returns RCAudioConfigBuilder 用于构造音频采集时的配置项,可以设置麦克风设备 id
|
|
3315
|
+
* 设置完需调 build 方法,最终在 setAudioConfig 后生效
|
|
3316
|
+
*/
|
|
3317
|
+
createAudioConfigBuilder(): RCAudioConfigBuilder;
|
|
3318
|
+
/**
|
|
3319
|
+
* 创建安卓推送信息构建器
|
|
3320
|
+
* @returns RCCallPlusAndroidPushConfigBuilder 用于构造安卓推送信的配置项
|
|
3321
|
+
* 设置完需调 build 方法获取设置的 androidPushConfig 数据
|
|
3322
|
+
* 最终需把 androidPushConfig 传入 startCall、invite、hangup 方法的 pushConfig.androidConfig 中
|
|
3323
|
+
*/
|
|
3324
|
+
createAndroidPushConfigBuilder(): RCCallPlusAndroidPushConfigBuilder;
|
|
3325
|
+
/**
|
|
3326
|
+
* 设置音频配置
|
|
3327
|
+
* 下次采集时生效,如重新建立通话
|
|
3328
|
+
*/
|
|
3329
|
+
setAudioConfig(cfg: IAudioConfig): {
|
|
3330
|
+
code: number;
|
|
3331
|
+
};
|
|
3332
|
+
/**
|
|
3333
|
+
* 发起呼叫
|
|
3334
|
+
* @param userIds 被叫人员 userId 列表,单人呼叫仅需在数组中放置对方一人的 userId
|
|
3335
|
+
* @param type 单人呼叫 or 多人呼叫
|
|
3336
|
+
* @param mediaType 通话媒体类型: 音频 or 音视频
|
|
3337
|
+
* @param pushConfig 移动端推送信息
|
|
3338
|
+
* @param extra 附加信息,会透传给被呼叫方
|
|
3339
|
+
* @returns callId 呼叫成功后,产生的会话 id
|
|
3340
|
+
*/
|
|
3341
|
+
startCall(userIds: string[], callType?: RCCallPlusType, mediaType?: RCCallPlusMediaType, pushConfig?: IRCCallPlusPushConfig, extra?: string): Promise<{
|
|
3342
|
+
code: number;
|
|
3343
|
+
callId?: string;
|
|
3344
|
+
}>;
|
|
3345
|
+
/**
|
|
3346
|
+
* 直接加入进行中的群组通话
|
|
3347
|
+
* @param callId 通话 id
|
|
3348
|
+
*/
|
|
3349
|
+
joinMultiCall(callId: string): Promise<{
|
|
3350
|
+
code: number;
|
|
3351
|
+
}>;
|
|
3352
|
+
/**
|
|
3353
|
+
* 通话中邀请他人
|
|
3354
|
+
* 单人通话中邀请他人会引发通话类型变更
|
|
3355
|
+
* @param userIds 被邀请人列表
|
|
3356
|
+
* @param pushConfig 移动端推送信息
|
|
3357
|
+
* @param extra 附加信息,会透传给被邀请方
|
|
3358
|
+
* @returns busyUsers 返回忙线人员列表
|
|
3359
|
+
*/
|
|
3360
|
+
invite(userIds: string[], pushConfig?: IRCCallPlusPushConfig, extra?: string): Promise<{
|
|
3361
|
+
code: number;
|
|
3362
|
+
busyUsers?: RCCallPlusCallUser[];
|
|
3363
|
+
}>;
|
|
3364
|
+
/**
|
|
3365
|
+
* 接听通话
|
|
3366
|
+
* @param callId 通话 id
|
|
3367
|
+
* @param pushConfig 移动端推送信息
|
|
3368
|
+
*/
|
|
3369
|
+
accept(callId: string, pushConfig?: IRCCallPlusPushConfig): Promise<{
|
|
3370
|
+
code: number;
|
|
3371
|
+
}>;
|
|
3372
|
+
private __innerHangup;
|
|
3373
|
+
/**
|
|
3374
|
+
* 挂断通话
|
|
3375
|
+
* @param callId 为可选参数,不传时,挂断正在进行的主 session,传入时可指定挂断主通话或暂未建立连接的通话
|
|
3376
|
+
* @param pushConfig 移动端推送信息
|
|
3377
|
+
* 暂未建立连接的通话:指已在通话中时,收到呼叫但暂未接听的通话
|
|
3378
|
+
* @param pushConfig 移动端推送信息
|
|
3379
|
+
*/
|
|
3380
|
+
hangup(callId?: string, pushConfig?: IRCCallPlusPushConfig): Promise<{
|
|
3381
|
+
code: number;
|
|
3382
|
+
}>;
|
|
3383
|
+
/**
|
|
3384
|
+
* 通话中发起媒体类型变更请求
|
|
3385
|
+
* @param mediaType 媒体类型
|
|
3386
|
+
* @returns transactionId 客户端和服务端交互的事务 id,在取消或应答媒体类型切换时传入
|
|
3387
|
+
*/
|
|
3388
|
+
requestChangeMediaType(mediaType: RCCallPlusMediaType): Promise<{
|
|
3389
|
+
code: number;
|
|
3390
|
+
transactionId?: string;
|
|
3391
|
+
}>;
|
|
3392
|
+
/**
|
|
3393
|
+
* 取消切换媒体类型变更请求
|
|
3394
|
+
* @param transactionId 客户端和服务端交互的事务 id,为发起媒体类型变更请求返回的 transactionId
|
|
3395
|
+
*/
|
|
3396
|
+
cancelChangeMediaType(transactionId: string): Promise<{
|
|
3397
|
+
code: number;
|
|
3398
|
+
}>;
|
|
3399
|
+
/**
|
|
3400
|
+
* 媒体类型变更应答
|
|
3401
|
+
* @param transactionId 客户端和服务端交互的事务 id,为 onReceivedChangeToVideo 监听收到 transactionId 参数值
|
|
3402
|
+
*/
|
|
3403
|
+
replyChangeMediaType(transactionId: string, isAgree: boolean): Promise<{
|
|
3404
|
+
code: number;
|
|
3405
|
+
}>;
|
|
3406
|
+
/**
|
|
3407
|
+
* 获取当前进行中的通话
|
|
3408
|
+
* @returns RCCallPlusSession 对象或 null 为当前正在进行的通话对象
|
|
3409
|
+
*/
|
|
3410
|
+
getCurrentCallSession(): RCCallPlusSession | null;
|
|
3411
|
+
/**
|
|
3412
|
+
* 从服务器获取未结束的通话记录
|
|
3413
|
+
* @returns records 一组未结束的通话记录
|
|
3414
|
+
*/
|
|
3415
|
+
getAvailableCallRecordsFromServer(): Promise<{
|
|
3416
|
+
code: number;
|
|
3417
|
+
records?: IRCCallPlusCallRecord[];
|
|
3418
|
+
}>;
|
|
3419
|
+
/**
|
|
3420
|
+
* 分页查找当前用户的全部通话记录
|
|
3421
|
+
* @param startTimestamp 起始时间戳,
|
|
3422
|
+
* 首次获取可传 -1,倒序时,返回最新的通话记录,正序时,返回最早的通话记录
|
|
3423
|
+
* order 为正序时,返回大于此时间戳的通话记录
|
|
3424
|
+
* order 为倒序时,返回小于此时间戳的通话记录
|
|
3425
|
+
* @param count 每次获取的数量
|
|
3426
|
+
* @param order 正序或倒序获取,默认为正序
|
|
3427
|
+
* 0 为正序,向开始时间戳之后查询
|
|
3428
|
+
* 1 为倒序,向开始时间戳之前查询
|
|
3429
|
+
* @returns result.hasMore 是否有更多通话记录
|
|
3430
|
+
* @returns result.list 通话记录列表,类型为 IRCCallPlusCallRecord[],可通过 apiDoc 查看具体包含字段
|
|
3431
|
+
* @returns result.syncTime hasMore 为 true 时,继续获取通话记录需传入的时间戳
|
|
3432
|
+
*/
|
|
3433
|
+
getCallRecords(startTimestamp: number, count: number, order?: 0 | 1): Promise<{
|
|
3434
|
+
code: number;
|
|
3435
|
+
result?: IRCCallPlusGetCallRecordRes;
|
|
3436
|
+
}>;
|
|
3437
|
+
/**
|
|
3438
|
+
* 根据 callId 集合批量删除通话记录
|
|
3439
|
+
* @param callIds callId 列表
|
|
3440
|
+
*/
|
|
3441
|
+
deleteCallRecordsFromServer(callIds: string[]): Promise<{
|
|
3442
|
+
code: number;
|
|
3443
|
+
}>;
|
|
3444
|
+
/**
|
|
3445
|
+
* 清空所有通话记录
|
|
3446
|
+
*/
|
|
3447
|
+
deleteAllCallRecordsFromServer(): Promise<{
|
|
3448
|
+
code: number;
|
|
3449
|
+
}>;
|
|
3450
|
+
/**
|
|
3451
|
+
* 开启摄像头
|
|
3452
|
+
* @description 通话过程中打开摄像头,如果扩散资源失败,即对方没收到本端打开摄像头的通知时,此次行为失败
|
|
3453
|
+
* @returns track 摄像头视频资源
|
|
3454
|
+
*/
|
|
3455
|
+
startCamera(): Promise<{
|
|
3456
|
+
code: number;
|
|
3457
|
+
}>;
|
|
3458
|
+
/**
|
|
3459
|
+
* 关闭摄像头
|
|
3460
|
+
*/
|
|
3461
|
+
stopCamera(): Promise<{
|
|
3462
|
+
code: number;
|
|
3463
|
+
}>;
|
|
3464
|
+
/**
|
|
3465
|
+
* 切换摄像头功能,通话前和通话中都可调用。
|
|
3466
|
+
* @param cameraId 浏览器中取得的摄像头设备 id,可调 getCameras 方法取得
|
|
3467
|
+
* @description 切换成功后,`ICallPlusEventListener` 监听器的 `onUserMediaAvailable` 会被触发,此时调用 `callPlusClient.playMedia` 方法播放新的资源。
|
|
3468
|
+
*/
|
|
3469
|
+
switchCamera(cameraId: string): Promise<{
|
|
3470
|
+
code: number;
|
|
3471
|
+
}>;
|
|
3472
|
+
/**
|
|
3473
|
+
* 开启麦克风
|
|
3474
|
+
* @description 通话过程中打开麦克风,如果扩散资源失败,即对方没收到本端打开麦克风的通知时,此次行为失败
|
|
3475
|
+
*/
|
|
3476
|
+
startMicrophone(): Promise<{
|
|
3477
|
+
code: number;
|
|
3478
|
+
}>;
|
|
3479
|
+
/**
|
|
3480
|
+
* 关闭麦克风
|
|
3481
|
+
* @description 通话过程中关闭麦克风,如果扩散资源失败,即对方没收到本端关闭麦克风的通知时,此次行为失败
|
|
3482
|
+
*/
|
|
3483
|
+
stopMicrophone(): Promise<{
|
|
3484
|
+
code: number;
|
|
3485
|
+
}>;
|
|
3486
|
+
/**
|
|
3487
|
+
* 麦克风是否开启
|
|
3488
|
+
*/
|
|
3489
|
+
isMicrophoneEnabled(): boolean;
|
|
3490
|
+
/**
|
|
3491
|
+
* 设置所有远端音频流是否可用
|
|
3492
|
+
* @param enable 为 true 时,启用所有远端音频流;为 false 时,静音所有远端音频流
|
|
3493
|
+
*/
|
|
3494
|
+
setAllRemoteAudioEnable(enable: boolean): Promise<{
|
|
3495
|
+
code: number;
|
|
3496
|
+
}>;
|
|
3497
|
+
/**
|
|
3498
|
+
* 获取 SDK 版本信息
|
|
3499
|
+
* @returns SDK 版本号
|
|
3500
|
+
*/
|
|
3501
|
+
getVersion(): string;
|
|
3502
|
+
/**
|
|
3503
|
+
* 获取摄像头列表
|
|
3504
|
+
*/
|
|
3505
|
+
getCameras(): Promise<MediaDeviceInfo[]>;
|
|
3506
|
+
/**
|
|
3507
|
+
* 获取麦克风列表
|
|
3508
|
+
*/
|
|
3509
|
+
getMicrophones(): Promise<MediaDeviceInfo[]>;
|
|
3510
|
+
getRTCSessionId(): string | null;
|
|
3511
|
+
/**
|
|
3512
|
+
* 切换麦克风功能,通话前和通话中都可调用。
|
|
3513
|
+
* @param microphoneId 浏览器中取得的麦克风设备 id,可调 getMicrophones 方法取得
|
|
3514
|
+
* @description 切换成功后,`ICallPlusEventListener` 监听器的 `onUserMediaAvailable` 会被触发,此时调用 `callPlusClient.playMedia` 方法播放新的资源。
|
|
3515
|
+
*/
|
|
3516
|
+
switchMicrophone(microphoneId: string): Promise<{
|
|
3517
|
+
code: number;
|
|
3518
|
+
}>;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3521
|
+
declare const installer: IPluginGenerator<RCCallPlusClient, ICallPlusInitOpts>;
|
|
3522
|
+
|
|
3523
|
+
export { IAndroidPushConfig, IAudioConfig, IAudioConfigBuilder, ICallOpts, ICallPlusEventListener, ICallPlusInitOpts, IRCCallPlusCallRecord, IRCCallPlusGetCallRecordRes, IRCCallPlusPushConfig, IRCCallPlusReceivedSummaryMessage, IRCCallPlusSummaryMessageContent, IServerPushExt, IStatusReportListener, IVideoConfig, IVideoConfigBuilder, IiOSPushConfig, RCAudioConfigBuilder, RCCallPlusAndroidPushConfigBuilder, RCCallPlusCallState, RCCallPlusCallUser, RCCallPlusClient, RCCallPlusCode, RCCallPlusMediaType, RCCallPlusMediaTypeChangeResult, RCCallPlusPacketLossStats, RCCallPlusReason, RCCallPlusSession, RCCallPlusSessionUserState, RCCallPlusType, RCVideoConfigBuilder, installer };
|