@wazo/sdk 0.38.4 → 0.38.7
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 +4 -4
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +6 -0
- package/esm/__tests__/web-rtc-client.test.js +88 -3
- package/esm/api/calld.js +6 -0
- package/esm/api/ctid-ng.js +6 -0
- package/esm/api-client.js +6 -0
- package/esm/checker/Checker.js +38 -3
- package/esm/checker/checks/aor.js +6 -0
- package/esm/checker/checks/api.js +6 -0
- package/esm/checker/checks/index.js +38 -3
- package/esm/checker/checks/webrtc-transport.js +38 -3
- package/esm/checker/checks/webrtc.js +38 -3
- package/esm/domain/AdHocAPIConference.js +6 -0
- package/esm/domain/Call.js +6 -0
- package/esm/domain/CallSession.js +1 -1
- package/esm/domain/Features.js +6 -0
- package/esm/domain/Phone/CTIPhone.js +7 -1
- package/esm/domain/Phone/WebRTCPhone.js +3 -3
- package/esm/domain/__tests__/Call.test.js +6 -0
- package/esm/domain/__tests__/CallSession.test.js +1 -1
- package/esm/domain/__tests__/IndirectTransfer.test.js +1 -1
- package/esm/domain/__tests__/Line.test.js +5 -5
- package/esm/domain/__tests__/Room.test.js +1 -1
- package/esm/index.js +42 -8
- package/esm/lib/WazoSessionDescriptionHandler.js +30 -1
- package/esm/service/CallApi.js +6 -0
- package/esm/service/getApiClient.js +6 -0
- package/esm/simple/Auth.js +42 -8
- package/esm/simple/Configuration.js +42 -8
- package/esm/simple/Directory.js +6 -0
- package/esm/simple/Phone.js +42 -8
- package/esm/simple/Softphone.js +1 -2
- package/esm/simple/index.js +42 -8
- package/esm/simple/room/LocalParticipant.js +42 -8
- package/esm/simple/room/Participant.js +42 -8
- package/esm/simple/room/RemoteParticipant.js +42 -8
- package/esm/simple/room/Room.js +42 -8
- package/esm/simple/room/SipRoom.js +42 -8
- package/esm/simple/room/Stream.js +42 -8
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +42 -8
- package/esm/simple/utils.js +42 -8
- package/esm/utils/__tests__/sdp.test.js +50 -0
- package/esm/utils/sdp.js +19 -1
- package/esm/web-rtc-client.js +38 -3
- package/lib/__tests__/api-client.test.js +6 -0
- package/lib/__tests__/web-rtc-client.test.js +88 -3
- package/lib/api/calld.js +6 -0
- package/lib/api/ctid-ng.js +6 -0
- package/lib/api-client.js +6 -0
- package/lib/checker/Checker.js +38 -3
- package/lib/checker/checks/aor.js +6 -0
- package/lib/checker/checks/api.js +6 -0
- package/lib/checker/checks/index.js +38 -3
- package/lib/checker/checks/webrtc-transport.js +38 -3
- package/lib/checker/checks/webrtc.js +38 -3
- package/lib/domain/AdHocAPIConference.js +6 -0
- package/lib/domain/Call.js +6 -0
- package/lib/domain/CallSession.js +1 -1
- package/lib/domain/Features.js +6 -0
- package/lib/domain/Phone/CTIPhone.js +7 -1
- package/lib/domain/Phone/WebRTCPhone.js +3 -3
- package/lib/domain/__tests__/Call.test.js +6 -0
- package/lib/domain/__tests__/CallSession.test.js +1 -1
- package/lib/domain/__tests__/IndirectTransfer.test.js +1 -1
- package/lib/domain/__tests__/Line.test.js +5 -5
- package/lib/domain/__tests__/Room.test.js +1 -1
- package/lib/index.js +42 -8
- package/lib/lib/WazoSessionDescriptionHandler.js +30 -1
- package/lib/service/CallApi.js +6 -0
- package/lib/service/getApiClient.js +6 -0
- package/lib/simple/Auth.js +42 -8
- package/lib/simple/Configuration.js +42 -8
- package/lib/simple/Directory.js +6 -0
- package/lib/simple/Phone.js +42 -8
- package/lib/simple/Softphone.js +1 -2
- package/lib/simple/index.js +42 -8
- package/lib/simple/room/LocalParticipant.js +42 -8
- package/lib/simple/room/Participant.js +42 -8
- package/lib/simple/room/RemoteParticipant.js +42 -8
- package/lib/simple/room/Room.js +42 -8
- package/lib/simple/room/SipRoom.js +42 -8
- package/lib/simple/room/Stream.js +42 -8
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +42 -8
- package/lib/simple/utils.js +42 -8
- package/lib/utils/__tests__/sdp.test.js +50 -0
- package/lib/utils/sdp.js +19 -0
- package/lib/web-rtc-client.js +38 -3
- package/package.json +1 -1
- package/src/__tests__/web-rtc-client.test.js +50 -0
- package/src/domain/Call.js +6 -0
- package/src/domain/CallSession.js +1 -1
- package/src/domain/Phone/WebRTCPhone.js +2 -2
- package/src/domain/__tests__/Line.test.js +5 -5
- package/src/lib/WazoSessionDescriptionHandler.js +13 -2
- package/src/simple/Softphone.js +1 -2
- package/src/utils/__tests__/sdp.test.js +33 -1
- package/src/utils/sdp.js +18 -0
- package/src/web-rtc-client.js +2 -2
|
@@ -778,6 +778,24 @@ const fixSdp = (sdp , candidates , forcePort = true)
|
|
|
778
778
|
return fixed;
|
|
779
779
|
};
|
|
780
780
|
|
|
781
|
+
const addIcesInAllBundles = (sdp ) => {
|
|
782
|
+
const parsedSdp = sdpParser.parse(sdp);
|
|
783
|
+
|
|
784
|
+
const mediaWithCandidate = parsedSdp.media.find(media => !!media.candidates);
|
|
785
|
+
if (!mediaWithCandidate) {
|
|
786
|
+
return sdp;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const { candidates } = mediaWithCandidate;
|
|
790
|
+
|
|
791
|
+
parsedSdp.media = parsedSdp.media.map(media => ({
|
|
792
|
+
...media,
|
|
793
|
+
candidates: media.candidates || candidates,
|
|
794
|
+
}));
|
|
795
|
+
|
|
796
|
+
return sdpParser.write(parsedSdp);
|
|
797
|
+
};
|
|
798
|
+
|
|
781
799
|
/* global RTCSessionDescriptionInit, navigator */
|
|
782
800
|
|
|
783
801
|
const wazoLogger = IssueReporter$1 ? IssueReporter$1.loggerFor('webrtc-sdh') : console;
|
|
@@ -876,6 +894,14 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
876
894
|
wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
|
|
877
895
|
if (event.candidate) {
|
|
878
896
|
this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
|
|
897
|
+
|
|
898
|
+
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
899
|
+
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
900
|
+
wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
|
|
901
|
+
ice: event.candidate.candidate,
|
|
902
|
+
});
|
|
903
|
+
this.iceGatheringComplete();
|
|
904
|
+
}
|
|
879
905
|
}
|
|
880
906
|
};
|
|
881
907
|
|
|
@@ -899,7 +925,10 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
899
925
|
|
|
900
926
|
// Check if we got ICEs
|
|
901
927
|
if (sdp.indexOf('a=candidate') !== -1) {
|
|
902
|
-
return
|
|
928
|
+
return {
|
|
929
|
+
type: description.type,
|
|
930
|
+
sdp: addIcesInAllBundles(sdp),
|
|
931
|
+
};
|
|
903
932
|
}
|
|
904
933
|
|
|
905
934
|
wazoLogger.info('No ICE candidates found in SDP, fixing it with gathered ices', this.gatheredCandidates);
|
|
@@ -3599,6 +3628,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3599
3628
|
|
|
3600
3629
|
|
|
3601
3630
|
|
|
3631
|
+
|
|
3602
3632
|
|
|
3603
3633
|
|
|
3604
3634
|
|
|
@@ -3609,6 +3639,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3609
3639
|
|
|
3610
3640
|
|
|
3611
3641
|
|
|
3642
|
+
|
|
3612
3643
|
|
|
3613
3644
|
|
|
3614
3645
|
|
|
@@ -3637,6 +3668,7 @@ class Call {
|
|
|
3637
3668
|
|
|
3638
3669
|
|
|
3639
3670
|
|
|
3671
|
+
|
|
3640
3672
|
|
|
3641
3673
|
|
|
3642
3674
|
|
|
@@ -3661,6 +3693,7 @@ class Call {
|
|
|
3661
3693
|
calleeNumber: plain.peer_caller_id_number,
|
|
3662
3694
|
dialedExtension: plain.dialed_extension,
|
|
3663
3695
|
isCaller: plain.is_caller,
|
|
3696
|
+
isVideo: plain.is_video,
|
|
3664
3697
|
muted: plain.muted,
|
|
3665
3698
|
onHold: plain.on_hold,
|
|
3666
3699
|
status: plain.status,
|
|
@@ -3684,6 +3717,7 @@ class Call {
|
|
|
3684
3717
|
calleeNumber,
|
|
3685
3718
|
dialedExtension,
|
|
3686
3719
|
isCaller,
|
|
3720
|
+
isVideo,
|
|
3687
3721
|
lineId,
|
|
3688
3722
|
muted,
|
|
3689
3723
|
onHold,
|
|
@@ -3707,6 +3741,7 @@ class Call {
|
|
|
3707
3741
|
this.startingTime = startingTime;
|
|
3708
3742
|
this.talkingToIds = talkingToIds || [];
|
|
3709
3743
|
this.recording = recording;
|
|
3744
|
+
this.isVideo = !!isVideo;
|
|
3710
3745
|
|
|
3711
3746
|
// Useful to compare instead of instanceof with minified code
|
|
3712
3747
|
this.type = 'Call';
|
|
@@ -6406,11 +6441,11 @@ class WebRTCClient extends Emitter {
|
|
|
6406
6441
|
});
|
|
6407
6442
|
}
|
|
6408
6443
|
|
|
6409
|
-
changeAudioInputDevice(id , session ) {
|
|
6444
|
+
changeAudioInputDevice(id , session , force ) {
|
|
6410
6445
|
const currentId = this.getAudioDeviceId();
|
|
6411
6446
|
logger.info('setting audio input device', { id, currentId, session: !!session });
|
|
6412
6447
|
|
|
6413
|
-
if (id === currentId) {
|
|
6448
|
+
if (!force && id === currentId) {
|
|
6414
6449
|
return null;
|
|
6415
6450
|
}
|
|
6416
6451
|
|
|
@@ -778,6 +778,24 @@ const fixSdp = (sdp , candidates , forcePort = true)
|
|
|
778
778
|
return fixed;
|
|
779
779
|
};
|
|
780
780
|
|
|
781
|
+
const addIcesInAllBundles = (sdp ) => {
|
|
782
|
+
const parsedSdp = sdpParser.parse(sdp);
|
|
783
|
+
|
|
784
|
+
const mediaWithCandidate = parsedSdp.media.find(media => !!media.candidates);
|
|
785
|
+
if (!mediaWithCandidate) {
|
|
786
|
+
return sdp;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const { candidates } = mediaWithCandidate;
|
|
790
|
+
|
|
791
|
+
parsedSdp.media = parsedSdp.media.map(media => ({
|
|
792
|
+
...media,
|
|
793
|
+
candidates: media.candidates || candidates,
|
|
794
|
+
}));
|
|
795
|
+
|
|
796
|
+
return sdpParser.write(parsedSdp);
|
|
797
|
+
};
|
|
798
|
+
|
|
781
799
|
/* global RTCSessionDescriptionInit, navigator */
|
|
782
800
|
|
|
783
801
|
const wazoLogger = IssueReporter$1 ? IssueReporter$1.loggerFor('webrtc-sdh') : console;
|
|
@@ -876,6 +894,14 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
876
894
|
wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
|
|
877
895
|
if (event.candidate) {
|
|
878
896
|
this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
|
|
897
|
+
|
|
898
|
+
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
899
|
+
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
900
|
+
wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
|
|
901
|
+
ice: event.candidate.candidate,
|
|
902
|
+
});
|
|
903
|
+
this.iceGatheringComplete();
|
|
904
|
+
}
|
|
879
905
|
}
|
|
880
906
|
};
|
|
881
907
|
|
|
@@ -899,7 +925,10 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
899
925
|
|
|
900
926
|
// Check if we got ICEs
|
|
901
927
|
if (sdp.indexOf('a=candidate') !== -1) {
|
|
902
|
-
return
|
|
928
|
+
return {
|
|
929
|
+
type: description.type,
|
|
930
|
+
sdp: addIcesInAllBundles(sdp),
|
|
931
|
+
};
|
|
903
932
|
}
|
|
904
933
|
|
|
905
934
|
wazoLogger.info('No ICE candidates found in SDP, fixing it with gathered ices', this.gatheredCandidates);
|
|
@@ -3599,6 +3628,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3599
3628
|
|
|
3600
3629
|
|
|
3601
3630
|
|
|
3631
|
+
|
|
3602
3632
|
|
|
3603
3633
|
|
|
3604
3634
|
|
|
@@ -3609,6 +3639,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3609
3639
|
|
|
3610
3640
|
|
|
3611
3641
|
|
|
3642
|
+
|
|
3612
3643
|
|
|
3613
3644
|
|
|
3614
3645
|
|
|
@@ -3637,6 +3668,7 @@ class Call {
|
|
|
3637
3668
|
|
|
3638
3669
|
|
|
3639
3670
|
|
|
3671
|
+
|
|
3640
3672
|
|
|
3641
3673
|
|
|
3642
3674
|
|
|
@@ -3661,6 +3693,7 @@ class Call {
|
|
|
3661
3693
|
calleeNumber: plain.peer_caller_id_number,
|
|
3662
3694
|
dialedExtension: plain.dialed_extension,
|
|
3663
3695
|
isCaller: plain.is_caller,
|
|
3696
|
+
isVideo: plain.is_video,
|
|
3664
3697
|
muted: plain.muted,
|
|
3665
3698
|
onHold: plain.on_hold,
|
|
3666
3699
|
status: plain.status,
|
|
@@ -3684,6 +3717,7 @@ class Call {
|
|
|
3684
3717
|
calleeNumber,
|
|
3685
3718
|
dialedExtension,
|
|
3686
3719
|
isCaller,
|
|
3720
|
+
isVideo,
|
|
3687
3721
|
lineId,
|
|
3688
3722
|
muted,
|
|
3689
3723
|
onHold,
|
|
@@ -3707,6 +3741,7 @@ class Call {
|
|
|
3707
3741
|
this.startingTime = startingTime;
|
|
3708
3742
|
this.talkingToIds = talkingToIds || [];
|
|
3709
3743
|
this.recording = recording;
|
|
3744
|
+
this.isVideo = !!isVideo;
|
|
3710
3745
|
|
|
3711
3746
|
// Useful to compare instead of instanceof with minified code
|
|
3712
3747
|
this.type = 'Call';
|
|
@@ -6406,11 +6441,11 @@ class WebRTCClient extends Emitter {
|
|
|
6406
6441
|
});
|
|
6407
6442
|
}
|
|
6408
6443
|
|
|
6409
|
-
changeAudioInputDevice(id , session ) {
|
|
6444
|
+
changeAudioInputDevice(id , session , force ) {
|
|
6410
6445
|
const currentId = this.getAudioDeviceId();
|
|
6411
6446
|
logger.info('setting audio input device', { id, currentId, session: !!session });
|
|
6412
6447
|
|
|
6413
|
-
if (id === currentId) {
|
|
6448
|
+
if (!force && id === currentId) {
|
|
6414
6449
|
return null;
|
|
6415
6450
|
}
|
|
6416
6451
|
|
|
@@ -30,6 +30,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
|
|
@@ -40,6 +41,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
|
|
44
|
+
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
|
|
@@ -68,6 +70,7 @@ class Call {
|
|
|
68
70
|
|
|
69
71
|
|
|
70
72
|
|
|
73
|
+
|
|
71
74
|
|
|
72
75
|
|
|
73
76
|
|
|
@@ -92,6 +95,7 @@ class Call {
|
|
|
92
95
|
calleeNumber: plain.peer_caller_id_number,
|
|
93
96
|
dialedExtension: plain.dialed_extension,
|
|
94
97
|
isCaller: plain.is_caller,
|
|
98
|
+
isVideo: plain.is_video,
|
|
95
99
|
muted: plain.muted,
|
|
96
100
|
onHold: plain.on_hold,
|
|
97
101
|
status: plain.status,
|
|
@@ -115,6 +119,7 @@ class Call {
|
|
|
115
119
|
calleeNumber,
|
|
116
120
|
dialedExtension,
|
|
117
121
|
isCaller,
|
|
122
|
+
isVideo,
|
|
118
123
|
lineId,
|
|
119
124
|
muted,
|
|
120
125
|
onHold,
|
|
@@ -138,6 +143,7 @@ class Call {
|
|
|
138
143
|
this.startingTime = startingTime;
|
|
139
144
|
this.talkingToIds = talkingToIds || [];
|
|
140
145
|
this.recording = recording;
|
|
146
|
+
this.isVideo = !!isVideo;
|
|
141
147
|
|
|
142
148
|
// Useful to compare instead of instanceof with minified code
|
|
143
149
|
this.type = 'Call';
|
package/esm/domain/Call.js
CHANGED
|
@@ -25,6 +25,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
@@ -35,6 +36,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
39
|
+
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
|
|
@@ -63,6 +65,7 @@ class Call {
|
|
|
63
65
|
|
|
64
66
|
|
|
65
67
|
|
|
68
|
+
|
|
66
69
|
|
|
67
70
|
|
|
68
71
|
|
|
@@ -87,6 +90,7 @@ class Call {
|
|
|
87
90
|
calleeNumber: plain.peer_caller_id_number,
|
|
88
91
|
dialedExtension: plain.dialed_extension,
|
|
89
92
|
isCaller: plain.is_caller,
|
|
93
|
+
isVideo: plain.is_video,
|
|
90
94
|
muted: plain.muted,
|
|
91
95
|
onHold: plain.on_hold,
|
|
92
96
|
status: plain.status,
|
|
@@ -110,6 +114,7 @@ class Call {
|
|
|
110
114
|
calleeNumber,
|
|
111
115
|
dialedExtension,
|
|
112
116
|
isCaller,
|
|
117
|
+
isVideo,
|
|
113
118
|
lineId,
|
|
114
119
|
muted,
|
|
115
120
|
onHold,
|
|
@@ -133,6 +138,7 @@ class Call {
|
|
|
133
138
|
this.startingTime = startingTime;
|
|
134
139
|
this.talkingToIds = talkingToIds || [];
|
|
135
140
|
this.recording = recording;
|
|
141
|
+
this.isVideo = !!isVideo;
|
|
136
142
|
|
|
137
143
|
// Useful to compare instead of instanceof with minified code
|
|
138
144
|
this.type = 'Call';
|
|
@@ -414,7 +414,7 @@ class CallSession {
|
|
|
414
414
|
ringing: call.isRinging(),
|
|
415
415
|
answered: call.isUp(),
|
|
416
416
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
417
|
-
cameraEnabled:
|
|
417
|
+
cameraEnabled: call.isVideo,
|
|
418
418
|
dialedExtension: call.dialedExtension,
|
|
419
419
|
call,
|
|
420
420
|
conference: false, // @FIXME?
|
package/esm/domain/Features.js
CHANGED
|
@@ -3051,6 +3051,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3051
3051
|
|
|
3052
3052
|
|
|
3053
3053
|
|
|
3054
|
+
|
|
3054
3055
|
|
|
3055
3056
|
|
|
3056
3057
|
|
|
@@ -3061,6 +3062,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3061
3062
|
|
|
3062
3063
|
|
|
3063
3064
|
|
|
3065
|
+
|
|
3064
3066
|
|
|
3065
3067
|
|
|
3066
3068
|
|
|
@@ -3089,6 +3091,7 @@ class Call {
|
|
|
3089
3091
|
|
|
3090
3092
|
|
|
3091
3093
|
|
|
3094
|
+
|
|
3092
3095
|
|
|
3093
3096
|
|
|
3094
3097
|
|
|
@@ -3113,6 +3116,7 @@ class Call {
|
|
|
3113
3116
|
calleeNumber: plain.peer_caller_id_number,
|
|
3114
3117
|
dialedExtension: plain.dialed_extension,
|
|
3115
3118
|
isCaller: plain.is_caller,
|
|
3119
|
+
isVideo: plain.is_video,
|
|
3116
3120
|
muted: plain.muted,
|
|
3117
3121
|
onHold: plain.on_hold,
|
|
3118
3122
|
status: plain.status,
|
|
@@ -3136,6 +3140,7 @@ class Call {
|
|
|
3136
3140
|
calleeNumber,
|
|
3137
3141
|
dialedExtension,
|
|
3138
3142
|
isCaller,
|
|
3143
|
+
isVideo,
|
|
3139
3144
|
lineId,
|
|
3140
3145
|
muted,
|
|
3141
3146
|
onHold,
|
|
@@ -3159,6 +3164,7 @@ class Call {
|
|
|
3159
3164
|
this.startingTime = startingTime;
|
|
3160
3165
|
this.talkingToIds = talkingToIds || [];
|
|
3161
3166
|
this.recording = recording;
|
|
3167
|
+
this.isVideo = !!isVideo;
|
|
3162
3168
|
|
|
3163
3169
|
// Useful to compare instead of instanceof with minified code
|
|
3164
3170
|
this.type = 'Call';
|
|
@@ -1513,6 +1513,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
1513
1513
|
|
|
1514
1514
|
|
|
1515
1515
|
|
|
1516
|
+
|
|
1516
1517
|
|
|
1517
1518
|
|
|
1518
1519
|
|
|
@@ -1523,6 +1524,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
1523
1524
|
|
|
1524
1525
|
|
|
1525
1526
|
|
|
1527
|
+
|
|
1526
1528
|
|
|
1527
1529
|
|
|
1528
1530
|
|
|
@@ -1551,6 +1553,7 @@ class Call {
|
|
|
1551
1553
|
|
|
1552
1554
|
|
|
1553
1555
|
|
|
1556
|
+
|
|
1554
1557
|
|
|
1555
1558
|
|
|
1556
1559
|
|
|
@@ -1575,6 +1578,7 @@ class Call {
|
|
|
1575
1578
|
calleeNumber: plain.peer_caller_id_number,
|
|
1576
1579
|
dialedExtension: plain.dialed_extension,
|
|
1577
1580
|
isCaller: plain.is_caller,
|
|
1581
|
+
isVideo: plain.is_video,
|
|
1578
1582
|
muted: plain.muted,
|
|
1579
1583
|
onHold: plain.on_hold,
|
|
1580
1584
|
status: plain.status,
|
|
@@ -1598,6 +1602,7 @@ class Call {
|
|
|
1598
1602
|
calleeNumber,
|
|
1599
1603
|
dialedExtension,
|
|
1600
1604
|
isCaller,
|
|
1605
|
+
isVideo,
|
|
1601
1606
|
lineId,
|
|
1602
1607
|
muted,
|
|
1603
1608
|
onHold,
|
|
@@ -1621,6 +1626,7 @@ class Call {
|
|
|
1621
1626
|
this.startingTime = startingTime;
|
|
1622
1627
|
this.talkingToIds = talkingToIds || [];
|
|
1623
1628
|
this.recording = recording;
|
|
1629
|
+
this.isVideo = !!isVideo;
|
|
1624
1630
|
|
|
1625
1631
|
// Useful to compare instead of instanceof with minified code
|
|
1626
1632
|
this.type = 'Call';
|
|
@@ -2094,7 +2100,7 @@ class CallSession {
|
|
|
2094
2100
|
ringing: call.isRinging(),
|
|
2095
2101
|
answered: call.isUp(),
|
|
2096
2102
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
2097
|
-
cameraEnabled:
|
|
2103
|
+
cameraEnabled: call.isVideo,
|
|
2098
2104
|
dialedExtension: call.dialedExtension,
|
|
2099
2105
|
call,
|
|
2100
2106
|
conference: false, // @FIXME?
|
|
@@ -436,7 +436,7 @@ class CallSession {
|
|
|
436
436
|
ringing: call.isRinging(),
|
|
437
437
|
answered: call.isUp(),
|
|
438
438
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
439
|
-
cameraEnabled:
|
|
439
|
+
cameraEnabled: call.isVideo,
|
|
440
440
|
dialedExtension: call.dialedExtension,
|
|
441
441
|
call,
|
|
442
442
|
conference: false, // @FIXME?
|
|
@@ -1570,10 +1570,10 @@ class WebRTCPhone extends Emitter {
|
|
|
1570
1570
|
this.audioRingVolume = volume;
|
|
1571
1571
|
}
|
|
1572
1572
|
|
|
1573
|
-
changeAudioInputDevice(id ) {
|
|
1573
|
+
changeAudioInputDevice(id , force ) {
|
|
1574
1574
|
logger.info('WebRTC phone - changeAudio input device', { deviceId: id });
|
|
1575
1575
|
|
|
1576
|
-
return this.client.changeAudioInputDevice(id, this.currentSipSession);
|
|
1576
|
+
return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
|
|
1577
1577
|
}
|
|
1578
1578
|
|
|
1579
1579
|
changeVideoInputDevice(id ) {
|
|
@@ -25,6 +25,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
@@ -35,6 +36,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
39
|
+
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
|
|
@@ -63,6 +65,7 @@ class Call {
|
|
|
63
65
|
|
|
64
66
|
|
|
65
67
|
|
|
68
|
+
|
|
66
69
|
|
|
67
70
|
|
|
68
71
|
|
|
@@ -87,6 +90,7 @@ class Call {
|
|
|
87
90
|
calleeNumber: plain.peer_caller_id_number,
|
|
88
91
|
dialedExtension: plain.dialed_extension,
|
|
89
92
|
isCaller: plain.is_caller,
|
|
93
|
+
isVideo: plain.is_video,
|
|
90
94
|
muted: plain.muted,
|
|
91
95
|
onHold: plain.on_hold,
|
|
92
96
|
status: plain.status,
|
|
@@ -110,6 +114,7 @@ class Call {
|
|
|
110
114
|
calleeNumber,
|
|
111
115
|
dialedExtension,
|
|
112
116
|
isCaller,
|
|
117
|
+
isVideo,
|
|
113
118
|
lineId,
|
|
114
119
|
muted,
|
|
115
120
|
onHold,
|
|
@@ -133,6 +138,7 @@ class Call {
|
|
|
133
138
|
this.startingTime = startingTime;
|
|
134
139
|
this.talkingToIds = talkingToIds || [];
|
|
135
140
|
this.recording = recording;
|
|
141
|
+
this.isVideo = !!isVideo;
|
|
136
142
|
|
|
137
143
|
// Useful to compare instead of instanceof with minified code
|
|
138
144
|
this.type = 'Call';
|
|
@@ -414,7 +414,7 @@ class CallSession {
|
|
|
414
414
|
ringing: call.isRinging(),
|
|
415
415
|
answered: call.isUp(),
|
|
416
416
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
417
|
-
cameraEnabled:
|
|
417
|
+
cameraEnabled: call.isVideo,
|
|
418
418
|
dialedExtension: call.dialedExtension,
|
|
419
419
|
call,
|
|
420
420
|
conference: false, // @FIXME?
|
|
@@ -414,7 +414,7 @@ class CallSession {
|
|
|
414
414
|
ringing: call.isRinging(),
|
|
415
415
|
answered: call.isUp(),
|
|
416
416
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
417
|
-
cameraEnabled:
|
|
417
|
+
cameraEnabled: call.isVideo,
|
|
418
418
|
dialedExtension: call.dialedExtension,
|
|
419
419
|
call,
|
|
420
420
|
conference: false, // @FIXME?
|
|
@@ -98,7 +98,7 @@ describe('Line domain', () => {
|
|
|
98
98
|
username: 'ipcor1pj',
|
|
99
99
|
links: [
|
|
100
100
|
{
|
|
101
|
-
href: 'https://stack.
|
|
101
|
+
href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
|
|
102
102
|
rel: 'endpoint_sip',
|
|
103
103
|
},
|
|
104
104
|
],
|
|
@@ -112,7 +112,7 @@ describe('Line domain', () => {
|
|
|
112
112
|
context: 'default',
|
|
113
113
|
links: [
|
|
114
114
|
{
|
|
115
|
-
href: 'https://stack.
|
|
115
|
+
href: 'https://stack.example.com/api/confd/1.1/extensions/59',
|
|
116
116
|
rel: 'extensions',
|
|
117
117
|
},
|
|
118
118
|
],
|
|
@@ -120,7 +120,7 @@ describe('Line domain', () => {
|
|
|
120
120
|
],
|
|
121
121
|
links: [
|
|
122
122
|
{
|
|
123
|
-
href: 'https://stack.
|
|
123
|
+
href: 'https://stack.example.com/api/confd/1.1/lines/8',
|
|
124
124
|
rel: 'lines',
|
|
125
125
|
},
|
|
126
126
|
],
|
|
@@ -138,7 +138,7 @@ describe('Line domain', () => {
|
|
|
138
138
|
context: 'default',
|
|
139
139
|
links: [
|
|
140
140
|
{
|
|
141
|
-
href: 'https://stack.
|
|
141
|
+
href: 'https://stack.example.com/api/confd/1.1/extensions/59',
|
|
142
142
|
rel: 'extensions',
|
|
143
143
|
},
|
|
144
144
|
],
|
|
@@ -148,7 +148,7 @@ describe('Line domain', () => {
|
|
|
148
148
|
id: 19,
|
|
149
149
|
links: [
|
|
150
150
|
{
|
|
151
|
-
href: 'https://stack.
|
|
151
|
+
href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
|
|
152
152
|
rel: 'endpoint_sip',
|
|
153
153
|
},
|
|
154
154
|
],
|
|
@@ -414,7 +414,7 @@ class CallSession {
|
|
|
414
414
|
ringing: call.isRinging(),
|
|
415
415
|
answered: call.isUp(),
|
|
416
416
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
417
|
-
cameraEnabled:
|
|
417
|
+
cameraEnabled: call.isVideo,
|
|
418
418
|
dialedExtension: call.dialedExtension,
|
|
419
419
|
call,
|
|
420
420
|
conference: false, // @FIXME?
|