@wazo/sdk 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +16 -7
- package/dist/wazo-sdk.js +2 -2
- package/esm/api/auth.js +3 -0
- package/esm/domain/CallLog.js +2 -3
- package/esm/domain/Phone/WebRTCPhone.js +29 -27
- package/esm/simple/Auth.js +13 -3
- package/esm/simple/Phone.js +2 -2
- package/esm/types/api/auth.d.ts +3 -0
- package/esm/types/api/auth.d.ts.map +1 -1
- package/esm/types/domain/CallLog.d.ts.map +1 -1
- package/esm/types/domain/Phone/WebRTCPhone.d.ts +3 -3
- package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/esm/types/simple/Auth.d.ts +6 -1
- package/esm/types/simple/Auth.d.ts.map +1 -1
- package/esm/types/simple/Phone.d.ts +2 -2
- package/esm/types/simple/Phone.d.ts.map +1 -1
- package/esm/types/utils/sdp.d.ts.map +1 -1
- package/esm/types/voice/call.d.ts.map +1 -1
- package/esm/types/web-rtc-client.d.ts.map +1 -1
- package/esm/utils/sdp.js +8 -7
- package/esm/voice/call.js +1 -2
- package/esm/web-rtc-client.js +23 -26
- package/lib/api/auth.js +3 -0
- package/lib/domain/CallLog.js +2 -3
- package/lib/domain/Phone/WebRTCPhone.js +29 -27
- package/lib/simple/Auth.js +15 -3
- package/lib/types/api/auth.d.ts +3 -0
- package/lib/types/api/auth.d.ts.map +1 -1
- package/lib/types/domain/CallLog.d.ts.map +1 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts +3 -3
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/lib/types/simple/Auth.d.ts +6 -1
- package/lib/types/simple/Auth.d.ts.map +1 -1
- package/lib/types/simple/Phone.d.ts +2 -2
- package/lib/types/simple/Phone.d.ts.map +1 -1
- package/lib/types/utils/sdp.d.ts.map +1 -1
- package/lib/types/voice/call.d.ts.map +1 -1
- package/lib/types/web-rtc-client.d.ts.map +1 -1
- package/lib/utils/sdp.js +7 -6
- package/lib/voice/call.js +1 -2
- package/lib/web-rtc-client.js +22 -25
- package/package.json +1 -1
- package/src/api/auth.ts +5 -0
- package/src/domain/CallLog.ts +2 -3
- package/src/domain/Phone/WebRTCPhone.ts +33 -31
- package/src/simple/Auth.ts +15 -3
- package/src/simple/Phone.ts +3 -3
- package/src/utils/sdp.ts +9 -8
- package/src/voice/call.ts +2 -3
- package/src/web-rtc-client.ts +24 -25
package/esm/utils/sdp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
import sdpParser from 'sdp-transform';
|
|
3
3
|
import { UserAgent } from 'sip.js/lib/api/user-agent';
|
|
4
|
-
import { Inviter } from 'sip.js/lib/api';
|
|
4
|
+
import { Inviter, Invitation } from 'sip.js/lib/api';
|
|
5
5
|
export const SIP_ID_MIN_LENGTH = 20;
|
|
6
6
|
export const getCandidates = (rawSdp) => {
|
|
7
7
|
if (!rawSdp) {
|
|
@@ -110,18 +110,19 @@ export const getSipCallId = (sipSession) => {
|
|
|
110
110
|
if (!sipSession) {
|
|
111
111
|
return '';
|
|
112
112
|
}
|
|
113
|
-
const message = sipSession.message;
|
|
114
|
-
if (message?.callId) {
|
|
115
|
-
return message.callId.substring(0, SIP_ID_MIN_LENGTH);
|
|
116
|
-
}
|
|
117
113
|
// For Inviter
|
|
118
114
|
// @ts-ignore: private
|
|
119
115
|
if (sipSession instanceof Inviter && sipSession.outgoingRequestMessage) {
|
|
120
116
|
// @ts-ignore: private
|
|
121
|
-
return sipSession.outgoingRequestMessage.callId
|
|
117
|
+
return sipSession.outgoingRequestMessage.callId;
|
|
122
118
|
}
|
|
123
119
|
// For Invitation
|
|
124
|
-
|
|
120
|
+
// @ts-ignore: private
|
|
121
|
+
if (sipSession instanceof Invitation && sipSession.incomingInviteRequest.message) {
|
|
122
|
+
// @ts-ignore: private
|
|
123
|
+
return sipSession.incomingInviteRequest.message.callId;
|
|
124
|
+
}
|
|
125
|
+
return sipSession.id;
|
|
125
126
|
};
|
|
126
127
|
// We need to replace 0.0.0.0 to 127.0.0.1 in the sdp to avoid MOH during a createOffer.
|
|
127
128
|
export const replaceLocalIpModifier = (description) => Promise.resolve({
|
package/esm/voice/call.js
CHANGED
|
@@ -79,7 +79,6 @@ class Call extends EventEmitter {
|
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
81
|
const call = new Call(sipCall, softphone);
|
|
82
|
-
// call._sendAction(Actions.ES);
|
|
83
82
|
call.apiId = apiCall.id;
|
|
84
83
|
call.answerTime = new Date(+apiCall.startingTime);
|
|
85
84
|
// Update call state
|
|
@@ -109,7 +108,6 @@ class Call extends EventEmitter {
|
|
|
109
108
|
this.sipCall = sipCall;
|
|
110
109
|
this.number = getCallNumber(sipCall);
|
|
111
110
|
this.displayName = getCallDisplayName(sipCall);
|
|
112
|
-
this._bindEvents();
|
|
113
111
|
}
|
|
114
112
|
async accept(options = {}) {
|
|
115
113
|
assertCan(this.callActor, Actions.ACCEPT);
|
|
@@ -401,6 +399,7 @@ class Call extends EventEmitter {
|
|
|
401
399
|
this._onScreenSharing(localStream, false, desktop);
|
|
402
400
|
}
|
|
403
401
|
onMakeCall() {
|
|
402
|
+
this._bindEvents();
|
|
404
403
|
this._sendAction(Actions.MAKE_CALL);
|
|
405
404
|
}
|
|
406
405
|
onAccepted() {
|
package/esm/web-rtc-client.js
CHANGED
|
@@ -17,7 +17,7 @@ import Emitter from './utils/Emitter';
|
|
|
17
17
|
import ApiClient from './api-client';
|
|
18
18
|
import IssueReporter from './service/IssueReporter';
|
|
19
19
|
import Heartbeat from './utils/Heartbeat';
|
|
20
|
-
import { getSipCallId, makeURI, replaceLocalIpModifier
|
|
20
|
+
import { getSipCallId, makeURI, replaceLocalIpModifier } from './utils/sdp';
|
|
21
21
|
import { cleanupStream, createUaOptions, fetchNetworkStats, getAudioConstraints, getLocalStream, getLocalTracks, getLocalVideoStream, getMediaConfiguration, getPeerConnection, getRemoteStream, getRemoteTracks, getRemoteVideoStream, getRemoteVideoStreamFromPc, getVideoConstraints, hasALocalVideoTrack, hasARemoteVideoTrack, hasAVideoTrack, hasLocalVideo, hasRemoteVideo, hasVideoTrack, isAudioOnly, isVideoRemotelyHeld, isWeb, sessionWantsToDoVideo, setLocalMediaStream, toggleAudio, toggleVideo, updateRemoteStream } from './utils/webrtc';
|
|
22
22
|
const SEND_STATS_DELAY = 5000;
|
|
23
23
|
const states = ['STATUS_NULL', 'STATUS_NEW', 'STATUS_CONNECTING', 'STATUS_CONNECTED', 'STATUS_COMPLETED'];
|
|
@@ -173,7 +173,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
173
173
|
logger.info('sdk webrtc on invite', {
|
|
174
174
|
method: 'delegate.onInvite',
|
|
175
175
|
clientId: this.clientId,
|
|
176
|
-
id: invitation
|
|
176
|
+
id: getSipCallId(invitation),
|
|
177
177
|
remoteURI: invitation.remoteURI,
|
|
178
178
|
});
|
|
179
179
|
this._setupSession(invitation);
|
|
@@ -456,7 +456,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
456
456
|
},
|
|
457
457
|
onReject: (response) => {
|
|
458
458
|
logger.info('on call rejected', {
|
|
459
|
-
id: session
|
|
459
|
+
id: getSipCallId(session),
|
|
460
460
|
// @ts-ignore: fromTag does not exist
|
|
461
461
|
fromTag: session?.fromTag,
|
|
462
462
|
});
|
|
@@ -486,7 +486,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
486
486
|
answer(session, enableVideo) {
|
|
487
487
|
logger.info('sdk webrtc answer call', {
|
|
488
488
|
clientId: this.clientId,
|
|
489
|
-
id: session
|
|
489
|
+
id: getSipCallId(session),
|
|
490
490
|
enableVideo,
|
|
491
491
|
});
|
|
492
492
|
if (!session || !session.accept) {
|
|
@@ -502,7 +502,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
502
502
|
if (session.isCanceled) {
|
|
503
503
|
const message = 'accepted a canceled session (or was canceled during the accept phase).';
|
|
504
504
|
logger.error(message, {
|
|
505
|
-
id: session
|
|
505
|
+
id: getSipCallId(session),
|
|
506
506
|
});
|
|
507
507
|
this.onCallEnded(session);
|
|
508
508
|
throw new CanceledCallError(message);
|
|
@@ -510,7 +510,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
510
510
|
logger.info('sdk webrtc answer, accepted.');
|
|
511
511
|
this._onAccepted(session);
|
|
512
512
|
}).catch(e => {
|
|
513
|
-
logger.error(`answer call error for ${session
|
|
513
|
+
logger.error(`answer call error for ${getSipCallId(session)}`, e);
|
|
514
514
|
throw e;
|
|
515
515
|
});
|
|
516
516
|
}
|
|
@@ -567,7 +567,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
567
567
|
async reject(session) {
|
|
568
568
|
logger.info('sdk webrtc reject call', {
|
|
569
569
|
clientId: this.clientId,
|
|
570
|
-
id: session
|
|
570
|
+
id: getSipCallId(session),
|
|
571
571
|
});
|
|
572
572
|
try {
|
|
573
573
|
if (session instanceof Invitation) {
|
|
@@ -621,13 +621,13 @@ export default class WebRTCClient extends Emitter {
|
|
|
621
621
|
}
|
|
622
622
|
mute(session) {
|
|
623
623
|
logger.info('sdk webrtc mute', {
|
|
624
|
-
id: session
|
|
624
|
+
id: getSipCallId(session),
|
|
625
625
|
});
|
|
626
626
|
toggleAudio(session, true);
|
|
627
627
|
}
|
|
628
628
|
unmute(session) {
|
|
629
629
|
logger.info('sdk webrtc unmute', {
|
|
630
|
-
id: session
|
|
630
|
+
id: getSipCallId(session),
|
|
631
631
|
});
|
|
632
632
|
toggleAudio(session, false);
|
|
633
633
|
}
|
|
@@ -664,13 +664,13 @@ export default class WebRTCClient extends Emitter {
|
|
|
664
664
|
}
|
|
665
665
|
toggleCameraOn(session) {
|
|
666
666
|
logger.info('sdk webrtc toggle camera on', {
|
|
667
|
-
id: session
|
|
667
|
+
id: getSipCallId(session),
|
|
668
668
|
});
|
|
669
669
|
toggleVideo(session, false);
|
|
670
670
|
}
|
|
671
671
|
toggleCameraOff(session) {
|
|
672
672
|
logger.info('sdk webrtc toggle camera off', {
|
|
673
|
-
id: session
|
|
673
|
+
id: getSipCallId(session),
|
|
674
674
|
});
|
|
675
675
|
toggleVideo(session, true);
|
|
676
676
|
}
|
|
@@ -844,7 +844,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
844
844
|
return;
|
|
845
845
|
}
|
|
846
846
|
logger.info('send WebRTC message', {
|
|
847
|
-
sipId: sipSession
|
|
847
|
+
sipId: getSipCallId(sipSession),
|
|
848
848
|
contentType,
|
|
849
849
|
});
|
|
850
850
|
try {
|
|
@@ -1218,7 +1218,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
1218
1218
|
this.sipSessions[id] = session;
|
|
1219
1219
|
}
|
|
1220
1220
|
getSipSession(id) {
|
|
1221
|
-
return id in this.sipSessions ? this.sipSessions[id
|
|
1221
|
+
return id in this.sipSessions ? this.sipSessions[id] : null;
|
|
1222
1222
|
}
|
|
1223
1223
|
getSipCallIds() {
|
|
1224
1224
|
return Object.keys(this.sipSessions);
|
|
@@ -1438,17 +1438,14 @@ export default class WebRTCClient extends Emitter {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
async _onProgress(session, early = false) {
|
|
1440
1440
|
await this._setupMedias(session);
|
|
1441
|
-
const sessionId = getSipCallId(session)
|
|
1441
|
+
const sessionId = getSipCallId(session);
|
|
1442
1442
|
updateRemoteStream(session);
|
|
1443
|
-
logger.info('progress received', {
|
|
1444
|
-
sessionId,
|
|
1445
|
-
early,
|
|
1446
|
-
});
|
|
1443
|
+
logger.info('progress received', { sessionId, early });
|
|
1447
1444
|
this.eventEmitter.emit(early ? ON_EARLY_MEDIA : ON_PROGRESS, session);
|
|
1448
1445
|
}
|
|
1449
1446
|
async _onAccepted(session, sessionDialog, withEvent = true, initAllTracks = true) {
|
|
1450
1447
|
logger.info('on call accepted', {
|
|
1451
|
-
id: session
|
|
1448
|
+
id: getSipCallId(session),
|
|
1452
1449
|
clientId: this.clientId,
|
|
1453
1450
|
remoteTag: session.remoteTag,
|
|
1454
1451
|
});
|
|
@@ -1638,18 +1635,18 @@ export default class WebRTCClient extends Emitter {
|
|
|
1638
1635
|
async _accept(session, options = {}) {
|
|
1639
1636
|
if (session.state === SessionState.Terminated || session.state === SessionState.Terminating) {
|
|
1640
1637
|
const error = 'Trying to accept a terminated sipSession.';
|
|
1641
|
-
logger.warn(error, { state: session.state, sessionId: session
|
|
1638
|
+
logger.warn(error, { state: session.state, sessionId: getSipCallId(session) });
|
|
1642
1639
|
throw new Error(error);
|
|
1643
1640
|
}
|
|
1644
1641
|
if (session.state !== SessionState.Initial) {
|
|
1645
1642
|
const error = 'Trying to accept a non Initial sipSession.';
|
|
1646
|
-
logger.warn(error, { state: session.state, sessionId: session
|
|
1643
|
+
logger.warn(error, { state: session.state, sessionId: getSipCallId(session) });
|
|
1647
1644
|
throw new Error(error);
|
|
1648
1645
|
}
|
|
1649
1646
|
// @ts-ignore: private
|
|
1650
1647
|
if (!session.incomingInviteRequest.acceptable) {
|
|
1651
1648
|
const error = 'Trying to reject a non `acceptable` session';
|
|
1652
|
-
logger.warn(error, { state: session.state, sessionId: session
|
|
1649
|
+
logger.warn(error, { state: session.state, sessionId: getSipCallId(session) });
|
|
1653
1650
|
throw new Error(error);
|
|
1654
1651
|
}
|
|
1655
1652
|
try {
|
|
@@ -1661,12 +1658,12 @@ export default class WebRTCClient extends Emitter {
|
|
|
1661
1658
|
}
|
|
1662
1659
|
async _reject(session, options = {}) {
|
|
1663
1660
|
if (session.state !== SessionState.Initial && session.state !== SessionState.Establishing) {
|
|
1664
|
-
logger.warn('Trying to reject a session in a wrong state', { state: session.state, sessionId: session
|
|
1661
|
+
logger.warn('Trying to reject a session in a wrong state', { state: session.state, sessionId: getSipCallId(session) });
|
|
1665
1662
|
return;
|
|
1666
1663
|
}
|
|
1667
1664
|
// @ts-ignore: private
|
|
1668
1665
|
if (!session.incomingInviteRequest.rejectable) {
|
|
1669
|
-
logger.warn('Trying to reject a non `rejectable` session', { state: session.state, sessionId: session
|
|
1666
|
+
logger.warn('Trying to reject a non `rejectable` session', { state: session.state, sessionId: getSipCallId(session) });
|
|
1670
1667
|
return;
|
|
1671
1668
|
}
|
|
1672
1669
|
try {
|
|
@@ -1678,7 +1675,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
1678
1675
|
}
|
|
1679
1676
|
async _cancel(session, options = {}) {
|
|
1680
1677
|
if (session.state !== SessionState.Initial && session.state !== SessionState.Establishing) {
|
|
1681
|
-
logger.warn('Trying to cancel a session in a wrong state', { state: session.state, sessionId: session
|
|
1678
|
+
logger.warn('Trying to cancel a session in a wrong state', { state: session.state, sessionId: getSipCallId(session) });
|
|
1682
1679
|
return;
|
|
1683
1680
|
}
|
|
1684
1681
|
try {
|
|
@@ -1690,7 +1687,7 @@ export default class WebRTCClient extends Emitter {
|
|
|
1690
1687
|
}
|
|
1691
1688
|
async _bye(session, options = {}) {
|
|
1692
1689
|
if (session.state !== SessionState.Established) {
|
|
1693
|
-
logger.warn('Trying to end a session in a wrong state', { state: session.state, sessionId: session
|
|
1690
|
+
logger.warn('Trying to end a session in a wrong state', { state: session.state, sessionId: getSipCallId(session) });
|
|
1694
1691
|
return null;
|
|
1695
1692
|
}
|
|
1696
1693
|
try {
|
package/lib/api/auth.js
CHANGED
|
@@ -64,6 +64,9 @@ exports.default = ((client, baseUrl) => ({
|
|
|
64
64
|
}
|
|
65
65
|
return client.post(`${baseUrl}/token`, body, headers).then(Session_1.default.parse);
|
|
66
66
|
}),
|
|
67
|
+
samlLogOut() {
|
|
68
|
+
return client.get(`${baseUrl}/saml/logout`, null, null);
|
|
69
|
+
},
|
|
67
70
|
initiateIdpAuthentication: (domain, redirectUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
71
|
const body = {
|
|
69
72
|
domain,
|
package/lib/domain/CallLog.js
CHANGED
|
@@ -46,8 +46,7 @@ class CallLog {
|
|
|
46
46
|
}
|
|
47
47
|
static parseNew(plain, session) {
|
|
48
48
|
const callLog = CallLog.parse(plain);
|
|
49
|
-
|
|
50
|
-
callLog.newMissedCall = session && session.hasExtension((plain.requested_extension || plain.destination_extension)) && !plain.answered;
|
|
49
|
+
callLog.newMissedCall = session && plain.destination_user_uuid === session.uuid && !plain.answered;
|
|
51
50
|
return callLog;
|
|
52
51
|
}
|
|
53
52
|
static newFrom(profile) {
|
|
@@ -105,7 +104,7 @@ class CallLog {
|
|
|
105
104
|
return this.callDirection === 'inbound';
|
|
106
105
|
}
|
|
107
106
|
isAnOutgoingCall(session) {
|
|
108
|
-
console.warn(`@wazo/sdk
|
|
107
|
+
console.warn(`@wazo/sdk
|
|
109
108
|
CallLog.isAnOutgoingcall(session) method is obsolete.
|
|
110
109
|
Please use CallLog.isOutgoing(session).
|
|
111
110
|
`);
|
|
@@ -125,7 +125,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
125
125
|
return __awaiter(this, arguments, void 0, function* (callSession, constraints = null, conference = false, audioOnly = false, iceRestart = false) {
|
|
126
126
|
const sipSession = this.findSipSession(callSession);
|
|
127
127
|
logger.info('WebRTC phone - send reinvite', {
|
|
128
|
-
sessionId:
|
|
128
|
+
sessionId: (0, sdp_1.getSipCallId)(sipSession),
|
|
129
129
|
constraints,
|
|
130
130
|
audioOnly,
|
|
131
131
|
conference,
|
|
@@ -303,7 +303,9 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
303
303
|
onCancel(message);
|
|
304
304
|
const elsewhere = message.data.indexOf('cause=26') !== -1 && message.data.indexOf('completed elsewhere') !== -1;
|
|
305
305
|
const callSession = this._createCallSession(sipSession);
|
|
306
|
-
|
|
306
|
+
if (sipSessionId) {
|
|
307
|
+
delete this.callSessions[sipSessionId];
|
|
308
|
+
}
|
|
307
309
|
this.eventEmitter.emit(exports.ON_CALL_CANCELED, callSession, elsewhere);
|
|
308
310
|
};
|
|
309
311
|
}
|
|
@@ -311,14 +313,14 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
311
313
|
switch (newState) {
|
|
312
314
|
case session_state_1.SessionState.Terminating:
|
|
313
315
|
logger.info('WebRTC phone - call terminating', {
|
|
314
|
-
sipId: sipSession
|
|
316
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
315
317
|
});
|
|
316
318
|
this.eventEmitter.emit(exports.ON_CALL_ENDING, this._createCallSession(sipSession));
|
|
317
319
|
break;
|
|
318
320
|
case session_state_1.SessionState.Terminated:
|
|
319
321
|
{
|
|
320
322
|
logger.info('WebRTC phone - call terminated', {
|
|
321
|
-
sipId: sipSession
|
|
323
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
322
324
|
});
|
|
323
325
|
// Should be called before `_onCallTerminated` or the callCount will not decrement...
|
|
324
326
|
const callSession = this._createCallSession(sipSession);
|
|
@@ -474,13 +476,13 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
474
476
|
}
|
|
475
477
|
_onCallAccepted(sipSession, cameraEnabled) {
|
|
476
478
|
logger.info('WebRTC phone - on call accepted', {
|
|
477
|
-
sipId: sipSession
|
|
479
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
478
480
|
cameraEnabled,
|
|
479
481
|
});
|
|
480
482
|
const callSession = this._createAcceptedCallSession(sipSession, cameraEnabled);
|
|
481
483
|
if (this.currentSipSession && !this.isCurrentCallSipSession(callSession)) {
|
|
482
484
|
logger.info('WebRTC phone - on call accepted with another ongoing call, holding it', {
|
|
483
|
-
sipId: sipSession
|
|
485
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
484
486
|
cameraEnabled,
|
|
485
487
|
});
|
|
486
488
|
this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
|
|
@@ -553,7 +555,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
553
555
|
_onCallTerminated(sipSession) {
|
|
554
556
|
const sipSessionId = (0, sdp_1.getSipCallId)(sipSession);
|
|
555
557
|
logger.info('WebRTC phone - on call terminated', {
|
|
556
|
-
sipId: sipSession
|
|
558
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
557
559
|
sipSessionId,
|
|
558
560
|
ids: Object.keys(this.callSessions),
|
|
559
561
|
});
|
|
@@ -573,8 +575,8 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
573
575
|
}
|
|
574
576
|
if (sipSessionId) {
|
|
575
577
|
this.removeIncomingSessions(sipSessionId);
|
|
578
|
+
delete this.callSessions[sipSessionId];
|
|
576
579
|
}
|
|
577
|
-
delete this.callSessions[sipSessionId];
|
|
578
580
|
if (isCurrentSession) {
|
|
579
581
|
this.currentSipSession = undefined;
|
|
580
582
|
this.currentCallSession = undefined;
|
|
@@ -582,7 +584,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
582
584
|
const hasIncomingCallSession = this.hasIncomingCallSession();
|
|
583
585
|
// Re-trigger incoming call event for remaining incoming calls
|
|
584
586
|
logger.info('WebRTC phone - check to re-trigger incoming call', {
|
|
585
|
-
sipId: sipSession
|
|
587
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
586
588
|
shouldRetrigger,
|
|
587
589
|
hasIncomingCallSession,
|
|
588
590
|
});
|
|
@@ -697,7 +699,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
697
699
|
this.eventEmitter.emit(exports.ON_CALL_ANSWERED, callSession);
|
|
698
700
|
const sipSession = this.client.getSipSession(callSession.getId());
|
|
699
701
|
if (sipSession) {
|
|
700
|
-
logger.info('accept call, session found', { sipId: sipSession
|
|
702
|
+
logger.info('accept call, session found', { sipId: (0, sdp_1.getSipCallId)(sipSession) });
|
|
701
703
|
return this.client.answer(sipSession, this.allowVideo ? cameraEnabled : false).then(() => {
|
|
702
704
|
return callSession.sipCallId;
|
|
703
705
|
}).catch(e => {
|
|
@@ -733,7 +735,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
733
735
|
const sipSession = this.findSipSession(callSession);
|
|
734
736
|
if (sipSession) {
|
|
735
737
|
logger.info('WebRTC rejecting', {
|
|
736
|
-
sipId: sipSession
|
|
738
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
737
739
|
});
|
|
738
740
|
this.client.hangup(sipSession);
|
|
739
741
|
}
|
|
@@ -754,7 +756,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
754
756
|
const sipSession = this.findSipSession(callSession);
|
|
755
757
|
if (sipSession) {
|
|
756
758
|
logger.info('WebRTC atxfer', {
|
|
757
|
-
sipId: sipSession
|
|
759
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
758
760
|
});
|
|
759
761
|
return this.client.atxfer(sipSession);
|
|
760
762
|
}
|
|
@@ -780,12 +782,12 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
780
782
|
return new Promise((resolve, reject) => reject(new Error('No session to resume')));
|
|
781
783
|
}
|
|
782
784
|
logger.info('WebRTC resuming', {
|
|
783
|
-
sipId: sipSession
|
|
785
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
784
786
|
});
|
|
785
787
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
786
|
-
if (this.currentSipSession && this.currentSipSession
|
|
788
|
+
if (this.currentSipSession && (0, sdp_1.getSipCallId)(this.currentSipSession) !== (0, sdp_1.getSipCallId)(sipSession)) {
|
|
787
789
|
logger.info('WebRTC hold call after resume', {
|
|
788
|
-
id: this.currentSipSession
|
|
790
|
+
id: (0, sdp_1.getSipCallId)(this.currentSipSession),
|
|
789
791
|
});
|
|
790
792
|
this.holdSipSession(this.currentSipSession, this.currentCallSession, withEvent);
|
|
791
793
|
}
|
|
@@ -804,7 +806,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
804
806
|
const sessionId = (0, sdp_1.getSipCallId)(sipSession);
|
|
805
807
|
const hasVideo = this.client.hasLocalVideo(sessionId);
|
|
806
808
|
logger.info('WebRTC hold sip session', {
|
|
807
|
-
sipId: sipSession
|
|
809
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
808
810
|
hasVideo,
|
|
809
811
|
});
|
|
810
812
|
// Stop screenshare if needed
|
|
@@ -883,7 +885,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
883
885
|
return;
|
|
884
886
|
}
|
|
885
887
|
logger.info('WebRTC muting', {
|
|
886
|
-
sipId: sipSession
|
|
888
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
887
889
|
});
|
|
888
890
|
this.client.mute(sipSession);
|
|
889
891
|
const newCallSession = this._createCallSession(sipSession, callSession, {
|
|
@@ -905,7 +907,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
905
907
|
return;
|
|
906
908
|
}
|
|
907
909
|
logger.info('WebRTC unmuting', {
|
|
908
|
-
sipId: sipSession
|
|
910
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
909
911
|
});
|
|
910
912
|
this.client.unmute(sipSession);
|
|
911
913
|
const newCallSession = this._createCallSession(sipSession, callSession, {
|
|
@@ -931,7 +933,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
931
933
|
return;
|
|
932
934
|
}
|
|
933
935
|
logger.info('WebRTC turn camera on', {
|
|
934
|
-
sipId: sipSession
|
|
936
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
935
937
|
});
|
|
936
938
|
this.client.toggleCameraOn(sipSession);
|
|
937
939
|
this.eventEmitter.emit(exports.ON_CAMERA_RESUMED, this._createCameraResumedCallSession(sipSession, callSession));
|
|
@@ -942,7 +944,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
942
944
|
return;
|
|
943
945
|
}
|
|
944
946
|
logger.info('WebRTC turn camera off', {
|
|
945
|
-
sipId: sipSession
|
|
947
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
946
948
|
});
|
|
947
949
|
this.client.toggleCameraOff(sipSession);
|
|
948
950
|
this.eventEmitter.emit(exports.ON_CAMERA_DISABLED, this._createCameraDisabledCallSession(sipSession, callSession));
|
|
@@ -953,7 +955,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
953
955
|
return;
|
|
954
956
|
}
|
|
955
957
|
logger.info('WebRTC send key', {
|
|
956
|
-
sipId: sipSession
|
|
958
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
957
959
|
tone,
|
|
958
960
|
});
|
|
959
961
|
this.client.sendDTMF(sipSession, tone);
|
|
@@ -1018,7 +1020,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
1018
1020
|
return;
|
|
1019
1021
|
}
|
|
1020
1022
|
logger.info('WebRTC transfer', {
|
|
1021
|
-
sipId: sipSession
|
|
1023
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
1022
1024
|
target,
|
|
1023
1025
|
});
|
|
1024
1026
|
this.client.transfer(sipSession, target);
|
|
@@ -1028,8 +1030,8 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
1028
1030
|
const sipSession = this.client.getSipSession(source.sipCallId);
|
|
1029
1031
|
const sipSessionTarget = this.client.getSipSession(destination.sipCallId);
|
|
1030
1032
|
logger.info('WebRTC indirect transfer', {
|
|
1031
|
-
sipId: sipSession ? sipSession
|
|
1032
|
-
target: sipSessionTarget ? sipSessionTarget
|
|
1033
|
+
sipId: sipSession ? (0, sdp_1.getSipCallId)(sipSession) : null,
|
|
1034
|
+
target: sipSessionTarget ? (0, sdp_1.getSipCallId)(sipSessionTarget) : null,
|
|
1033
1035
|
});
|
|
1034
1036
|
if (!sipSessionTarget) {
|
|
1035
1037
|
return Promise.reject();
|
|
@@ -1061,7 +1063,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
1061
1063
|
}
|
|
1062
1064
|
const sipSessionId = (0, sdp_1.getSipCallId)(sipSession);
|
|
1063
1065
|
logger.info('WebRTC hangup', {
|
|
1064
|
-
sipId: sipSession
|
|
1066
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
1065
1067
|
sipSessionId,
|
|
1066
1068
|
});
|
|
1067
1069
|
yield this.client.hangup(sipSession);
|
|
@@ -1219,7 +1221,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
1219
1221
|
const autoAnswer = sipSession.request.getHeader('Answer-Mode') === 'Auto';
|
|
1220
1222
|
const withVideo = this.allowVideo ? wantsToDoVideo : false;
|
|
1221
1223
|
logger.info('WebRTC invite received', {
|
|
1222
|
-
sipId: sipSession
|
|
1224
|
+
sipId: (0, sdp_1.getSipCallId)(sipSession),
|
|
1223
1225
|
withVideo,
|
|
1224
1226
|
autoAnswer,
|
|
1225
1227
|
});
|
|
@@ -1279,7 +1281,7 @@ class WebRTCPhone extends Emitter_1.default {
|
|
|
1279
1281
|
this.eventEmitter.emit(exports.ON_CALL_ERROR, e);
|
|
1280
1282
|
});
|
|
1281
1283
|
this.client.on(this.client.REJECTED, session => {
|
|
1282
|
-
logger.info('WebRTC call rejected',
|
|
1284
|
+
logger.info('WebRTC call rejected', { id: (0, sdp_1.getSipCallId)(session) });
|
|
1283
1285
|
const callSession = this._createCallSession(session);
|
|
1284
1286
|
// `_createCallSession` add the CallSession in `this.callSessions`.
|
|
1285
1287
|
// so we have to remove it or `callCount` will always return 1 even if the call was rejected
|
package/lib/simple/Auth.js
CHANGED
|
@@ -154,6 +154,11 @@ class Auth {
|
|
|
154
154
|
return this._onAuthenticated(rawSession);
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
+
samlLogOut() {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
return yield this.logout(false, true);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
157
162
|
initiateIdpAuthentication(domain, redirectUrl) {
|
|
158
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
164
|
try {
|
|
@@ -206,20 +211,26 @@ class Auth {
|
|
|
206
211
|
});
|
|
207
212
|
}
|
|
208
213
|
logout() {
|
|
209
|
-
return __awaiter(this, arguments, void 0, function* (deleteRefreshToken = true) {
|
|
214
|
+
return __awaiter(this, arguments, void 0, function* (deleteRefreshToken = true, saml = false) {
|
|
210
215
|
var _a;
|
|
211
216
|
try {
|
|
212
217
|
index_1.default.Websocket.close(true);
|
|
213
|
-
if (this.clientId && deleteRefreshToken) {
|
|
218
|
+
if (!saml && this.clientId && deleteRefreshToken) {
|
|
214
219
|
yield (0, getApiClient_1.default)().auth.deleteRefreshToken(this.clientId);
|
|
215
220
|
}
|
|
216
221
|
}
|
|
217
222
|
catch (e) {
|
|
218
223
|
// Nothing to
|
|
219
224
|
}
|
|
225
|
+
let response;
|
|
220
226
|
try {
|
|
221
227
|
if ((_a = this.session) === null || _a === void 0 ? void 0 : _a.token) {
|
|
222
|
-
|
|
228
|
+
if (saml) {
|
|
229
|
+
response = yield (0, getApiClient_1.default)().auth.samlLogOut();
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
yield (0, getApiClient_1.default)().auth.logOut(this.session.token);
|
|
233
|
+
}
|
|
223
234
|
}
|
|
224
235
|
}
|
|
225
236
|
catch (e) {
|
|
@@ -231,6 +242,7 @@ class Auth {
|
|
|
231
242
|
this.authenticated = false;
|
|
232
243
|
this.usingEdgeServer = undefined;
|
|
233
244
|
(0, getApiClient_1.setFetchOptions)({});
|
|
245
|
+
return response;
|
|
234
246
|
});
|
|
235
247
|
}
|
|
236
248
|
setOnHostFromHeaders(callback) {
|
package/lib/types/api/auth.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export interface AuthD {
|
|
|
23
23
|
logIn(params: LoginParams): Promise<Session | null | undefined>;
|
|
24
24
|
logOut: (token: Token) => Promise<LogoutResponse>;
|
|
25
25
|
samlLogIn: (samlSessionId: string) => Promise<Session | null | undefined>;
|
|
26
|
+
samlLogOut: () => Promise<void | {
|
|
27
|
+
location: string;
|
|
28
|
+
}>;
|
|
26
29
|
initiateIdpAuthentication(domain: string, redirectUrl: string): Promise<any>;
|
|
27
30
|
refreshToken: (refreshToken: string, backend: string, expiration: number, isMobile?: boolean, tenantId?: string, domainName?: string) => Promise<Session | null | undefined>;
|
|
28
31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EAAE,OAAO,GAAG,OAAO;IAIhD,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAQ3C,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAI1C,aAAa;CAId"}
|
|
@@ -3,7 +3,7 @@ import { OutgoingInviteRequest } from 'sip.js/lib/core';
|
|
|
3
3
|
import { Inviter } from 'sip.js/lib/api';
|
|
4
4
|
import CallSession from '../CallSession';
|
|
5
5
|
import type { Phone, AvailablePhoneOptions } from './Phone';
|
|
6
|
-
import
|
|
6
|
+
import WebRTCClient from '../../web-rtc-client';
|
|
7
7
|
import Emitter from '../../utils/Emitter';
|
|
8
8
|
import { WazoSession } from '../types';
|
|
9
9
|
export declare const ON_USER_AGENT = "onUserAgent";
|
|
@@ -52,7 +52,7 @@ export declare const MESSAGE_TYPE_CHAT = "message/TYPE_CHAT";
|
|
|
52
52
|
export declare const MESSAGE_TYPE_SIGNAL = "message/TYPE_SIGNAL";
|
|
53
53
|
export declare const events: string[];
|
|
54
54
|
export default class WebRTCPhone extends Emitter implements Phone {
|
|
55
|
-
client:
|
|
55
|
+
client: WebRTCClient;
|
|
56
56
|
allowVideo: boolean;
|
|
57
57
|
callSessions: Record<string, CallSession>;
|
|
58
58
|
incomingSessions: string[];
|
|
@@ -69,7 +69,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
69
69
|
currentScreenShare: Record<string, any> | null;
|
|
70
70
|
lastScreenShare: Record<string, any> | null;
|
|
71
71
|
shouldSendReinvite: boolean;
|
|
72
|
-
constructor(client:
|
|
72
|
+
constructor(client: WebRTCClient, audioOutputDeviceId: string | undefined, allowVideo?: boolean, audioRingDeviceId?: string);
|
|
73
73
|
register(): Promise<void>;
|
|
74
74
|
unregister(): Promise<void> | null;
|
|
75
75
|
stop(): void;
|