WebSocket disconnected (code: 1006)

3,721 views
Skip to first unread message

prity19...@gmail.com

unread,
Mar 22, 2016, 6:44:01 AM3/22/16
to SIP.js
var config = {
uri: '10...@192.168.X.XXX',
traceSip: true,
hackIpInContact: true,
hackViaTcp: true,
wsServers: 'ws://192.168.X.XXX:5066',
authorizationUser: '1000',
password: '1234'
};

userAgent = new SIP.UA(config);

I am using the default credentails and have replaced the IP with the local IP4 address. BUt i am still getting websocket connection error.

James Criscuolo

unread,
Mar 22, 2016, 9:24:38 AM3/22/16
to SIP.js, prity19...@gmail.com
Hi prity,
  What is the software you are running as the websocket server? It could be something on that end. When these errors come up for me, it's usually because I haven't accepted the certificate for my web socket server (navigate to https://192.168.X.XXX and accept) and I am not attempting to connect securely (change 'ws' to 'wss'). Unfortunately, 1006 is the generic disconnect code, so any information about it will probably be found in the logs of your websocket server itself.

Good luck,
James

prity19...@gmail.com

unread,
Mar 22, 2016, 9:31:14 AM3/22/16
to SIP.js, prity19...@gmail.com
I am trying to use FreeSwitch with Sip.js.

James Criscuolo

unread,
Mar 22, 2016, 9:41:43 AM3/22/16
to SIP.js, prity19...@gmail.com
I haven't been able to find anything definitive quickly, but if you are trying to connect from an https webpage (in Chrome this is necessary for getUserMedia to work), you need to use wss instead of ws. Outside of that, Freeswitch logs or ngrep'ing on your Freeswitch box should provide some insight into the problem.

prity19...@gmail.com

unread,
Mar 23, 2016, 6:38:08 AM3/23/16
to SIP.js
can freeswitch be installed on windows OS as well. ?

Eric Tamme

unread,
Mar 23, 2016, 9:09:10 AM3/23/16
to sip...@googlegroups.com
You should probably ask on a freeswitch mailing list.


On 03/23/2016 04:38 AM, prity19...@gmail.com wrote:
can freeswitch be installed on windows OS as well. ?


James Criscuolo

unread,
Mar 23, 2016, 9:20:00 AM3/23/16
to SIP.js
They have a confluence page on it, but that's about all I could tell you. We have a guide for installing Freeswitch, and that's all we've tested with, but I'm sure it would work with other environments. As Eric stated, a confident answer on that would come from the freeswitch mailing list.

prity19...@gmail.com

unread,
Mar 24, 2016, 4:43:03 AM3/24/16
to SIP.js
As per Freeswitch mailing list, freeswitch can be installed on windows. I have installed freeswitch. But when i try to follow the guide (http://sipjs.com/guides/server-configuration/freeswitch/)(of linking sip.js with freeswitch), the ws is unable to make a connection.

var config = {
uri: '10...@127.0.0.1',
traceSip: true,
register:true,
hackIpInContact: true,
hackViaTcp: false,
wsServers: 'ws://127.0.0.1:5066',


authorizationUser: '1000',
password: '1234'
};
userAgent = new SIP.UA(config);

logs : https://gist.github.com/anonymous/245eb2b605f774f37cd5

James Criscuolo

unread,
Mar 24, 2016, 9:58:20 AM3/24/16
to SIP.js, prity19...@gmail.com
Sip.js logs are not going to be helpful here unfortunately. I believe Chrome requires https (and thus wss), but outside of that freeswitch logs and ngrep'ing are probably your best bet here.
Reply all
Reply to author
Forward
0 new messages