use of SIP.js inside a Node.js as a webRTC audio client?

2,936 views
Skip to first unread message

SD

unread,
May 16, 2014, 1:13:58 PM5/16/14
to sip...@googlegroups.com
Does anyone know if its possible to run a javascript application that uses SIP.js inside of a Node.js server as a webRTC audio client?
Thanks!

Will Mitchell

unread,
May 16, 2014, 1:21:08 PM5/16/14
to sip...@googlegroups.com
I don't think any of us has tried this.  I know there are some dependencies on the `window` object, so you would probably have to make at least some modifications.  If you try it, let us know how it goes.  We'd be happy to pull in any changes or add it to the documentation if it works.

-Will

Joseph Frazier

unread,
Jul 11, 2014, 1:49:45 PM7/11/14
to sip...@googlegroups.com
As of version 0.6.0, SIP.js can run in Node.js, as long as the global WebSocket is appropriately defined. The following code will create an anonymous user agent capable of signaling, but not media.

cd /tmp
npm install ws
node
global.WebSocket = require('ws');
var SIP = require('./sip-0.6.0.js');
var ua = new SIP.UA({traceSip: true});

To add media, you'll need to write a custom MediaHandler that integrates with server-side WebRTC support (which may be feasible with projects like node-webrtc or Kurento).

Joseph
Message has been deleted

m0.inte...@gmail.com

unread,
Feb 27, 2016, 1:32:22 AM2/27/16
to SIP.js
Hey, just wondering if anyone has code available to make this work? I am trying to send a raw binary stream in node.js to sip.js

bezcl...@gmail.com

unread,
Oct 4, 2016, 4:50:27 AM10/4/16
to SIP.js
On Friday, May 16, 2014 at 7:13:58 PM UTC+2, SD wrote:
> Does anyone know if its possible to run a javascript application that uses SIP.js inside of a Node.js server as a webRTC audio client?
> Thanks!

I've been working on something similar. Best Route to go is to make a desktop app using electron. It encapsulates a chromium browser and a node server in one. You can then use jquery directly in your server app to manipulate a gui or make use of libraries like peerjs or sipjs within the server although it will still act as client on those libraries. You loose mobile support if you go this route though.

Also have a look at drachtio , its SIP middleware for node. So if you make use of peerjs or socket.io-stream then you can transport and make requests like any other SIP app. This makes your app more robust seeing as it will interface with any external sip clients too, audio and video gets transported to and from your clients in the same way.

Hope this helps.

halimaj...@gmail.com

unread,
Apr 4, 2018, 12:46:28 PM4/4/18
to SIP.js
Reply all
Reply to author
Forward
0 new messages