@wazo/sdk 0.37.0 → 0.37.4
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 +5 -5
- package/esm/__tests__/api-client.test.js +91 -23
- package/esm/__tests__/web-rtc-client.test.js +165 -56
- package/esm/api/agentd.js +7 -1
- package/esm/api/amid.js +7 -1
- package/esm/api/application.js +7 -1
- package/esm/api/auth.js +7 -1
- package/esm/api/call-logd.js +17 -23
- package/esm/api/calld.js +10 -18
- package/esm/api/chatd.js +7 -1
- package/esm/api/confd.js +78 -1
- package/esm/api/ctid-ng.js +7 -1
- package/esm/api/dird.js +7 -1
- package/esm/api/webhookd.js +7 -1
- package/esm/api-client.js +91 -23
- package/esm/checker/Checker.js +169 -56
- package/esm/checker/checks/aor.js +91 -23
- package/esm/checker/checks/api.js +91 -23
- package/esm/checker/checks/index.js +169 -56
- package/esm/checker/checks/wazo-websocket.js +11 -1
- package/esm/checker/checks/webrtc-transport.js +165 -56
- package/esm/checker/checks/webrtc.js +165 -56
- package/esm/domain/AdHocAPIConference.js +1722 -1654
- package/esm/domain/CallLog.js +10 -22
- package/esm/domain/CallSession.js +1 -18
- package/esm/domain/Features.js +91 -23
- package/esm/domain/IndirectTransfer.js +0 -17
- package/esm/domain/Meeting.js +71 -0
- package/esm/domain/Phone/CTIPhone.js +98 -26
- package/esm/domain/Phone/Phone.js +0 -17
- package/esm/domain/Phone/WebRTCPhone.js +47 -27
- package/esm/domain/Room.js +0 -17
- package/esm/domain/SwitchboardCall.js +0 -17
- package/esm/domain/__tests__/CallLog.test.js +10 -22
- package/esm/domain/__tests__/CallSession.test.js +1 -18
- package/esm/domain/__tests__/IndirectTransfer.test.js +1 -18
- package/esm/domain/__tests__/Room.test.js +1 -18
- package/esm/index.js +3880 -3111
- package/esm/lib/WazoSessionDescriptionHandler.js +24 -10
- package/esm/service/CallApi.js +91 -23
- package/esm/service/IssueReporter.js +7 -1
- package/esm/service/__tests__/IssueReporter.test.js +9 -1
- package/esm/service/getApiClient.js +91 -23
- package/esm/simple/Auth.js +1126 -360
- package/esm/simple/Configuration.js +1126 -360
- package/esm/simple/Directory.js +91 -23
- package/esm/simple/Phone.js +3724 -2958
- package/esm/simple/Websocket.js +13 -1
- package/esm/simple/index.js +1128 -362
- package/esm/simple/room/LocalParticipant.js +1097 -331
- package/esm/simple/room/Participant.js +1097 -331
- package/esm/simple/room/RemoteParticipant.js +1097 -331
- package/esm/simple/room/Room.js +1097 -331
- package/esm/simple/room/SipRoom.js +12996 -0
- package/esm/simple/room/Stream.js +1128 -362
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +5157 -4389
- package/esm/simple/utils.js +1128 -362
- package/esm/utils/__tests__/api-requester.test.js +7 -1
- package/esm/utils/api-requester.js +7 -1
- package/esm/web-rtc-client.js +165 -56
- package/esm/websocket-client.js +12 -2
- package/lib/__tests__/api-client.test.js +91 -23
- package/lib/__tests__/web-rtc-client.test.js +165 -56
- package/lib/api/agentd.js +7 -1
- package/lib/api/amid.js +7 -1
- package/lib/api/application.js +7 -1
- package/lib/api/auth.js +7 -1
- package/lib/api/call-logd.js +17 -23
- package/lib/api/calld.js +10 -18
- package/lib/api/chatd.js +7 -1
- package/lib/api/confd.js +78 -1
- package/lib/api/ctid-ng.js +7 -1
- package/lib/api/dird.js +7 -1
- package/lib/api/webhookd.js +7 -1
- package/lib/api-client.js +91 -23
- package/lib/checker/Checker.js +169 -56
- package/lib/checker/checks/aor.js +91 -23
- package/lib/checker/checks/api.js +91 -23
- package/lib/checker/checks/index.js +169 -56
- package/lib/checker/checks/wazo-websocket.js +11 -1
- package/lib/checker/checks/webrtc-transport.js +165 -56
- package/lib/checker/checks/webrtc.js +165 -56
- package/lib/domain/AdHocAPIConference.js +1722 -1654
- package/lib/domain/CallLog.js +10 -22
- package/lib/domain/CallSession.js +1 -18
- package/lib/domain/Features.js +91 -23
- package/lib/domain/IndirectTransfer.js +0 -17
- package/lib/domain/Meeting.js +73 -0
- package/lib/domain/Phone/CTIPhone.js +98 -26
- package/lib/domain/Phone/Phone.js +0 -16
- package/lib/domain/Phone/WebRTCPhone.js +47 -27
- package/lib/domain/Room.js +0 -17
- package/lib/domain/SwitchboardCall.js +0 -17
- package/lib/domain/__tests__/CallLog.test.js +10 -22
- package/lib/domain/__tests__/CallSession.test.js +1 -18
- package/lib/domain/__tests__/IndirectTransfer.test.js +1 -18
- package/lib/domain/__tests__/Room.test.js +1 -18
- package/lib/index.js +3880 -3111
- package/lib/lib/WazoSessionDescriptionHandler.js +24 -10
- package/lib/service/CallApi.js +91 -23
- package/lib/service/IssueReporter.js +7 -1
- package/lib/service/__tests__/IssueReporter.test.js +9 -1
- package/lib/service/getApiClient.js +91 -23
- package/lib/simple/Auth.js +1126 -360
- package/lib/simple/Configuration.js +1126 -360
- package/lib/simple/Directory.js +91 -23
- package/lib/simple/Phone.js +3724 -2958
- package/lib/simple/Websocket.js +13 -1
- package/lib/simple/index.js +1128 -362
- package/lib/simple/room/LocalParticipant.js +1097 -331
- package/lib/simple/room/Participant.js +1097 -331
- package/lib/simple/room/RemoteParticipant.js +1097 -331
- package/lib/simple/room/Room.js +1097 -331
- package/lib/simple/room/SipRoom.js +13006 -0
- package/lib/simple/room/Stream.js +1128 -362
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +5157 -4389
- package/lib/simple/utils.js +1128 -362
- package/lib/utils/__tests__/api-requester.test.js +7 -1
- package/lib/utils/api-requester.js +7 -1
- package/lib/web-rtc-client.js +165 -56
- package/lib/websocket-client.js +13 -1
- package/package.json +1 -1
- package/src/api/calld.js +3 -0
- package/src/api/confd.js +13 -0
- package/src/domain/CallLog.js +10 -22
- package/src/domain/CallSession.js +1 -2
- package/src/domain/Meeting.js +59 -0
- package/src/domain/Phone/CTIPhone.js +6 -2
- package/src/domain/Phone/Phone.js +2 -0
- package/src/domain/Phone/WebRTCPhone.js +22 -8
- package/src/index.js +6 -0
- package/src/lib/WazoSessionDescriptionHandler.js +17 -9
- package/src/service/IssueReporter.js +7 -1
- package/src/service/__tests__/IssueReporter.test.js +2 -0
- package/src/simple/Phone.js +13 -4
- package/src/simple/index.js +8 -0
- package/src/simple/room/Participant.js +7 -0
- package/src/simple/room/Room.js +157 -79
- package/src/simple/room/SipRoom.js +147 -0
- package/src/simple/room/Stream.js +1 -3
- package/src/simple/room/__tests__/RemoteParticipant.test.js +3 -2
- package/src/types/WebSocketMessage.js +21 -0
- package/src/web-rtc-client.js +57 -24
- package/src/websocket-client.js +4 -0
|
@@ -200,7 +200,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
if (!sipSession) {
|
|
203
|
-
return
|
|
203
|
+
return false;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
// $FlowFixMe
|
|
@@ -210,19 +210,17 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
210
210
|
// Downgrade
|
|
211
211
|
if (constraints && !isUpgrade) {
|
|
212
212
|
// No reinvite needed
|
|
213
|
-
|
|
213
|
+
this._downgradeToAudio(callSession);
|
|
214
|
+
return false;
|
|
214
215
|
}
|
|
215
216
|
|
|
216
217
|
if (isUpgrade) {
|
|
217
218
|
const shouldReinvite = await this._upgradeToVideo(callSession, constraints, conference);
|
|
218
219
|
if (!shouldReinvite) {
|
|
219
|
-
return;
|
|
220
|
+
return false;
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
223
|
|
|
223
|
-
// Force reinvite in SDH
|
|
224
|
-
sipSession.sessionDescriptionHandler.localMediaStreamConstraints = null;
|
|
225
|
-
|
|
226
224
|
return this.client.reinvite(sipSession, constraints, conference, audioOnly);
|
|
227
225
|
}
|
|
228
226
|
|
|
@@ -295,7 +293,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
295
293
|
_downgradeToAudio(callSession: ?CallSession) {
|
|
296
294
|
const sipSession = this.findSipSession(callSession);
|
|
297
295
|
if (!sipSession) {
|
|
298
|
-
return;
|
|
296
|
+
return false;
|
|
299
297
|
}
|
|
300
298
|
|
|
301
299
|
// Release local video stream when downgrading to audio
|
|
@@ -499,6 +497,10 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
499
497
|
localStream.removeTrack(videoTrack);
|
|
500
498
|
}
|
|
501
499
|
|
|
500
|
+
if (localStream) {
|
|
501
|
+
localStream.addTrack(screenTrack);
|
|
502
|
+
}
|
|
503
|
+
|
|
502
504
|
if (sender) {
|
|
503
505
|
sender.replaceTrack(screenTrack);
|
|
504
506
|
}
|
|
@@ -514,6 +516,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
514
516
|
}
|
|
515
517
|
|
|
516
518
|
logger.info('WebRTC phone - stop screen sharing');
|
|
519
|
+
let reinvited = false;
|
|
517
520
|
|
|
518
521
|
try {
|
|
519
522
|
if (this.currentScreenShare.stream) {
|
|
@@ -528,7 +531,8 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
528
531
|
// When upgrading directly to screenshare (eg: we don't have a videoLocalStream to replace)
|
|
529
532
|
// We have to downgrade to audio.
|
|
530
533
|
const screenshareStopped = this.currentScreenShare.sender && this.currentScreenShare.hadVideo;
|
|
531
|
-
|
|
534
|
+
const constraints = { audio: false, video: screenshareStopped };
|
|
535
|
+
reinvited = await this.sendReinvite(targetCallSession, constraints, conference);
|
|
532
536
|
}
|
|
533
537
|
} catch (e) {
|
|
534
538
|
console.warn(e);
|
|
@@ -542,6 +546,8 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
542
546
|
);
|
|
543
547
|
|
|
544
548
|
this.currentScreenShare = null;
|
|
549
|
+
|
|
550
|
+
return reinvited;
|
|
545
551
|
}
|
|
546
552
|
|
|
547
553
|
async _getStreamFromConstraints(constraints: Object, conference: boolean = false): Promise<?MediaStream> {
|
|
@@ -602,6 +608,10 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
602
608
|
this.client.changeAudioOutputDevice(id);
|
|
603
609
|
}
|
|
604
610
|
|
|
611
|
+
createAudioElementFor(sessionId: string) {
|
|
612
|
+
return this.client.createAudioElementFor(sessionId);
|
|
613
|
+
}
|
|
614
|
+
|
|
605
615
|
changeRingDevice(id: string) {
|
|
606
616
|
this.audioRingDeviceId = id;
|
|
607
617
|
}
|
|
@@ -1249,6 +1259,10 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
1249
1259
|
return callSession ? this.client.hasLocalVideo(callSession.sipCallId) : null;
|
|
1250
1260
|
}
|
|
1251
1261
|
|
|
1262
|
+
hasALocalVideoTrack(callSession: CallSession) {
|
|
1263
|
+
return callSession ? this.client.hasALocalVideoTrack(callSession.sipCallId) : null;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1252
1266
|
getRemoteStream(callSession: CallSession): ?MediaStream {
|
|
1253
1267
|
return callSession ? this.client.getRemoteStream(callSession.sipCallId) : null;
|
|
1254
1268
|
}
|
package/src/index.js
CHANGED
|
@@ -28,6 +28,9 @@ import Room from './domain/Room';
|
|
|
28
28
|
import CallSession from './domain/CallSession';
|
|
29
29
|
import IndirectTransfer from './domain/IndirectTransfer';
|
|
30
30
|
import SwitchboardCall from './domain/SwitchboardCall';
|
|
31
|
+
import WebRTCPhone from './domain/Phone/WebRTCPhone';
|
|
32
|
+
import CTIPhone from './domain/Phone/CTIPhone';
|
|
33
|
+
import Meeting from './domain/Meeting';
|
|
31
34
|
import type {
|
|
32
35
|
NewContact as NewContactType,
|
|
33
36
|
ContactResponse as ContactResponseType,
|
|
@@ -94,6 +97,7 @@ export default {
|
|
|
94
97
|
ServerError,
|
|
95
98
|
Call,
|
|
96
99
|
CallSession,
|
|
100
|
+
CTIPhone,
|
|
97
101
|
Features,
|
|
98
102
|
IndirectTransfer,
|
|
99
103
|
SwitchboardCall,
|
|
@@ -118,4 +122,6 @@ export default {
|
|
|
118
122
|
LINE_STATE,
|
|
119
123
|
SOCKET_EVENTS,
|
|
120
124
|
Wazo,
|
|
125
|
+
WebRTCPhone,
|
|
126
|
+
Meeting,
|
|
121
127
|
};
|
|
@@ -116,7 +116,9 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
116
116
|
.then(() => {
|
|
117
117
|
if (isConference && (options.constraints && !options.constraints.video) && !('hold' in options) && !audioOnly) {
|
|
118
118
|
// Add a video an empty bundle to be able to replaceTrack when joining a conference without video
|
|
119
|
-
this.peerConnection.addTransceiver
|
|
119
|
+
if (this.peerConnection.addTransceiver) {
|
|
120
|
+
this.peerConnection.addTransceiver('video', { streams: [this._localMediaStream], direction: 'sendrecv' });
|
|
121
|
+
}
|
|
120
122
|
}
|
|
121
123
|
})
|
|
122
124
|
.then(() => this.createLocalOfferOrAnswer(options))
|
|
@@ -143,12 +145,6 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
143
145
|
};
|
|
144
146
|
})
|
|
145
147
|
.then((sessionDescription) => this.applyModifiers(sessionDescription, modifiers))
|
|
146
|
-
.then((sessionDescription) => {
|
|
147
|
-
// Set new constraints to avoid the constraints check issue in `sdh.getLocalMediaStream` later.
|
|
148
|
-
this.localMediaStreamConstraints = options.constraints;
|
|
149
|
-
|
|
150
|
-
return sessionDescription;
|
|
151
|
-
})
|
|
152
148
|
.then((sessionDescription) => ({ body: sessionDescription.sdp, contentType: 'application/sdp' }))
|
|
153
149
|
.catch((error) => {
|
|
154
150
|
wazoLogger.error('error when creating media', error);
|
|
@@ -343,6 +339,9 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
343
339
|
|
|
344
340
|
// set the transceiver direction to the answer direction
|
|
345
341
|
this._peerConnection.getTransceivers().forEach((transceiver) => {
|
|
342
|
+
if (transceiver.stopped) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
346
345
|
if (transceiver.direction /* guarding, but should always be true */) {
|
|
347
346
|
const { receiver } = transceiver;
|
|
348
347
|
if (isConference && audioOnly && receiver.track && receiver.track.kind === 'video') {
|
|
@@ -387,10 +386,15 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
387
386
|
if (kind !== 'audio' && kind !== 'video') {
|
|
388
387
|
throw new Error(`Unknown new track kind ${kind}.`);
|
|
389
388
|
}
|
|
390
|
-
const sender = pc.getSenders().find((otherSender) =>
|
|
389
|
+
const sender = pc.getSenders && pc.getSenders().find((otherSender) =>
|
|
390
|
+
otherSender.track && otherSender.track.kind === kind);
|
|
391
391
|
|
|
392
392
|
// Do not reuse sender video tracks in SFU
|
|
393
393
|
if (sender && (!sfu || newTrack.kind === 'audio')) {
|
|
394
|
+
if (sender.track) {
|
|
395
|
+
// eslint-disable-next-line no-param-reassign
|
|
396
|
+
newTrack.enabled = sender.track.enabled;
|
|
397
|
+
}
|
|
394
398
|
trackUpdates.push(
|
|
395
399
|
new Promise((resolve) => {
|
|
396
400
|
this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - replacing sender ${kind} track`);
|
|
@@ -424,7 +428,11 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
424
428
|
// Review: could make streamless tracks a configurable option?
|
|
425
429
|
// https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTrack#Usage_notes
|
|
426
430
|
try {
|
|
427
|
-
pc.addTrack
|
|
431
|
+
if (pc.addTrack) {
|
|
432
|
+
pc.addTrack(newTrack, localStream);
|
|
433
|
+
} else {
|
|
434
|
+
pc.addStream(localStream);
|
|
435
|
+
}
|
|
428
436
|
} catch (error) {
|
|
429
437
|
this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to add sender ${kind} track`);
|
|
430
438
|
throw error;
|
|
@@ -243,7 +243,13 @@ class IssueReporter {
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
_isLevelAbove(level1: string, level2: string) {
|
|
246
|
-
|
|
246
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
247
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
248
|
+
if (index1 === -1 || index2 === -1) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return index1 > index2;
|
|
247
253
|
}
|
|
248
254
|
|
|
249
255
|
_makeCategory(category: string) {
|
|
@@ -41,6 +41,8 @@ describe('IssueReporter', () => {
|
|
|
41
41
|
expect(IssueReporter._isLevelAbove('error', 'warn')).toBeTruthy();
|
|
42
42
|
expect(IssueReporter._isLevelAbove('info', 'warn')).toBeFalsy();
|
|
43
43
|
expect(IssueReporter._isLevelAbove('trace', 'trace')).toBeFalsy();
|
|
44
|
+
expect(IssueReporter._isLevelAbove('trace', 'something')).toBeFalsy();
|
|
45
|
+
expect(IssueReporter._isLevelAbove('something', 'trace')).toBeFalsy();
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
it('should send if verbosity is higher than required', () => {
|
package/src/simple/Phone.js
CHANGED
|
@@ -171,13 +171,18 @@ class Phone extends Emitter {
|
|
|
171
171
|
return adHocConference.start();
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
mute(callSession: CallSession) {
|
|
175
|
-
|
|
174
|
+
mute(callSession: CallSession, withApi: boolean = true) {
|
|
175
|
+
if (withApi) {
|
|
176
|
+
this.muteViaAPI(callSession);
|
|
177
|
+
}
|
|
178
|
+
|
|
176
179
|
return this.phone && this.phone.mute(callSession);
|
|
177
180
|
}
|
|
178
181
|
|
|
179
|
-
unmute(callSession: CallSession) {
|
|
180
|
-
|
|
182
|
+
unmute(callSession: CallSession, withApi: boolean = true) {
|
|
183
|
+
if (withApi) {
|
|
184
|
+
this.unmuteViaAPI(callSession);
|
|
185
|
+
}
|
|
181
186
|
|
|
182
187
|
return this.phone && this.phone.unmute(callSession);
|
|
183
188
|
}
|
|
@@ -283,6 +288,10 @@ class Phone extends Emitter {
|
|
|
283
288
|
return this.phone && this.phone.hasLocalVideo(callSession);
|
|
284
289
|
}
|
|
285
290
|
|
|
291
|
+
hasALocalVideoTrack(callSession: CallSession) {
|
|
292
|
+
return this.phone && this.phone.hasALocalVideoTrack(callSession);
|
|
293
|
+
}
|
|
294
|
+
|
|
286
295
|
// @Deprecated
|
|
287
296
|
getLocalMediaStream(callSession: CallSession) {
|
|
288
297
|
logger.warn('Phone.getLocalMediaStream is deprecated, use Phone.getLocalStream instead');
|
package/src/simple/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import Auth, { InvalidSubscription, InvalidAuthorization } from './Auth';
|
|
|
3
3
|
import Phone from './Phone';
|
|
4
4
|
import Websocket from './Websocket';
|
|
5
5
|
import Room from './room/Room';
|
|
6
|
+
import SipRoom from './room/SipRoom';
|
|
6
7
|
import RemoteParticipant from './room/RemoteParticipant';
|
|
7
8
|
import LocalParticipant from './room/LocalParticipant';
|
|
8
9
|
import Stream from './room/Stream';
|
|
@@ -29,10 +30,13 @@ import Voicemail from '../domain/Voicemail';
|
|
|
29
30
|
import Relocation from '../domain/Relocation';
|
|
30
31
|
import ConferenceRoom from '../domain/Room';
|
|
31
32
|
import CallSession from '../domain/CallSession';
|
|
33
|
+
import WebRTCPhone from '../domain/Phone/WebRTCPhone';
|
|
34
|
+
import CTIPhone from '../domain/Phone/CTIPhone';
|
|
32
35
|
import IndirectTransfer from '../domain/IndirectTransfer';
|
|
33
36
|
import SwitchboardCall from '../domain/SwitchboardCall';
|
|
34
37
|
import IssueReporter from '../service/IssueReporter';
|
|
35
38
|
import Features from '../domain/Features';
|
|
39
|
+
import Meeting from '../domain/Meeting';
|
|
36
40
|
import Checker from '../checker/Checker';
|
|
37
41
|
|
|
38
42
|
const Wazo = {
|
|
@@ -40,6 +44,7 @@ const Wazo = {
|
|
|
40
44
|
Phone,
|
|
41
45
|
Websocket,
|
|
42
46
|
Room,
|
|
47
|
+
SipRoom,
|
|
43
48
|
RemoteParticipant,
|
|
44
49
|
LocalParticipant,
|
|
45
50
|
Stream,
|
|
@@ -59,6 +64,7 @@ const Wazo = {
|
|
|
59
64
|
ServerError,
|
|
60
65
|
Call,
|
|
61
66
|
CallLog,
|
|
67
|
+
CTIPhone,
|
|
62
68
|
Recording,
|
|
63
69
|
ChatMessage,
|
|
64
70
|
ChatRoom,
|
|
@@ -74,6 +80,8 @@ const Wazo = {
|
|
|
74
80
|
CallSession,
|
|
75
81
|
IndirectTransfer,
|
|
76
82
|
SwitchboardCall,
|
|
83
|
+
WebRTCPhone,
|
|
84
|
+
Meeting,
|
|
77
85
|
},
|
|
78
86
|
|
|
79
87
|
// Api
|
|
@@ -3,6 +3,7 @@ import Emitter from '../../utils/Emitter';
|
|
|
3
3
|
import IssueReporter from '../../service/IssueReporter';
|
|
4
4
|
|
|
5
5
|
import Room, { SIGNAL_TYPE_PARTICIPANT_UPDATE } from './Room';
|
|
6
|
+
import Contact from '../../domain/Contact';
|
|
6
7
|
|
|
7
8
|
const logger = IssueReporter.loggerFor('room');
|
|
8
9
|
|
|
@@ -38,6 +39,7 @@ class Participant extends Emitter {
|
|
|
38
39
|
ON_RESUME: string;
|
|
39
40
|
|
|
40
41
|
/**
|
|
42
|
+
* @param room Room The room where the participant is
|
|
41
43
|
* @param rawParticipant string Participant sent via the Wazo WS
|
|
42
44
|
* @param extra Object extra status of the participant
|
|
43
45
|
*/
|
|
@@ -267,6 +269,11 @@ class Participant extends Emitter {
|
|
|
267
269
|
// Poor man's object comparison
|
|
268
270
|
if (typeof status.extra !== 'undefined' && JSON.stringify(this.extra) !== JSON.stringify(status.extra)) {
|
|
269
271
|
this.extra = { ...this.extra, ...status.extra };
|
|
272
|
+
|
|
273
|
+
if (this.extra.contact && !(this.extra.contact instanceof Contact)) {
|
|
274
|
+
this.extra.contact = new Contact(this.extra.contact);
|
|
275
|
+
}
|
|
276
|
+
|
|
270
277
|
this.triggerUpdate(this.ON_EXTRA_CHANGE, broadcast);
|
|
271
278
|
}
|
|
272
279
|
}
|