@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
|
@@ -387,13 +387,9 @@ class IssueReporter {
|
|
|
387
387
|
|
|
388
388
|
setTimeout(() => {
|
|
389
389
|
if (isArray) {
|
|
390
|
-
payload = payload.map(message =>
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
});
|
|
394
|
-
} else {
|
|
395
|
-
// $FlowFixMe
|
|
396
|
-
payload._retry = retry + 1;
|
|
390
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
391
|
+
} else if (payload && typeof payload === 'object') {
|
|
392
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
397
393
|
}
|
|
398
394
|
|
|
399
395
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -401,6 +397,15 @@ class IssueReporter {
|
|
|
401
397
|
});
|
|
402
398
|
}
|
|
403
399
|
|
|
400
|
+
_writeRetryCount(message , count ) {
|
|
401
|
+
if (message && typeof message === 'object') {
|
|
402
|
+
// $FlowFixMe
|
|
403
|
+
message._retry = count;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return message;
|
|
407
|
+
}
|
|
408
|
+
|
|
404
409
|
_isLevelAbove(level1 , level2 ) {
|
|
405
410
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
406
411
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -861,7 +866,7 @@ class WebSocketClient extends Emitter {
|
|
|
861
866
|
this.close();
|
|
862
867
|
}
|
|
863
868
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
864
|
-
logger.
|
|
869
|
+
logger.info('Wazo WS url computed to reconnect', { url });
|
|
865
870
|
|
|
866
871
|
return url;
|
|
867
872
|
}
|
|
@@ -678,13 +678,9 @@ class IssueReporter {
|
|
|
678
678
|
|
|
679
679
|
setTimeout(() => {
|
|
680
680
|
if (isArray) {
|
|
681
|
-
payload = payload.map(message =>
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
});
|
|
685
|
-
} else {
|
|
686
|
-
// $FlowFixMe
|
|
687
|
-
payload._retry = retry + 1;
|
|
681
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
682
|
+
} else if (payload && typeof payload === 'object') {
|
|
683
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
688
684
|
}
|
|
689
685
|
|
|
690
686
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -692,6 +688,15 @@ class IssueReporter {
|
|
|
692
688
|
});
|
|
693
689
|
}
|
|
694
690
|
|
|
691
|
+
_writeRetryCount(message , count ) {
|
|
692
|
+
if (message && typeof message === 'object') {
|
|
693
|
+
// $FlowFixMe
|
|
694
|
+
message._retry = count;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
return message;
|
|
698
|
+
}
|
|
699
|
+
|
|
695
700
|
_isLevelAbove(level1 , level2 ) {
|
|
696
701
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
697
702
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -6102,8 +6107,10 @@ class WebRTCClient extends Emitter {
|
|
|
6102
6107
|
conference: isConference,
|
|
6103
6108
|
};
|
|
6104
6109
|
|
|
6105
|
-
// Avoid sdh to
|
|
6106
|
-
session.sessionDescriptionHandler
|
|
6110
|
+
// Avoid sdh to create a new stream
|
|
6111
|
+
if (session.sessionDescriptionHandler) {
|
|
6112
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
6113
|
+
}
|
|
6107
6114
|
|
|
6108
6115
|
// Send re-INVITE
|
|
6109
6116
|
return session.invite(options);
|
|
@@ -678,13 +678,9 @@ class IssueReporter {
|
|
|
678
678
|
|
|
679
679
|
setTimeout(() => {
|
|
680
680
|
if (isArray) {
|
|
681
|
-
payload = payload.map(message =>
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
});
|
|
685
|
-
} else {
|
|
686
|
-
// $FlowFixMe
|
|
687
|
-
payload._retry = retry + 1;
|
|
681
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
682
|
+
} else if (payload && typeof payload === 'object') {
|
|
683
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
688
684
|
}
|
|
689
685
|
|
|
690
686
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -692,6 +688,15 @@ class IssueReporter {
|
|
|
692
688
|
});
|
|
693
689
|
}
|
|
694
690
|
|
|
691
|
+
_writeRetryCount(message , count ) {
|
|
692
|
+
if (message && typeof message === 'object') {
|
|
693
|
+
// $FlowFixMe
|
|
694
|
+
message._retry = count;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
return message;
|
|
698
|
+
}
|
|
699
|
+
|
|
695
700
|
_isLevelAbove(level1 , level2 ) {
|
|
696
701
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
697
702
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -6102,8 +6107,10 @@ class WebRTCClient extends Emitter {
|
|
|
6102
6107
|
conference: isConference,
|
|
6103
6108
|
};
|
|
6104
6109
|
|
|
6105
|
-
// Avoid sdh to
|
|
6106
|
-
session.sessionDescriptionHandler
|
|
6110
|
+
// Avoid sdh to create a new stream
|
|
6111
|
+
if (session.sessionDescriptionHandler) {
|
|
6112
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
6113
|
+
}
|
|
6107
6114
|
|
|
6108
6115
|
// Send re-INVITE
|
|
6109
6116
|
return session.invite(options);
|
|
@@ -616,13 +616,9 @@ class IssueReporter {
|
|
|
616
616
|
|
|
617
617
|
setTimeout(() => {
|
|
618
618
|
if (isArray) {
|
|
619
|
-
payload = payload.map(message =>
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
});
|
|
623
|
-
} else {
|
|
624
|
-
// $FlowFixMe
|
|
625
|
-
payload._retry = retry + 1;
|
|
619
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
620
|
+
} else if (payload && typeof payload === 'object') {
|
|
621
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
626
622
|
}
|
|
627
623
|
|
|
628
624
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -630,6 +626,15 @@ class IssueReporter {
|
|
|
630
626
|
});
|
|
631
627
|
}
|
|
632
628
|
|
|
629
|
+
_writeRetryCount(message , count ) {
|
|
630
|
+
if (message && typeof message === 'object') {
|
|
631
|
+
// $FlowFixMe
|
|
632
|
+
message._retry = count;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
return message;
|
|
636
|
+
}
|
|
637
|
+
|
|
633
638
|
_isLevelAbove(level1 , level2 ) {
|
|
634
639
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
635
640
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/esm/domain/Features.js
CHANGED
|
@@ -396,13 +396,9 @@ class IssueReporter {
|
|
|
396
396
|
|
|
397
397
|
setTimeout(() => {
|
|
398
398
|
if (isArray) {
|
|
399
|
-
payload = payload.map(message =>
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
});
|
|
403
|
-
} else {
|
|
404
|
-
// $FlowFixMe
|
|
405
|
-
payload._retry = retry + 1;
|
|
399
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
400
|
+
} else if (payload && typeof payload === 'object') {
|
|
401
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
406
402
|
}
|
|
407
403
|
|
|
408
404
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -410,6 +406,15 @@ class IssueReporter {
|
|
|
410
406
|
});
|
|
411
407
|
}
|
|
412
408
|
|
|
409
|
+
_writeRetryCount(message , count ) {
|
|
410
|
+
if (message && typeof message === 'object') {
|
|
411
|
+
// $FlowFixMe
|
|
412
|
+
message._retry = count;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return message;
|
|
416
|
+
}
|
|
417
|
+
|
|
413
418
|
_isLevelAbove(level1 , level2 ) {
|
|
414
419
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
415
420
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -2850,13 +2850,9 @@ class IssueReporter {
|
|
|
2850
2850
|
|
|
2851
2851
|
setTimeout(() => {
|
|
2852
2852
|
if (isArray) {
|
|
2853
|
-
payload = payload.map(message =>
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
});
|
|
2857
|
-
} else {
|
|
2858
|
-
// $FlowFixMe
|
|
2859
|
-
payload._retry = retry + 1;
|
|
2853
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
2854
|
+
} else if (payload && typeof payload === 'object') {
|
|
2855
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
2860
2856
|
}
|
|
2861
2857
|
|
|
2862
2858
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -2864,6 +2860,15 @@ class IssueReporter {
|
|
|
2864
2860
|
});
|
|
2865
2861
|
}
|
|
2866
2862
|
|
|
2863
|
+
_writeRetryCount(message , count ) {
|
|
2864
|
+
if (message && typeof message === 'object') {
|
|
2865
|
+
// $FlowFixMe
|
|
2866
|
+
message._retry = count;
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
return message;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2867
2872
|
_isLevelAbove(level1 , level2 ) {
|
|
2868
2873
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
2869
2874
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -802,13 +802,9 @@ class IssueReporter {
|
|
|
802
802
|
|
|
803
803
|
setTimeout(() => {
|
|
804
804
|
if (isArray) {
|
|
805
|
-
payload = payload.map(message =>
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
});
|
|
809
|
-
} else {
|
|
810
|
-
// $FlowFixMe
|
|
811
|
-
payload._retry = retry + 1;
|
|
805
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
806
|
+
} else if (payload && typeof payload === 'object') {
|
|
807
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
812
808
|
}
|
|
813
809
|
|
|
814
810
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -816,6 +812,15 @@ class IssueReporter {
|
|
|
816
812
|
});
|
|
817
813
|
}
|
|
818
814
|
|
|
815
|
+
_writeRetryCount(message , count ) {
|
|
816
|
+
if (message && typeof message === 'object') {
|
|
817
|
+
// $FlowFixMe
|
|
818
|
+
message._retry = count;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
return message;
|
|
822
|
+
}
|
|
823
|
+
|
|
819
824
|
_isLevelAbove(level1 , level2 ) {
|
|
820
825
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
821
826
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/esm/index.js
CHANGED
|
@@ -416,13 +416,9 @@ class IssueReporter {
|
|
|
416
416
|
|
|
417
417
|
setTimeout(() => {
|
|
418
418
|
if (isArray) {
|
|
419
|
-
payload = payload.map(message =>
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
});
|
|
423
|
-
} else {
|
|
424
|
-
// $FlowFixMe
|
|
425
|
-
payload._retry = retry + 1;
|
|
419
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
420
|
+
} else if (payload && typeof payload === 'object') {
|
|
421
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
426
422
|
}
|
|
427
423
|
|
|
428
424
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -430,6 +426,15 @@ class IssueReporter {
|
|
|
430
426
|
});
|
|
431
427
|
}
|
|
432
428
|
|
|
429
|
+
_writeRetryCount(message , count ) {
|
|
430
|
+
if (message && typeof message === 'object') {
|
|
431
|
+
// $FlowFixMe
|
|
432
|
+
message._retry = count;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return message;
|
|
436
|
+
}
|
|
437
|
+
|
|
433
438
|
_isLevelAbove(level1 , level2 ) {
|
|
434
439
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
435
440
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -6996,8 +7001,10 @@ class WebRTCClient extends Emitter {
|
|
|
6996
7001
|
conference: isConference,
|
|
6997
7002
|
};
|
|
6998
7003
|
|
|
6999
|
-
// Avoid sdh to
|
|
7000
|
-
session.sessionDescriptionHandler
|
|
7004
|
+
// Avoid sdh to create a new stream
|
|
7005
|
+
if (session.sessionDescriptionHandler) {
|
|
7006
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7007
|
+
}
|
|
7001
7008
|
|
|
7002
7009
|
// Send re-INVITE
|
|
7003
7010
|
return session.invite(options);
|
|
@@ -8786,7 +8793,7 @@ class WebSocketClient extends Emitter {
|
|
|
8786
8793
|
this.close();
|
|
8787
8794
|
}
|
|
8788
8795
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
8789
|
-
logger$8.
|
|
8796
|
+
logger$8.info('Wazo WS url computed to reconnect', { url });
|
|
8790
8797
|
|
|
8791
8798
|
return url;
|
|
8792
8799
|
}
|
|
@@ -363,13 +363,9 @@ class IssueReporter {
|
|
|
363
363
|
|
|
364
364
|
setTimeout(() => {
|
|
365
365
|
if (isArray) {
|
|
366
|
-
payload = payload.map(message =>
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
});
|
|
370
|
-
} else {
|
|
371
|
-
// $FlowFixMe
|
|
372
|
-
payload._retry = retry + 1;
|
|
366
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
367
|
+
} else if (payload && typeof payload === 'object') {
|
|
368
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
373
369
|
}
|
|
374
370
|
|
|
375
371
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -377,6 +373,15 @@ class IssueReporter {
|
|
|
377
373
|
});
|
|
378
374
|
}
|
|
379
375
|
|
|
376
|
+
_writeRetryCount(message , count ) {
|
|
377
|
+
if (message && typeof message === 'object') {
|
|
378
|
+
// $FlowFixMe
|
|
379
|
+
message._retry = count;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return message;
|
|
383
|
+
}
|
|
384
|
+
|
|
380
385
|
_isLevelAbove(level1 , level2 ) {
|
|
381
386
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
382
387
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/esm/service/CallApi.js
CHANGED
|
@@ -2430,13 +2430,9 @@ class IssueReporter {
|
|
|
2430
2430
|
|
|
2431
2431
|
setTimeout(() => {
|
|
2432
2432
|
if (isArray) {
|
|
2433
|
-
payload = payload.map(message =>
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
});
|
|
2437
|
-
} else {
|
|
2438
|
-
// $FlowFixMe
|
|
2439
|
-
payload._retry = retry + 1;
|
|
2433
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
2434
|
+
} else if (payload && typeof payload === 'object') {
|
|
2435
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
2440
2436
|
}
|
|
2441
2437
|
|
|
2442
2438
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -2444,6 +2440,15 @@ class IssueReporter {
|
|
|
2444
2440
|
});
|
|
2445
2441
|
}
|
|
2446
2442
|
|
|
2443
|
+
_writeRetryCount(message , count ) {
|
|
2444
|
+
if (message && typeof message === 'object') {
|
|
2445
|
+
// $FlowFixMe
|
|
2446
|
+
message._retry = count;
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
return message;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2447
2452
|
_isLevelAbove(level1 , level2 ) {
|
|
2448
2453
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
2449
2454
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -359,13 +359,9 @@ class IssueReporter {
|
|
|
359
359
|
|
|
360
360
|
setTimeout(() => {
|
|
361
361
|
if (isArray) {
|
|
362
|
-
payload = payload.map(message =>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
});
|
|
366
|
-
} else {
|
|
367
|
-
// $FlowFixMe
|
|
368
|
-
payload._retry = retry + 1;
|
|
362
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
363
|
+
} else if (payload && typeof payload === 'object') {
|
|
364
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
369
365
|
}
|
|
370
366
|
|
|
371
367
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -373,6 +369,15 @@ class IssueReporter {
|
|
|
373
369
|
});
|
|
374
370
|
}
|
|
375
371
|
|
|
372
|
+
_writeRetryCount(message , count ) {
|
|
373
|
+
if (message && typeof message === 'object') {
|
|
374
|
+
// $FlowFixMe
|
|
375
|
+
message._retry = count;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return message;
|
|
379
|
+
}
|
|
380
|
+
|
|
376
381
|
_isLevelAbove(level1 , level2 ) {
|
|
377
382
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
378
383
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -359,13 +359,9 @@ class IssueReporter {
|
|
|
359
359
|
|
|
360
360
|
setTimeout(() => {
|
|
361
361
|
if (isArray) {
|
|
362
|
-
payload = payload.map(message =>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
});
|
|
366
|
-
} else {
|
|
367
|
-
// $FlowFixMe
|
|
368
|
-
payload._retry = retry + 1;
|
|
362
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
363
|
+
} else if (payload && typeof payload === 'object') {
|
|
364
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
369
365
|
}
|
|
370
366
|
|
|
371
367
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -373,6 +369,15 @@ class IssueReporter {
|
|
|
373
369
|
});
|
|
374
370
|
}
|
|
375
371
|
|
|
372
|
+
_writeRetryCount(message , count ) {
|
|
373
|
+
if (message && typeof message === 'object') {
|
|
374
|
+
// $FlowFixMe
|
|
375
|
+
message._retry = count;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return message;
|
|
379
|
+
}
|
|
380
|
+
|
|
376
381
|
_isLevelAbove(level1 , level2 ) {
|
|
377
382
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
378
383
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -488,4 +493,10 @@ describe('IssueReporter', () => {
|
|
|
488
493
|
expect(IssueReporter$1.removeSlashes('\"')).toBe("'");
|
|
489
494
|
expect(IssueReporter$1.removeSlashes('\\\"')).toBe("'");
|
|
490
495
|
});
|
|
496
|
+
|
|
497
|
+
it('Add retry count', () => {
|
|
498
|
+
expect(IssueReporter$1._writeRetryCount('', 1)).toBe('');
|
|
499
|
+
expect(IssueReporter$1._writeRetryCount('{}', 1)).toBe('{}');
|
|
500
|
+
expect(IssueReporter$1._writeRetryCount({}, 1)).toEqual({ _retry: 1 });
|
|
501
|
+
});
|
|
491
502
|
});
|
|
@@ -396,13 +396,9 @@ class IssueReporter {
|
|
|
396
396
|
|
|
397
397
|
setTimeout(() => {
|
|
398
398
|
if (isArray) {
|
|
399
|
-
payload = payload.map(message =>
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
});
|
|
403
|
-
} else {
|
|
404
|
-
// $FlowFixMe
|
|
405
|
-
payload._retry = retry + 1;
|
|
399
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
400
|
+
} else if (payload && typeof payload === 'object') {
|
|
401
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
406
402
|
}
|
|
407
403
|
|
|
408
404
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -410,6 +406,15 @@ class IssueReporter {
|
|
|
410
406
|
});
|
|
411
407
|
}
|
|
412
408
|
|
|
409
|
+
_writeRetryCount(message , count ) {
|
|
410
|
+
if (message && typeof message === 'object') {
|
|
411
|
+
// $FlowFixMe
|
|
412
|
+
message._retry = count;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return message;
|
|
416
|
+
}
|
|
417
|
+
|
|
413
418
|
_isLevelAbove(level1 , level2 ) {
|
|
414
419
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
415
420
|
const index2 = LOG_LEVELS.indexOf(level2);
|
package/esm/simple/Auth.js
CHANGED
|
@@ -1909,13 +1909,9 @@ class IssueReporter {
|
|
|
1909
1909
|
|
|
1910
1910
|
setTimeout(() => {
|
|
1911
1911
|
if (isArray) {
|
|
1912
|
-
payload = payload.map(message =>
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
});
|
|
1916
|
-
} else {
|
|
1917
|
-
// $FlowFixMe
|
|
1918
|
-
payload._retry = retry + 1;
|
|
1912
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
1913
|
+
} else if (payload && typeof payload === 'object') {
|
|
1914
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
1919
1915
|
}
|
|
1920
1916
|
|
|
1921
1917
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -1923,6 +1919,15 @@ class IssueReporter {
|
|
|
1923
1919
|
});
|
|
1924
1920
|
}
|
|
1925
1921
|
|
|
1922
|
+
_writeRetryCount(message , count ) {
|
|
1923
|
+
if (message && typeof message === 'object') {
|
|
1924
|
+
// $FlowFixMe
|
|
1925
|
+
message._retry = count;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
return message;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1926
1931
|
_isLevelAbove(level1 , level2 ) {
|
|
1927
1932
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1928
1933
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7174,8 +7179,10 @@ class WebRTCClient extends Emitter {
|
|
|
7174
7179
|
conference: isConference,
|
|
7175
7180
|
};
|
|
7176
7181
|
|
|
7177
|
-
// Avoid sdh to
|
|
7178
|
-
session.sessionDescriptionHandler
|
|
7182
|
+
// Avoid sdh to create a new stream
|
|
7183
|
+
if (session.sessionDescriptionHandler) {
|
|
7184
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7185
|
+
}
|
|
7179
7186
|
|
|
7180
7187
|
// Send re-INVITE
|
|
7181
7188
|
return session.invite(options);
|
|
@@ -11186,7 +11193,7 @@ class WebSocketClient extends Emitter {
|
|
|
11186
11193
|
this.close();
|
|
11187
11194
|
}
|
|
11188
11195
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11189
|
-
logger$6.
|
|
11196
|
+
logger$6.info('Wazo WS url computed to reconnect', { url });
|
|
11190
11197
|
|
|
11191
11198
|
return url;
|
|
11192
11199
|
}
|
|
@@ -1909,13 +1909,9 @@ class IssueReporter {
|
|
|
1909
1909
|
|
|
1910
1910
|
setTimeout(() => {
|
|
1911
1911
|
if (isArray) {
|
|
1912
|
-
payload = payload.map(message =>
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
});
|
|
1916
|
-
} else {
|
|
1917
|
-
// $FlowFixMe
|
|
1918
|
-
payload._retry = retry + 1;
|
|
1912
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
1913
|
+
} else if (payload && typeof payload === 'object') {
|
|
1914
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
1919
1915
|
}
|
|
1920
1916
|
|
|
1921
1917
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -1923,6 +1919,15 @@ class IssueReporter {
|
|
|
1923
1919
|
});
|
|
1924
1920
|
}
|
|
1925
1921
|
|
|
1922
|
+
_writeRetryCount(message , count ) {
|
|
1923
|
+
if (message && typeof message === 'object') {
|
|
1924
|
+
// $FlowFixMe
|
|
1925
|
+
message._retry = count;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
return message;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1926
1931
|
_isLevelAbove(level1 , level2 ) {
|
|
1927
1932
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1928
1933
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7174,8 +7179,10 @@ class WebRTCClient extends Emitter {
|
|
|
7174
7179
|
conference: isConference,
|
|
7175
7180
|
};
|
|
7176
7181
|
|
|
7177
|
-
// Avoid sdh to
|
|
7178
|
-
session.sessionDescriptionHandler
|
|
7182
|
+
// Avoid sdh to create a new stream
|
|
7183
|
+
if (session.sessionDescriptionHandler) {
|
|
7184
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7185
|
+
}
|
|
7179
7186
|
|
|
7180
7187
|
// Send re-INVITE
|
|
7181
7188
|
return session.invite(options);
|
|
@@ -11186,7 +11193,7 @@ class WebSocketClient extends Emitter {
|
|
|
11186
11193
|
this.close();
|
|
11187
11194
|
}
|
|
11188
11195
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11189
|
-
logger$6.
|
|
11196
|
+
logger$6.info('Wazo WS url computed to reconnect', { url });
|
|
11190
11197
|
|
|
11191
11198
|
return url;
|
|
11192
11199
|
}
|
package/esm/simple/Directory.js
CHANGED
|
@@ -396,13 +396,9 @@ class IssueReporter {
|
|
|
396
396
|
|
|
397
397
|
setTimeout(() => {
|
|
398
398
|
if (isArray) {
|
|
399
|
-
payload = payload.map(message =>
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
});
|
|
403
|
-
} else {
|
|
404
|
-
// $FlowFixMe
|
|
405
|
-
payload._retry = retry + 1;
|
|
399
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
400
|
+
} else if (payload && typeof payload === 'object') {
|
|
401
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
406
402
|
}
|
|
407
403
|
|
|
408
404
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -410,6 +406,15 @@ class IssueReporter {
|
|
|
410
406
|
});
|
|
411
407
|
}
|
|
412
408
|
|
|
409
|
+
_writeRetryCount(message , count ) {
|
|
410
|
+
if (message && typeof message === 'object') {
|
|
411
|
+
// $FlowFixMe
|
|
412
|
+
message._retry = count;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return message;
|
|
416
|
+
}
|
|
417
|
+
|
|
413
418
|
_isLevelAbove(level1 , level2 ) {
|
|
414
419
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
415
420
|
const index2 = LOG_LEVELS.indexOf(level2);
|