Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JsSIP, the JavaScript SIP library

0.6.21: Don't iterate arrays with ( to avoid problems with e…

…vil JS libraries that add stuff into the Array protptype.
latest commit 64f5979dbf
Iñaki Baz Castillo ibc authored

Build Status


Getting Started

The following simple JavaScript code creates a JsSIP User Agent instance and makes a SIP call:

// Create our JsSIP instance and run it:

var configuration = {
  'ws_servers': 'ws://',
  'uri': '',
  'password': 'superpassword'

var ua = new JsSIP.UA(configuration);


// Make an audio/video call:
var session = null;

// HTML5 <video> elements in which local and remote video will be shown
var selfView =   document.getElementById('my-video');
var remoteView =  document.getElementById('peer-video');

// Register callbacks to desired call events
var eventHandlers = {
  'progress': function(e){
    console.log('call is in progress');
  'failed': function(e){
    console.log('call failed with cause: '+;
  'ended': function(e){
    console.log('call ended with cause: '+;
  'confirmed': function(e){
    var local_stream = session.connection.getLocalStreams()[0];

    console.log('call confirmed');

    // Attach local stream to selfView
    selfView = JsSIP.rtcninja.attachMediaStream(selfView, local_stream);
  'addstream': function(e){
    var stream =;

    console.log('remote stream added');

    // Attach remote stream to remoteView
    remoteView = JsSIP.rtcninja.attachMediaStream(remoteView, stream);

var options = {
  'eventHandlers': eventHandlers,
  'mediaConstraints': {'audio': true, 'video': true}

session ='', options);

Want to see more? Check the full documentation at

Online Demo

Check our Tryit JsSIP online demo:

Website and Documentation


  • As Node module: $ npm install jssip
  • As Bower module: $ bower install jssip
  • Manually:


José Luis Millán

Iñaki Baz Castillo

Saúl Ibarra Corretgé


JsSIP is released under the MIT license.

Something went wrong with that request. Please try again.