@wazo/sdk 0.37.33 → 0.37.34
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 +2 -2
- package/esm/__tests__/web-rtc-client.test.js +1 -1
- package/esm/checker/Checker.js +1 -1
- package/esm/checker/checks/index.js +1 -1
- package/esm/checker/checks/webrtc-transport.js +1 -1
- package/esm/checker/checks/webrtc.js +1 -1
- package/esm/domain/Phone/WebRTCPhone.js +23 -4
- package/esm/index.js +24 -5
- package/esm/simple/Auth.js +24 -5
- package/esm/simple/Configuration.js +24 -5
- package/esm/simple/Phone.js +24 -5
- package/esm/simple/index.js +24 -5
- package/esm/simple/room/LocalParticipant.js +24 -5
- package/esm/simple/room/Participant.js +24 -5
- package/esm/simple/room/RemoteParticipant.js +24 -5
- package/esm/simple/room/Room.js +24 -5
- package/esm/simple/room/SipRoom.js +24 -5
- package/esm/simple/room/Stream.js +24 -5
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +24 -5
- package/esm/simple/utils.js +24 -5
- package/esm/web-rtc-client.js +1 -1
- package/lib/__tests__/web-rtc-client.test.js +1 -1
- package/lib/checker/Checker.js +1 -1
- package/lib/checker/checks/index.js +1 -1
- package/lib/checker/checks/webrtc-transport.js +1 -1
- package/lib/checker/checks/webrtc.js +1 -1
- package/lib/domain/Phone/WebRTCPhone.js +23 -4
- package/lib/index.js +24 -5
- package/lib/simple/Auth.js +24 -5
- package/lib/simple/Configuration.js +24 -5
- package/lib/simple/Phone.js +24 -5
- package/lib/simple/index.js +24 -5
- package/lib/simple/room/LocalParticipant.js +24 -5
- package/lib/simple/room/Participant.js +24 -5
- package/lib/simple/room/RemoteParticipant.js +24 -5
- package/lib/simple/room/Room.js +24 -5
- package/lib/simple/room/SipRoom.js +24 -5
- package/lib/simple/room/Stream.js +24 -5
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +24 -5
- package/lib/simple/utils.js +24 -5
- package/lib/web-rtc-client.js +1 -1
- package/package.json +1 -1
- package/src/domain/Phone/WebRTCPhone.js +23 -4
- package/src/web-rtc-client.js +1 -1
|
@@ -6673,7 +6673,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6673
6673
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6674
6674
|
class CanceledCallError extends Error {}
|
|
6675
6675
|
|
|
6676
|
-
const MAX_REGISTER_TRIES =
|
|
6676
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6677
6677
|
|
|
6678
6678
|
|
|
6679
6679
|
|
|
@@ -9636,6 +9636,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9636
9636
|
return Promise.resolve(null);
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9640
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9641
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9642
|
+
return Promise.resolve(null);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9639
9645
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9640
9646
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9641
9647
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10260,9 +10266,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10260
10266
|
});
|
|
10261
10267
|
|
|
10262
10268
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10263
|
-
|
|
10269
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10270
|
+
const hasSession = sessionId in this.callSessions;
|
|
10271
|
+
|
|
10272
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10273
|
+
|
|
10274
|
+
if (!hasSession) {
|
|
10275
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10264
10278
|
|
|
10265
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10279
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10266
10280
|
|
|
10267
10281
|
if (this.audioOutputDeviceId) {
|
|
10268
10282
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10398,9 +10412,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10398
10412
|
return this.client.getSipSessionId(sipSession);
|
|
10399
10413
|
}
|
|
10400
10414
|
|
|
10401
|
-
|
|
10415
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10402
10416
|
const sipSession = this.findSipSession(callSession);
|
|
10403
|
-
|
|
10417
|
+
|
|
10418
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
_updateCallSession(callSession ) {
|
|
10422
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10404
10423
|
|
|
10405
10424
|
if (sipSessionId) {
|
|
10406
10425
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -6673,7 +6673,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6673
6673
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6674
6674
|
class CanceledCallError extends Error {}
|
|
6675
6675
|
|
|
6676
|
-
const MAX_REGISTER_TRIES =
|
|
6676
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6677
6677
|
|
|
6678
6678
|
|
|
6679
6679
|
|
|
@@ -9636,6 +9636,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9636
9636
|
return Promise.resolve(null);
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9640
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9641
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9642
|
+
return Promise.resolve(null);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9639
9645
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9640
9646
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9641
9647
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10260,9 +10266,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10260
10266
|
});
|
|
10261
10267
|
|
|
10262
10268
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10263
|
-
|
|
10269
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10270
|
+
const hasSession = sessionId in this.callSessions;
|
|
10271
|
+
|
|
10272
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10273
|
+
|
|
10274
|
+
if (!hasSession) {
|
|
10275
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10264
10278
|
|
|
10265
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10279
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10266
10280
|
|
|
10267
10281
|
if (this.audioOutputDeviceId) {
|
|
10268
10282
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10398,9 +10412,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10398
10412
|
return this.client.getSipSessionId(sipSession);
|
|
10399
10413
|
}
|
|
10400
10414
|
|
|
10401
|
-
|
|
10415
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10402
10416
|
const sipSession = this.findSipSession(callSession);
|
|
10403
|
-
|
|
10417
|
+
|
|
10418
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
_updateCallSession(callSession ) {
|
|
10422
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10404
10423
|
|
|
10405
10424
|
if (sipSessionId) {
|
|
10406
10425
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -6673,7 +6673,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6673
6673
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6674
6674
|
class CanceledCallError extends Error {}
|
|
6675
6675
|
|
|
6676
|
-
const MAX_REGISTER_TRIES =
|
|
6676
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6677
6677
|
|
|
6678
6678
|
|
|
6679
6679
|
|
|
@@ -9636,6 +9636,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9636
9636
|
return Promise.resolve(null);
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9640
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9641
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9642
|
+
return Promise.resolve(null);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9639
9645
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9640
9646
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9641
9647
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10260,9 +10266,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10260
10266
|
});
|
|
10261
10267
|
|
|
10262
10268
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10263
|
-
|
|
10269
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10270
|
+
const hasSession = sessionId in this.callSessions;
|
|
10271
|
+
|
|
10272
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10273
|
+
|
|
10274
|
+
if (!hasSession) {
|
|
10275
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10264
10278
|
|
|
10265
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10279
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10266
10280
|
|
|
10267
10281
|
if (this.audioOutputDeviceId) {
|
|
10268
10282
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10398,9 +10412,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10398
10412
|
return this.client.getSipSessionId(sipSession);
|
|
10399
10413
|
}
|
|
10400
10414
|
|
|
10401
|
-
|
|
10415
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10402
10416
|
const sipSession = this.findSipSession(callSession);
|
|
10403
|
-
|
|
10417
|
+
|
|
10418
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
_updateCallSession(callSession ) {
|
|
10422
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10404
10423
|
|
|
10405
10424
|
if (sipSessionId) {
|
|
10406
10425
|
this.callSessions[sipSessionId] = callSession;
|
package/lib/simple/room/Room.js
CHANGED
|
@@ -6675,7 +6675,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6675
6675
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6676
6676
|
class CanceledCallError extends Error {}
|
|
6677
6677
|
|
|
6678
|
-
const MAX_REGISTER_TRIES =
|
|
6678
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6679
6679
|
|
|
6680
6680
|
|
|
6681
6681
|
|
|
@@ -9638,6 +9638,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9638
9638
|
return Promise.resolve(null);
|
|
9639
9639
|
}
|
|
9640
9640
|
|
|
9641
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9642
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9643
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9644
|
+
return Promise.resolve(null);
|
|
9645
|
+
}
|
|
9646
|
+
|
|
9641
9647
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9642
9648
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9643
9649
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10262,9 +10268,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10262
10268
|
});
|
|
10263
10269
|
|
|
10264
10270
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10265
|
-
|
|
10271
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10272
|
+
const hasSession = sessionId in this.callSessions;
|
|
10273
|
+
|
|
10274
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10275
|
+
|
|
10276
|
+
if (!hasSession) {
|
|
10277
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10278
|
+
return;
|
|
10279
|
+
}
|
|
10266
10280
|
|
|
10267
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10281
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10268
10282
|
|
|
10269
10283
|
if (this.audioOutputDeviceId) {
|
|
10270
10284
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10400,9 +10414,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10400
10414
|
return this.client.getSipSessionId(sipSession);
|
|
10401
10415
|
}
|
|
10402
10416
|
|
|
10403
|
-
|
|
10417
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10404
10418
|
const sipSession = this.findSipSession(callSession);
|
|
10405
|
-
|
|
10419
|
+
|
|
10420
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10421
|
+
}
|
|
10422
|
+
|
|
10423
|
+
_updateCallSession(callSession ) {
|
|
10424
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10406
10425
|
|
|
10407
10426
|
if (sipSessionId) {
|
|
10408
10427
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -6673,7 +6673,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6673
6673
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6674
6674
|
class CanceledCallError extends Error {}
|
|
6675
6675
|
|
|
6676
|
-
const MAX_REGISTER_TRIES =
|
|
6676
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6677
6677
|
|
|
6678
6678
|
|
|
6679
6679
|
|
|
@@ -9636,6 +9636,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9636
9636
|
return Promise.resolve(null);
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9640
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9641
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9642
|
+
return Promise.resolve(null);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9639
9645
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9640
9646
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9641
9647
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10260,9 +10266,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10260
10266
|
});
|
|
10261
10267
|
|
|
10262
10268
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10263
|
-
|
|
10269
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10270
|
+
const hasSession = sessionId in this.callSessions;
|
|
10271
|
+
|
|
10272
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10273
|
+
|
|
10274
|
+
if (!hasSession) {
|
|
10275
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10264
10278
|
|
|
10265
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10279
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10266
10280
|
|
|
10267
10281
|
if (this.audioOutputDeviceId) {
|
|
10268
10282
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10398,9 +10412,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10398
10412
|
return this.client.getSipSessionId(sipSession);
|
|
10399
10413
|
}
|
|
10400
10414
|
|
|
10401
|
-
|
|
10415
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10402
10416
|
const sipSession = this.findSipSession(callSession);
|
|
10403
|
-
|
|
10417
|
+
|
|
10418
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
_updateCallSession(callSession ) {
|
|
10422
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10404
10423
|
|
|
10405
10424
|
if (sipSessionId) {
|
|
10406
10425
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -6673,7 +6673,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6673
6673
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6674
6674
|
class CanceledCallError extends Error {}
|
|
6675
6675
|
|
|
6676
|
-
const MAX_REGISTER_TRIES =
|
|
6676
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6677
6677
|
|
|
6678
6678
|
|
|
6679
6679
|
|
|
@@ -9636,6 +9636,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9636
9636
|
return Promise.resolve(null);
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9640
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9641
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9642
|
+
return Promise.resolve(null);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9639
9645
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9640
9646
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9641
9647
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10260,9 +10266,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10260
10266
|
});
|
|
10261
10267
|
|
|
10262
10268
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10263
|
-
|
|
10269
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10270
|
+
const hasSession = sessionId in this.callSessions;
|
|
10271
|
+
|
|
10272
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10273
|
+
|
|
10274
|
+
if (!hasSession) {
|
|
10275
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10264
10278
|
|
|
10265
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10279
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10266
10280
|
|
|
10267
10281
|
if (this.audioOutputDeviceId) {
|
|
10268
10282
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10398,9 +10412,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10398
10412
|
return this.client.getSipSessionId(sipSession);
|
|
10399
10413
|
}
|
|
10400
10414
|
|
|
10401
|
-
|
|
10415
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10402
10416
|
const sipSession = this.findSipSession(callSession);
|
|
10403
|
-
|
|
10417
|
+
|
|
10418
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
_updateCallSession(callSession ) {
|
|
10422
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10404
10423
|
|
|
10405
10424
|
if (sipSessionId) {
|
|
10406
10425
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -6673,7 +6673,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6673
6673
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6674
6674
|
class CanceledCallError extends Error {}
|
|
6675
6675
|
|
|
6676
|
-
const MAX_REGISTER_TRIES =
|
|
6676
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6677
6677
|
|
|
6678
6678
|
|
|
6679
6679
|
|
|
@@ -9636,6 +9636,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9636
9636
|
return Promise.resolve(null);
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9640
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9641
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9642
|
+
return Promise.resolve(null);
|
|
9643
|
+
}
|
|
9644
|
+
|
|
9639
9645
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9640
9646
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9641
9647
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10260,9 +10266,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10260
10266
|
});
|
|
10261
10267
|
|
|
10262
10268
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10263
|
-
|
|
10269
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10270
|
+
const hasSession = sessionId in this.callSessions;
|
|
10271
|
+
|
|
10272
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10273
|
+
|
|
10274
|
+
if (!hasSession) {
|
|
10275
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10264
10278
|
|
|
10265
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10279
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10266
10280
|
|
|
10267
10281
|
if (this.audioOutputDeviceId) {
|
|
10268
10282
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10398,9 +10412,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10398
10412
|
return this.client.getSipSessionId(sipSession);
|
|
10399
10413
|
}
|
|
10400
10414
|
|
|
10401
|
-
|
|
10415
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10402
10416
|
const sipSession = this.findSipSession(callSession);
|
|
10403
|
-
|
|
10417
|
+
|
|
10418
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
_updateCallSession(callSession ) {
|
|
10422
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10404
10423
|
|
|
10405
10424
|
if (sipSessionId) {
|
|
10406
10425
|
this.callSessions[sipSessionId] = callSession;
|
package/lib/simple/utils.js
CHANGED
|
@@ -6675,7 +6675,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6675
6675
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6676
6676
|
class CanceledCallError extends Error {}
|
|
6677
6677
|
|
|
6678
|
-
const MAX_REGISTER_TRIES =
|
|
6678
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6679
6679
|
|
|
6680
6680
|
|
|
6681
6681
|
|
|
@@ -9638,6 +9638,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9638
9638
|
return Promise.resolve(null);
|
|
9639
9639
|
}
|
|
9640
9640
|
|
|
9641
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9642
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9643
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9644
|
+
return Promise.resolve(null);
|
|
9645
|
+
}
|
|
9646
|
+
|
|
9641
9647
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9642
9648
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9643
9649
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10262,9 +10268,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10262
10268
|
});
|
|
10263
10269
|
|
|
10264
10270
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10265
|
-
|
|
10271
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10272
|
+
const hasSession = sessionId in this.callSessions;
|
|
10273
|
+
|
|
10274
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10275
|
+
|
|
10276
|
+
if (!hasSession) {
|
|
10277
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10278
|
+
return;
|
|
10279
|
+
}
|
|
10266
10280
|
|
|
10267
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10281
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10268
10282
|
|
|
10269
10283
|
if (this.audioOutputDeviceId) {
|
|
10270
10284
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10400,9 +10414,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10400
10414
|
return this.client.getSipSessionId(sipSession);
|
|
10401
10415
|
}
|
|
10402
10416
|
|
|
10403
|
-
|
|
10417
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10404
10418
|
const sipSession = this.findSipSession(callSession);
|
|
10405
|
-
|
|
10419
|
+
|
|
10420
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10421
|
+
}
|
|
10422
|
+
|
|
10423
|
+
_updateCallSession(callSession ) {
|
|
10424
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10406
10425
|
|
|
10407
10426
|
if (sipSessionId) {
|
|
10408
10427
|
this.callSessions[sipSessionId] = callSession;
|
package/lib/web-rtc-client.js
CHANGED
|
@@ -5376,7 +5376,7 @@ const events = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
5376
5376
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
5377
5377
|
class CanceledCallError extends Error {}
|
|
5378
5378
|
|
|
5379
|
-
const MAX_REGISTER_TRIES =
|
|
5379
|
+
const MAX_REGISTER_TRIES = 5;
|
|
5380
5380
|
|
|
5381
5381
|
|
|
5382
5382
|
|
package/package.json
CHANGED
|
@@ -841,6 +841,12 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
841
841
|
return Promise.resolve(null);
|
|
842
842
|
}
|
|
843
843
|
|
|
844
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
845
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
846
|
+
logger.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
847
|
+
return Promise.resolve(null);
|
|
848
|
+
}
|
|
849
|
+
|
|
844
850
|
if (callSession.getId() in this.acceptedSessions) {
|
|
845
851
|
logger.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
846
852
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -1465,9 +1471,17 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
1465
1471
|
});
|
|
1466
1472
|
|
|
1467
1473
|
this.client.on(this.client.ACCEPTED, (sipSession: Session) => {
|
|
1468
|
-
|
|
1474
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
1475
|
+
const hasSession = sessionId in this.callSessions;
|
|
1476
|
+
|
|
1477
|
+
logger.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
1478
|
+
|
|
1479
|
+
if (!hasSession) {
|
|
1480
|
+
logger.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1469
1483
|
|
|
1470
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
1484
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
1471
1485
|
|
|
1472
1486
|
if (this.audioOutputDeviceId) {
|
|
1473
1487
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -1603,9 +1617,14 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
1603
1617
|
return this.client.getSipSessionId(sipSession);
|
|
1604
1618
|
}
|
|
1605
1619
|
|
|
1606
|
-
|
|
1620
|
+
getSipSessionIdFromCallSession(callSession: CallSession) {
|
|
1607
1621
|
const sipSession = this.findSipSession(callSession);
|
|
1608
|
-
|
|
1622
|
+
|
|
1623
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
_updateCallSession(callSession: CallSession) {
|
|
1627
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
1609
1628
|
|
|
1610
1629
|
if (sipSessionId) {
|
|
1611
1630
|
this.callSessions[sipSessionId] = callSession;
|
package/src/web-rtc-client.js
CHANGED
|
@@ -75,7 +75,7 @@ export const events = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
75
75
|
export const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
76
76
|
export class CanceledCallError extends Error {}
|
|
77
77
|
|
|
78
|
-
const MAX_REGISTER_TRIES =
|
|
78
|
+
const MAX_REGISTER_TRIES = 5;
|
|
79
79
|
|
|
80
80
|
type MediaConfig = {
|
|
81
81
|
audio: Object & boolean,
|