SIP.js

SIP.js is a JavaScript library that helps developers add a full SIP signaling stack to their WebRTC applications. Originally developed by the OnSIP team on top of jsSIP, SIP.js remains an open source project open for further contributions.

Integration steps

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, localUserID, csInitCallback, csStatsCallback, configParams);