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
clearNotificationboolboolean value, when true means that notification should be cleared on UI
timestampdoubletimestamp of the notification
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 notification text for your use-case. 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
csjs.on('pctConnectionQualityChange', results => {
  console.log(results);
})

//console log output
{
"clearNotification": true
"timestamp": "405241500"
"notificationID": "766172756e6c6f76657363616c6c7374617473"
"connectivityCode": 3
"connectivity": "success"
"statusCode": 4
"status": "good"
"summaryCode": 75
"summary": "connection is Good, Fair bandwidth (good audio, poor video)"
"notificationCode": 700
"notification": "Current bandwidth is enough for good audio quality, but poor video quality or screen sharing"
"networkType": "wifi"
"localIp": "194.110.84.59"
}

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

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

Summary CodeColorDescription
10redbad connection
20redHigh packet loss
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 very poor
200You have poor network conditions (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 notification codes must be tracked. For example, if the current notification code is 100 and is the same as the previous one, the notification could be suppressed.

Updated 11 months 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.