SIP.js icon indicating copy to clipboard operation
SIP.js copied to clipboard

Provide delegate for websocket events

Open oomsveta opened this issue 3 years ago • 2 comments

Hello!

I would like to know if there is currently a way to catch websocket events, and if not, if it would be possible to provide one.

The handler onWebSocketClose calls the method transitionState, triggering a state change that can be listened to. This is currently what I use to detect the closing of the websocket. However, this doesn't provide access to the websocket close event, thus preventing me from having finer-grained error handling based on the close code sent by the server.

If possible, I would like to be able to define handlers for websocket events using the delegate when creating the user agent.

Thank you!

oomsveta avatar Jan 25 '22 16:01 oomsveta

This is not a support forum - try https://groups.google.com/g/sip_js instead

seanbright avatar Jan 25 '22 16:01 seanbright

This is actually a feature request. I admit that the title is probably misleading

oomsveta avatar Jan 25 '22 16:01 oomsveta

Relevant documentation to get you started...

  • https://github.com/onsip/SIP.js/blob/main/docs/transport/sip.js.transport.ws.md
  • https://github.com/onsip/SIP.js/blob/main/docs/api/sip.js.useragent.transport.md

But this is not a support forum, so any followup to the google group.

Thanks.

john-e-riordan avatar Sep 29 '22 19:09 john-e-riordan