@wazo/sdk 0.37.20 → 0.37.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wazo-sdk.js +5 -5
- package/esm/__tests__/api-client.test.js +44 -5
- package/esm/__tests__/web-rtc-client.test.js +70 -15
- package/esm/api/agentd.js +25 -2
- package/esm/api/amid.js +25 -2
- package/esm/api/application.js +25 -2
- package/esm/api/auth.js +25 -2
- package/esm/api/call-logd.js +25 -2
- package/esm/api/calld.js +25 -2
- package/esm/api/chatd.js +25 -2
- package/esm/api/confd.js +44 -5
- package/esm/api/ctid-ng.js +25 -2
- package/esm/api/dird.js +25 -2
- package/esm/api/webhookd.js +25 -2
- package/esm/api-client.js +44 -5
- package/esm/checker/Checker.js +72 -15
- package/esm/checker/checks/aor.js +44 -5
- package/esm/checker/checks/api.js +44 -5
- package/esm/checker/checks/index.js +72 -15
- package/esm/checker/checks/wazo-websocket.js +27 -2
- package/esm/checker/checks/webrtc-transport.js +70 -15
- package/esm/checker/checks/webrtc.js +70 -15
- package/esm/domain/AdHocAPIConference.js +44 -5
- package/esm/domain/Features.js +44 -5
- package/esm/domain/Meeting.js +14 -1
- package/esm/domain/Phone/CTIPhone.js +44 -5
- package/esm/domain/Phone/WebRTCPhone.js +32 -3
- package/esm/index.js +85 -16
- package/esm/lib/WazoSessionDescriptionHandler.js +25 -2
- package/esm/service/CallApi.js +44 -5
- package/esm/service/IssueReporter.js +25 -2
- package/esm/service/__tests__/IssueReporter.test.js +25 -2
- package/esm/service/getApiClient.js +44 -5
- package/esm/simple/Auth.js +85 -16
- package/esm/simple/Configuration.js +85 -16
- package/esm/simple/Directory.js +44 -5
- package/esm/simple/Phone.js +85 -16
- package/esm/simple/Websocket.js +28 -2
- package/esm/simple/index.js +85 -16
- package/esm/simple/room/LocalParticipant.js +85 -16
- package/esm/simple/room/Participant.js +85 -16
- package/esm/simple/room/RemoteParticipant.js +85 -16
- package/esm/simple/room/Room.js +85 -16
- package/esm/simple/room/SipRoom.js +85 -16
- package/esm/simple/room/Stream.js +85 -16
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +85 -16
- package/esm/simple/utils.js +85 -16
- package/esm/utils/__tests__/api-requester.test.js +25 -2
- package/esm/utils/api-requester.js +25 -2
- package/esm/web-rtc-client.js +70 -15
- package/esm/websocket-client.js +28 -3
- package/lib/__tests__/api-client.test.js +44 -5
- package/lib/__tests__/web-rtc-client.test.js +70 -15
- package/lib/api/agentd.js +25 -2
- package/lib/api/amid.js +25 -2
- package/lib/api/application.js +25 -2
- package/lib/api/auth.js +25 -2
- package/lib/api/call-logd.js +25 -2
- package/lib/api/calld.js +25 -2
- package/lib/api/chatd.js +25 -2
- package/lib/api/confd.js +44 -5
- package/lib/api/ctid-ng.js +25 -2
- package/lib/api/dird.js +25 -2
- package/lib/api/webhookd.js +25 -2
- package/lib/api-client.js +44 -5
- package/lib/checker/Checker.js +72 -15
- package/lib/checker/checks/aor.js +44 -5
- package/lib/checker/checks/api.js +44 -5
- package/lib/checker/checks/index.js +72 -15
- package/lib/checker/checks/wazo-websocket.js +27 -2
- package/lib/checker/checks/webrtc-transport.js +70 -15
- package/lib/checker/checks/webrtc.js +70 -15
- package/lib/domain/AdHocAPIConference.js +44 -5
- package/lib/domain/Features.js +44 -5
- package/lib/domain/Meeting.js +14 -1
- package/lib/domain/Phone/CTIPhone.js +44 -5
- package/lib/domain/Phone/WebRTCPhone.js +32 -3
- package/lib/index.js +85 -16
- package/lib/lib/WazoSessionDescriptionHandler.js +25 -2
- package/lib/service/CallApi.js +44 -5
- package/lib/service/IssueReporter.js +25 -2
- package/lib/service/__tests__/IssueReporter.test.js +25 -2
- package/lib/service/getApiClient.js +44 -5
- package/lib/simple/Auth.js +85 -16
- package/lib/simple/Configuration.js +85 -16
- package/lib/simple/Directory.js +44 -5
- package/lib/simple/Phone.js +85 -16
- package/lib/simple/Websocket.js +28 -2
- package/lib/simple/index.js +85 -16
- package/lib/simple/room/LocalParticipant.js +85 -16
- package/lib/simple/room/Participant.js +85 -16
- package/lib/simple/room/RemoteParticipant.js +85 -16
- package/lib/simple/room/Room.js +85 -16
- package/lib/simple/room/SipRoom.js +85 -16
- package/lib/simple/room/Stream.js +85 -16
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +85 -16
- package/lib/simple/utils.js +85 -16
- package/lib/utils/__tests__/api-requester.test.js +25 -2
- package/lib/utils/api-requester.js +25 -2
- package/lib/web-rtc-client.js +70 -15
- package/lib/websocket-client.js +28 -2
- package/package.json +1 -1
- package/src/api/confd.js +5 -2
- package/src/domain/Meeting.js +14 -1
- package/src/domain/Phone/WebRTCPhone.js +7 -1
- package/src/service/IssueReporter.js +25 -2
- package/src/simple/Phone.js +5 -0
- package/src/types/WebSocketMessage.js +5 -1
- package/src/web-rtc-client.js +26 -10
- package/src/websocket-client.js +2 -0
|
@@ -99,6 +99,7 @@ class IssueReporter {
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
|
|
102
103
|
|
|
103
104
|
constructor() {
|
|
104
105
|
addLevelsTo(this);
|
|
@@ -110,12 +111,17 @@ class IssueReporter {
|
|
|
110
111
|
this.bufferTimeout = null;
|
|
111
112
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
112
113
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
114
|
+
this._callback = null;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
init() {
|
|
116
118
|
this._catchConsole();
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
setCallback(cb ) {
|
|
122
|
+
this._callback = cb;
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
120
126
|
this.remoteClientConfiguration = configuration;
|
|
121
127
|
}
|
|
@@ -151,6 +157,7 @@ class IssueReporter {
|
|
|
151
157
|
|
|
152
158
|
// Handle category label
|
|
153
159
|
let category = null;
|
|
160
|
+
let skipSendToRemote = false;
|
|
154
161
|
let extra = {};
|
|
155
162
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
156
163
|
category = args[0].split('=')[1];
|
|
@@ -166,6 +173,7 @@ class IssueReporter {
|
|
|
166
173
|
errorMessage: lastArg.message,
|
|
167
174
|
errorStack: lastArg.stack,
|
|
168
175
|
errorType: lastArg.constructor.name,
|
|
176
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
169
177
|
};
|
|
170
178
|
} else {
|
|
171
179
|
extra = lastArg;
|
|
@@ -174,6 +182,11 @@ class IssueReporter {
|
|
|
174
182
|
args.splice(1, 1);
|
|
175
183
|
}
|
|
176
184
|
|
|
185
|
+
if (extra.skipSendToRemote) {
|
|
186
|
+
skipSendToRemote = true;
|
|
187
|
+
delete extra.skipSendToRemote;
|
|
188
|
+
}
|
|
189
|
+
|
|
177
190
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
178
191
|
const message = args.join(', ');
|
|
179
192
|
let consoleMessage = message;
|
|
@@ -194,7 +207,13 @@ class IssueReporter {
|
|
|
194
207
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
195
208
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
196
209
|
|
|
197
|
-
this.
|
|
210
|
+
if (this._callback) {
|
|
211
|
+
this._callback(level, consoleMessage);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (!skipSendToRemote) {
|
|
215
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
216
|
+
}
|
|
198
217
|
}
|
|
199
218
|
|
|
200
219
|
logRequest(url , options , response , start ) {
|
|
@@ -339,7 +358,11 @@ class IssueReporter {
|
|
|
339
358
|
},
|
|
340
359
|
// $FlowFixMe
|
|
341
360
|
body,
|
|
342
|
-
}).catch(() => {
|
|
361
|
+
}).catch((e ) => {
|
|
362
|
+
// $FlowFixMe
|
|
363
|
+
e.skipSendToRemote = true;
|
|
364
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
365
|
+
|
|
343
366
|
setTimeout(() => {
|
|
344
367
|
if (isArray) {
|
|
345
368
|
payload = payload.map(message => {
|
|
@@ -99,6 +99,7 @@ class IssueReporter {
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
|
|
102
103
|
|
|
103
104
|
constructor() {
|
|
104
105
|
addLevelsTo(this);
|
|
@@ -110,12 +111,17 @@ class IssueReporter {
|
|
|
110
111
|
this.bufferTimeout = null;
|
|
111
112
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
112
113
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
114
|
+
this._callback = null;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
init() {
|
|
116
118
|
this._catchConsole();
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
setCallback(cb ) {
|
|
122
|
+
this._callback = cb;
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
120
126
|
this.remoteClientConfiguration = configuration;
|
|
121
127
|
}
|
|
@@ -151,6 +157,7 @@ class IssueReporter {
|
|
|
151
157
|
|
|
152
158
|
// Handle category label
|
|
153
159
|
let category = null;
|
|
160
|
+
let skipSendToRemote = false;
|
|
154
161
|
let extra = {};
|
|
155
162
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
156
163
|
category = args[0].split('=')[1];
|
|
@@ -166,6 +173,7 @@ class IssueReporter {
|
|
|
166
173
|
errorMessage: lastArg.message,
|
|
167
174
|
errorStack: lastArg.stack,
|
|
168
175
|
errorType: lastArg.constructor.name,
|
|
176
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
169
177
|
};
|
|
170
178
|
} else {
|
|
171
179
|
extra = lastArg;
|
|
@@ -174,6 +182,11 @@ class IssueReporter {
|
|
|
174
182
|
args.splice(1, 1);
|
|
175
183
|
}
|
|
176
184
|
|
|
185
|
+
if (extra.skipSendToRemote) {
|
|
186
|
+
skipSendToRemote = true;
|
|
187
|
+
delete extra.skipSendToRemote;
|
|
188
|
+
}
|
|
189
|
+
|
|
177
190
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
178
191
|
const message = args.join(', ');
|
|
179
192
|
let consoleMessage = message;
|
|
@@ -194,7 +207,13 @@ class IssueReporter {
|
|
|
194
207
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
195
208
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
196
209
|
|
|
197
|
-
this.
|
|
210
|
+
if (this._callback) {
|
|
211
|
+
this._callback(level, consoleMessage);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (!skipSendToRemote) {
|
|
215
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
216
|
+
}
|
|
198
217
|
}
|
|
199
218
|
|
|
200
219
|
logRequest(url , options , response , start ) {
|
|
@@ -339,7 +358,11 @@ class IssueReporter {
|
|
|
339
358
|
},
|
|
340
359
|
// $FlowFixMe
|
|
341
360
|
body,
|
|
342
|
-
}).catch(() => {
|
|
361
|
+
}).catch((e ) => {
|
|
362
|
+
// $FlowFixMe
|
|
363
|
+
e.skipSendToRemote = true;
|
|
364
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
365
|
+
|
|
343
366
|
setTimeout(() => {
|
|
344
367
|
if (isArray) {
|
|
345
368
|
payload = payload.map(message => {
|
|
@@ -138,6 +138,7 @@ class IssueReporter {
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
|
|
141
142
|
|
|
142
143
|
constructor() {
|
|
143
144
|
addLevelsTo(this);
|
|
@@ -149,12 +150,17 @@ class IssueReporter {
|
|
|
149
150
|
this.bufferTimeout = null;
|
|
150
151
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
151
152
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
153
|
+
this._callback = null;
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
init() {
|
|
155
157
|
this._catchConsole();
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
setCallback(cb ) {
|
|
161
|
+
this._callback = cb;
|
|
162
|
+
}
|
|
163
|
+
|
|
158
164
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
159
165
|
this.remoteClientConfiguration = configuration;
|
|
160
166
|
}
|
|
@@ -190,6 +196,7 @@ class IssueReporter {
|
|
|
190
196
|
|
|
191
197
|
// Handle category label
|
|
192
198
|
let category = null;
|
|
199
|
+
let skipSendToRemote = false;
|
|
193
200
|
let extra = {};
|
|
194
201
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
195
202
|
category = args[0].split('=')[1];
|
|
@@ -205,6 +212,7 @@ class IssueReporter {
|
|
|
205
212
|
errorMessage: lastArg.message,
|
|
206
213
|
errorStack: lastArg.stack,
|
|
207
214
|
errorType: lastArg.constructor.name,
|
|
215
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
208
216
|
};
|
|
209
217
|
} else {
|
|
210
218
|
extra = lastArg;
|
|
@@ -213,6 +221,11 @@ class IssueReporter {
|
|
|
213
221
|
args.splice(1, 1);
|
|
214
222
|
}
|
|
215
223
|
|
|
224
|
+
if (extra.skipSendToRemote) {
|
|
225
|
+
skipSendToRemote = true;
|
|
226
|
+
delete extra.skipSendToRemote;
|
|
227
|
+
}
|
|
228
|
+
|
|
216
229
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
217
230
|
const message = args.join(', ');
|
|
218
231
|
let consoleMessage = message;
|
|
@@ -233,7 +246,13 @@ class IssueReporter {
|
|
|
233
246
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
234
247
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
235
248
|
|
|
236
|
-
this.
|
|
249
|
+
if (this._callback) {
|
|
250
|
+
this._callback(level, consoleMessage);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!skipSendToRemote) {
|
|
254
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
255
|
+
}
|
|
237
256
|
}
|
|
238
257
|
|
|
239
258
|
logRequest(url , options , response , start ) {
|
|
@@ -378,7 +397,11 @@ class IssueReporter {
|
|
|
378
397
|
},
|
|
379
398
|
// $FlowFixMe
|
|
380
399
|
body,
|
|
381
|
-
}).catch(() => {
|
|
400
|
+
}).catch((e ) => {
|
|
401
|
+
// $FlowFixMe
|
|
402
|
+
e.skipSendToRemote = true;
|
|
403
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
404
|
+
|
|
382
405
|
setTimeout(() => {
|
|
383
406
|
if (isArray) {
|
|
384
407
|
payload = payload.map(message => {
|
|
@@ -2622,11 +2645,24 @@ class Meeting {
|
|
|
2622
2645
|
});
|
|
2623
2646
|
}
|
|
2624
2647
|
|
|
2648
|
+
static parseMany(items ) {
|
|
2649
|
+
return items.map(plain => Meeting.parse(plain));
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2625
2652
|
static newFrom(meeting ) {
|
|
2626
2653
|
return newFrom(meeting, Meeting);
|
|
2627
2654
|
}
|
|
2628
2655
|
|
|
2629
|
-
constructor({
|
|
2656
|
+
constructor({
|
|
2657
|
+
uuid,
|
|
2658
|
+
name,
|
|
2659
|
+
guestSipAuthorization,
|
|
2660
|
+
ownerUuids,
|
|
2661
|
+
port,
|
|
2662
|
+
uri,
|
|
2663
|
+
number,
|
|
2664
|
+
persistent,
|
|
2665
|
+
} = {}) {
|
|
2630
2666
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2631
2667
|
this.uri = uri;
|
|
2632
2668
|
this.name = name;
|
|
@@ -2712,8 +2748,11 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2712
2748
|
}
|
|
2713
2749
|
},
|
|
2714
2750
|
|
|
2715
|
-
|
|
2716
|
-
client.
|
|
2751
|
+
getMyMeetings: () =>
|
|
2752
|
+
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2753
|
+
|
|
2754
|
+
createMyMeeting: (name , persistent ) =>
|
|
2755
|
+
client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
|
|
2717
2756
|
|
|
2718
2757
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2719
2758
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
package/lib/simple/Auth.js
CHANGED
|
@@ -1646,6 +1646,7 @@ class IssueReporter {
|
|
|
1646
1646
|
|
|
1647
1647
|
|
|
1648
1648
|
|
|
1649
|
+
|
|
1649
1650
|
|
|
1650
1651
|
constructor() {
|
|
1651
1652
|
addLevelsTo(this);
|
|
@@ -1657,12 +1658,17 @@ class IssueReporter {
|
|
|
1657
1658
|
this.bufferTimeout = null;
|
|
1658
1659
|
this._boundProcessBuffer = this._processBuffer.bind(this);
|
|
1659
1660
|
this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
|
|
1661
|
+
this._callback = null;
|
|
1660
1662
|
}
|
|
1661
1663
|
|
|
1662
1664
|
init() {
|
|
1663
1665
|
this._catchConsole();
|
|
1664
1666
|
}
|
|
1665
1667
|
|
|
1668
|
+
setCallback(cb ) {
|
|
1669
|
+
this._callback = cb;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1666
1672
|
configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
|
|
1667
1673
|
this.remoteClientConfiguration = configuration;
|
|
1668
1674
|
}
|
|
@@ -1698,6 +1704,7 @@ class IssueReporter {
|
|
|
1698
1704
|
|
|
1699
1705
|
// Handle category label
|
|
1700
1706
|
let category = null;
|
|
1707
|
+
let skipSendToRemote = false;
|
|
1701
1708
|
let extra = {};
|
|
1702
1709
|
if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
|
|
1703
1710
|
category = args[0].split('=')[1];
|
|
@@ -1713,6 +1720,7 @@ class IssueReporter {
|
|
|
1713
1720
|
errorMessage: lastArg.message,
|
|
1714
1721
|
errorStack: lastArg.stack,
|
|
1715
1722
|
errorType: lastArg.constructor.name,
|
|
1723
|
+
skipSendToRemote: lastArg.skipSendToRemote,
|
|
1716
1724
|
};
|
|
1717
1725
|
} else {
|
|
1718
1726
|
extra = lastArg;
|
|
@@ -1721,6 +1729,11 @@ class IssueReporter {
|
|
|
1721
1729
|
args.splice(1, 1);
|
|
1722
1730
|
}
|
|
1723
1731
|
|
|
1732
|
+
if (extra.skipSendToRemote) {
|
|
1733
|
+
skipSendToRemote = true;
|
|
1734
|
+
delete extra.skipSendToRemote;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1724
1737
|
const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
|
|
1725
1738
|
const message = args.join(', ');
|
|
1726
1739
|
let consoleMessage = message;
|
|
@@ -1741,7 +1754,13 @@ class IssueReporter {
|
|
|
1741
1754
|
const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
|
|
1742
1755
|
oldMethod.apply(oldMethod, [date, consoleMessage]);
|
|
1743
1756
|
|
|
1744
|
-
this.
|
|
1757
|
+
if (this._callback) {
|
|
1758
|
+
this._callback(level, consoleMessage);
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
if (!skipSendToRemote) {
|
|
1762
|
+
this._sendToRemoteLogger(level, { date, message, category, ...extra });
|
|
1763
|
+
}
|
|
1745
1764
|
}
|
|
1746
1765
|
|
|
1747
1766
|
logRequest(url , options , response , start ) {
|
|
@@ -1886,7 +1905,11 @@ class IssueReporter {
|
|
|
1886
1905
|
},
|
|
1887
1906
|
// $FlowFixMe
|
|
1888
1907
|
body,
|
|
1889
|
-
}).catch(() => {
|
|
1908
|
+
}).catch((e ) => {
|
|
1909
|
+
// $FlowFixMe
|
|
1910
|
+
e.skipSendToRemote = true;
|
|
1911
|
+
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
1912
|
+
|
|
1890
1913
|
setTimeout(() => {
|
|
1891
1914
|
if (isArray) {
|
|
1892
1915
|
payload = payload.map(message => {
|
|
@@ -2645,11 +2668,24 @@ class Meeting {
|
|
|
2645
2668
|
});
|
|
2646
2669
|
}
|
|
2647
2670
|
|
|
2671
|
+
static parseMany(items ) {
|
|
2672
|
+
return items.map(plain => Meeting.parse(plain));
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2648
2675
|
static newFrom(meeting ) {
|
|
2649
2676
|
return newFrom(meeting, Meeting);
|
|
2650
2677
|
}
|
|
2651
2678
|
|
|
2652
|
-
constructor({
|
|
2679
|
+
constructor({
|
|
2680
|
+
uuid,
|
|
2681
|
+
name,
|
|
2682
|
+
guestSipAuthorization,
|
|
2683
|
+
ownerUuids,
|
|
2684
|
+
port,
|
|
2685
|
+
uri,
|
|
2686
|
+
number,
|
|
2687
|
+
persistent,
|
|
2688
|
+
} = {}) {
|
|
2653
2689
|
this.guestSipAuthorization = guestSipAuthorization;
|
|
2654
2690
|
this.uri = uri;
|
|
2655
2691
|
this.name = name;
|
|
@@ -2735,8 +2771,11 @@ var confdMethods = (client , baseUrl ) => ({
|
|
|
2735
2771
|
}
|
|
2736
2772
|
},
|
|
2737
2773
|
|
|
2738
|
-
|
|
2739
|
-
client.
|
|
2774
|
+
getMyMeetings: () =>
|
|
2775
|
+
client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
|
|
2776
|
+
|
|
2777
|
+
createMyMeeting: (name , persistent ) =>
|
|
2778
|
+
client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
|
|
2740
2779
|
|
|
2741
2780
|
deleteMyMeeting: (meetingUuid ) =>
|
|
2742
2781
|
client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
|
|
@@ -6708,7 +6747,9 @@ class WebRTCClient extends Emitter {
|
|
|
6708
6747
|
const inviteOptions = {
|
|
6709
6748
|
requestDelegate: {
|
|
6710
6749
|
onAccept: (response ) => {
|
|
6711
|
-
session.sessionDescriptionHandler.peerConnection
|
|
6750
|
+
if (session.sessionDescriptionHandler.peerConnection) {
|
|
6751
|
+
session.sessionDescriptionHandler.peerConnection.sfu = conference;
|
|
6752
|
+
}
|
|
6712
6753
|
this._onAccepted(session, response.session, true);
|
|
6713
6754
|
},
|
|
6714
6755
|
onReject: (response ) => {
|
|
@@ -7580,6 +7621,16 @@ class WebRTCClient extends Emitter {
|
|
|
7580
7621
|
return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
|
|
7581
7622
|
}
|
|
7582
7623
|
|
|
7624
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
7625
|
+
getRemoteVideoStreamFromPc(sessionId ) {
|
|
7626
|
+
const pc = this.getPeerConnection(sessionId);
|
|
7627
|
+
if (!pc) {
|
|
7628
|
+
return null;
|
|
7629
|
+
}
|
|
7630
|
+
|
|
7631
|
+
return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
|
|
7632
|
+
}
|
|
7633
|
+
|
|
7583
7634
|
hasVideo(sessionId ) {
|
|
7584
7635
|
return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
|
|
7585
7636
|
}
|
|
@@ -8358,18 +8409,22 @@ class WebRTCClient extends Emitter {
|
|
|
8358
8409
|
});
|
|
8359
8410
|
|
|
8360
8411
|
networkStats.packetsLost = packetsLost;
|
|
8361
|
-
networkStats.
|
|
8412
|
+
networkStats.totalAudioBytesSent = audioBytesSent;
|
|
8413
|
+
networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
|
|
8414
|
+
networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
|
|
8362
8415
|
networkStats.audioBytesReceived = audioBytesReceived;
|
|
8363
|
-
networkStats.
|
|
8364
|
-
networkStats.
|
|
8416
|
+
networkStats.totalVideoBytesSent = videoBytesSent;
|
|
8417
|
+
networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
|
|
8418
|
+
networkStats.totalVideoBytesReceived = videoBytesReceived;
|
|
8419
|
+
networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
|
|
8420
|
+
networkStats.totalTransportSent = transportSent - lastTransportSent;
|
|
8365
8421
|
networkStats.transportSent = transportSent;
|
|
8366
|
-
networkStats.
|
|
8422
|
+
networkStats.totalTransportReceived = transportReceived;
|
|
8423
|
+
networkStats.transportReceived = transportReceived - lastTransportReceived;
|
|
8367
8424
|
|
|
8368
|
-
|
|
8369
|
-
+
|
|
8370
|
-
+
|
|
8371
|
-
|
|
8372
|
-
networkStats.bandwidth = bandwidth;
|
|
8425
|
+
networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
|
|
8426
|
+
+ networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
|
|
8427
|
+
+ networkStats.transportSent;
|
|
8373
8428
|
|
|
8374
8429
|
this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
|
|
8375
8430
|
this.sessionNetworkStats[sessionId].push(networkStats);
|
|
@@ -8780,9 +8835,11 @@ class WebRTCPhone extends Emitter {
|
|
|
8780
8835
|
case sessionState.SessionState.Terminated: {
|
|
8781
8836
|
logger$8.info('WebRTC phone - call terminated', { sipId: sipSession.id });
|
|
8782
8837
|
|
|
8838
|
+
// Should be called before `_onCallTerminated` or the callCount will not decrement...
|
|
8839
|
+
const callSession = this._createCallSession(sipSession);
|
|
8783
8840
|
const wasCurrentSession = this._onCallTerminated(sipSession);
|
|
8784
8841
|
|
|
8785
|
-
return this.eventEmitter.emit(ON_CALL_ENDED,
|
|
8842
|
+
return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
|
|
8786
8843
|
}
|
|
8787
8844
|
}
|
|
8788
8845
|
});
|
|
@@ -9730,6 +9787,10 @@ class WebRTCPhone extends Emitter {
|
|
|
9730
9787
|
return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
|
|
9731
9788
|
}
|
|
9732
9789
|
|
|
9790
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
9791
|
+
return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
|
|
9792
|
+
}
|
|
9793
|
+
|
|
9733
9794
|
hasRemoteVideo(callSession ) {
|
|
9734
9795
|
return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
|
|
9735
9796
|
}
|
|
@@ -10413,6 +10474,11 @@ class Phone extends Emitter {
|
|
|
10413
10474
|
return this.getRemoteVideoStream(callSession);
|
|
10414
10475
|
}
|
|
10415
10476
|
|
|
10477
|
+
// Useful in a react-native environment when remoteMediaStream is not updated
|
|
10478
|
+
getRemoteVideoStreamFromPc(callSession ) {
|
|
10479
|
+
return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
|
|
10480
|
+
}
|
|
10481
|
+
|
|
10416
10482
|
hasVideo(callSession ) {
|
|
10417
10483
|
return this.phone ? this.phone.hasVideo(callSession) : false;
|
|
10418
10484
|
}
|
|
@@ -10572,6 +10638,7 @@ const AGENT_PAUSED = 'agent_paused';
|
|
|
10572
10638
|
const AGENT_UNPAUSED = 'agent_unpaused';
|
|
10573
10639
|
const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
|
|
10574
10640
|
const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
|
|
10641
|
+
const MEETING_USER_PROGRESS = 'meeting_user_progress';
|
|
10575
10642
|
|
|
10576
10643
|
const BLACKLIST_EVENTS = [
|
|
10577
10644
|
CHAT_MESSAGE_SENT,
|
|
@@ -10922,6 +10989,7 @@ WebSocketClient.eventLists = [
|
|
|
10922
10989
|
AGENT_UNPAUSED,
|
|
10923
10990
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
10924
10991
|
CONFERENCE_ADHOC_DELETED,
|
|
10992
|
+
MEETING_USER_PROGRESS,
|
|
10925
10993
|
];
|
|
10926
10994
|
|
|
10927
10995
|
var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -10992,6 +11060,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
|
|
|
10992
11060
|
AGENT_UNPAUSED: AGENT_UNPAUSED,
|
|
10993
11061
|
CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
|
|
10994
11062
|
CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
|
|
11063
|
+
MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
|
|
10995
11064
|
HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
|
|
10996
11065
|
'default': WebSocketClient
|
|
10997
11066
|
});
|