Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared/persistent websockets on multiple tabs #1060

Open
dberardo-com opened this issue Nov 13, 2023 · 4 comments
Open

shared/persistent websockets on multiple tabs #1060

dberardo-com opened this issue Nov 13, 2023 · 4 comments

Comments

@dberardo-com
Copy link

it would be nice to have the following possibilities:

  • use the same registration / session for multiple tabs on the same browser
  • persist websocket session between refresh, so that the user does not need to register each time the page is closed/refreshed
@Bill-Niz
Copy link

Bill-Niz commented Nov 13, 2023

@dberardo-com
Copy link
Author

would this be a solution for both problems above ?

and how can service workers be used with this library ? i had the same thought of using service workers, but i dont get how to include it in this library ...should i fork it in order to achieve this ?

@Bill-Niz
Copy link

Maybe setting up sipjs inside service worker
Or setup custom websocket transport inside serve worker and use it in sipjs

@dberardo-com
Copy link
Author

dberardo-com commented Nov 14, 2023

i need to use sipjs in the client application, so the first option you are suggesting sound too complex to mantain for me, meaning that the interaction with the service worker would need to be fully event based and that would mean too much refactoring.
as for this one:

Or setup custom websocket transport inside serve worker and use it in sipjs

i am not sure i got it, do you mean opening up a websocket in the webworker and then pass its reference to the specific window that needs it ? is this even possible (i am thinking security limits or so)?

and how to pass the websoket object in the sipjs options ? is it allowed ?


also: what motivates this is the fact that SIP does not allow the same user to register twice (at least not in my case, let me know if this is not correct), and so the only way to let the user use sipjs on multiple tabs at the same time needs to be via a shared websocket as we cannot have 2 parallel registration with the same sipId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants