My SIP trunk provider doesn’t support 401 challenge for authentication. It requires authentication (user/password) to be included in the initial outbound SIP trunk registration, otherwise it failed with 403. The config from Wiki below doesn’t seem to support the authentication in the initial Registration to SIP trunk provider. Is anything missing?
No. You can’t create special requests like that, not without modifying the code. You’d also need to know how to “include authentication” and what that means.
Some provider settings allow first INVITEs with username and password. To do it at chan_sip you must add “remoteuser=” and “remotesecret=” with respectively values at trunk settings.
I don’t know how to do the same with pjsip.
There are no such equivalent options in PJSIP, beyond the authentication option. According to the code in chan_sip I don’t see how it behaves that way but I’m not going to look further in it.
I also wasn’t aware that chan_sip did anything like that. As far as I understand it, remotesecret is just a cleaner way of handling the problem that insescure=invite hacks around, or the rather rare case of both way authentication with different credentials.
The only way you could authenticate in SIP without 401 is by using basic authentication, which is very insecure, as the password is sent in the clear. Moreover, RFC 3261 says:
Note, however, that SIP servers MUST NOT accept or request Basic authentication.
So any server using basic authentication cannot be a SIP server.
You are basically asking us how to do something that is not possible, and therefore there is no specification of how to do it over the wire, so it is impossible to say how to configure a UA to do it.
I think the OP needs to find a SIP service provider.
@fsilvestre: could you share your example of the adding remoteuser= and remotesecret= I finally loaded chan_sip after rebuilt it (make memuselect doesn’t have the option of selecting chan_sip anymore).
Totally agree with security concerns, just try to get my lab IOT working.