@@ -32,12 +32,12 @@ let userFacingDiagnostics = self.call?.feature(Features.diagnostics)
32
32
33
33
### Native Android
34
34
``` java
35
- DiagnosticsCallFeature diagnosticsCallFeature = call. feature(Features . DIAGONSTICS_CALL );
35
+ DiagnosticsCallFeature diagnosticsCallFeature = call. feature(Features . DIAGNOSTICS_CALL );
36
36
```
37
37
38
38
### Native Windows
39
39
``` csharp
40
- this .diagnosticsCallFeature = ( DiagnosticsCallFeature ) call .GetCallFeatureExtension ( HandleType . DiagnosticsCallFeature ) ;
40
+ this .diagnosticsCallFeature = call .Features . Diagnostics ;
41
41
```
42
42
43
43
## Diagnostic values
@@ -145,25 +145,104 @@ userFacingDiagnostics.media.on('diagnosticChanged', diagnosticChangedListener);
145
145
``` swift
146
146
extension CallObserver : MediaDiagnosticsDelegate {
147
147
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
148
- didChangeBooleanDiagnosticValue args : MediaBooleanDiagnosticChangedEventArgs) {
149
- let diagnostic = args.diagnostic // Which media diagnostic value is changing.
150
- let value = args.value // Boolean indicating new value.
151
- // Handle the diagnostic event value changed...
148
+ didChangeCameraFreezeValue args : FlagDiagnosticChangedEventArgs) {
149
+ let value = args.value // Boolean indicating new value for CameraFreeze
150
+ }
151
+
152
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
153
+ didChangeSpeakerMutedValue args : FlagDiagnosticChangedEventArgs) {
154
+ let value = args.value // Boolean indicating new value for SpeakerMuted
155
+ }
156
+
157
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
158
+ didChangeCameraStartFailedValue args : FlagDiagnosticChangedEventArgs) {
159
+ let value = args.value // Boolean indicating new value for CameraStartFailed
160
+ }
161
+
162
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
163
+ didChangeSpeakerNotFunctioningValue args : FlagDiagnosticChangedEventArgs) {
164
+ let value = args.value // Boolean indicating new value for SpeakerNotFunctioning
165
+ }
166
+
167
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
168
+ didChangeCameraPermissionDeniedValue args : FlagDiagnosticChangedEventArgs) {
169
+ let value = args.value // Boolean indicating new value for CameraPermissionDenied
170
+ }
171
+
172
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
173
+ didChangeMicrophoneNotFunctioningValue args : FlagDiagnosticChangedEventArgs) {
174
+ let value = args.value // Boolean indicating new value for MicrophoneNotFunctioning
175
+ }
176
+
177
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
178
+ didChangeMicrophoneMuteUnexpectedlyValue args : FlagDiagnosticChangedEventArgs) {
179
+ let value = args.value // Boolean indicating new value for MicrophoneMuteUnexpectedly
180
+ }
181
+
182
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
183
+ didChangeCameraStartTimedOutValue args : FlagDiagnosticChangedEventArgs) {
184
+ let value = args.value // Boolean indicating new value for CameraStartTimedOut
185
+ }
186
+
187
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
188
+ didChangeSpeakerVolumeIsZeroValue args : FlagDiagnosticChangedEventArgs) {
189
+ let value = args.value // Boolean indicating new value for SpeakerVolumeIsZero
190
+ }
191
+
192
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
193
+ didChangeNoSpeakerDevicesEnumeratedValue args : FlagDiagnosticChangedEventArgs) {
194
+ let value = args.value // Boolean indicating new value for NoSpeakerDevicesEnumerated
195
+ }
196
+
197
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
198
+ didChangeNoMicrophoneDevicesEnumeratedValue args : FlagDiagnosticChangedEventArgs) {
199
+ let value = args.value // Boolean indicating new value for NoMicrophoneDevicesEnumerated
200
+ }
201
+
202
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
203
+ didChangeSpeakingWhileMicrophoneIsMutedValue args : FlagDiagnosticChangedEventArgs) {
204
+ let value = args.value // Boolean indicating new value for SpeakingWhileMicrophoneIsMuted
205
+ }
206
+
207
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
208
+ didChangeSpeakerNotFunctioningDeviceInUseValue args : FlagDiagnosticChangedEventArgs) {
209
+ let value = args.value // Boolean indicating new value for SpeakerNotFunctioningDeviceInUse
210
+ }
211
+
212
+ func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
213
+ didChangeMicrophoneNotFunctioningDeviceInUseValue args : FlagDiagnosticChangedEventArgs) {
214
+ let value = args.value // Boolean indicating new value for MicrophoneNotFunctioningDeviceInUse
152
215
}
153
216
}
154
217
155
218
extension CallObserver : NetworkDiagnosticsDelegate {
156
219
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
157
- didChangeBooleanDiagnosticValue args : NetworkBooleanDiagnosticChangedEventArgs) {
158
- let diagnostic = args.diagnostic // Which network diagnostic value is changing.
159
- let value = args.value // Boolean indicating new value.
220
+ didChangeNoNetworkValue args : FlagDiagnosticChangedEventArgs) {
221
+ let value = args.value // Boolean indicating new value for NoNetwork
160
222
// Handle the diagnostic event value changed...
161
223
}
162
224
163
225
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
164
- didChangeQualityDiagnosticValue args : NetworkQualityDiagnosticChangedEventArgs) {
165
- let diagnostic = args.diagnostic // Which network diagnostic value is changing.
166
- let value = args.value // DiagnosticQuality indicating the new value.
226
+ didChangeNetworkReconnectValue args : QualityDiagnosticChangedEventArgs) {
227
+ let value = args.value // Boolean indicating new value for NetworkReconnect
228
+ // Handle the diagnostic event value changed...
229
+ }
230
+
231
+ func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
232
+ didChangeNetworkSendQualityValue args : QualityDiagnosticChangedEventArgs) {
233
+ let value = args.value // Quality scale indicating new value for NetworkSendQuality
234
+ // Handle the diagnostic event value changed...
235
+ }
236
+
237
+ func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
238
+ didChangeNetworkReceiveQualityValue args : QualityDiagnosticChangedEventArgs) {
239
+ let value = args.value // Quality scale indicating new value for NetworkReceiveQuality
240
+ // Handle the diagnostic event value changed...
241
+ }
242
+
243
+ func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
244
+ didChangeNetworkRelaysNotReachableValue args : FlagDiagnosticChangedEventArgs) {
245
+ let value = args.value // Quality scale indicating new value for NetworkRelaysNotReachable
167
246
// Handle the diagnostic event value changed...
168
247
}
169
248
}
@@ -185,44 +264,43 @@ self.networkDiagnostics?.delegate = self.callObserver
185
264
``` java
186
265
DiagnosticsCallFeature diagnosticsCallFeature = call. feature(Features . DIAGNOSTICS_CALL );
187
266
188
- /* NetworkQualityDiagnostic */
189
- NetworkQualityDiagnosticChangedListener networkQualityChangedListener = (NetworkQualityDiagnosticChangedEvent args) - > {
190
- NetworkDiagnosticType diagnostic = args. getDiagnostic();
191
- DiagnosticQuality value = args. getValue();
192
- // Handle the diagnostic event value changed...
267
+ /* NetworkDiagnostic */
268
+ FlagDiagnosticChangedListener listener = (FlagDiagnosticChangedEvent args) - > {
269
+ Boolean mediaValue = args. getValue();
270
+ // Handle new value for no network diagnostic.
193
271
};
194
272
195
- NetworkDiagnostics networkDiagnostics = diagnosticsCallFeature. getNetwork ();
196
- networkDiagnostics. addOnNetworkQualityDiagnosticChangedListener(networkQualityChangedListener );
273
+ NetworkDiagnostics networkDiagnostics = diagnosticsCallFeature. getNetworkDiagnostics ();
274
+ networkDiagnostics. addOnNoNetworkChangedListener(listener );
197
275
198
276
// To remove listener for network quality event
199
- networkDiagnostics. removeOnNetworkQualityDiagnosticChangedListener(networkQualityChangedListener );
277
+ networkDiagnostics. removeOnNoNetworkChangedListener(listener );
200
278
201
- /* NetworkBooleanDiagnostic */
202
- NetworkBooleanDiagnosticChangedListener networkBooleanChangedListener = ( NetworkBooleanDiagnosticChangedEvent args) - > {
203
- NetworkDiagnosticType diagnostic = args . getDiagnostic();
204
- Boolean value = args. getValue();
205
- // Handle the diagnostic event value changed.. .
279
+ // Quality Diagnostics
280
+ DiagnosticsCallFeature diagnosticsCallFeature = call . feature( Features . DIAGNOSTICS_CALL );
281
+ QualityDiagnosticChangedListener listener = ( QualityDiagnosticChangedEvent args) - > {
282
+ DiagnosticQuality diagnosticQuality = args. getValue();
283
+ // Handle new value for network reconnect diagnostic .
206
284
};
207
285
208
- NetworkDiagnostics networkDiagnostics = diagnosticsCallFeature. getNetwork ();
209
- networkDiagnostics. addOnNetworkBooleanDiagnosticChangedListener(networkBooleanChangedListener );
286
+ NetworkDiagnostics networkDiagnostics = diagnosticsCallFeature. getNetworkDiagnostics ();
287
+ networkDiagnostics. addOnNetworkReconnectChangedListener(listener );
210
288
211
- // To remove listener for network boolean event
212
- networkDiagnostics. removeOnNetworkBooleanDiagnosticChangedListener(networkBooleanChangedListener );
289
+ // To remove listener for media flag event
290
+ networkDiagnostics. removeOnNetworkReconnectChangedListener(listener );
213
291
214
- /* MediaBooleanDiagnostic */
215
- MediaBooleanDiagnosticChangedListener mediaBooleanChangedListener = ( MediaBooleanDiagnosticChangedEvent args) - > {
216
- MediaDiagnosticType diagnostic = args . getDiagnostic();
217
- Boolean value = args. getValue();
218
- // Handle the diagnostic event value changed.. .
292
+ /* MediaDiagnostic */
293
+ DiagnosticsCallFeature diagnosticsCallFeature = call . feature( Features . DIAGNOSTICS_CALL );
294
+ FlagDiagnosticChangedListener listener = ( FlagDiagnosticChangedEvent args) - > {
295
+ Boolean mediaValue = args. getValue();
296
+ // Handle new value for speaker not functioning diagnostic .
219
297
};
220
298
221
299
MediaDiagnostics mediaDiagnostics = diagnosticsCallFeature. getMedia();
222
- mediaDiagnostics. addOnMediaBooleanDiagnosticChangedListener(mediaBooleanChangedListener );
300
+ mediaDiagnostics. addOnSpeakerNotFunctioningChangedListener(listener );
223
301
224
302
// To remove listener for media flag event
225
- mediaDiagnostics. removeOnMediaDiagnosticTypeChangedListener(mediaBooleanChangedListener );
303
+ mediaDiagnostics. removeOnSpeakerNotFunctioningChangedListener(listener );
226
304
227
305
```
228
306
@@ -231,44 +309,43 @@ mediaDiagnostics.removeOnMediaDiagnosticTypeChangedListener(mediaBooleanChangedL
231
309
- Implement listeners for diagnostic events.
232
310
233
311
``` csharp
234
- private async void Call__OnNetworkQualityDiagnosticsChanged (object sender , NetworkQualityDiagnosticChangedEventArgs args )
312
+ private async void Call__OnNoNetworkChanged (object sender , FlagDiagnosticChangedEventArgs args )
235
313
{
236
- var diagnostic = args .Diagnostic ;
237
- var value = args .Value ;
238
- // Handle the diagnostic event value changed...
314
+ var value = args .Value ;
315
+ // Handle the diagnostic event value changed...
239
316
}
240
317
241
- private async void Call__OnNetworkBooleanDiagnosticChanged (object sender , NetworkBooleanDiagnosticChangedEventArgs args )
242
- {
243
- var diagnostic = args .Diagnostic ;
244
- var value = args .Value ;
245
- // Handle the diagnostic event value changed...
246
- }
318
+ // Listen to other network diagnostics
247
319
248
- private async void Call__OnMediaBooleanDiagnosticChanged (object sender , MediaBooleanDiagnosticChangedEventArgs args )
320
+ private async void Call__OnMediaSpeakerNotFunctioningChanged (object sender , FlagDiagnosticChangedEventArgs args )
249
321
{
250
- var diagnostic = args .Diagnostic ;
251
- var value = args .Value ;
252
- // Handle the diagnostic event value changed...
322
+ var value = args .Value ;
323
+ // Handle the diagnostic event value changed...
253
324
}
325
+
326
+ // Listen to other media diagnostics
254
327
```
255
328
256
329
- Set event methods for listening to events.
257
330
258
331
``` csharp
259
- this .diagnosticsCallFeature = ( DiagnosticsCallFeature ) call .GetCallFeatureExtension ( HandleType . DiagnosticsCallFeature ) ;
332
+ this .diagnosticsCallFeature = call .Features . Diagnostics ;
260
333
this .networkDiagnostics = diagnosticsCallFeature .Network ;
261
334
this .mediaDiagnostics = diagnosticsCallFeature .Media ;
262
335
263
- this .networkDiagnostics .OnNetworkQualityDiagnosticChanged += Call__OnNetworkQualityDiagnosticsChanged ;
264
- this .networkDiagnostics .OnNetworkBooleanDiagnosticChanged += Call__OnNetworkBooleanDiagnosticChanged ;
265
- this .mediaDiagnostics .OnMediaBooleanDiagnosticChanged += Call__OnMediaBooleanDiagnosticChanged ;
336
+ this .networkDiagnostics .NoNetworkChanged += Call__OnNoNetworkChanged ;
337
+ // Listen to other network events as well ...
338
+
339
+ this .mediaDiagnostics .SpeakerNotFunctioningChanged += Call__OnMediaSpeakerNotFunctioningChanged ;
340
+ // Listen to other media events as well ...
266
341
267
342
// Removing listeners
268
343
269
- this .networkDiagnostics .OnNetworkQualityDiagnosticChanged -= Call__OnNetworkQualityDiagnosticsChanged ;
270
- this .networkDiagnostics .OnNetworkBooleanDiagnosticChanged -= Call__OnNetworkBooleanDiagnosticChanged ;
271
- this .mediaDiagnostics .OnMediaBooleanDiagnosticChanged -= Call__OnMediaBooleanDiagnosticChanged ;
344
+ this .networkDiagnostics .NoNetworkChanged -= Call__OnNoNetworkChanged ;
345
+ // Remove the other listeners as well ...
346
+
347
+ this .mediaDiagnostics .SpeakerNotFunctioningChanged -= Call__OnMediaSpeakerNotFunctioningChanged ;
348
+ // Remove the other listeners as well ...
272
349
273
350
```
274
351
@@ -316,13 +393,13 @@ console.log(
316
393
317
394
### Native / iOS SDK
318
395
319
- - Get the latest diagnostic values that were raised. If a we still didn't receive a value for the diagnostic, ` nil ` is returned.
396
+ - Get the latest diagnostic values that were raised. If we still didn't receive a value for the diagnostic, ` nil ` or ` .unknown ` is returned.
320
397
321
398
``` swift
322
399
let lastSpeakerNotFunctionValue = self .mediaDiagnostics .latest .speakerNotFunctioning // Boolean?
323
400
let lastNetworkRelayNotReachableValue = self .networkDiagnostics .latest .networkRelaysNotReachable // Boolean?
324
- let lastReceiveQualityValue = self .networkDiagnostics .lates .networkReceiveQuality // DiagnosticQuality? (.good, .poor, .bad)
325
-
401
+ let lastReceiveQualityValue = self .networkDiagnostics .latest .networkReceiveQuality // DiagnosticQuality (.good, .poor, .bad)
402
+ // or .unknown if there isn't a diagnostic for this.
326
403
```
327
404
328
405
### Native / Android SDK
@@ -334,29 +411,29 @@ DiagnosticsCallFeature diagnosticsCallFeature = call.feature(Features.DIAGNOSTIC
334
411
NetworkDiagnostics networkDiagnostics = diagnosticsCallFeature. getNetwork();
335
412
MediaDiagnostics mediaDiagnostics = diagnosticsCallFeature. getMedia();
336
413
337
- LatestNetworkDiagnostics latestNetwork = networkDiagnostics. getLatest();
338
- java.util.Optional<Boolean > lastNetworkValue = latestNetwork. getNoNetwork();
339
- java.util.Optional<DiagnosticQuality > lastReceiveQualityValue = latestNetwork. getNetworkReceiveQuality();
340
-
414
+ NetworkDiagnosticValues latestNetwork = networkDiagnostics. getLatest();
415
+ Boolean lastNetworkValue = latestNetwork. isNoNetwork(); // null if there isn't a value for this diagnostic.
416
+ DiagnosticQuality lastReceiveQualityValue = latestNetwork. getNetworkReceiveQuality(); // UNKNOWN if there isn't a value for this diagnostic.
341
417
342
- LatestMediaDiagnostics latestMedia = networkDiagnostics. getLatest();
343
- java.util.Optional< Boolean > lastSpeakerNotFunctionValue = latestMedia. getSpeakerNotFunctioning ();
418
+ MediaDiagnosticValues latestMedia = networkDiagnostics. getLatest();
419
+ Boolean lastSpeakerNotFunctionValue = latestMedia. isSpeakerNotFunctioning (); // null if there isn't a value for this diagnostic.
344
420
345
421
// Use the last values ...
346
422
347
423
```
348
424
349
425
### Native / Windows SDK
350
426
351
- - Get the latest diagnostic values that were raised in current call. If a we still didn't receive a value for the diagnostic, an error is thrown .
427
+ - Get the latest diagnostic values that were raised in current call. If a we still didn't receive a value for the diagnostic, ` null ` or ` .unknown ` for is returned .
352
428
353
429
``` csharp
354
- this .diagnosticsCallFeature = ( DiagnosticsCallFeature ) call .GetCallFeatureExtension ( HandleType . DiagnosticsCallFeature ) ;
430
+ this .diagnosticsCallFeature = call .Features . Diagnostics ;
355
431
this .networkDiagnostics = diagnosticsCallFeature .Network ;
356
432
this .mediaDiagnostics = diagnosticsCallFeature .Media ;
357
433
358
- bool ? lastSpeakerNotFunctionValue = this .mediaDiagnostics .Latest .SpeakerNotFunctioning ; // Boolean?
359
- bool ? lastNetworkRelayNotReachableValue = this .networkDiagnostics .Latest .NetworkRelaysNotReachable ; // Boolean?
360
- DiagnosticQuality ? lastReceiveQualityValue = this .networkDiagnostics .Latest .NetworkReceiveQuality ; // DiagnosticQuality? (.good, .poor, .bad)
434
+ bool ? lastSpeakerNotFunctionValue = this .mediaDiagnostics .GetLatest ().IsSpeakerNotFunctioning ; // Boolean?
435
+ bool ? lastNetworkRelayNotReachableValue = this .networkDiagnostics .GetLatest ().IsNetworkRelaysNotReachable ; // Boolean?
436
+ DiagnosticQuality lastReceiveQualityValue = this .networkDiagnostics .GetLatest ().NetworkReceiveQuality ; // DiagnosticQuality (.good, .poor, .bad)
437
+ // or .unknown if there isn't a diagnostic for this.
361
438
362
439
```
0 commit comments