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

JsSIP.UA disconnected event enhancements #163

Closed
pontello opened this issue Sep 26, 2013 · 11 comments
Closed

JsSIP.UA disconnected event enhancements #163

pontello opened this issue Sep 26, 2013 · 11 comments

Comments

@pontello
Copy link

When disconnected event is fired, jssip try unlimited times to recover the transport and there is no way to tell him to stop!

Suggestions:

  • Add a new UA configuration parameter to enable/disable the transport recover
  • If disconnected event is fired, JsSIP.UA.stop() should also stop the transport recover

What do we have right now is an infinite attempt to recover the transport, even after we call JsSIP.UA.stop() method!

@jmillan
Copy link
Member

jmillan commented Sep 26, 2013

UA.stop() should stop re-connection attempts. If it does not do it, then it is a bug.

@saghul
Copy link
Contributor

saghul commented Sep 26, 2013

When would you like not to recover from a transport error? I agree that UA.stop should stop the recovery process.

@pontello
Copy link
Author

I have one app that connect, make call and disconnect... If I am not able to connect to the server I just inform the user that we have a network error and the call is cancelled.... The process will be repeated only if user try to make a call again...

So, for this use case, I don't what to try to connect again because the connection is not important anymore after some seconds...

@saghul
Copy link
Contributor

saghul commented Sep 26, 2013

Can't you stop the UA after the call is finished?

@pontello
Copy link
Author

Yes, sure, but JsSIP.UA.stop() don't stop the transport recover process... My call was not even started on this case...

@jmillan
Copy link
Member

jmillan commented Sep 26, 2013

Yep, that is the issue. It is being solved.

@saghul
Copy link
Contributor

saghul commented Sep 26, 2013

Of, course, that is, assuming UA.stop actually works :-) Looks like @jmillan is on it 👍

@pontello
Copy link
Author

Thank you guys!

@jmillan
Copy link
Member

jmillan commented Sep 26, 2013

Thank you for reporting @nilsonfreitas

@pontello
Copy link
Author

@jmillan

Your fix is not working... Please take a look into UA.prototype.recoverTransport method..

  window.setTimeout(
    function(){
      ua.transportRecoverAttempts = count + 1;
      new JsSIP.Transport(ua, server);
    }, nextRetry * 1000);

This timeout has to be cleared as well... Following code will still send unlimited attempts to reconnect:

uac.once('disconnected', function(e){ 
    uac.stop();
});

jmillan added a commit that referenced this issue Sep 27, 2013
- EventEmitter does not emit in the same execution iteration to avoid inestability. Thanks @ibc
@jmillan
Copy link
Member

jmillan commented Sep 27, 2013

You are absolutely right @nilsonfreitas,

Such timer was not being cleaned. Its done now. Please, give it a try.

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

No branches or pull requests

3 participants