Learn about our integration with Amazon Connect here !

To get featured on www.callstats.io/integrate/ as a WebRTC service provider, we need three things from you:

  1. Instructions on how to integrate. We’ll write a blog post or an instructions page based on this.
  2. Code, usually there is a shim or a link to a Github library
  3. A logo

To write the coded needed create a working integration you can follow the instructions below. When you are ready to get listed or have questions about integrating, email us at growth[at]callstats.io (our CEO also reads this email).

Integration instructions

Each WebRTC SDK has its quirks, and we often see an SDK provider hide the peerconnection and wrap their library around the peerconnection. Callstats.io relies on having access to the peerconnection object to access getStats() and the eventhandlers.

Step 1: provide access to the peerconnection.

Step 1-bis: If access to the peerconnection cannot be granted, the SDK can create a fake peerconnection. The fake peerconnection can be passed to callstats.js. However, callstats.js needs access to getStats() and some event handlers.

The event handlers need to be mapped to corresponding callbacks in callstats.js, they are listed below:

  • onIceCandidate maps to iceCandidateFoundCallback
  • onIceCandidateStateChange maps to iceConnectionStateChangeCallback
  • onSignalingStateChange maps to pcSignalingStateChangeCallback

For example the mapping can be done using addEventListener as follows:

fakePcObject.addEventListener('icecandidate', iceCandidateFoundCallback, false);
fakePcObject.addEventListener('iceconnectionstatechange', iceConnectionStateChangeCallback, false);
fakePcObject.addEventListener('signalingstatechange', pcSignalingStateChangeCallback, false);

Additionally, callstats.js routinely polls the peerconnection for state
information, they are listed below:

  • fakePcObject.signallingstate
  • fakePcObject.icegatheringstate
  • fakePcObject.iceconnectionstate

If configured to collect SDP, callstats.js will need access to:

  • fakePcObject.localDescription.sdp
  • fakePcObject.remoteDescription.sdp

Step 2: provide access to the callbacks for reportError() from the following WebRTC functions:

  • getUserMedia
  • createOffer
  • createAnswer
  • setLocalDescription
  • setRemoteDescription
  • addIceCandidate

Optional: make sure RTCP termination is enabled. In some cases, middleboxes need to be explicitly configured to send RTCP Receiver Reports, enable them. Without these the browser endpoints will not be able to measure RTT, fractional losses, jitter, etc.

Reference Implementation

Below are a few example integrations (not a complete list):

Feedback

The information on this page is based on our experience with different WebRTC SDK providers. If your WebRTC SDK functions differently, send your feedback and suggestions to sdk-support[at]callstats.io.