@wazo/sdk 0.37.35 → 0.37.36
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/README.md +1 -0
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +7 -1
- package/esm/__tests__/web-rtc-client.test.js +7 -1
- package/esm/api/call-logd.js +1 -1
- package/esm/api/chatd.js +6 -0
- package/esm/api/confd.js +6 -0
- package/esm/api-client.js +7 -1
- package/esm/checker/Checker.js +7 -1
- package/esm/checker/checks/aor.js +7 -1
- package/esm/checker/checks/api.js +7 -1
- package/esm/checker/checks/index.js +7 -1
- package/esm/checker/checks/webrtc-transport.js +7 -1
- package/esm/checker/checks/webrtc.js +7 -1
- package/esm/domain/AdHocAPIConference.js +11 -1
- package/esm/domain/CallLog.js +1 -1
- package/esm/domain/CallSession.js +14 -0
- package/esm/domain/Features.js +7 -1
- package/esm/domain/Phone/CTIPhone.js +21 -1
- package/esm/domain/Phone/WebRTCPhone.js +42 -11
- package/esm/domain/Profile.js +6 -0
- package/esm/domain/__tests__/CallLog.test.js +5 -1
- package/esm/domain/__tests__/CallSession.test.js +14 -0
- package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/esm/domain/__tests__/Profile.test.js +6 -0
- package/esm/domain/__tests__/Room.test.js +14 -0
- package/esm/domain/__tests__/Session.test.js +6 -0
- package/esm/index.js +59 -18
- package/esm/service/CallApi.js +7 -1
- package/esm/service/getApiClient.js +7 -1
- package/esm/simple/Auth.js +59 -18
- package/esm/simple/Configuration.js +59 -18
- package/esm/simple/Directory.js +7 -1
- package/esm/simple/Phone.js +59 -18
- package/esm/simple/index.js +59 -18
- package/esm/simple/room/LocalParticipant.js +59 -18
- package/esm/simple/room/Participant.js +59 -18
- package/esm/simple/room/RemoteParticipant.js +59 -18
- package/esm/simple/room/Room.js +59 -18
- package/esm/simple/room/SipRoom.js +59 -18
- package/esm/simple/room/Stream.js +59 -18
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +59 -18
- package/esm/simple/utils.js +59 -18
- package/esm/web-rtc-client.js +7 -1
- package/lib/__tests__/api-client.test.js +7 -1
- package/lib/__tests__/web-rtc-client.test.js +7 -1
- package/lib/api/call-logd.js +1 -1
- package/lib/api/chatd.js +6 -0
- package/lib/api/confd.js +6 -0
- package/lib/api-client.js +7 -1
- package/lib/checker/Checker.js +7 -1
- package/lib/checker/checks/aor.js +7 -1
- package/lib/checker/checks/api.js +7 -1
- package/lib/checker/checks/index.js +7 -1
- package/lib/checker/checks/webrtc-transport.js +7 -1
- package/lib/checker/checks/webrtc.js +7 -1
- package/lib/domain/AdHocAPIConference.js +11 -1
- package/lib/domain/CallLog.js +1 -1
- package/lib/domain/CallSession.js +14 -0
- package/lib/domain/Features.js +7 -1
- package/lib/domain/Phone/CTIPhone.js +21 -1
- package/lib/domain/Phone/WebRTCPhone.js +42 -11
- package/lib/domain/Profile.js +6 -0
- package/lib/domain/__tests__/CallLog.test.js +5 -1
- package/lib/domain/__tests__/CallSession.test.js +14 -0
- package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/lib/domain/__tests__/Profile.test.js +6 -0
- package/lib/domain/__tests__/Room.test.js +14 -0
- package/lib/domain/__tests__/Session.test.js +6 -0
- package/lib/index.js +59 -18
- package/lib/service/CallApi.js +7 -1
- package/lib/service/getApiClient.js +7 -1
- package/lib/simple/Auth.js +59 -18
- package/lib/simple/Configuration.js +59 -18
- package/lib/simple/Directory.js +7 -1
- package/lib/simple/Phone.js +59 -18
- package/lib/simple/index.js +59 -18
- package/lib/simple/room/LocalParticipant.js +59 -18
- package/lib/simple/room/Participant.js +59 -18
- package/lib/simple/room/RemoteParticipant.js +59 -18
- package/lib/simple/room/Room.js +59 -18
- package/lib/simple/room/SipRoom.js +59 -18
- package/lib/simple/room/Stream.js +59 -18
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +59 -18
- package/lib/simple/utils.js +59 -18
- package/lib/web-rtc-client.js +7 -1
- package/package.json +1 -1
- package/src/domain/AdHocAPIConference.js +4 -0
- package/src/domain/CallLog.js +1 -1
- package/src/domain/CallSession.js +14 -0
- package/src/domain/Phone/WebRTCPhone.js +28 -11
- package/src/domain/Profile.js +6 -0
- package/src/domain/__tests__/CallLog.test.js +4 -0
- package/src/simple/Phone.js +6 -6
package/esm/simple/Phone.js
CHANGED
|
@@ -275,6 +275,7 @@ var updateFrom = (instance , from ) => {
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
|
|
278
|
+
|
|
278
279
|
|
|
279
280
|
|
|
280
281
|
class CallSession {
|
|
@@ -337,6 +338,8 @@ class CallSession {
|
|
|
337
338
|
|
|
338
339
|
|
|
339
340
|
|
|
341
|
+
|
|
342
|
+
|
|
340
343
|
|
|
341
344
|
|
|
342
345
|
|
|
@@ -368,6 +371,7 @@ class CallSession {
|
|
|
368
371
|
videoRemotelyDowngraded,
|
|
369
372
|
sipSession,
|
|
370
373
|
answerTime,
|
|
374
|
+
conference,
|
|
371
375
|
} ) {
|
|
372
376
|
this.callId = callId;
|
|
373
377
|
this.sipCallId = sipCallId;
|
|
@@ -396,6 +400,7 @@ class CallSession {
|
|
|
396
400
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
397
401
|
this.sipSession = sipSession;
|
|
398
402
|
this.answerTime = answerTime || this.answerTime;
|
|
403
|
+
this.conference = conference;
|
|
399
404
|
|
|
400
405
|
// Useful to compare instead of instanceof with minified code
|
|
401
406
|
this.type = 'CallSession';
|
|
@@ -453,6 +458,10 @@ class CallSession {
|
|
|
453
458
|
this.screensharing = false;
|
|
454
459
|
}
|
|
455
460
|
|
|
461
|
+
setIsConference(conference ) {
|
|
462
|
+
this.conference = conference;
|
|
463
|
+
}
|
|
464
|
+
|
|
456
465
|
isIncoming() {
|
|
457
466
|
return !this.isCaller && !this.answered;
|
|
458
467
|
}
|
|
@@ -529,6 +538,10 @@ class CallSession {
|
|
|
529
538
|
return this.sipStatus === SessionState.Terminated;
|
|
530
539
|
}
|
|
531
540
|
|
|
541
|
+
isConference() {
|
|
542
|
+
return this.conference;
|
|
543
|
+
}
|
|
544
|
+
|
|
532
545
|
getElapsedTimeInSeconds() {
|
|
533
546
|
if (!this.startTime) {
|
|
534
547
|
return 0;
|
|
@@ -620,6 +633,7 @@ class CallSession {
|
|
|
620
633
|
cameraEnabled: false,
|
|
621
634
|
dialedExtension: call.dialedExtension,
|
|
622
635
|
call,
|
|
636
|
+
conference: false, // @FIXME?
|
|
623
637
|
});
|
|
624
638
|
}
|
|
625
639
|
}
|
|
@@ -1660,6 +1674,7 @@ const LINE_STATE = {
|
|
|
1660
1674
|
|
|
1661
1675
|
|
|
1662
1676
|
|
|
1677
|
+
|
|
1663
1678
|
|
|
1664
1679
|
|
|
1665
1680
|
|
|
@@ -1696,6 +1711,7 @@ const LINE_STATE = {
|
|
|
1696
1711
|
|
|
1697
1712
|
|
|
1698
1713
|
|
|
1714
|
+
|
|
1699
1715
|
|
|
1700
1716
|
|
|
1701
1717
|
|
|
@@ -1727,6 +1743,7 @@ class Profile {
|
|
|
1727
1743
|
|
|
1728
1744
|
|
|
1729
1745
|
|
|
1746
|
+
|
|
1730
1747
|
|
|
1731
1748
|
|
|
1732
1749
|
|
|
@@ -1743,6 +1760,7 @@ class Profile {
|
|
|
1743
1760
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
1744
1761
|
username: plain.username,
|
|
1745
1762
|
mobileNumber: plain.mobile_phone_number || '',
|
|
1763
|
+
ringSeconds: plain.ring_seconds,
|
|
1746
1764
|
forwards: [
|
|
1747
1765
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
1748
1766
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -1779,6 +1797,7 @@ class Profile {
|
|
|
1779
1797
|
switchboards,
|
|
1780
1798
|
agent,
|
|
1781
1799
|
status,
|
|
1800
|
+
ringSeconds,
|
|
1782
1801
|
sipLines,
|
|
1783
1802
|
callPickupTargetUsers,
|
|
1784
1803
|
onlineCallRecordEnabled,
|
|
@@ -1800,6 +1819,7 @@ class Profile {
|
|
|
1800
1819
|
this.status = status;
|
|
1801
1820
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
1802
1821
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
1822
|
+
this.ringSeconds = ringSeconds;
|
|
1803
1823
|
|
|
1804
1824
|
this.sipLines = sipLines || [];
|
|
1805
1825
|
}
|
|
@@ -3720,7 +3740,7 @@ class Recording {
|
|
|
3720
3740
|
|
|
3721
3741
|
|
|
3722
3742
|
|
|
3723
|
-
|
|
3743
|
+
|
|
3724
3744
|
|
|
3725
3745
|
|
|
3726
3746
|
|
|
@@ -5656,6 +5676,10 @@ class AdHocAPIConference {
|
|
|
5656
5676
|
this.conferenceId = conferenceId || '';
|
|
5657
5677
|
this.muted = muted || false;
|
|
5658
5678
|
this.paused = paused || false;
|
|
5679
|
+
|
|
5680
|
+
if (this.host) {
|
|
5681
|
+
this.host.setIsConference(true);
|
|
5682
|
+
}
|
|
5659
5683
|
}
|
|
5660
5684
|
|
|
5661
5685
|
async start() {
|
|
@@ -9365,7 +9389,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9365
9389
|
accept(callSession , cameraEnabled ) {
|
|
9366
9390
|
logger$8.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
9367
9391
|
if (this.currentSipSession) {
|
|
9368
|
-
this.holdSipSession(
|
|
9392
|
+
this.holdSipSession(
|
|
9393
|
+
this.currentSipSession,
|
|
9394
|
+
this.currentCallSession,
|
|
9395
|
+
true,
|
|
9396
|
+
);
|
|
9369
9397
|
}
|
|
9370
9398
|
|
|
9371
9399
|
if (!callSession) {
|
|
@@ -9458,22 +9486,22 @@ class WebRTCPhone extends Emitter {
|
|
|
9458
9486
|
}
|
|
9459
9487
|
}
|
|
9460
9488
|
|
|
9461
|
-
hold(callSession , withEvent = true
|
|
9489
|
+
hold(callSession , withEvent = true) {
|
|
9462
9490
|
logger$8.info('WebRTC hold', { id: callSession.getId() });
|
|
9463
9491
|
|
|
9464
9492
|
const sipSession = this.findSipSession(callSession);
|
|
9465
9493
|
|
|
9466
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
9494
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
9467
9495
|
}
|
|
9468
9496
|
|
|
9469
9497
|
// @Deprecated
|
|
9470
|
-
unhold(callSession , withEvent = true
|
|
9498
|
+
unhold(callSession , withEvent = true) {
|
|
9471
9499
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
9472
9500
|
|
|
9473
|
-
return this.resume(callSession,
|
|
9501
|
+
return this.resume(callSession, withEvent);
|
|
9474
9502
|
}
|
|
9475
9503
|
|
|
9476
|
-
resume(callSession ,
|
|
9504
|
+
resume(callSession , withEvent = true) {
|
|
9477
9505
|
logger$8.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
9478
9506
|
|
|
9479
9507
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -9486,10 +9514,14 @@ class WebRTCPhone extends Emitter {
|
|
|
9486
9514
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
9487
9515
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
9488
9516
|
logger$8.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
9489
|
-
this.holdSipSession(
|
|
9517
|
+
this.holdSipSession(
|
|
9518
|
+
this.currentSipSession,
|
|
9519
|
+
this.currentCallSession,
|
|
9520
|
+
withEvent,
|
|
9521
|
+
);
|
|
9490
9522
|
}
|
|
9491
9523
|
|
|
9492
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
9524
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
9493
9525
|
this.currentSipSession = sipSession;
|
|
9494
9526
|
if (callSession) {
|
|
9495
9527
|
this.currentCallSession = callSession;
|
|
@@ -9502,7 +9534,6 @@ class WebRTCPhone extends Emitter {
|
|
|
9502
9534
|
sipSession ,
|
|
9503
9535
|
callSession ,
|
|
9504
9536
|
withEvent = true,
|
|
9505
|
-
isConference = false,
|
|
9506
9537
|
) {
|
|
9507
9538
|
if (!sipSession) {
|
|
9508
9539
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -9523,6 +9554,8 @@ class WebRTCPhone extends Emitter {
|
|
|
9523
9554
|
await this.client.downgradeToAudio(sipSession);
|
|
9524
9555
|
}
|
|
9525
9556
|
|
|
9557
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9558
|
+
|
|
9526
9559
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
9527
9560
|
if (withEvent) {
|
|
9528
9561
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -9535,11 +9568,13 @@ class WebRTCPhone extends Emitter {
|
|
|
9535
9568
|
sipSession ,
|
|
9536
9569
|
callSession ,
|
|
9537
9570
|
withEvent = true,
|
|
9538
|
-
isConference = false,
|
|
9539
9571
|
) {
|
|
9540
9572
|
if (!sipSession) {
|
|
9541
9573
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
9542
9574
|
}
|
|
9575
|
+
|
|
9576
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9577
|
+
|
|
9543
9578
|
const sessionId = this.getSipSessionId(sipSession);
|
|
9544
9579
|
logger$8.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
9545
9580
|
|
|
@@ -9681,7 +9716,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9681
9716
|
await this.client.register();
|
|
9682
9717
|
}
|
|
9683
9718
|
if (this.currentSipSession) {
|
|
9684
|
-
this.holdSipSession(
|
|
9719
|
+
this.holdSipSession(
|
|
9720
|
+
this.currentSipSession,
|
|
9721
|
+
this.currentCallSession,
|
|
9722
|
+
true,
|
|
9723
|
+
).catch(e => {
|
|
9685
9724
|
logger$8.warn('Unable to hold current session when making another call', e);
|
|
9686
9725
|
});
|
|
9687
9726
|
}
|
|
@@ -9696,6 +9735,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9696
9735
|
return Promise.resolve(null);
|
|
9697
9736
|
}
|
|
9698
9737
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
9738
|
+
callSession.setIsConference(conference);
|
|
9699
9739
|
callSession.creationTime = new Date();
|
|
9700
9740
|
this._updateCallSession(callSession);
|
|
9701
9741
|
|
|
@@ -10274,6 +10314,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10274
10314
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10275
10315
|
recordingPaused: false, // @TODO
|
|
10276
10316
|
sipSession,
|
|
10317
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10277
10318
|
...extra,
|
|
10278
10319
|
});
|
|
10279
10320
|
|
|
@@ -13691,16 +13732,16 @@ class Phone extends Emitter {
|
|
|
13691
13732
|
}
|
|
13692
13733
|
}
|
|
13693
13734
|
|
|
13694
|
-
hold(callSession
|
|
13695
|
-
return this.phone && this.phone.hold(callSession, true
|
|
13735
|
+
hold(callSession ) {
|
|
13736
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
13696
13737
|
}
|
|
13697
13738
|
|
|
13698
|
-
unhold(callSession
|
|
13699
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
13739
|
+
unhold(callSession ) {
|
|
13740
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
13700
13741
|
}
|
|
13701
13742
|
|
|
13702
|
-
resume(callSession
|
|
13703
|
-
return this.phone && this.phone.resume(callSession
|
|
13743
|
+
resume(callSession ) {
|
|
13744
|
+
return this.phone && this.phone.resume(callSession);
|
|
13704
13745
|
}
|
|
13705
13746
|
|
|
13706
13747
|
reject(callSession ) {
|
package/esm/simple/index.js
CHANGED
|
@@ -384,6 +384,7 @@ const LINE_STATE = {
|
|
|
384
384
|
|
|
385
385
|
|
|
386
386
|
|
|
387
|
+
|
|
387
388
|
|
|
388
389
|
|
|
389
390
|
|
|
@@ -420,6 +421,7 @@ const LINE_STATE = {
|
|
|
420
421
|
|
|
421
422
|
|
|
422
423
|
|
|
424
|
+
|
|
423
425
|
|
|
424
426
|
|
|
425
427
|
|
|
@@ -451,6 +453,7 @@ class Profile {
|
|
|
451
453
|
|
|
452
454
|
|
|
453
455
|
|
|
456
|
+
|
|
454
457
|
|
|
455
458
|
|
|
456
459
|
|
|
@@ -467,6 +470,7 @@ class Profile {
|
|
|
467
470
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
468
471
|
username: plain.username,
|
|
469
472
|
mobileNumber: plain.mobile_phone_number || '',
|
|
473
|
+
ringSeconds: plain.ring_seconds,
|
|
470
474
|
forwards: [
|
|
471
475
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
472
476
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -503,6 +507,7 @@ class Profile {
|
|
|
503
507
|
switchboards,
|
|
504
508
|
agent,
|
|
505
509
|
status,
|
|
510
|
+
ringSeconds,
|
|
506
511
|
sipLines,
|
|
507
512
|
callPickupTargetUsers,
|
|
508
513
|
onlineCallRecordEnabled,
|
|
@@ -524,6 +529,7 @@ class Profile {
|
|
|
524
529
|
this.status = status;
|
|
525
530
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
526
531
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
532
|
+
this.ringSeconds = ringSeconds;
|
|
527
533
|
|
|
528
534
|
this.sipLines = sipLines || [];
|
|
529
535
|
}
|
|
@@ -3280,6 +3286,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3280
3286
|
|
|
3281
3287
|
|
|
3282
3288
|
|
|
3289
|
+
|
|
3283
3290
|
|
|
3284
3291
|
|
|
3285
3292
|
class CallSession {
|
|
@@ -3342,6 +3349,8 @@ class CallSession {
|
|
|
3342
3349
|
|
|
3343
3350
|
|
|
3344
3351
|
|
|
3352
|
+
|
|
3353
|
+
|
|
3345
3354
|
|
|
3346
3355
|
|
|
3347
3356
|
|
|
@@ -3373,6 +3382,7 @@ class CallSession {
|
|
|
3373
3382
|
videoRemotelyDowngraded,
|
|
3374
3383
|
sipSession,
|
|
3375
3384
|
answerTime,
|
|
3385
|
+
conference,
|
|
3376
3386
|
} ) {
|
|
3377
3387
|
this.callId = callId;
|
|
3378
3388
|
this.sipCallId = sipCallId;
|
|
@@ -3401,6 +3411,7 @@ class CallSession {
|
|
|
3401
3411
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3402
3412
|
this.sipSession = sipSession;
|
|
3403
3413
|
this.answerTime = answerTime || this.answerTime;
|
|
3414
|
+
this.conference = conference;
|
|
3404
3415
|
|
|
3405
3416
|
// Useful to compare instead of instanceof with minified code
|
|
3406
3417
|
this.type = 'CallSession';
|
|
@@ -3458,6 +3469,10 @@ class CallSession {
|
|
|
3458
3469
|
this.screensharing = false;
|
|
3459
3470
|
}
|
|
3460
3471
|
|
|
3472
|
+
setIsConference(conference ) {
|
|
3473
|
+
this.conference = conference;
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3461
3476
|
isIncoming() {
|
|
3462
3477
|
return !this.isCaller && !this.answered;
|
|
3463
3478
|
}
|
|
@@ -3534,6 +3549,10 @@ class CallSession {
|
|
|
3534
3549
|
return this.sipStatus === SessionState.Terminated;
|
|
3535
3550
|
}
|
|
3536
3551
|
|
|
3552
|
+
isConference() {
|
|
3553
|
+
return this.conference;
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3537
3556
|
getElapsedTimeInSeconds() {
|
|
3538
3557
|
if (!this.startTime) {
|
|
3539
3558
|
return 0;
|
|
@@ -3625,6 +3644,7 @@ class CallSession {
|
|
|
3625
3644
|
cameraEnabled: false,
|
|
3626
3645
|
dialedExtension: call.dialedExtension,
|
|
3627
3646
|
call,
|
|
3647
|
+
conference: false, // @FIXME?
|
|
3628
3648
|
});
|
|
3629
3649
|
}
|
|
3630
3650
|
}
|
|
@@ -3720,7 +3740,7 @@ class Recording {
|
|
|
3720
3740
|
|
|
3721
3741
|
|
|
3722
3742
|
|
|
3723
|
-
|
|
3743
|
+
|
|
3724
3744
|
|
|
3725
3745
|
|
|
3726
3746
|
|
|
@@ -5920,6 +5940,10 @@ class AdHocAPIConference {
|
|
|
5920
5940
|
this.conferenceId = conferenceId || '';
|
|
5921
5941
|
this.muted = muted || false;
|
|
5922
5942
|
this.paused = paused || false;
|
|
5943
|
+
|
|
5944
|
+
if (this.host) {
|
|
5945
|
+
this.host.setIsConference(true);
|
|
5946
|
+
}
|
|
5923
5947
|
}
|
|
5924
5948
|
|
|
5925
5949
|
async start() {
|
|
@@ -9629,7 +9653,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9629
9653
|
accept(callSession , cameraEnabled ) {
|
|
9630
9654
|
logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
9631
9655
|
if (this.currentSipSession) {
|
|
9632
|
-
this.holdSipSession(
|
|
9656
|
+
this.holdSipSession(
|
|
9657
|
+
this.currentSipSession,
|
|
9658
|
+
this.currentCallSession,
|
|
9659
|
+
true,
|
|
9660
|
+
);
|
|
9633
9661
|
}
|
|
9634
9662
|
|
|
9635
9663
|
if (!callSession) {
|
|
@@ -9722,22 +9750,22 @@ class WebRTCPhone extends Emitter {
|
|
|
9722
9750
|
}
|
|
9723
9751
|
}
|
|
9724
9752
|
|
|
9725
|
-
hold(callSession , withEvent = true
|
|
9753
|
+
hold(callSession , withEvent = true) {
|
|
9726
9754
|
logger$7.info('WebRTC hold', { id: callSession.getId() });
|
|
9727
9755
|
|
|
9728
9756
|
const sipSession = this.findSipSession(callSession);
|
|
9729
9757
|
|
|
9730
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
9758
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
9731
9759
|
}
|
|
9732
9760
|
|
|
9733
9761
|
// @Deprecated
|
|
9734
|
-
unhold(callSession , withEvent = true
|
|
9762
|
+
unhold(callSession , withEvent = true) {
|
|
9735
9763
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
9736
9764
|
|
|
9737
|
-
return this.resume(callSession,
|
|
9765
|
+
return this.resume(callSession, withEvent);
|
|
9738
9766
|
}
|
|
9739
9767
|
|
|
9740
|
-
resume(callSession ,
|
|
9768
|
+
resume(callSession , withEvent = true) {
|
|
9741
9769
|
logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
9742
9770
|
|
|
9743
9771
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -9750,10 +9778,14 @@ class WebRTCPhone extends Emitter {
|
|
|
9750
9778
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
9751
9779
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
9752
9780
|
logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
9753
|
-
this.holdSipSession(
|
|
9781
|
+
this.holdSipSession(
|
|
9782
|
+
this.currentSipSession,
|
|
9783
|
+
this.currentCallSession,
|
|
9784
|
+
withEvent,
|
|
9785
|
+
);
|
|
9754
9786
|
}
|
|
9755
9787
|
|
|
9756
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
9788
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
9757
9789
|
this.currentSipSession = sipSession;
|
|
9758
9790
|
if (callSession) {
|
|
9759
9791
|
this.currentCallSession = callSession;
|
|
@@ -9766,7 +9798,6 @@ class WebRTCPhone extends Emitter {
|
|
|
9766
9798
|
sipSession ,
|
|
9767
9799
|
callSession ,
|
|
9768
9800
|
withEvent = true,
|
|
9769
|
-
isConference = false,
|
|
9770
9801
|
) {
|
|
9771
9802
|
if (!sipSession) {
|
|
9772
9803
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -9787,6 +9818,8 @@ class WebRTCPhone extends Emitter {
|
|
|
9787
9818
|
await this.client.downgradeToAudio(sipSession);
|
|
9788
9819
|
}
|
|
9789
9820
|
|
|
9821
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9822
|
+
|
|
9790
9823
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
9791
9824
|
if (withEvent) {
|
|
9792
9825
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -9799,11 +9832,13 @@ class WebRTCPhone extends Emitter {
|
|
|
9799
9832
|
sipSession ,
|
|
9800
9833
|
callSession ,
|
|
9801
9834
|
withEvent = true,
|
|
9802
|
-
isConference = false,
|
|
9803
9835
|
) {
|
|
9804
9836
|
if (!sipSession) {
|
|
9805
9837
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
9806
9838
|
}
|
|
9839
|
+
|
|
9840
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9841
|
+
|
|
9807
9842
|
const sessionId = this.getSipSessionId(sipSession);
|
|
9808
9843
|
logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
9809
9844
|
|
|
@@ -9945,7 +9980,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9945
9980
|
await this.client.register();
|
|
9946
9981
|
}
|
|
9947
9982
|
if (this.currentSipSession) {
|
|
9948
|
-
this.holdSipSession(
|
|
9983
|
+
this.holdSipSession(
|
|
9984
|
+
this.currentSipSession,
|
|
9985
|
+
this.currentCallSession,
|
|
9986
|
+
true,
|
|
9987
|
+
).catch(e => {
|
|
9949
9988
|
logger$7.warn('Unable to hold current session when making another call', e);
|
|
9950
9989
|
});
|
|
9951
9990
|
}
|
|
@@ -9960,6 +9999,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9960
9999
|
return Promise.resolve(null);
|
|
9961
10000
|
}
|
|
9962
10001
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
10002
|
+
callSession.setIsConference(conference);
|
|
9963
10003
|
callSession.creationTime = new Date();
|
|
9964
10004
|
this._updateCallSession(callSession);
|
|
9965
10005
|
|
|
@@ -10538,6 +10578,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10538
10578
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10539
10579
|
recordingPaused: false, // @TODO
|
|
10540
10580
|
sipSession,
|
|
10581
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10541
10582
|
...extra,
|
|
10542
10583
|
});
|
|
10543
10584
|
|
|
@@ -10794,16 +10835,16 @@ class Phone extends Emitter {
|
|
|
10794
10835
|
}
|
|
10795
10836
|
}
|
|
10796
10837
|
|
|
10797
|
-
hold(callSession
|
|
10798
|
-
return this.phone && this.phone.hold(callSession, true
|
|
10838
|
+
hold(callSession ) {
|
|
10839
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
10799
10840
|
}
|
|
10800
10841
|
|
|
10801
|
-
unhold(callSession
|
|
10802
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
10842
|
+
unhold(callSession ) {
|
|
10843
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
10803
10844
|
}
|
|
10804
10845
|
|
|
10805
|
-
resume(callSession
|
|
10806
|
-
return this.phone && this.phone.resume(callSession
|
|
10846
|
+
resume(callSession ) {
|
|
10847
|
+
return this.phone && this.phone.resume(callSession);
|
|
10807
10848
|
}
|
|
10808
10849
|
|
|
10809
10850
|
reject(callSession ) {
|