callstats.io

The callstats Developer Hub

Welcome to the callstats developer hub. You'll find comprehensive guides and documentation to help you start working with callstats as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides    API Reference

SCT Notifications

The connection notification callback (pctConnectionQualityChange)

The pctConnectionQualityChangeCallback function is set with the on() functionality. The callback is invoked when the precall tests are finished for all the TURN credentials given in startPrecallTest(). Connection notification gives the insight in plain english. The following table provides the list of parameters incorporated in pctConnectionQualityChange callback functoin:

ParamsTypeDescription
timestampdoubleFIXME: this should be consistent with the other APIS
deviceIdstringUUID associated with this userID
notificationIDstringrepresents the hash of a notification, makes it easy to reference
connectivityCodeintsee connectivity table below
connectivitystringsee connectivity table below
statusCodeintsee status table below
statusstringsee status table below
summaryCodeintsee summary table below
summarystringsee summary table below
notificationCodeintA code that ties to the notification. This allows you to override the text for your usecase. See notification table
notificationstringInsight on connection quality in English. See notification table
networkTypestringRTCNetworkType enum
localIpstringIP address associated with the userID, related to address in webrtc-stats. FIXME: call this consistently
ispstringgeo resolved localIp to this ISP
citystringgeo resolved localIp to this City
countrystringgeo resolved localIp to this Country
csjs.on('pctConnectionQualityChange', results => {
  console.log(results);
})

//console log output
{
// FIXME: copy the output from a test or similar
}

SCT notification messages

Smart Connectivity Test module (SCT) of callstats.js API is now equipped with a machine learning pipeline. ML pipeline generates notifications about the abnormal changes in the network parameters and alerts the user about his/her network condition before joining a call. Each SCT notification message generated by callstats.js API consists of four groups of information: Connectivity, Status, Summary and Message. The following tables represent underlying messages of each group and the codes.

Connectivity

If the connection has been successful or not

Connectivity CodeDescription
1no connection
2no media device
3success

Status

Overall condition of network

Status CodeDescription
1bad
2poor
3fair
4good
5excellent

Summary

This summary of the situation that can be used for listing and history reporting. You can map the codes to colors.

Summary CodeColorDescription
10redbad connection
20redlossy network
30redhigh latency
40redinsufficient bandwidth
50amber fairconnection is Fair with minor issues, Poor bandwidth (audio-only and thumbnail video)
55amber fairconnection is Fair with minor issues, Fair bandwidth (good audio, poor video)
60amber fairconnection is Fair with minor issues, Good bandwidth (good audio and fair video)
65amber fairconnection is Fair with minor issues (bandwidth excellent)
70amber goodconnection is Good, Poor bandwidth (audio-only and thumbnail video)
75amber goodconnection is Good, Fair bandwidth (good audio, poor video)
80-89reserved-
90greenconnection and bandwidth are both good
95greenexcellent network

Notification

The main message that appears as a notification on the application

Notification CodeDescription
100We expect your call quality to be really terrible
200You are in a very lossy network
300Your round trip time seems to be too high for good quality calls, but it might be because you are located far from our test servers
400Your bandwidth is insufficient for both audio and video calls
500With current bandwidth you can have audio-only and thumbnail video. Your network is unstable and you might experience minor issues
550Current bandwidth is enough for good audio quality, but poor video quality or screen sharing. Your network is unstable and you might experience minor issues
600Your bandwidth is enough for good audio and fair video quality, but not enough for screen sharing quality. Your network is unstable and you might experience minor issues
650Your network is unstable and you might experience minor issues
700With current bandwidth you can have audio-only and thumbnail video
750Current bandwidth is enough for good audio quality, but poor video quality or screen sharing
800-899reserved
900Your bandwidth is enough for good audio and fair video quality, but not enough for screen sharing quality
950You are in a good network condition

In order to suppress or send the messages on the UI side, message codes should be considered. For example, to avoid overwhelming the users with repetitive notifications, the message codes must be tracked. For example, if the current message code is 100 and is the same as the previous one, the notification could be surpressed.

Updated 2 days ago


SCT Notifications


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.