SIP.js
SIP.js copied to clipboard
Provide delegate for websocket events
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!
This is not a support forum - try https://groups.google.com/g/sip_js instead
This is actually a feature request. I admit that the title is probably misleading
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.