VoIP Resources VoIP Fundamentals Developer Blog

Build and Manage WebRTC Applications with SIP.js and Callstats.io

by Jenny Liang

Developers can now use SIP.js with callstats.io to monitor and troubleshoot calls. Learn more about how this integration can benefit your WebRTC apps.

These days, developers working with real-time web-based communications have more resources than ever before. But what tools are best for analyzing the performance of WebRTC apps? We recently integrated with callstats.io, a cloud-based monitoring and management service for WebRTC so that developers using SIP.js can monitor and analyze key metrics and errors on their calls.

What is SIP.js?

SIP.js - An open-source SIP Javascript library for developers

SIP.js is our open source SIP JavaScript library for developers looking to leverage WebRTC for real-time, web-based communications. Developers can use SIP.js to add secure voice and video calling, text messaging, data transfer, video conferencing, and more to their web apps.

What is callstats.io?

Callstats.io

Callstats.io is a call quality analytics tool and monitoring platform for WebRTC conferences. Developers can use callstats.io to diagnose issues, track metrics and improve real-time performance of their applications.

Callstats.io works with several 3rd party WebRTC SDK and PaaS solutions, including AppRTC, jitsi.org, twilio, and others. Developers can select a plan based on the volume of data points and other preferences to improve, operate, and scale real-time communication apps.

Why use callstats.io with SIP.js?

With callstats.io and SIP.js, developers are able to dig deeper into individual errors and different error categories for call failures. This can be used to help understand if errors are related to signaling, media source, SDP generation, SDP negotiation, ICE connection, or transport, for example.

Developers can also search for a particular call and identify the exact reason for call errors, as well as in-depth analysis of the failure. In addition to specific errors, developers can monitor other conference level metrics, such as RTT, throughput, and jitter.

callstats.io sample dashboard

Finally, callstats.io offers an analytics dashboard that helps present complex call data in a visual, user-friendly format that caters to many different user groups. This tool can be used by various teams, from DevOps and engineers to product managers and customer support specialists. Users can also set customized notifications on failures so that the DevOps team can subsequently respond to issues faster and resolve problems by analyzing the callstats.io dashboard data.

How do you integrate callstats.io with SIP.js?

Callstats.io is integrated with v0.7.8 of SIP.js. The full documentation for integrating the callstats-shim is available here: https://github.com/callstats-io/callstats-sipjs.

Integrating in HTML

<!DOCTYPE html>
<html>
 <head>
  <!-- Load callstats.io library (it provides window.callstats) -->
  <script src="https://api.callstats.io/static/callstats.min.js"></script>
  <!-- Load SIPjs library -->
  <script src="js/sipjs.js"></script>
  <!-- Load callstats-sipjs library (it provides window.callstatssipjs) -->
  <script src="js/callstats-sipjs.js"></script>
  <!-- Load our app code -->
  <script src="js/app.js"></script>
 </head>
 <body>
  <!-- your stuff -->
 </body>
</html>

Integrating in app.js

// Create a SIP.UA instance
var ua = new SIP.UA(config);

// Run the callstats-sipjs library for this UA
callstatssipjs(ua, AppID, AppSecret);

If you have any questions or comments about the integration, you can contact the callstats.io team at support@callstats.io.

Analyze and Troubleshoot Your WebRTC Calls

By taking advantage of the callstats.io integration with SIP.js, developers can add monitoring and analytics right from the start of development as well as in production applications.

The integration offers diverse data on conference metrics and call quality that can be used for many purposes, from debugging and understanding app errors to target setting and configuration optimization.

Learn more about VoIP Fundamentals