chan_sip.c: Failed to authenticate device


I have configured two non-identical trunks with different parameters for testing purposes on asterisk (11.7.0) with Elastix (2.4.0 x64) on a Linux based machine (x86_64; 2.6.18) . None of them worked out (when I try calling these numbers it doesn’t even connect to them). These are the configuration setups I came up with:

Trunk #1

disallow=all username= type=friend secret= qualify=yes nat=yes insecure=port,invite host= fromdomain= dtmfmode=auto context=ext-did canreinvite=no auth=plaintext allow=alaw&ulaw port=5060 t38pt_udptl=yes

Trunk #2

username= type=friend secret= reinvite=yes realm=asterisk qualify=no port=5060 nat=yes insecure=very host= dtmfmode=rfc2833 disallow=all canreinvite=yes auth=md5 allow=ulaw&alaw&gsm

Also the log is quite full of these kind of reports :

NOTICE[2859][C-0000004f] chan_sip.c: Failed to authenticate device 201<sip:[email protected](Server IP)>;tag=0f2dd608 NOTICE[2859][C-00000050] chan_sip.c: Failed to authenticate device 201<sip:[email protected](Server IP)>;tag=d84346e6 NOTICE[2859][C-00000051] chan_sip.c: Failed to authenticate device 201<sip:[email protected](Server IP)>;tag=e6a6e67c VERBOSE[2727] asterisk.c:  -- Remote UNIX connection VERBOSE[27810] asterisk.c:  -- Remote UNIX connection disconnected

Any kind of help in this matter is appreciated. Thank you for your time.


This is what happens in the log files when I create a trunk:

`-- Registration for '[email protected](VoIP Provider IP)' timed out, trying again (Attempt #5)
 NOTICE[2868] chan_sip.c: Failed to authenticate on REGISTER to '[email protected](VoIP Provider IP)' (Tries 3)

It should be self-explanatory. Either the number, or IP adress, or both are invalid, however I have contacted the SIP provider company and they assured me that they are correct and have checked them themselves and it works just fine.

Actually the self explanatory bit is the time out one, you have a routing problem.

1 Like

I have contacted both the SIP provider company and the server hosting company and they both reported that everything works just fine on their end. Is there any specific way to diagnose and find out exactly where the problem is?

no specific way, perhaps a combination of

sip set debug ip th.em.ip.dudes


tcpdump port 5060 and host th.em.ip.dudes

to presumably fix your router misconfiguration

1 Like