I’ve had a bunch of extensions and multiple different phones and SIP clients able to login fine but recently I added extension 55 with username 55 and this user cannot login (REGISTER fails with 401 Unauthorized). I’ve tried two different SIP softphones and the password is correct. These same softphones can register with another extension/user.
It’s as if there is something else blocking this new extension/user to login.
401 Unauthorised is not a failure; it is a normal part of the registration process (and also the call initiation process). Also note that registration isn’t a log in; a phone can initiate calls without being registered. Registration tells the registrar where to send calls.
If the phone abandons the registration when it receives 401, it means it either doesn’t support the authentication method requested (unlikely), or there is no authentication information configured in the phone.
If you get 401 for the second one, that could be that the phone was not recognized as one known to the PABX (to try and hide the fact that it wasn’t known); that the nonce had expired between the challenge and the response, or that some of the information in the response didn’t match the challenge. I would have expected 403, not 401, but I think I’ve seen suggestions that chan_pjsip sends 401.
Your question was not helpful in that it didn’t provide logs or even say that the phone tried to authenticate. In this case the full contents of the INVITEs and 401s are needed, and you should also look for any reason given for re-challenging.
What do you mean “reason for re-challenging”? The challenge-response communication I explained in my previous message is the standard Digest authentication method. The first 401 is normal, the second 401 can be caused by incorrect password, for example. But my password is correct. I’ve even calculated the messages hashes myself to be sure.
What other reasons can there be for the authentication to fail if the challenge response is valid (password is correct)?
chan_sip would certainly explain why it was re-challenging. I’m not so sure what chan_pjsip does, but I would hope, at some debug, level, it would explain why it didn’t like the response.
Do you have any pjsip trunks between pbx systems. I have had this happen when my trunks between systems just messed up, I was trying to get device states working and I screwed them up because I was figuring out the custom.conf files. I had to delete them and then recreate them. Then the phones registered, but would not dial any extensions or any call of any type, even voicemail. I would just say “call failed”. I did a fwconsole reload to rebuild the from-internal context that my pjsip trunks between systems used and then it started working correctly and making calls.
I started with a working extension/user that I’ve created about one year earlier: the extension is 641 and password is 64112345. I can connect to FreePBX with this account using MicroSIP on Windows.
I can also confirm from Asterisk database that the bcrypt hash is