Skip to content

Registration blocks indefinitely when 401 Unauthorized is received as response to authenticated registration request #18

Description

@sischnei

Using SipPhone.register(...) with wrong credentials results in indefinitely blocking the calling thread and sending infinitely many REGISTER requests, if the other party responds with "401 Unauthorized" instead of "403 Forbidden".

The issue can be reproduced with pjsip on Asterisk 13, trying to register with invalid credentials. See the attached wireshark trace.

I think the solution could be as easy as checking the result of the authenticated registration message, and if it is a "401 Unauthorized" then exit the registration sending loop.

sip_registration_loop.zip

Activity

  1. gsaslis commented on Jan 30, 2018

    @gsaslis
    Contributor

    Hi @sischnei,

    Thanks a lot for raising this and apologies for not getting back to you sooner.
    Any chance you would still be interested enough in this, to have a go at providing a fix, through a PR ?

    Plz let me know if you need any help on that.

  2. added 2 commits that reference this issue on Jan 30, 2018
    5649e1e
    4c435fb
  3. sischnei commented on Jan 30, 2018

    @sischnei
    Author

    I created #25 which fixes the issue for me. However I was not able to write tests as I do not have the required setup to run the SipUnit tests.

  4. gsaslis commented on Jan 30, 2018

    @gsaslis
    Contributor

    Great stuff, thanks so much @sischnei !

    let me see if i can find someone to help out with that part.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions