JsSIP icon indicating copy to clipboard operation
JsSIP copied to clipboard

Fix WebSocketInterface ondisconnect typings

Open makstheimba opened this issue 4 years ago • 1 comments

Hi!

I wanted to write my own WebSocketInterface and use reconnection mechanism from JsSIP. However to use it I need to call ondisconnect from my code to trigger transport reconnect on JsSIP. However I'm not able to do it since typings for ondisconnect are wrong.

Relevant lines of code: Here socket's ondisconnect gets bind to Transport's _onDisconnect - https://github.com/versatica/JsSIP/blob/master/lib/Transport.js#L146 Transport's _onDisconnect is declared with 3 arguments and not a one argument object - https://github.com/versatica/JsSIP/blob/master/lib/Transport.js#L311

I believe that these typings were probably mismatched for the Transport's ondisconnect, which has exactly that interface -https://github.com/versatica/JsSIP/blob/master/lib/Transport.js#L314

makstheimba avatar Oct 14 '21 14:10 makstheimba

@jmillan Hi! Can you merge that one please? It's pretty straightforward :)

makstheimba avatar Nov 12 '21 10:11 makstheimba