Our integration enables UWP developers to monitor real-time voice, video, and data streams in applications ranging from virtual and augmented reality to gaming. UWP powers popular Microsoft Xbox game consoles and HoloLens mixed reality smart glasses, as well as Windows 10 desktop and ARM-powered mobile devices.
The callstats.io integration allows developers to easily monitor and troubleshoot any application that relies on real-time communications. We collect over 500 metrics every few seconds from a UWP endpoint and use AI-driven algorithms to detect network problems and automatically troubleshoot issues.
Integration Steps
Step 1: Create an account with callstats.io.
Follow the integrations steps below:
a. Create the Organization.
b. Navigate to the apps tab to create an app and enter the SDK as other UWP.
c. From the left side panel, click on App Settings and navigate to the Security tab
d. Click on New credentials and choose a label for the key.
e. Select the key type as ECDSA and enter the public key.
f. Under the key details, click on View for the credential.
Step 2: Authenticate with callstats.io
To authenticate with callstats.io, you need to generate cryptographic key and upload the public key to the dashboard. Follow the instructions in the readme.md. You should have a Config class and .p12 certificate in your project, which is all you need to authenticate to the callstats.io REST API.
Step 3: Reference the Org.WebRTC NuGet package
Reference the Org.WebRtc.Callstats NuGet package available here in your project.
Step 4: Add the PeerCC-Sample files to your project
-
If you are using PeerCC sample, you can find classes for collecting data from PeerCC and WebRTC in the Stats folder. You may use this code as an example for your implementation. Add the files in the PeerCC-Sample repo to your project:
-
PeerConnectionControllerStateChange.cs: Tracks RTCPeerConnection state changes and collects data from peer connection states for submission to callstats.io.
-
StatsController.cs: Collects data from the entire PeerCC sample and uses the Org.WebRtc.Callstats library to send prepared data to the callstats.io REST API.
-
WebRtcStats.cs: Prepares statistics obtained from RTCPeerConnection for communication to callstats.io via the REST API.
Step 5: Initialize callstats.io
Initialize callstats.io service and send SDP and application errors via the StatsController.
For an example, see Conductor.cs in PeerCC-Sample.
Step 6: Handle ICE state changes on RTCPeerConnection
Handle ICE state changes on RTCPeerConnection and use PeerConnectionStateChange to send data to the service:
_peerConnection.OnIceGatheringStateChange += async() =>
{
awaitPeerConnectionStateChange.StatsOnIceGatheringStateChange(_peerConnection);
Debug.WriteLine("Conductor: Ice connection state change, gathering-state=" +_peerConnection.IceGatheringState.ToString().ToLower());
};
_peerConnection.OnIceConnectionStateChange += async () =>
{
if (_peerConnection != null)
await
PeerConnectionStateChange.StatsOnIceConnectionStateChange(_peerConnection);
else
{
await PeerConnectionStateChange.PeerConnectionClosedStateChange();
ClosePeerConnection();
}
};
Send application level events for audio muting and unmuting to StatsController. For an example, see MainViewModel.cs in PeerCC-Sample.
Comments
0 comments
Please sign in to leave a comment.