@wazo/sdk 0.38.3 → 0.38.6
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 +10 -10
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +6 -0
- package/esm/__tests__/web-rtc-client.test.js +66 -2
- 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 +16 -2
- package/esm/checker/checks/aor.js +6 -0
- package/esm/checker/checks/api.js +6 -0
- package/esm/checker/checks/index.js +16 -2
- package/esm/checker/checks/webrtc-transport.js +16 -2
- package/esm/checker/checks/webrtc.js +16 -2
- 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 +24 -11
- package/esm/lib/WazoSessionDescriptionHandler.js +8 -0
- package/esm/service/CallApi.js +6 -0
- package/esm/service/getApiClient.js +6 -0
- package/esm/simple/Auth.js +24 -11
- package/esm/simple/Configuration.js +24 -11
- package/esm/simple/Directory.js +6 -0
- package/esm/simple/Phone.js +24 -11
- package/esm/simple/Softphone.js +5 -6
- package/esm/simple/index.js +24 -11
- package/esm/simple/room/LocalParticipant.js +24 -11
- package/esm/simple/room/Participant.js +24 -11
- package/esm/simple/room/RemoteParticipant.js +24 -11
- package/esm/simple/room/Room.js +24 -11
- package/esm/simple/room/SipRoom.js +24 -11
- package/esm/simple/room/Stream.js +24 -11
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +24 -11
- package/esm/simple/utils.js +24 -11
- package/esm/web-rtc-client.js +16 -2
- package/lib/__tests__/api-client.test.js +6 -0
- package/lib/__tests__/web-rtc-client.test.js +66 -2
- 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 +16 -2
- package/lib/checker/checks/aor.js +6 -0
- package/lib/checker/checks/api.js +6 -0
- package/lib/checker/checks/index.js +16 -2
- package/lib/checker/checks/webrtc-transport.js +16 -2
- package/lib/checker/checks/webrtc.js +16 -2
- 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 +24 -11
- package/lib/lib/WazoSessionDescriptionHandler.js +8 -0
- package/lib/service/CallApi.js +6 -0
- package/lib/service/getApiClient.js +6 -0
- package/lib/simple/Auth.js +24 -11
- package/lib/simple/Configuration.js +24 -11
- package/lib/simple/Directory.js +6 -0
- package/lib/simple/Phone.js +24 -11
- package/lib/simple/Softphone.js +5 -6
- package/lib/simple/index.js +24 -11
- package/lib/simple/room/LocalParticipant.js +24 -11
- package/lib/simple/room/Participant.js +24 -11
- package/lib/simple/room/RemoteParticipant.js +24 -11
- package/lib/simple/room/Room.js +24 -11
- package/lib/simple/room/SipRoom.js +24 -11
- package/lib/simple/room/Stream.js +24 -11
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +24 -11
- package/lib/simple/utils.js +24 -11
- package/lib/web-rtc-client.js +16 -2
- 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 +8 -0
- package/src/simple/Softphone.js +5 -6
- package/src/web-rtc-client.js +2 -2
|
@@ -445,7 +445,7 @@ class CallSession {
|
|
|
445
445
|
ringing: call.isRinging(),
|
|
446
446
|
answered: call.isUp(),
|
|
447
447
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
448
|
-
cameraEnabled:
|
|
448
|
+
cameraEnabled: call.isVideo,
|
|
449
449
|
dialedExtension: call.dialedExtension,
|
|
450
450
|
call,
|
|
451
451
|
conference: false, // @FIXME?
|
|
@@ -1579,10 +1579,10 @@ class WebRTCPhone extends Emitter {
|
|
|
1579
1579
|
this.audioRingVolume = volume;
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
-
changeAudioInputDevice(id ) {
|
|
1582
|
+
changeAudioInputDevice(id , force ) {
|
|
1583
1583
|
logger.info('WebRTC phone - changeAudio input device', { deviceId: id });
|
|
1584
1584
|
|
|
1585
|
-
return this.client.changeAudioInputDevice(id, this.currentSipSession);
|
|
1585
|
+
return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
|
|
1586
1586
|
}
|
|
1587
1587
|
|
|
1588
1588
|
changeVideoInputDevice(id ) {
|
|
@@ -31,6 +31,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
|
|
@@ -41,6 +42,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
|
|
@@ -69,6 +71,7 @@ class Call {
|
|
|
69
71
|
|
|
70
72
|
|
|
71
73
|
|
|
74
|
+
|
|
72
75
|
|
|
73
76
|
|
|
74
77
|
|
|
@@ -93,6 +96,7 @@ class Call {
|
|
|
93
96
|
calleeNumber: plain.peer_caller_id_number,
|
|
94
97
|
dialedExtension: plain.dialed_extension,
|
|
95
98
|
isCaller: plain.is_caller,
|
|
99
|
+
isVideo: plain.is_video,
|
|
96
100
|
muted: plain.muted,
|
|
97
101
|
onHold: plain.on_hold,
|
|
98
102
|
status: plain.status,
|
|
@@ -116,6 +120,7 @@ class Call {
|
|
|
116
120
|
calleeNumber,
|
|
117
121
|
dialedExtension,
|
|
118
122
|
isCaller,
|
|
123
|
+
isVideo,
|
|
119
124
|
lineId,
|
|
120
125
|
muted,
|
|
121
126
|
onHold,
|
|
@@ -139,6 +144,7 @@ class Call {
|
|
|
139
144
|
this.startingTime = startingTime;
|
|
140
145
|
this.talkingToIds = talkingToIds || [];
|
|
141
146
|
this.recording = recording;
|
|
147
|
+
this.isVideo = !!isVideo;
|
|
142
148
|
|
|
143
149
|
// Useful to compare instead of instanceof with minified code
|
|
144
150
|
this.type = 'Call';
|
|
@@ -416,7 +416,7 @@ class CallSession {
|
|
|
416
416
|
ringing: call.isRinging(),
|
|
417
417
|
answered: call.isUp(),
|
|
418
418
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
419
|
-
cameraEnabled:
|
|
419
|
+
cameraEnabled: call.isVideo,
|
|
420
420
|
dialedExtension: call.dialedExtension,
|
|
421
421
|
call,
|
|
422
422
|
conference: false, // @FIXME?
|
|
@@ -416,7 +416,7 @@ class CallSession {
|
|
|
416
416
|
ringing: call.isRinging(),
|
|
417
417
|
answered: call.isUp(),
|
|
418
418
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
419
|
-
cameraEnabled:
|
|
419
|
+
cameraEnabled: call.isVideo,
|
|
420
420
|
dialedExtension: call.dialedExtension,
|
|
421
421
|
call,
|
|
422
422
|
conference: false, // @FIXME?
|
|
@@ -100,7 +100,7 @@ describe('Line domain', () => {
|
|
|
100
100
|
username: 'ipcor1pj',
|
|
101
101
|
links: [
|
|
102
102
|
{
|
|
103
|
-
href: 'https://stack.
|
|
103
|
+
href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
|
|
104
104
|
rel: 'endpoint_sip',
|
|
105
105
|
},
|
|
106
106
|
],
|
|
@@ -114,7 +114,7 @@ describe('Line domain', () => {
|
|
|
114
114
|
context: 'default',
|
|
115
115
|
links: [
|
|
116
116
|
{
|
|
117
|
-
href: 'https://stack.
|
|
117
|
+
href: 'https://stack.example.com/api/confd/1.1/extensions/59',
|
|
118
118
|
rel: 'extensions',
|
|
119
119
|
},
|
|
120
120
|
],
|
|
@@ -122,7 +122,7 @@ describe('Line domain', () => {
|
|
|
122
122
|
],
|
|
123
123
|
links: [
|
|
124
124
|
{
|
|
125
|
-
href: 'https://stack.
|
|
125
|
+
href: 'https://stack.example.com/api/confd/1.1/lines/8',
|
|
126
126
|
rel: 'lines',
|
|
127
127
|
},
|
|
128
128
|
],
|
|
@@ -140,7 +140,7 @@ describe('Line domain', () => {
|
|
|
140
140
|
context: 'default',
|
|
141
141
|
links: [
|
|
142
142
|
{
|
|
143
|
-
href: 'https://stack.
|
|
143
|
+
href: 'https://stack.example.com/api/confd/1.1/extensions/59',
|
|
144
144
|
rel: 'extensions',
|
|
145
145
|
},
|
|
146
146
|
],
|
|
@@ -150,7 +150,7 @@ describe('Line domain', () => {
|
|
|
150
150
|
id: 19,
|
|
151
151
|
links: [
|
|
152
152
|
{
|
|
153
|
-
href: 'https://stack.
|
|
153
|
+
href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
|
|
154
154
|
rel: 'endpoint_sip',
|
|
155
155
|
},
|
|
156
156
|
],
|
|
@@ -416,7 +416,7 @@ class CallSession {
|
|
|
416
416
|
ringing: call.isRinging(),
|
|
417
417
|
answered: call.isUp(),
|
|
418
418
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
419
|
-
cameraEnabled:
|
|
419
|
+
cameraEnabled: call.isVideo,
|
|
420
420
|
dialedExtension: call.dialedExtension,
|
|
421
421
|
call,
|
|
422
422
|
conference: false, // @FIXME?
|
package/lib/index.js
CHANGED
|
@@ -3083,6 +3083,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3083
3083
|
|
|
3084
3084
|
|
|
3085
3085
|
|
|
3086
|
+
|
|
3086
3087
|
|
|
3087
3088
|
|
|
3088
3089
|
|
|
@@ -3093,6 +3094,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3093
3094
|
|
|
3094
3095
|
|
|
3095
3096
|
|
|
3097
|
+
|
|
3096
3098
|
|
|
3097
3099
|
|
|
3098
3100
|
|
|
@@ -3121,6 +3123,7 @@ class Call {
|
|
|
3121
3123
|
|
|
3122
3124
|
|
|
3123
3125
|
|
|
3126
|
+
|
|
3124
3127
|
|
|
3125
3128
|
|
|
3126
3129
|
|
|
@@ -3145,6 +3148,7 @@ class Call {
|
|
|
3145
3148
|
calleeNumber: plain.peer_caller_id_number,
|
|
3146
3149
|
dialedExtension: plain.dialed_extension,
|
|
3147
3150
|
isCaller: plain.is_caller,
|
|
3151
|
+
isVideo: plain.is_video,
|
|
3148
3152
|
muted: plain.muted,
|
|
3149
3153
|
onHold: plain.on_hold,
|
|
3150
3154
|
status: plain.status,
|
|
@@ -3168,6 +3172,7 @@ class Call {
|
|
|
3168
3172
|
calleeNumber,
|
|
3169
3173
|
dialedExtension,
|
|
3170
3174
|
isCaller,
|
|
3175
|
+
isVideo,
|
|
3171
3176
|
lineId,
|
|
3172
3177
|
muted,
|
|
3173
3178
|
onHold,
|
|
@@ -3191,6 +3196,7 @@ class Call {
|
|
|
3191
3196
|
this.startingTime = startingTime;
|
|
3192
3197
|
this.talkingToIds = talkingToIds || [];
|
|
3193
3198
|
this.recording = recording;
|
|
3199
|
+
this.isVideo = !!isVideo;
|
|
3194
3200
|
|
|
3195
3201
|
// Useful to compare instead of instanceof with minified code
|
|
3196
3202
|
this.type = 'Call';
|
|
@@ -3664,7 +3670,7 @@ class CallSession {
|
|
|
3664
3670
|
ringing: call.isRinging(),
|
|
3665
3671
|
answered: call.isUp(),
|
|
3666
3672
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
3667
|
-
cameraEnabled:
|
|
3673
|
+
cameraEnabled: call.isVideo,
|
|
3668
3674
|
dialedExtension: call.dialedExtension,
|
|
3669
3675
|
call,
|
|
3670
3676
|
conference: false, // @FIXME?
|
|
@@ -5828,6 +5834,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
5828
5834
|
wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
|
|
5829
5835
|
if (event.candidate) {
|
|
5830
5836
|
this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
|
|
5837
|
+
|
|
5838
|
+
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
5839
|
+
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
5840
|
+
wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
|
|
5841
|
+
ice: event.candidate.candidate,
|
|
5842
|
+
});
|
|
5843
|
+
this.iceGatheringComplete();
|
|
5844
|
+
}
|
|
5831
5845
|
}
|
|
5832
5846
|
};
|
|
5833
5847
|
|
|
@@ -7311,11 +7325,11 @@ class WebRTCClient extends Emitter {
|
|
|
7311
7325
|
});
|
|
7312
7326
|
}
|
|
7313
7327
|
|
|
7314
|
-
changeAudioInputDevice(id , session ) {
|
|
7328
|
+
changeAudioInputDevice(id , session , force ) {
|
|
7315
7329
|
const currentId = this.getAudioDeviceId();
|
|
7316
7330
|
logger$9.info('setting audio input device', { id, currentId, session: !!session });
|
|
7317
7331
|
|
|
7318
|
-
if (id === currentId) {
|
|
7332
|
+
if (!force && id === currentId) {
|
|
7319
7333
|
return null;
|
|
7320
7334
|
}
|
|
7321
7335
|
|
|
@@ -10012,10 +10026,10 @@ class WebRTCPhone extends Emitter {
|
|
|
10012
10026
|
this.audioRingVolume = volume;
|
|
10013
10027
|
}
|
|
10014
10028
|
|
|
10015
|
-
changeAudioInputDevice(id ) {
|
|
10029
|
+
changeAudioInputDevice(id , force ) {
|
|
10016
10030
|
logger$7.info('WebRTC phone - changeAudio input device', { deviceId: id });
|
|
10017
10031
|
|
|
10018
|
-
return this.client.changeAudioInputDevice(id, this.currentSipSession);
|
|
10032
|
+
return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
|
|
10019
10033
|
}
|
|
10020
10034
|
|
|
10021
10035
|
changeVideoInputDevice(id ) {
|
|
@@ -14136,7 +14150,7 @@ const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
|
14136
14150
|
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
14137
14151
|
const BRIDGE_ON_CALL_LOCALLY_ACCEPTED = 'bridge/BRIDGE_ON_CALL_LOCALLY_ACCEPTED';
|
|
14138
14152
|
const BRIDGE_ON_CALL_REJECTED = 'bridge/BRIDGE_ON_CALL_REJECTED';
|
|
14139
|
-
const
|
|
14153
|
+
const BRIDGE_ON_CALL_ESTABLISHED = 'bridge/BRIDGE_ON_CALL_ESTABLISHED';
|
|
14140
14154
|
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
14141
14155
|
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
14142
14156
|
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
@@ -14180,7 +14194,7 @@ class Softphone {
|
|
|
14180
14194
|
onIFrameLoaded() {}
|
|
14181
14195
|
|
|
14182
14196
|
onCallLocallyAnswered(call ) {}
|
|
14183
|
-
|
|
14197
|
+
onCallEstablished(call ) {}
|
|
14184
14198
|
onOutgoingCallMade(call ) {}
|
|
14185
14199
|
onCallIncoming(call ) {}
|
|
14186
14200
|
onCallRejected(call ) {}
|
|
@@ -14240,8 +14254,7 @@ class Softphone {
|
|
|
14240
14254
|
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
14241
14255
|
|
|
14242
14256
|
if (!server) {
|
|
14243
|
-
|
|
14244
|
-
server = 'stack.dev.wazo.io';
|
|
14257
|
+
throw new Error('`server` is not set');
|
|
14245
14258
|
}
|
|
14246
14259
|
|
|
14247
14260
|
const config = { server };
|
|
@@ -14486,8 +14499,8 @@ class Softphone {
|
|
|
14486
14499
|
case BRIDGE_ON_CALL_REJECTED:
|
|
14487
14500
|
this.onCallRejected(event.data.call);
|
|
14488
14501
|
break;
|
|
14489
|
-
case
|
|
14490
|
-
this.
|
|
14502
|
+
case BRIDGE_ON_CALL_ESTABLISHED:
|
|
14503
|
+
this.onCallEstablished(event.data.call);
|
|
14491
14504
|
break;
|
|
14492
14505
|
default:
|
|
14493
14506
|
this.onUnHandledEvent(event);
|
|
@@ -550,6 +550,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
550
550
|
wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
|
|
551
551
|
if (event.candidate) {
|
|
552
552
|
this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
|
|
553
|
+
|
|
554
|
+
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
555
|
+
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
556
|
+
wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
|
|
557
|
+
ice: event.candidate.candidate,
|
|
558
|
+
});
|
|
559
|
+
this.iceGatheringComplete();
|
|
560
|
+
}
|
|
553
561
|
}
|
|
554
562
|
};
|
|
555
563
|
|
package/lib/service/CallApi.js
CHANGED
|
@@ -36,6 +36,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
|
|
@@ -46,6 +47,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
|
|
50
|
+
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
|
|
@@ -74,6 +76,7 @@ class Call {
|
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
|
|
79
|
+
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
|
|
@@ -98,6 +101,7 @@ class Call {
|
|
|
98
101
|
calleeNumber: plain.peer_caller_id_number,
|
|
99
102
|
dialedExtension: plain.dialed_extension,
|
|
100
103
|
isCaller: plain.is_caller,
|
|
104
|
+
isVideo: plain.is_video,
|
|
101
105
|
muted: plain.muted,
|
|
102
106
|
onHold: plain.on_hold,
|
|
103
107
|
status: plain.status,
|
|
@@ -121,6 +125,7 @@ class Call {
|
|
|
121
125
|
calleeNumber,
|
|
122
126
|
dialedExtension,
|
|
123
127
|
isCaller,
|
|
128
|
+
isVideo,
|
|
124
129
|
lineId,
|
|
125
130
|
muted,
|
|
126
131
|
onHold,
|
|
@@ -144,6 +149,7 @@ class Call {
|
|
|
144
149
|
this.startingTime = startingTime;
|
|
145
150
|
this.talkingToIds = talkingToIds || [];
|
|
146
151
|
this.recording = recording;
|
|
152
|
+
this.isVideo = !!isVideo;
|
|
147
153
|
|
|
148
154
|
// Useful to compare instead of instanceof with minified code
|
|
149
155
|
this.type = 'Call';
|
|
@@ -3059,6 +3059,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3059
3059
|
|
|
3060
3060
|
|
|
3061
3061
|
|
|
3062
|
+
|
|
3062
3063
|
|
|
3063
3064
|
|
|
3064
3065
|
|
|
@@ -3069,6 +3070,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3069
3070
|
|
|
3070
3071
|
|
|
3071
3072
|
|
|
3073
|
+
|
|
3072
3074
|
|
|
3073
3075
|
|
|
3074
3076
|
|
|
@@ -3097,6 +3099,7 @@ class Call {
|
|
|
3097
3099
|
|
|
3098
3100
|
|
|
3099
3101
|
|
|
3102
|
+
|
|
3100
3103
|
|
|
3101
3104
|
|
|
3102
3105
|
|
|
@@ -3121,6 +3124,7 @@ class Call {
|
|
|
3121
3124
|
calleeNumber: plain.peer_caller_id_number,
|
|
3122
3125
|
dialedExtension: plain.dialed_extension,
|
|
3123
3126
|
isCaller: plain.is_caller,
|
|
3127
|
+
isVideo: plain.is_video,
|
|
3124
3128
|
muted: plain.muted,
|
|
3125
3129
|
onHold: plain.on_hold,
|
|
3126
3130
|
status: plain.status,
|
|
@@ -3144,6 +3148,7 @@ class Call {
|
|
|
3144
3148
|
calleeNumber,
|
|
3145
3149
|
dialedExtension,
|
|
3146
3150
|
isCaller,
|
|
3151
|
+
isVideo,
|
|
3147
3152
|
lineId,
|
|
3148
3153
|
muted,
|
|
3149
3154
|
onHold,
|
|
@@ -3167,6 +3172,7 @@ class Call {
|
|
|
3167
3172
|
this.startingTime = startingTime;
|
|
3168
3173
|
this.talkingToIds = talkingToIds || [];
|
|
3169
3174
|
this.recording = recording;
|
|
3175
|
+
this.isVideo = !!isVideo;
|
|
3170
3176
|
|
|
3171
3177
|
// Useful to compare instead of instanceof with minified code
|
|
3172
3178
|
this.type = 'Call';
|
package/lib/simple/Auth.js
CHANGED
|
@@ -3083,6 +3083,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3083
3083
|
|
|
3084
3084
|
|
|
3085
3085
|
|
|
3086
|
+
|
|
3086
3087
|
|
|
3087
3088
|
|
|
3088
3089
|
|
|
@@ -3093,6 +3094,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3093
3094
|
|
|
3094
3095
|
|
|
3095
3096
|
|
|
3097
|
+
|
|
3096
3098
|
|
|
3097
3099
|
|
|
3098
3100
|
|
|
@@ -3121,6 +3123,7 @@ class Call {
|
|
|
3121
3123
|
|
|
3122
3124
|
|
|
3123
3125
|
|
|
3126
|
+
|
|
3124
3127
|
|
|
3125
3128
|
|
|
3126
3129
|
|
|
@@ -3145,6 +3148,7 @@ class Call {
|
|
|
3145
3148
|
calleeNumber: plain.peer_caller_id_number,
|
|
3146
3149
|
dialedExtension: plain.dialed_extension,
|
|
3147
3150
|
isCaller: plain.is_caller,
|
|
3151
|
+
isVideo: plain.is_video,
|
|
3148
3152
|
muted: plain.muted,
|
|
3149
3153
|
onHold: plain.on_hold,
|
|
3150
3154
|
status: plain.status,
|
|
@@ -3168,6 +3172,7 @@ class Call {
|
|
|
3168
3172
|
calleeNumber,
|
|
3169
3173
|
dialedExtension,
|
|
3170
3174
|
isCaller,
|
|
3175
|
+
isVideo,
|
|
3171
3176
|
lineId,
|
|
3172
3177
|
muted,
|
|
3173
3178
|
onHold,
|
|
@@ -3191,6 +3196,7 @@ class Call {
|
|
|
3191
3196
|
this.startingTime = startingTime;
|
|
3192
3197
|
this.talkingToIds = talkingToIds || [];
|
|
3193
3198
|
this.recording = recording;
|
|
3199
|
+
this.isVideo = !!isVideo;
|
|
3194
3200
|
|
|
3195
3201
|
// Useful to compare instead of instanceof with minified code
|
|
3196
3202
|
this.type = 'Call';
|
|
@@ -3664,7 +3670,7 @@ class CallSession {
|
|
|
3664
3670
|
ringing: call.isRinging(),
|
|
3665
3671
|
answered: call.isUp(),
|
|
3666
3672
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
3667
|
-
cameraEnabled:
|
|
3673
|
+
cameraEnabled: call.isVideo,
|
|
3668
3674
|
dialedExtension: call.dialedExtension,
|
|
3669
3675
|
call,
|
|
3670
3676
|
conference: false, // @FIXME?
|
|
@@ -6007,6 +6013,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
6007
6013
|
wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
|
|
6008
6014
|
if (event.candidate) {
|
|
6009
6015
|
this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
|
|
6016
|
+
|
|
6017
|
+
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
6018
|
+
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
6019
|
+
wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
|
|
6020
|
+
ice: event.candidate.candidate,
|
|
6021
|
+
});
|
|
6022
|
+
this.iceGatheringComplete();
|
|
6023
|
+
}
|
|
6010
6024
|
}
|
|
6011
6025
|
};
|
|
6012
6026
|
|
|
@@ -7490,11 +7504,11 @@ class WebRTCClient extends Emitter {
|
|
|
7490
7504
|
});
|
|
7491
7505
|
}
|
|
7492
7506
|
|
|
7493
|
-
changeAudioInputDevice(id , session ) {
|
|
7507
|
+
changeAudioInputDevice(id , session , force ) {
|
|
7494
7508
|
const currentId = this.getAudioDeviceId();
|
|
7495
7509
|
logger$9.info('setting audio input device', { id, currentId, session: !!session });
|
|
7496
7510
|
|
|
7497
|
-
if (id === currentId) {
|
|
7511
|
+
if (!force && id === currentId) {
|
|
7498
7512
|
return null;
|
|
7499
7513
|
}
|
|
7500
7514
|
|
|
@@ -9290,10 +9304,10 @@ class WebRTCPhone extends Emitter {
|
|
|
9290
9304
|
this.audioRingVolume = volume;
|
|
9291
9305
|
}
|
|
9292
9306
|
|
|
9293
|
-
changeAudioInputDevice(id ) {
|
|
9307
|
+
changeAudioInputDevice(id , force ) {
|
|
9294
9308
|
logger$8.info('WebRTC phone - changeAudio input device', { deviceId: id });
|
|
9295
9309
|
|
|
9296
|
-
return this.client.changeAudioInputDevice(id, this.currentSipSession);
|
|
9310
|
+
return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
|
|
9297
9311
|
}
|
|
9298
9312
|
|
|
9299
9313
|
changeVideoInputDevice(id ) {
|
|
@@ -13698,7 +13712,7 @@ const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
|
13698
13712
|
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
13699
13713
|
const BRIDGE_ON_CALL_LOCALLY_ACCEPTED = 'bridge/BRIDGE_ON_CALL_LOCALLY_ACCEPTED';
|
|
13700
13714
|
const BRIDGE_ON_CALL_REJECTED = 'bridge/BRIDGE_ON_CALL_REJECTED';
|
|
13701
|
-
const
|
|
13715
|
+
const BRIDGE_ON_CALL_ESTABLISHED = 'bridge/BRIDGE_ON_CALL_ESTABLISHED';
|
|
13702
13716
|
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
13703
13717
|
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
13704
13718
|
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
@@ -13742,7 +13756,7 @@ class Softphone {
|
|
|
13742
13756
|
onIFrameLoaded() {}
|
|
13743
13757
|
|
|
13744
13758
|
onCallLocallyAnswered(call ) {}
|
|
13745
|
-
|
|
13759
|
+
onCallEstablished(call ) {}
|
|
13746
13760
|
onOutgoingCallMade(call ) {}
|
|
13747
13761
|
onCallIncoming(call ) {}
|
|
13748
13762
|
onCallRejected(call ) {}
|
|
@@ -13802,8 +13816,7 @@ class Softphone {
|
|
|
13802
13816
|
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
13803
13817
|
|
|
13804
13818
|
if (!server) {
|
|
13805
|
-
|
|
13806
|
-
server = 'stack.dev.wazo.io';
|
|
13819
|
+
throw new Error('`server` is not set');
|
|
13807
13820
|
}
|
|
13808
13821
|
|
|
13809
13822
|
const config = { server };
|
|
@@ -14048,8 +14061,8 @@ class Softphone {
|
|
|
14048
14061
|
case BRIDGE_ON_CALL_REJECTED:
|
|
14049
14062
|
this.onCallRejected(event.data.call);
|
|
14050
14063
|
break;
|
|
14051
|
-
case
|
|
14052
|
-
this.
|
|
14064
|
+
case BRIDGE_ON_CALL_ESTABLISHED:
|
|
14065
|
+
this.onCallEstablished(event.data.call);
|
|
14053
14066
|
break;
|
|
14054
14067
|
default:
|
|
14055
14068
|
this.onUnHandledEvent(event);
|
|
@@ -3081,6 +3081,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3081
3081
|
|
|
3082
3082
|
|
|
3083
3083
|
|
|
3084
|
+
|
|
3084
3085
|
|
|
3085
3086
|
|
|
3086
3087
|
|
|
@@ -3091,6 +3092,7 @@ const RECORD_STATE_ACTIVE = 'active';
|
|
|
3091
3092
|
|
|
3092
3093
|
|
|
3093
3094
|
|
|
3095
|
+
|
|
3094
3096
|
|
|
3095
3097
|
|
|
3096
3098
|
|
|
@@ -3119,6 +3121,7 @@ class Call {
|
|
|
3119
3121
|
|
|
3120
3122
|
|
|
3121
3123
|
|
|
3124
|
+
|
|
3122
3125
|
|
|
3123
3126
|
|
|
3124
3127
|
|
|
@@ -3143,6 +3146,7 @@ class Call {
|
|
|
3143
3146
|
calleeNumber: plain.peer_caller_id_number,
|
|
3144
3147
|
dialedExtension: plain.dialed_extension,
|
|
3145
3148
|
isCaller: plain.is_caller,
|
|
3149
|
+
isVideo: plain.is_video,
|
|
3146
3150
|
muted: plain.muted,
|
|
3147
3151
|
onHold: plain.on_hold,
|
|
3148
3152
|
status: plain.status,
|
|
@@ -3166,6 +3170,7 @@ class Call {
|
|
|
3166
3170
|
calleeNumber,
|
|
3167
3171
|
dialedExtension,
|
|
3168
3172
|
isCaller,
|
|
3173
|
+
isVideo,
|
|
3169
3174
|
lineId,
|
|
3170
3175
|
muted,
|
|
3171
3176
|
onHold,
|
|
@@ -3189,6 +3194,7 @@ class Call {
|
|
|
3189
3194
|
this.startingTime = startingTime;
|
|
3190
3195
|
this.talkingToIds = talkingToIds || [];
|
|
3191
3196
|
this.recording = recording;
|
|
3197
|
+
this.isVideo = !!isVideo;
|
|
3192
3198
|
|
|
3193
3199
|
// Useful to compare instead of instanceof with minified code
|
|
3194
3200
|
this.type = 'Call';
|
|
@@ -3662,7 +3668,7 @@ class CallSession {
|
|
|
3662
3668
|
ringing: call.isRinging(),
|
|
3663
3669
|
answered: call.isUp(),
|
|
3664
3670
|
answeredBySystem: call.isUp() && call.talkingToIds.length === 0,
|
|
3665
|
-
cameraEnabled:
|
|
3671
|
+
cameraEnabled: call.isVideo,
|
|
3666
3672
|
dialedExtension: call.dialedExtension,
|
|
3667
3673
|
call,
|
|
3668
3674
|
conference: false, // @FIXME?
|
|
@@ -6005,6 +6011,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
|
|
|
6005
6011
|
wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
|
|
6006
6012
|
if (event.candidate) {
|
|
6007
6013
|
this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
|
|
6014
|
+
|
|
6015
|
+
// When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
|
|
6016
|
+
if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
|
|
6017
|
+
wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
|
|
6018
|
+
ice: event.candidate.candidate,
|
|
6019
|
+
});
|
|
6020
|
+
this.iceGatheringComplete();
|
|
6021
|
+
}
|
|
6008
6022
|
}
|
|
6009
6023
|
};
|
|
6010
6024
|
|
|
@@ -7488,11 +7502,11 @@ class WebRTCClient extends Emitter {
|
|
|
7488
7502
|
});
|
|
7489
7503
|
}
|
|
7490
7504
|
|
|
7491
|
-
changeAudioInputDevice(id , session ) {
|
|
7505
|
+
changeAudioInputDevice(id , session , force ) {
|
|
7492
7506
|
const currentId = this.getAudioDeviceId();
|
|
7493
7507
|
logger$9.info('setting audio input device', { id, currentId, session: !!session });
|
|
7494
7508
|
|
|
7495
|
-
if (id === currentId) {
|
|
7509
|
+
if (!force && id === currentId) {
|
|
7496
7510
|
return null;
|
|
7497
7511
|
}
|
|
7498
7512
|
|
|
@@ -9288,10 +9302,10 @@ class WebRTCPhone extends Emitter {
|
|
|
9288
9302
|
this.audioRingVolume = volume;
|
|
9289
9303
|
}
|
|
9290
9304
|
|
|
9291
|
-
changeAudioInputDevice(id ) {
|
|
9305
|
+
changeAudioInputDevice(id , force ) {
|
|
9292
9306
|
logger$8.info('WebRTC phone - changeAudio input device', { deviceId: id });
|
|
9293
9307
|
|
|
9294
|
-
return this.client.changeAudioInputDevice(id, this.currentSipSession);
|
|
9308
|
+
return this.client.changeAudioInputDevice(id, this.currentSipSession, force);
|
|
9295
9309
|
}
|
|
9296
9310
|
|
|
9297
9311
|
changeVideoInputDevice(id ) {
|
|
@@ -13679,7 +13693,7 @@ const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
|
13679
13693
|
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
13680
13694
|
const BRIDGE_ON_CALL_LOCALLY_ACCEPTED = 'bridge/BRIDGE_ON_CALL_LOCALLY_ACCEPTED';
|
|
13681
13695
|
const BRIDGE_ON_CALL_REJECTED = 'bridge/BRIDGE_ON_CALL_REJECTED';
|
|
13682
|
-
const
|
|
13696
|
+
const BRIDGE_ON_CALL_ESTABLISHED = 'bridge/BRIDGE_ON_CALL_ESTABLISHED';
|
|
13683
13697
|
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
13684
13698
|
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
13685
13699
|
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
@@ -13723,7 +13737,7 @@ class Softphone {
|
|
|
13723
13737
|
onIFrameLoaded() {}
|
|
13724
13738
|
|
|
13725
13739
|
onCallLocallyAnswered(call ) {}
|
|
13726
|
-
|
|
13740
|
+
onCallEstablished(call ) {}
|
|
13727
13741
|
onOutgoingCallMade(call ) {}
|
|
13728
13742
|
onCallIncoming(call ) {}
|
|
13729
13743
|
onCallRejected(call ) {}
|
|
@@ -13783,8 +13797,7 @@ class Softphone {
|
|
|
13783
13797
|
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
13784
13798
|
|
|
13785
13799
|
if (!server) {
|
|
13786
|
-
|
|
13787
|
-
server = 'stack.dev.wazo.io';
|
|
13800
|
+
throw new Error('`server` is not set');
|
|
13788
13801
|
}
|
|
13789
13802
|
|
|
13790
13803
|
const config = { server };
|
|
@@ -14029,8 +14042,8 @@ class Softphone {
|
|
|
14029
14042
|
case BRIDGE_ON_CALL_REJECTED:
|
|
14030
14043
|
this.onCallRejected(event.data.call);
|
|
14031
14044
|
break;
|
|
14032
|
-
case
|
|
14033
|
-
this.
|
|
14045
|
+
case BRIDGE_ON_CALL_ESTABLISHED:
|
|
14046
|
+
this.onCallEstablished(event.data.call);
|
|
14034
14047
|
break;
|
|
14035
14048
|
default:
|
|
14036
14049
|
this.onUnHandledEvent(event);
|