@wazo/sdk 0.37.42 → 0.37.43
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 +3 -3
- package/esm/__tests__/api-client.test.js +12 -7
- package/esm/__tests__/web-rtc-client.test.js +16 -9
- package/esm/api/agentd.js +12 -7
- package/esm/api/amid.js +12 -7
- package/esm/api/application.js +12 -7
- package/esm/api/auth.js +12 -7
- package/esm/api/call-logd.js +12 -7
- package/esm/api/calld.js +12 -7
- package/esm/api/chatd.js +12 -7
- package/esm/api/confd.js +12 -7
- package/esm/api/ctid-ng.js +12 -7
- package/esm/api/dird.js +12 -7
- package/esm/api/webhookd.js +12 -7
- package/esm/api-client.js +12 -7
- package/esm/checker/Checker.js +17 -10
- package/esm/checker/checks/aor.js +12 -7
- package/esm/checker/checks/api.js +12 -7
- package/esm/checker/checks/index.js +17 -10
- package/esm/checker/checks/wazo-websocket.js +13 -8
- package/esm/checker/checks/webrtc-transport.js +16 -9
- package/esm/checker/checks/webrtc.js +16 -9
- package/esm/domain/AdHocAPIConference.js +12 -7
- package/esm/domain/Features.js +12 -7
- package/esm/domain/Phone/CTIPhone.js +12 -7
- package/esm/domain/Phone/WebRTCPhone.js +12 -7
- package/esm/index.js +17 -10
- package/esm/lib/WazoSessionDescriptionHandler.js +12 -7
- package/esm/service/CallApi.js +12 -7
- package/esm/service/IssueReporter.js +12 -7
- package/esm/service/__tests__/IssueReporter.test.js +18 -7
- package/esm/service/getApiClient.js +12 -7
- package/esm/simple/Auth.js +17 -10
- package/esm/simple/Configuration.js +17 -10
- package/esm/simple/Directory.js +12 -7
- package/esm/simple/Phone.js +17 -10
- package/esm/simple/Websocket.js +13 -8
- package/esm/simple/index.js +17 -10
- package/esm/simple/room/LocalParticipant.js +17 -10
- package/esm/simple/room/Participant.js +17 -10
- package/esm/simple/room/RemoteParticipant.js +17 -10
- package/esm/simple/room/Room.js +17 -10
- package/esm/simple/room/SipRoom.js +17 -10
- package/esm/simple/room/Stream.js +17 -10
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +17 -10
- package/esm/simple/utils.js +17 -10
- package/esm/utils/__tests__/api-requester.test.js +12 -7
- package/esm/utils/api-requester.js +12 -7
- package/esm/web-rtc-client.js +16 -9
- package/esm/websocket-client.js +13 -8
- package/lib/__tests__/api-client.test.js +12 -7
- package/lib/__tests__/web-rtc-client.test.js +16 -9
- package/lib/api/agentd.js +12 -7
- package/lib/api/amid.js +12 -7
- package/lib/api/application.js +12 -7
- package/lib/api/auth.js +12 -7
- package/lib/api/call-logd.js +12 -7
- package/lib/api/calld.js +12 -7
- package/lib/api/chatd.js +12 -7
- package/lib/api/confd.js +12 -7
- package/lib/api/ctid-ng.js +12 -7
- package/lib/api/dird.js +12 -7
- package/lib/api/webhookd.js +12 -7
- package/lib/api-client.js +12 -7
- package/lib/checker/Checker.js +17 -10
- package/lib/checker/checks/aor.js +12 -7
- package/lib/checker/checks/api.js +12 -7
- package/lib/checker/checks/index.js +17 -10
- package/lib/checker/checks/wazo-websocket.js +13 -8
- package/lib/checker/checks/webrtc-transport.js +16 -9
- package/lib/checker/checks/webrtc.js +16 -9
- package/lib/domain/AdHocAPIConference.js +12 -7
- package/lib/domain/Features.js +12 -7
- package/lib/domain/Phone/CTIPhone.js +12 -7
- package/lib/domain/Phone/WebRTCPhone.js +12 -7
- package/lib/index.js +17 -10
- package/lib/lib/WazoSessionDescriptionHandler.js +12 -7
- package/lib/service/CallApi.js +12 -7
- package/lib/service/IssueReporter.js +12 -7
- package/lib/service/__tests__/IssueReporter.test.js +18 -7
- package/lib/service/getApiClient.js +12 -7
- package/lib/simple/Auth.js +17 -10
- package/lib/simple/Configuration.js +17 -10
- package/lib/simple/Directory.js +12 -7
- package/lib/simple/Phone.js +17 -10
- package/lib/simple/Websocket.js +13 -8
- package/lib/simple/index.js +17 -10
- package/lib/simple/room/LocalParticipant.js +17 -10
- package/lib/simple/room/Participant.js +17 -10
- package/lib/simple/room/RemoteParticipant.js +17 -10
- package/lib/simple/room/Room.js +17 -10
- package/lib/simple/room/SipRoom.js +17 -10
- package/lib/simple/room/Stream.js +17 -10
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +17 -10
- package/lib/simple/utils.js +17 -10
- package/lib/utils/__tests__/api-requester.test.js +12 -7
- package/lib/utils/api-requester.js +12 -7
- package/lib/web-rtc-client.js +16 -9
- package/lib/websocket-client.js +13 -8
- package/package.json +1 -1
- package/src/service/IssueReporter.js +12 -7
- package/src/service/__tests__/IssueReporter.test.js +6 -0
- package/src/web-rtc-client.js +4 -2
- package/src/websocket-client.js +1 -1
|
@@ -402,13 +402,9 @@ class IssueReporter {
|
|
|
402
402
|
|
|
403
403
|
setTimeout(() => {
|
|
404
404
|
if (isArray) {
|
|
405
|
-
payload = payload.map(message =>
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
});
|
|
409
|
-
} else {
|
|
410
|
-
// $FlowFixMe
|
|
411
|
-
payload._retry = retry + 1;
|
|
405
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
406
|
+
} else if (payload && typeof payload === 'object') {
|
|
407
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
412
408
|
}
|
|
413
409
|
|
|
414
410
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -416,6 +412,15 @@ class IssueReporter {
|
|
|
416
412
|
});
|
|
417
413
|
}
|
|
418
414
|
|
|
415
|
+
_writeRetryCount(message , count ) {
|
|
416
|
+
if (message && typeof message === 'object') {
|
|
417
|
+
// $FlowFixMe
|
|
418
|
+
message._retry = count;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return message;
|
|
422
|
+
}
|
|
423
|
+
|
|
419
424
|
_isLevelAbove(level1 , level2 ) {
|
|
420
425
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
421
426
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -424,13 +424,9 @@ class IssueReporter {
|
|
|
424
424
|
|
|
425
425
|
setTimeout(() => {
|
|
426
426
|
if (isArray) {
|
|
427
|
-
payload = payload.map(message =>
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
});
|
|
431
|
-
} else {
|
|
432
|
-
// $FlowFixMe
|
|
433
|
-
payload._retry = retry + 1;
|
|
427
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
428
|
+
} else if (payload && typeof payload === 'object') {
|
|
429
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
434
430
|
}
|
|
435
431
|
|
|
436
432
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -438,6 +434,15 @@ class IssueReporter {
|
|
|
438
434
|
});
|
|
439
435
|
}
|
|
440
436
|
|
|
437
|
+
_writeRetryCount(message , count ) {
|
|
438
|
+
if (message && typeof message === 'object') {
|
|
439
|
+
// $FlowFixMe
|
|
440
|
+
message._retry = count;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return message;
|
|
444
|
+
}
|
|
445
|
+
|
|
441
446
|
_isLevelAbove(level1 , level2 ) {
|
|
442
447
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
443
448
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -5317,7 +5322,7 @@ class WebSocketClient extends Emitter {
|
|
|
5317
5322
|
this.close();
|
|
5318
5323
|
}
|
|
5319
5324
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
5320
|
-
logger$1.
|
|
5325
|
+
logger$1.info('Wazo WS url computed to reconnect', { url });
|
|
5321
5326
|
|
|
5322
5327
|
return url;
|
|
5323
5328
|
}
|
|
@@ -6697,8 +6702,10 @@ class WebRTCClient extends Emitter {
|
|
|
6697
6702
|
conference: isConference,
|
|
6698
6703
|
};
|
|
6699
6704
|
|
|
6700
|
-
// Avoid sdh to
|
|
6701
|
-
session.sessionDescriptionHandler
|
|
6705
|
+
// Avoid sdh to create a new stream
|
|
6706
|
+
if (session.sessionDescriptionHandler) {
|
|
6707
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
6708
|
+
}
|
|
6702
6709
|
|
|
6703
6710
|
// Send re-INVITE
|
|
6704
6711
|
return session.invite(options);
|
|
@@ -395,13 +395,9 @@ class IssueReporter {
|
|
|
395
395
|
|
|
396
396
|
setTimeout(() => {
|
|
397
397
|
if (isArray) {
|
|
398
|
-
payload = payload.map(message =>
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
});
|
|
402
|
-
} else {
|
|
403
|
-
// $FlowFixMe
|
|
404
|
-
payload._retry = retry + 1;
|
|
398
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
399
|
+
} else if (payload && typeof payload === 'object') {
|
|
400
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
405
401
|
}
|
|
406
402
|
|
|
407
403
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -409,6 +405,15 @@ class IssueReporter {
|
|
|
409
405
|
});
|
|
410
406
|
}
|
|
411
407
|
|
|
408
|
+
_writeRetryCount(message , count ) {
|
|
409
|
+
if (message && typeof message === 'object') {
|
|
410
|
+
// $FlowFixMe
|
|
411
|
+
message._retry = count;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return message;
|
|
415
|
+
}
|
|
416
|
+
|
|
412
417
|
_isLevelAbove(level1 , level2 ) {
|
|
413
418
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
414
419
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -869,7 +874,7 @@ class WebSocketClient extends Emitter {
|
|
|
869
874
|
this.close();
|
|
870
875
|
}
|
|
871
876
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
872
|
-
logger.
|
|
877
|
+
logger.info('Wazo WS url computed to reconnect', { url });
|
|
873
878
|
|
|
874
879
|
return url;
|
|
875
880
|
}
|
|
@@ -687,13 +687,9 @@ class IssueReporter {
|
|
|
687
687
|
|
|
688
688
|
setTimeout(() => {
|
|
689
689
|
if (isArray) {
|
|
690
|
-
payload = payload.map(message =>
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
});
|
|
694
|
-
} else {
|
|
695
|
-
// $FlowFixMe
|
|
696
|
-
payload._retry = retry + 1;
|
|
690
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
691
|
+
} else if (payload && typeof payload === 'object') {
|
|
692
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
697
693
|
}
|
|
698
694
|
|
|
699
695
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -701,6 +697,15 @@ class IssueReporter {
|
|
|
701
697
|
});
|
|
702
698
|
}
|
|
703
699
|
|
|
700
|
+
_writeRetryCount(message , count ) {
|
|
701
|
+
if (message && typeof message === 'object') {
|
|
702
|
+
// $FlowFixMe
|
|
703
|
+
message._retry = count;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
return message;
|
|
707
|
+
}
|
|
708
|
+
|
|
704
709
|
_isLevelAbove(level1 , level2 ) {
|
|
705
710
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
706
711
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -6111,8 +6116,10 @@ class WebRTCClient extends Emitter {
|
|
|
6111
6116
|
conference: isConference,
|
|
6112
6117
|
};
|
|
6113
6118
|
|
|
6114
|
-
// Avoid sdh to
|
|
6115
|
-
session.sessionDescriptionHandler
|
|
6119
|
+
// Avoid sdh to create a new stream
|
|
6120
|
+
if (session.sessionDescriptionHandler) {
|
|
6121
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
6122
|
+
}
|
|
6116
6123
|
|
|
6117
6124
|
// Send re-INVITE
|
|
6118
6125
|
return session.invite(options);
|
|
@@ -687,13 +687,9 @@ class IssueReporter {
|
|
|
687
687
|
|
|
688
688
|
setTimeout(() => {
|
|
689
689
|
if (isArray) {
|
|
690
|
-
payload = payload.map(message =>
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
});
|
|
694
|
-
} else {
|
|
695
|
-
// $FlowFixMe
|
|
696
|
-
payload._retry = retry + 1;
|
|
690
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
691
|
+
} else if (payload && typeof payload === 'object') {
|
|
692
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
697
693
|
}
|
|
698
694
|
|
|
699
695
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -701,6 +697,15 @@ class IssueReporter {
|
|
|
701
697
|
});
|
|
702
698
|
}
|
|
703
699
|
|
|
700
|
+
_writeRetryCount(message , count ) {
|
|
701
|
+
if (message && typeof message === 'object') {
|
|
702
|
+
// $FlowFixMe
|
|
703
|
+
message._retry = count;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
return message;
|
|
707
|
+
}
|
|
708
|
+
|
|
704
709
|
_isLevelAbove(level1 , level2 ) {
|
|
705
710
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
706
711
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -6111,8 +6116,10 @@ class WebRTCClient extends Emitter {
|
|
|
6111
6116
|
conference: isConference,
|
|
6112
6117
|
};
|
|
6113
6118
|
|
|
6114
|
-
// Avoid sdh to
|
|
6115
|
-
session.sessionDescriptionHandler
|
|
6119
|
+
// Avoid sdh to create a new stream
|
|
6120
|
+
if (session.sessionDescriptionHandler) {
|
|
6121
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
6122
|
+
}
|
|
6116
6123
|
|
|
6117
6124
|
// Send re-INVITE
|
|
6118
6125
|
return session.invite(options);
|
|
@@ -622,13 +622,9 @@ class IssueReporter {
|
|
|
622
622
|
|
|
623
623
|
setTimeout(() => {
|
|
624
624
|
if (isArray) {
|
|
625
|
-
payload = payload.map(message =>
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
});
|
|
629
|
-
} else {
|
|
630
|
-
// $FlowFixMe
|
|
631
|
-
payload._retry = retry + 1;
|
|
625
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
626
|
+
} else if (payload && typeof payload === 'object') {
|
|
627
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
632
628
|
}
|
|
633
629
|
|
|
634
630
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -636,6 +632,15 @@ class IssueReporter {
|
|
|
636
632
|
});
|
|
637
633
|
}
|
|
638
634
|
|
|
635
|
+
_writeRetryCount(message , count ) {
|
|
636
|
+
if (message && typeof message === 'object') {
|
|
637
|
+
// $FlowFixMe
|
|
638
|
+
message._retry = count;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
return message;
|
|
642
|
+
}
|
|
643
|
+
|
|
639
644
|
_isLevelAbove(level1 , level2 ) {
|
|
640
645
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
641
646
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/lib/domain/Features.js
CHANGED
|
@@ -404,13 +404,9 @@ class IssueReporter {
|
|
|
404
404
|
|
|
405
405
|
setTimeout(() => {
|
|
406
406
|
if (isArray) {
|
|
407
|
-
payload = payload.map(message =>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
});
|
|
411
|
-
} else {
|
|
412
|
-
// $FlowFixMe
|
|
413
|
-
payload._retry = retry + 1;
|
|
407
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
408
|
+
} else if (payload && typeof payload === 'object') {
|
|
409
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
414
410
|
}
|
|
415
411
|
|
|
416
412
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -418,6 +414,15 @@ class IssueReporter {
|
|
|
418
414
|
});
|
|
419
415
|
}
|
|
420
416
|
|
|
417
|
+
_writeRetryCount(message , count ) {
|
|
418
|
+
if (message && typeof message === 'object') {
|
|
419
|
+
// $FlowFixMe
|
|
420
|
+
message._retry = count;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return message;
|
|
424
|
+
}
|
|
425
|
+
|
|
421
426
|
_isLevelAbove(level1 , level2 ) {
|
|
422
427
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
423
428
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -2859,13 +2859,9 @@ class IssueReporter {
|
|
|
2859
2859
|
|
|
2860
2860
|
setTimeout(() => {
|
|
2861
2861
|
if (isArray) {
|
|
2862
|
-
payload = payload.map(message =>
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
});
|
|
2866
|
-
} else {
|
|
2867
|
-
// $FlowFixMe
|
|
2868
|
-
payload._retry = retry + 1;
|
|
2862
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
2863
|
+
} else if (payload && typeof payload === 'object') {
|
|
2864
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
2869
2865
|
}
|
|
2870
2866
|
|
|
2871
2867
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -2873,6 +2869,15 @@ class IssueReporter {
|
|
|
2873
2869
|
});
|
|
2874
2870
|
}
|
|
2875
2871
|
|
|
2872
|
+
_writeRetryCount(message , count ) {
|
|
2873
|
+
if (message && typeof message === 'object') {
|
|
2874
|
+
// $FlowFixMe
|
|
2875
|
+
message._retry = count;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
return message;
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2876
2881
|
_isLevelAbove(level1 , level2 ) {
|
|
2877
2882
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
2878
2883
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -811,13 +811,9 @@ class IssueReporter {
|
|
|
811
811
|
|
|
812
812
|
setTimeout(() => {
|
|
813
813
|
if (isArray) {
|
|
814
|
-
payload = payload.map(message =>
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
});
|
|
818
|
-
} else {
|
|
819
|
-
// $FlowFixMe
|
|
820
|
-
payload._retry = retry + 1;
|
|
814
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
815
|
+
} else if (payload && typeof payload === 'object') {
|
|
816
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
821
817
|
}
|
|
822
818
|
|
|
823
819
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -825,6 +821,15 @@ class IssueReporter {
|
|
|
825
821
|
});
|
|
826
822
|
}
|
|
827
823
|
|
|
824
|
+
_writeRetryCount(message , count ) {
|
|
825
|
+
if (message && typeof message === 'object') {
|
|
826
|
+
// $FlowFixMe
|
|
827
|
+
message._retry = count;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
return message;
|
|
831
|
+
}
|
|
832
|
+
|
|
828
833
|
_isLevelAbove(level1 , level2 ) {
|
|
829
834
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
830
835
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/lib/index.js
CHANGED
|
@@ -427,13 +427,9 @@ class IssueReporter {
|
|
|
427
427
|
|
|
428
428
|
setTimeout(() => {
|
|
429
429
|
if (isArray) {
|
|
430
|
-
payload = payload.map(message =>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
});
|
|
434
|
-
} else {
|
|
435
|
-
// $FlowFixMe
|
|
436
|
-
payload._retry = retry + 1;
|
|
430
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
431
|
+
} else if (payload && typeof payload === 'object') {
|
|
432
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
437
433
|
}
|
|
438
434
|
|
|
439
435
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -441,6 +437,15 @@ class IssueReporter {
|
|
|
441
437
|
});
|
|
442
438
|
}
|
|
443
439
|
|
|
440
|
+
_writeRetryCount(message , count ) {
|
|
441
|
+
if (message && typeof message === 'object') {
|
|
442
|
+
// $FlowFixMe
|
|
443
|
+
message._retry = count;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return message;
|
|
447
|
+
}
|
|
448
|
+
|
|
444
449
|
_isLevelAbove(level1 , level2 ) {
|
|
445
450
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
446
451
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7007,8 +7012,10 @@ class WebRTCClient extends Emitter {
|
|
|
7007
7012
|
conference: isConference,
|
|
7008
7013
|
};
|
|
7009
7014
|
|
|
7010
|
-
// Avoid sdh to
|
|
7011
|
-
session.sessionDescriptionHandler
|
|
7015
|
+
// Avoid sdh to create a new stream
|
|
7016
|
+
if (session.sessionDescriptionHandler) {
|
|
7017
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7018
|
+
}
|
|
7012
7019
|
|
|
7013
7020
|
// Send re-INVITE
|
|
7014
7021
|
return session.invite(options);
|
|
@@ -8797,7 +8804,7 @@ class WebSocketClient extends Emitter {
|
|
|
8797
8804
|
this.close();
|
|
8798
8805
|
}
|
|
8799
8806
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
8800
|
-
logger$8.
|
|
8807
|
+
logger$8.info('Wazo WS url computed to reconnect', { url });
|
|
8801
8808
|
|
|
8802
8809
|
return url;
|
|
8803
8810
|
}
|
|
@@ -373,13 +373,9 @@ class IssueReporter {
|
|
|
373
373
|
|
|
374
374
|
setTimeout(() => {
|
|
375
375
|
if (isArray) {
|
|
376
|
-
payload = payload.map(message =>
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
});
|
|
380
|
-
} else {
|
|
381
|
-
// $FlowFixMe
|
|
382
|
-
payload._retry = retry + 1;
|
|
376
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
377
|
+
} else if (payload && typeof payload === 'object') {
|
|
378
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
383
379
|
}
|
|
384
380
|
|
|
385
381
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -387,6 +383,15 @@ class IssueReporter {
|
|
|
387
383
|
});
|
|
388
384
|
}
|
|
389
385
|
|
|
386
|
+
_writeRetryCount(message , count ) {
|
|
387
|
+
if (message && typeof message === 'object') {
|
|
388
|
+
// $FlowFixMe
|
|
389
|
+
message._retry = count;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return message;
|
|
393
|
+
}
|
|
394
|
+
|
|
390
395
|
_isLevelAbove(level1 , level2 ) {
|
|
391
396
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
392
397
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/lib/service/CallApi.js
CHANGED
|
@@ -2436,13 +2436,9 @@ class IssueReporter {
|
|
|
2436
2436
|
|
|
2437
2437
|
setTimeout(() => {
|
|
2438
2438
|
if (isArray) {
|
|
2439
|
-
payload = payload.map(message =>
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
});
|
|
2443
|
-
} else {
|
|
2444
|
-
// $FlowFixMe
|
|
2445
|
-
payload._retry = retry + 1;
|
|
2439
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
2440
|
+
} else if (payload && typeof payload === 'object') {
|
|
2441
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
2446
2442
|
}
|
|
2447
2443
|
|
|
2448
2444
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -2450,6 +2446,15 @@ class IssueReporter {
|
|
|
2450
2446
|
});
|
|
2451
2447
|
}
|
|
2452
2448
|
|
|
2449
|
+
_writeRetryCount(message , count ) {
|
|
2450
|
+
if (message && typeof message === 'object') {
|
|
2451
|
+
// $FlowFixMe
|
|
2452
|
+
message._retry = count;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
return message;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2453
2458
|
_isLevelAbove(level1 , level2 ) {
|
|
2454
2459
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
2455
2460
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -365,13 +365,9 @@ class IssueReporter {
|
|
|
365
365
|
|
|
366
366
|
setTimeout(() => {
|
|
367
367
|
if (isArray) {
|
|
368
|
-
payload = payload.map(message =>
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
});
|
|
372
|
-
} else {
|
|
373
|
-
// $FlowFixMe
|
|
374
|
-
payload._retry = retry + 1;
|
|
368
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
369
|
+
} else if (payload && typeof payload === 'object') {
|
|
370
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
375
371
|
}
|
|
376
372
|
|
|
377
373
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -379,6 +375,15 @@ class IssueReporter {
|
|
|
379
375
|
});
|
|
380
376
|
}
|
|
381
377
|
|
|
378
|
+
_writeRetryCount(message , count ) {
|
|
379
|
+
if (message && typeof message === 'object') {
|
|
380
|
+
// $FlowFixMe
|
|
381
|
+
message._retry = count;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return message;
|
|
385
|
+
}
|
|
386
|
+
|
|
382
387
|
_isLevelAbove(level1 , level2 ) {
|
|
383
388
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
384
389
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -365,13 +365,9 @@ class IssueReporter {
|
|
|
365
365
|
|
|
366
366
|
setTimeout(() => {
|
|
367
367
|
if (isArray) {
|
|
368
|
-
payload = payload.map(message =>
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
});
|
|
372
|
-
} else {
|
|
373
|
-
// $FlowFixMe
|
|
374
|
-
payload._retry = retry + 1;
|
|
368
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
369
|
+
} else if (payload && typeof payload === 'object') {
|
|
370
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
375
371
|
}
|
|
376
372
|
|
|
377
373
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -379,6 +375,15 @@ class IssueReporter {
|
|
|
379
375
|
});
|
|
380
376
|
}
|
|
381
377
|
|
|
378
|
+
_writeRetryCount(message , count ) {
|
|
379
|
+
if (message && typeof message === 'object') {
|
|
380
|
+
// $FlowFixMe
|
|
381
|
+
message._retry = count;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return message;
|
|
385
|
+
}
|
|
386
|
+
|
|
382
387
|
_isLevelAbove(level1 , level2 ) {
|
|
383
388
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
384
389
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -494,4 +499,10 @@ describe('IssueReporter', () => {
|
|
|
494
499
|
expect(IssueReporter$1.removeSlashes('\"')).toBe("'");
|
|
495
500
|
expect(IssueReporter$1.removeSlashes('\\\"')).toBe("'");
|
|
496
501
|
});
|
|
502
|
+
|
|
503
|
+
it('Add retry count', () => {
|
|
504
|
+
expect(IssueReporter$1._writeRetryCount('', 1)).toBe('');
|
|
505
|
+
expect(IssueReporter$1._writeRetryCount('{}', 1)).toBe('{}');
|
|
506
|
+
expect(IssueReporter$1._writeRetryCount({}, 1)).toEqual({ _retry: 1 });
|
|
507
|
+
});
|
|
497
508
|
});
|
|
@@ -404,13 +404,9 @@ class IssueReporter {
|
|
|
404
404
|
|
|
405
405
|
setTimeout(() => {
|
|
406
406
|
if (isArray) {
|
|
407
|
-
payload = payload.map(message =>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
});
|
|
411
|
-
} else {
|
|
412
|
-
// $FlowFixMe
|
|
413
|
-
payload._retry = retry + 1;
|
|
407
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
408
|
+
} else if (payload && typeof payload === 'object') {
|
|
409
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
414
410
|
}
|
|
415
411
|
|
|
416
412
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -418,6 +414,15 @@ class IssueReporter {
|
|
|
418
414
|
});
|
|
419
415
|
}
|
|
420
416
|
|
|
417
|
+
_writeRetryCount(message , count ) {
|
|
418
|
+
if (message && typeof message === 'object') {
|
|
419
|
+
// $FlowFixMe
|
|
420
|
+
message._retry = count;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return message;
|
|
424
|
+
}
|
|
425
|
+
|
|
421
426
|
_isLevelAbove(level1 , level2 ) {
|
|
422
427
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
423
428
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/lib/simple/Auth.js
CHANGED
|
@@ -1921,13 +1921,9 @@ class IssueReporter {
|
|
|
1921
1921
|
|
|
1922
1922
|
setTimeout(() => {
|
|
1923
1923
|
if (isArray) {
|
|
1924
|
-
payload = payload.map(message =>
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
});
|
|
1928
|
-
} else {
|
|
1929
|
-
// $FlowFixMe
|
|
1930
|
-
payload._retry = retry + 1;
|
|
1924
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
1925
|
+
} else if (payload && typeof payload === 'object') {
|
|
1926
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
1931
1927
|
}
|
|
1932
1928
|
|
|
1933
1929
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -1935,6 +1931,15 @@ class IssueReporter {
|
|
|
1935
1931
|
});
|
|
1936
1932
|
}
|
|
1937
1933
|
|
|
1934
|
+
_writeRetryCount(message , count ) {
|
|
1935
|
+
if (message && typeof message === 'object') {
|
|
1936
|
+
// $FlowFixMe
|
|
1937
|
+
message._retry = count;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
return message;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1938
1943
|
_isLevelAbove(level1 , level2 ) {
|
|
1939
1944
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1940
1945
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7186,8 +7191,10 @@ class WebRTCClient extends Emitter {
|
|
|
7186
7191
|
conference: isConference,
|
|
7187
7192
|
};
|
|
7188
7193
|
|
|
7189
|
-
// Avoid sdh to
|
|
7190
|
-
session.sessionDescriptionHandler
|
|
7194
|
+
// Avoid sdh to create a new stream
|
|
7195
|
+
if (session.sessionDescriptionHandler) {
|
|
7196
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7197
|
+
}
|
|
7191
7198
|
|
|
7192
7199
|
// Send re-INVITE
|
|
7193
7200
|
return session.invite(options);
|
|
@@ -11198,7 +11205,7 @@ class WebSocketClient extends Emitter {
|
|
|
11198
11205
|
this.close();
|
|
11199
11206
|
}
|
|
11200
11207
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11201
|
-
logger$6.
|
|
11208
|
+
logger$6.info('Wazo WS url computed to reconnect', { url });
|
|
11202
11209
|
|
|
11203
11210
|
return url;
|
|
11204
11211
|
}
|