Note: IP addresses, phone numbers and account id’s are masked.
When trying to call inbound, sometimes we get this error:
chan_sip.c:26125 handle_request_invite: Failed to authenticate device "Company B.V." sip:0031543000000@domain.com:5080>;tag=as4a58d8cb
The call will be rejected and Asterisk hangs up. When i do an “sip reload” or “core reload”, inbound calls will be accepted for a while but will eventually be rejected again. Our provider says they get a 403 response from our Asterisk server.
What is your configuration? It’s possible that they may be using a few different IPs, and calls start coming from one which does not match and chan_sip then challenges for authentication.
As you have masked out the hostname I am unable to tell you if this is the case or not. You can check yourself by resolving the hostname manually and seeing if it has multiple ‘A’ records. If it does then only one would be used. If the call comes in from another one then it would not match and be rejected.
I see this happen all the time. chan_sip resolves and uses the first returned dns IP on registration so if the provider uses multiple IP address it’s a crap shoot each call and each registration and the SIP trunk provider does not care if your PBX can deal with it or not. You need to create a separate trunk config for each IP or use chan_pjsip which resolves all returned IP’s from the dns name.