@wazo/sdk 0.37.28 → 0.37.29
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/dist/wazo-sdk.js +2 -2
- package/esm/domain/CallSession.js +15 -3
- package/esm/domain/Phone/CTIPhone.js +15 -3
- package/esm/domain/Phone/WebRTCPhone.js +17 -3
- package/esm/domain/__tests__/CallSession.test.js +32 -3
- package/esm/domain/__tests__/IndirectTransfer.test.js +15 -3
- package/esm/domain/__tests__/Room.test.js +15 -3
- package/esm/index.js +17 -3
- package/esm/simple/Auth.js +17 -3
- package/esm/simple/Configuration.js +17 -3
- package/esm/simple/Phone.js +17 -3
- package/esm/simple/index.js +17 -3
- package/esm/simple/room/LocalParticipant.js +17 -3
- package/esm/simple/room/Participant.js +17 -3
- package/esm/simple/room/RemoteParticipant.js +17 -3
- package/esm/simple/room/Room.js +17 -3
- package/esm/simple/room/SipRoom.js +17 -3
- package/esm/simple/room/Stream.js +17 -3
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +17 -3
- package/esm/simple/utils.js +17 -3
- package/lib/domain/CallSession.js +15 -3
- package/lib/domain/Phone/CTIPhone.js +15 -3
- package/lib/domain/Phone/WebRTCPhone.js +17 -3
- package/lib/domain/__tests__/CallSession.test.js +32 -3
- package/lib/domain/__tests__/IndirectTransfer.test.js +15 -3
- package/lib/domain/__tests__/Room.test.js +15 -3
- package/lib/index.js +17 -3
- package/lib/simple/Auth.js +17 -3
- package/lib/simple/Configuration.js +17 -3
- package/lib/simple/Phone.js +17 -3
- package/lib/simple/index.js +17 -3
- package/lib/simple/room/LocalParticipant.js +17 -3
- package/lib/simple/room/Participant.js +17 -3
- package/lib/simple/room/RemoteParticipant.js +17 -3
- package/lib/simple/room/Room.js +17 -3
- package/lib/simple/room/SipRoom.js +17 -3
- package/lib/simple/room/Stream.js +17 -3
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +17 -3
- package/lib/simple/utils.js +17 -3
- package/package.json +1 -1
- package/src/domain/CallSession.js +16 -4
- package/src/domain/Phone/WebRTCPhone.js +2 -0
- package/src/domain/__tests__/CallSession.test.js +17 -0
package/lib/simple/Auth.js
CHANGED
|
@@ -3260,6 +3260,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3260
3260
|
|
|
3261
3261
|
|
|
3262
3262
|
|
|
3263
|
+
|
|
3263
3264
|
|
|
3264
3265
|
|
|
3265
3266
|
|
|
@@ -3307,14 +3308,14 @@ class CallSession {
|
|
|
3307
3308
|
|
|
3308
3309
|
|
|
3309
3310
|
|
|
3311
|
+
// = creationTime
|
|
3312
|
+
|
|
3310
3313
|
|
|
3311
3314
|
|
|
3312
3315
|
|
|
3313
3316
|
|
|
3314
3317
|
|
|
3315
3318
|
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
3319
|
|
|
3319
3320
|
|
|
3320
3321
|
|
|
@@ -3378,6 +3379,7 @@ class CallSession {
|
|
|
3378
3379
|
recordingPaused,
|
|
3379
3380
|
videoRemotelyDowngraded,
|
|
3380
3381
|
sipSession,
|
|
3382
|
+
answerTime,
|
|
3381
3383
|
} ) {
|
|
3382
3384
|
this.callId = callId;
|
|
3383
3385
|
this.sipCallId = sipCallId;
|
|
@@ -3405,6 +3407,7 @@ class CallSession {
|
|
|
3405
3407
|
this.recordingPaused = recordingPaused || false;
|
|
3406
3408
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3407
3409
|
this.sipSession = sipSession;
|
|
3410
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3408
3411
|
|
|
3409
3412
|
// Useful to compare instead of instanceof with minified code
|
|
3410
3413
|
this.type = 'CallSession';
|
|
@@ -3435,7 +3438,7 @@ class CallSession {
|
|
|
3435
3438
|
}
|
|
3436
3439
|
|
|
3437
3440
|
answer() {
|
|
3438
|
-
this.
|
|
3441
|
+
this.answerTime = new Date();
|
|
3439
3442
|
}
|
|
3440
3443
|
|
|
3441
3444
|
systemAnswer() {
|
|
@@ -3591,6 +3594,15 @@ class CallSession {
|
|
|
3591
3594
|
return newFrom(callSession, CallSession);
|
|
3592
3595
|
}
|
|
3593
3596
|
|
|
3597
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3598
|
+
set answered(value ) {
|
|
3599
|
+
this.answerTime = value ? new Date() : null;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
get answered() {
|
|
3603
|
+
return !!this.answerTime;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3594
3606
|
static parseCall(call ) {
|
|
3595
3607
|
return new CallSession({
|
|
3596
3608
|
callId: call.id,
|
|
@@ -9084,6 +9096,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9084
9096
|
this.removeIncomingSessions(sipSessionId);
|
|
9085
9097
|
}
|
|
9086
9098
|
|
|
9099
|
+
callSession.answerTime = new Date();
|
|
9087
9100
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9088
9101
|
|
|
9089
9102
|
return callSession;
|
|
@@ -9299,6 +9312,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9299
9312
|
}
|
|
9300
9313
|
|
|
9301
9314
|
this.shouldSendReinvite = false;
|
|
9315
|
+
callSession.answerTime = new Date();
|
|
9302
9316
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9303
9317
|
|
|
9304
9318
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
|
@@ -3258,6 +3258,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3258
3258
|
|
|
3259
3259
|
|
|
3260
3260
|
|
|
3261
|
+
|
|
3261
3262
|
|
|
3262
3263
|
|
|
3263
3264
|
|
|
@@ -3305,14 +3306,14 @@ class CallSession {
|
|
|
3305
3306
|
|
|
3306
3307
|
|
|
3307
3308
|
|
|
3309
|
+
// = creationTime
|
|
3310
|
+
|
|
3308
3311
|
|
|
3309
3312
|
|
|
3310
3313
|
|
|
3311
3314
|
|
|
3312
3315
|
|
|
3313
3316
|
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
3317
|
|
|
3317
3318
|
|
|
3318
3319
|
|
|
@@ -3376,6 +3377,7 @@ class CallSession {
|
|
|
3376
3377
|
recordingPaused,
|
|
3377
3378
|
videoRemotelyDowngraded,
|
|
3378
3379
|
sipSession,
|
|
3380
|
+
answerTime,
|
|
3379
3381
|
} ) {
|
|
3380
3382
|
this.callId = callId;
|
|
3381
3383
|
this.sipCallId = sipCallId;
|
|
@@ -3403,6 +3405,7 @@ class CallSession {
|
|
|
3403
3405
|
this.recordingPaused = recordingPaused || false;
|
|
3404
3406
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3405
3407
|
this.sipSession = sipSession;
|
|
3408
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3406
3409
|
|
|
3407
3410
|
// Useful to compare instead of instanceof with minified code
|
|
3408
3411
|
this.type = 'CallSession';
|
|
@@ -3433,7 +3436,7 @@ class CallSession {
|
|
|
3433
3436
|
}
|
|
3434
3437
|
|
|
3435
3438
|
answer() {
|
|
3436
|
-
this.
|
|
3439
|
+
this.answerTime = new Date();
|
|
3437
3440
|
}
|
|
3438
3441
|
|
|
3439
3442
|
systemAnswer() {
|
|
@@ -3589,6 +3592,15 @@ class CallSession {
|
|
|
3589
3592
|
return newFrom(callSession, CallSession);
|
|
3590
3593
|
}
|
|
3591
3594
|
|
|
3595
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3596
|
+
set answered(value ) {
|
|
3597
|
+
this.answerTime = value ? new Date() : null;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
get answered() {
|
|
3601
|
+
return !!this.answerTime;
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3592
3604
|
static parseCall(call ) {
|
|
3593
3605
|
return new CallSession({
|
|
3594
3606
|
callId: call.id,
|
|
@@ -9082,6 +9094,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9082
9094
|
this.removeIncomingSessions(sipSessionId);
|
|
9083
9095
|
}
|
|
9084
9096
|
|
|
9097
|
+
callSession.answerTime = new Date();
|
|
9085
9098
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9086
9099
|
|
|
9087
9100
|
return callSession;
|
|
@@ -9297,6 +9310,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9297
9310
|
}
|
|
9298
9311
|
|
|
9299
9312
|
this.shouldSendReinvite = false;
|
|
9313
|
+
callSession.answerTime = new Date();
|
|
9300
9314
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9301
9315
|
|
|
9302
9316
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
package/lib/simple/Phone.js
CHANGED
|
@@ -258,6 +258,7 @@ var updateFrom = (instance , from ) => {
|
|
|
258
258
|
|
|
259
259
|
|
|
260
260
|
|
|
261
|
+
|
|
261
262
|
|
|
262
263
|
|
|
263
264
|
|
|
@@ -305,14 +306,14 @@ class CallSession {
|
|
|
305
306
|
|
|
306
307
|
|
|
307
308
|
|
|
309
|
+
// = creationTime
|
|
310
|
+
|
|
308
311
|
|
|
309
312
|
|
|
310
313
|
|
|
311
314
|
|
|
312
315
|
|
|
313
316
|
|
|
314
|
-
|
|
315
|
-
|
|
316
317
|
|
|
317
318
|
|
|
318
319
|
|
|
@@ -376,6 +377,7 @@ class CallSession {
|
|
|
376
377
|
recordingPaused,
|
|
377
378
|
videoRemotelyDowngraded,
|
|
378
379
|
sipSession,
|
|
380
|
+
answerTime,
|
|
379
381
|
} ) {
|
|
380
382
|
this.callId = callId;
|
|
381
383
|
this.sipCallId = sipCallId;
|
|
@@ -403,6 +405,7 @@ class CallSession {
|
|
|
403
405
|
this.recordingPaused = recordingPaused || false;
|
|
404
406
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
405
407
|
this.sipSession = sipSession;
|
|
408
|
+
this.answerTime = answerTime || this.answerTime;
|
|
406
409
|
|
|
407
410
|
// Useful to compare instead of instanceof with minified code
|
|
408
411
|
this.type = 'CallSession';
|
|
@@ -433,7 +436,7 @@ class CallSession {
|
|
|
433
436
|
}
|
|
434
437
|
|
|
435
438
|
answer() {
|
|
436
|
-
this.
|
|
439
|
+
this.answerTime = new Date();
|
|
437
440
|
}
|
|
438
441
|
|
|
439
442
|
systemAnswer() {
|
|
@@ -589,6 +592,15 @@ class CallSession {
|
|
|
589
592
|
return newFrom(callSession, CallSession);
|
|
590
593
|
}
|
|
591
594
|
|
|
595
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
596
|
+
set answered(value ) {
|
|
597
|
+
this.answerTime = value ? new Date() : null;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
get answered() {
|
|
601
|
+
return !!this.answerTime;
|
|
602
|
+
}
|
|
603
|
+
|
|
592
604
|
static parseCall(call ) {
|
|
593
605
|
return new CallSession({
|
|
594
606
|
callId: call.id,
|
|
@@ -9082,6 +9094,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9082
9094
|
this.removeIncomingSessions(sipSessionId);
|
|
9083
9095
|
}
|
|
9084
9096
|
|
|
9097
|
+
callSession.answerTime = new Date();
|
|
9085
9098
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9086
9099
|
|
|
9087
9100
|
return callSession;
|
|
@@ -9297,6 +9310,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9297
9310
|
}
|
|
9298
9311
|
|
|
9299
9312
|
this.shouldSendReinvite = false;
|
|
9313
|
+
callSession.answerTime = new Date();
|
|
9300
9314
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9301
9315
|
|
|
9302
9316
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
package/lib/simple/index.js
CHANGED
|
@@ -3258,6 +3258,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3258
3258
|
|
|
3259
3259
|
|
|
3260
3260
|
|
|
3261
|
+
|
|
3261
3262
|
|
|
3262
3263
|
|
|
3263
3264
|
|
|
@@ -3305,14 +3306,14 @@ class CallSession {
|
|
|
3305
3306
|
|
|
3306
3307
|
|
|
3307
3308
|
|
|
3309
|
+
// = creationTime
|
|
3310
|
+
|
|
3308
3311
|
|
|
3309
3312
|
|
|
3310
3313
|
|
|
3311
3314
|
|
|
3312
3315
|
|
|
3313
3316
|
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
3317
|
|
|
3317
3318
|
|
|
3318
3319
|
|
|
@@ -3376,6 +3377,7 @@ class CallSession {
|
|
|
3376
3377
|
recordingPaused,
|
|
3377
3378
|
videoRemotelyDowngraded,
|
|
3378
3379
|
sipSession,
|
|
3380
|
+
answerTime,
|
|
3379
3381
|
} ) {
|
|
3380
3382
|
this.callId = callId;
|
|
3381
3383
|
this.sipCallId = sipCallId;
|
|
@@ -3403,6 +3405,7 @@ class CallSession {
|
|
|
3403
3405
|
this.recordingPaused = recordingPaused || false;
|
|
3404
3406
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3405
3407
|
this.sipSession = sipSession;
|
|
3408
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3406
3409
|
|
|
3407
3410
|
// Useful to compare instead of instanceof with minified code
|
|
3408
3411
|
this.type = 'CallSession';
|
|
@@ -3433,7 +3436,7 @@ class CallSession {
|
|
|
3433
3436
|
}
|
|
3434
3437
|
|
|
3435
3438
|
answer() {
|
|
3436
|
-
this.
|
|
3439
|
+
this.answerTime = new Date();
|
|
3437
3440
|
}
|
|
3438
3441
|
|
|
3439
3442
|
systemAnswer() {
|
|
@@ -3589,6 +3592,15 @@ class CallSession {
|
|
|
3589
3592
|
return newFrom(callSession, CallSession);
|
|
3590
3593
|
}
|
|
3591
3594
|
|
|
3595
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3596
|
+
set answered(value ) {
|
|
3597
|
+
this.answerTime = value ? new Date() : null;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
get answered() {
|
|
3601
|
+
return !!this.answerTime;
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3592
3604
|
static parseCall(call ) {
|
|
3593
3605
|
return new CallSession({
|
|
3594
3606
|
callId: call.id,
|
|
@@ -9346,6 +9358,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9346
9358
|
this.removeIncomingSessions(sipSessionId);
|
|
9347
9359
|
}
|
|
9348
9360
|
|
|
9361
|
+
callSession.answerTime = new Date();
|
|
9349
9362
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9350
9363
|
|
|
9351
9364
|
return callSession;
|
|
@@ -9561,6 +9574,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9561
9574
|
}
|
|
9562
9575
|
|
|
9563
9576
|
this.shouldSendReinvite = false;
|
|
9577
|
+
callSession.answerTime = new Date();
|
|
9564
9578
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9565
9579
|
|
|
9566
9580
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
|
@@ -3284,6 +3284,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3284
3284
|
|
|
3285
3285
|
|
|
3286
3286
|
|
|
3287
|
+
|
|
3287
3288
|
|
|
3288
3289
|
|
|
3289
3290
|
|
|
@@ -3331,14 +3332,14 @@ class CallSession {
|
|
|
3331
3332
|
|
|
3332
3333
|
|
|
3333
3334
|
|
|
3335
|
+
// = creationTime
|
|
3336
|
+
|
|
3334
3337
|
|
|
3335
3338
|
|
|
3336
3339
|
|
|
3337
3340
|
|
|
3338
3341
|
|
|
3339
3342
|
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
3343
|
|
|
3343
3344
|
|
|
3344
3345
|
|
|
@@ -3402,6 +3403,7 @@ class CallSession {
|
|
|
3402
3403
|
recordingPaused,
|
|
3403
3404
|
videoRemotelyDowngraded,
|
|
3404
3405
|
sipSession,
|
|
3406
|
+
answerTime,
|
|
3405
3407
|
} ) {
|
|
3406
3408
|
this.callId = callId;
|
|
3407
3409
|
this.sipCallId = sipCallId;
|
|
@@ -3429,6 +3431,7 @@ class CallSession {
|
|
|
3429
3431
|
this.recordingPaused = recordingPaused || false;
|
|
3430
3432
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3431
3433
|
this.sipSession = sipSession;
|
|
3434
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3432
3435
|
|
|
3433
3436
|
// Useful to compare instead of instanceof with minified code
|
|
3434
3437
|
this.type = 'CallSession';
|
|
@@ -3459,7 +3462,7 @@ class CallSession {
|
|
|
3459
3462
|
}
|
|
3460
3463
|
|
|
3461
3464
|
answer() {
|
|
3462
|
-
this.
|
|
3465
|
+
this.answerTime = new Date();
|
|
3463
3466
|
}
|
|
3464
3467
|
|
|
3465
3468
|
systemAnswer() {
|
|
@@ -3615,6 +3618,15 @@ class CallSession {
|
|
|
3615
3618
|
return newFrom(callSession, CallSession);
|
|
3616
3619
|
}
|
|
3617
3620
|
|
|
3621
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3622
|
+
set answered(value ) {
|
|
3623
|
+
this.answerTime = value ? new Date() : null;
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
get answered() {
|
|
3627
|
+
return !!this.answerTime;
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3618
3630
|
static parseCall(call ) {
|
|
3619
3631
|
return new CallSession({
|
|
3620
3632
|
callId: call.id,
|
|
@@ -9346,6 +9358,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9346
9358
|
this.removeIncomingSessions(sipSessionId);
|
|
9347
9359
|
}
|
|
9348
9360
|
|
|
9361
|
+
callSession.answerTime = new Date();
|
|
9349
9362
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9350
9363
|
|
|
9351
9364
|
return callSession;
|
|
@@ -9561,6 +9574,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9561
9574
|
}
|
|
9562
9575
|
|
|
9563
9576
|
this.shouldSendReinvite = false;
|
|
9577
|
+
callSession.answerTime = new Date();
|
|
9564
9578
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9565
9579
|
|
|
9566
9580
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
|
@@ -3284,6 +3284,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3284
3284
|
|
|
3285
3285
|
|
|
3286
3286
|
|
|
3287
|
+
|
|
3287
3288
|
|
|
3288
3289
|
|
|
3289
3290
|
|
|
@@ -3331,14 +3332,14 @@ class CallSession {
|
|
|
3331
3332
|
|
|
3332
3333
|
|
|
3333
3334
|
|
|
3335
|
+
// = creationTime
|
|
3336
|
+
|
|
3334
3337
|
|
|
3335
3338
|
|
|
3336
3339
|
|
|
3337
3340
|
|
|
3338
3341
|
|
|
3339
3342
|
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
3343
|
|
|
3343
3344
|
|
|
3344
3345
|
|
|
@@ -3402,6 +3403,7 @@ class CallSession {
|
|
|
3402
3403
|
recordingPaused,
|
|
3403
3404
|
videoRemotelyDowngraded,
|
|
3404
3405
|
sipSession,
|
|
3406
|
+
answerTime,
|
|
3405
3407
|
} ) {
|
|
3406
3408
|
this.callId = callId;
|
|
3407
3409
|
this.sipCallId = sipCallId;
|
|
@@ -3429,6 +3431,7 @@ class CallSession {
|
|
|
3429
3431
|
this.recordingPaused = recordingPaused || false;
|
|
3430
3432
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3431
3433
|
this.sipSession = sipSession;
|
|
3434
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3432
3435
|
|
|
3433
3436
|
// Useful to compare instead of instanceof with minified code
|
|
3434
3437
|
this.type = 'CallSession';
|
|
@@ -3459,7 +3462,7 @@ class CallSession {
|
|
|
3459
3462
|
}
|
|
3460
3463
|
|
|
3461
3464
|
answer() {
|
|
3462
|
-
this.
|
|
3465
|
+
this.answerTime = new Date();
|
|
3463
3466
|
}
|
|
3464
3467
|
|
|
3465
3468
|
systemAnswer() {
|
|
@@ -3615,6 +3618,15 @@ class CallSession {
|
|
|
3615
3618
|
return newFrom(callSession, CallSession);
|
|
3616
3619
|
}
|
|
3617
3620
|
|
|
3621
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3622
|
+
set answered(value ) {
|
|
3623
|
+
this.answerTime = value ? new Date() : null;
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
get answered() {
|
|
3627
|
+
return !!this.answerTime;
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3618
3630
|
static parseCall(call ) {
|
|
3619
3631
|
return new CallSession({
|
|
3620
3632
|
callId: call.id,
|
|
@@ -9346,6 +9358,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9346
9358
|
this.removeIncomingSessions(sipSessionId);
|
|
9347
9359
|
}
|
|
9348
9360
|
|
|
9361
|
+
callSession.answerTime = new Date();
|
|
9349
9362
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9350
9363
|
|
|
9351
9364
|
return callSession;
|
|
@@ -9561,6 +9574,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9561
9574
|
}
|
|
9562
9575
|
|
|
9563
9576
|
this.shouldSendReinvite = false;
|
|
9577
|
+
callSession.answerTime = new Date();
|
|
9564
9578
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9565
9579
|
|
|
9566
9580
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
|
@@ -3258,6 +3258,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3258
3258
|
|
|
3259
3259
|
|
|
3260
3260
|
|
|
3261
|
+
|
|
3261
3262
|
|
|
3262
3263
|
|
|
3263
3264
|
|
|
@@ -3305,14 +3306,14 @@ class CallSession {
|
|
|
3305
3306
|
|
|
3306
3307
|
|
|
3307
3308
|
|
|
3309
|
+
// = creationTime
|
|
3310
|
+
|
|
3308
3311
|
|
|
3309
3312
|
|
|
3310
3313
|
|
|
3311
3314
|
|
|
3312
3315
|
|
|
3313
3316
|
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
3317
|
|
|
3317
3318
|
|
|
3318
3319
|
|
|
@@ -3376,6 +3377,7 @@ class CallSession {
|
|
|
3376
3377
|
recordingPaused,
|
|
3377
3378
|
videoRemotelyDowngraded,
|
|
3378
3379
|
sipSession,
|
|
3380
|
+
answerTime,
|
|
3379
3381
|
} ) {
|
|
3380
3382
|
this.callId = callId;
|
|
3381
3383
|
this.sipCallId = sipCallId;
|
|
@@ -3403,6 +3405,7 @@ class CallSession {
|
|
|
3403
3405
|
this.recordingPaused = recordingPaused || false;
|
|
3404
3406
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3405
3407
|
this.sipSession = sipSession;
|
|
3408
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3406
3409
|
|
|
3407
3410
|
// Useful to compare instead of instanceof with minified code
|
|
3408
3411
|
this.type = 'CallSession';
|
|
@@ -3433,7 +3436,7 @@ class CallSession {
|
|
|
3433
3436
|
}
|
|
3434
3437
|
|
|
3435
3438
|
answer() {
|
|
3436
|
-
this.
|
|
3439
|
+
this.answerTime = new Date();
|
|
3437
3440
|
}
|
|
3438
3441
|
|
|
3439
3442
|
systemAnswer() {
|
|
@@ -3589,6 +3592,15 @@ class CallSession {
|
|
|
3589
3592
|
return newFrom(callSession, CallSession);
|
|
3590
3593
|
}
|
|
3591
3594
|
|
|
3595
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3596
|
+
set answered(value ) {
|
|
3597
|
+
this.answerTime = value ? new Date() : null;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
get answered() {
|
|
3601
|
+
return !!this.answerTime;
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3592
3604
|
static parseCall(call ) {
|
|
3593
3605
|
return new CallSession({
|
|
3594
3606
|
callId: call.id,
|
|
@@ -9346,6 +9358,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9346
9358
|
this.removeIncomingSessions(sipSessionId);
|
|
9347
9359
|
}
|
|
9348
9360
|
|
|
9361
|
+
callSession.answerTime = new Date();
|
|
9349
9362
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9350
9363
|
|
|
9351
9364
|
return callSession;
|
|
@@ -9561,6 +9574,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9561
9574
|
}
|
|
9562
9575
|
|
|
9563
9576
|
this.shouldSendReinvite = false;
|
|
9577
|
+
callSession.answerTime = new Date();
|
|
9564
9578
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9565
9579
|
|
|
9566
9580
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|
package/lib/simple/room/Room.js
CHANGED
|
@@ -3260,6 +3260,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3260
3260
|
|
|
3261
3261
|
|
|
3262
3262
|
|
|
3263
|
+
|
|
3263
3264
|
|
|
3264
3265
|
|
|
3265
3266
|
|
|
@@ -3307,14 +3308,14 @@ class CallSession {
|
|
|
3307
3308
|
|
|
3308
3309
|
|
|
3309
3310
|
|
|
3311
|
+
// = creationTime
|
|
3312
|
+
|
|
3310
3313
|
|
|
3311
3314
|
|
|
3312
3315
|
|
|
3313
3316
|
|
|
3314
3317
|
|
|
3315
3318
|
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
3319
|
|
|
3319
3320
|
|
|
3320
3321
|
|
|
@@ -3378,6 +3379,7 @@ class CallSession {
|
|
|
3378
3379
|
recordingPaused,
|
|
3379
3380
|
videoRemotelyDowngraded,
|
|
3380
3381
|
sipSession,
|
|
3382
|
+
answerTime,
|
|
3381
3383
|
} ) {
|
|
3382
3384
|
this.callId = callId;
|
|
3383
3385
|
this.sipCallId = sipCallId;
|
|
@@ -3405,6 +3407,7 @@ class CallSession {
|
|
|
3405
3407
|
this.recordingPaused = recordingPaused || false;
|
|
3406
3408
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3407
3409
|
this.sipSession = sipSession;
|
|
3410
|
+
this.answerTime = answerTime || this.answerTime;
|
|
3408
3411
|
|
|
3409
3412
|
// Useful to compare instead of instanceof with minified code
|
|
3410
3413
|
this.type = 'CallSession';
|
|
@@ -3435,7 +3438,7 @@ class CallSession {
|
|
|
3435
3438
|
}
|
|
3436
3439
|
|
|
3437
3440
|
answer() {
|
|
3438
|
-
this.
|
|
3441
|
+
this.answerTime = new Date();
|
|
3439
3442
|
}
|
|
3440
3443
|
|
|
3441
3444
|
systemAnswer() {
|
|
@@ -3591,6 +3594,15 @@ class CallSession {
|
|
|
3591
3594
|
return newFrom(callSession, CallSession);
|
|
3592
3595
|
}
|
|
3593
3596
|
|
|
3597
|
+
// Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
|
|
3598
|
+
set answered(value ) {
|
|
3599
|
+
this.answerTime = value ? new Date() : null;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
get answered() {
|
|
3603
|
+
return !!this.answerTime;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3594
3606
|
static parseCall(call ) {
|
|
3595
3607
|
return new CallSession({
|
|
3596
3608
|
callId: call.id,
|
|
@@ -9348,6 +9360,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9348
9360
|
this.removeIncomingSessions(sipSessionId);
|
|
9349
9361
|
}
|
|
9350
9362
|
|
|
9363
|
+
callSession.answerTime = new Date();
|
|
9351
9364
|
this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
|
|
9352
9365
|
|
|
9353
9366
|
return callSession;
|
|
@@ -9563,6 +9576,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9563
9576
|
}
|
|
9564
9577
|
|
|
9565
9578
|
this.shouldSendReinvite = false;
|
|
9579
|
+
callSession.answerTime = new Date();
|
|
9566
9580
|
this.acceptedSessions[callSession.getId()] = true;
|
|
9567
9581
|
|
|
9568
9582
|
this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
|