Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a JS SIP library using a non-websockets transport?

Tags:

node.js

sip

jssip

This question was asked by somebody on Quora here but there was no answer. Is there any work around solution for this, other than changing the source code of jsSip?

The issue is that most JS SIP libraries that work with webRTC do so through websockets (RFC 7118). ALso, Chrome now requires getUserMedia interface to be run on a https which imposes additional requirements on the SIP server side. The SIP server must also support websockets, SRTP, DTLS, etc.

All this makes sense if the SIP calls are made through a browser, either as a signalling mechanism for webRTC or non-webRTC telephony calls through a web page.

However, when the SIP server is on the local network and the SIP call has to be initiated from an app server, all these requirements are no longer applicable. It should be possible to make JS SIP calls over plain UDP without the need to run a http server with the SIP server as the http server in my case is integrated with the application server itself.

Scenario 1 as supported bymost JS SIP libraries:
JSSIP (in HTML page <------>websockets<---->[http-builtin with SIP server]<---->PSTN

Scenario 2 which applies to the question:
JSSIP (in HTML page <--https---->app-server with https-server<----local net--->[SIP server] <-----> PSTN  
like image 330
Sunny Avatar asked Apr 18 '16 20:04

Sunny


1 Answers

It looks like you have built your own already, but I was looking for a similar thing and found this: https://github.com/davehorton/drachtio

I haven't tried it yet, but it is designed to be middleware on a nodejs server and it looks like it supports the older non websockets model.

like image 76
Nick K. Avatar answered Oct 13 '22 12:10

Nick K.