Asterisk res_pjsip: fatal Response 401

Hi there,

I have this issue going on with my asterisk where i am not able to register at my sip provider. I am using pjsip.conf file for the registration and i am pretty much sure that the syntax of the file is written correctly. After i send a request for a registration, i receive a Warning message which says,

res_pjsip_outbound_registration.c1378 handle_registration_response: Fatal response “401” received from…
I didn’t find anything helpful on the web. Any Idea how can i solve this problem?

Thank you.

Hi. Did you really search on Internet ? Google with sip error 401 unauthorized …

SIP 401 - Unauthorized usually means that the request requires user authentication. This error message is returned by the SIP server,

Check your configuration.

The configuration file has the parameter username and password which are written correctly.The warning just says 401 and usually if you see a 401 Error it always contains the word unauthorized but in this case it is something else. Any solution?

It should not only have the parameters, you should also send them. Without having relevant part of your pjsip configuration it’s difficult to diagnose.


This is how the pjsip.conf file looks like

and this is the warning which i am getting again and again after sendin the registration

Contact user should be username, not the trunk name in type=registration

Contact user should be the extension (DID for FreePBX users) that handles incoming calls from the endpoint. It doesn’t correspond to any user field in the pjsip configuration.

401 is always a challenge for authentication (or a mock challenge to avoid giving away which users are valid). The text “Unauthorised” is for human consumption, only.

I’m not sure why everyone redacts the provider identification, as that is likely to be very useful information for debugging.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.