SIP Station Outgoing Connection Problem

I’ve been having intermittent connection problems from our Asterisk 1.6 box to our FreePBX SIP Station trunks. We can consistently receive calls over the trunk but we seem to have trouble consistently establishing outgoing connections. When we are having a problem it is evidenced in the SIP Station control panel within FreePBX with the SIP Ping showing “Unreachable” for both trunks. All other values look good and the Firewall test passes. I’ve been pulling my hair out trying to figure it out. I ran a TCP trace on it this evening and saw the following things in the trace:

71 17.870822 SIP Request: REGISTER
78 17.945623 SIP Request: REGISTER
79 18.024085 SIP Status: 401 Unauthorized (0 bindings)
80 18.024226 SIP Request: REGISTER
81 18.105642 SIP Status: 401 Unauthorized (0 bindings)
82 18.105727 SIP Request: REGISTER
83 18.145140 SIP Status: 200 OK (1 bindings)
84 18.171690 SIP Request: NOTIFY sip:[email protected]
85 18.171826 SIP Status: 489 Bad event
86 18.265951 SIP Status: 200 OK (1 bindings)
87 18.282233 SIP Request: NOTIFY sip:[email protected]
88 18.282342 SIP Status: 489 Bad event

I don’t know if these logs are helpful in diagnosing the problem but the 401 and 489 errors looked a little suspicious.

Can anyone help me diagnose this?



Looks like a trunk setting between and has a bad user name or secret that doesn’t match the other end.

These two agree: and
and so do these two: