emiago / gophone

Gophone CLI SIP phone powered by SIPGO
BSD 2-Clause "Simplified" License
45 stars 1 forks source link

Potential Proxy Auth Issue #5

Open tcmartin opened 3 weeks ago

tcmartin commented 3 weeks ago

This is an issue I'm getting with a lot of clients (not just gophone). Basically, when registering with my sip server (metaswitch in this case), a 407 is sent even with correct credentials, and then it doesn't connect. However, twinkle and zoiper somehow are able to register with the same exact credentials, so I'm not sure what's causing the issue. I think it may have something to do with proxy auth, but I don't have access to the other side. 13:36:18.167 INF Register > sending request expiry=0 uri=sip:699@cms-voice.nkhconnect.com:5060 13:36:18.615 WRN transportlayer > DNS resolution is slow dur=447.121159 13:36:18.970 INF Register > Received status status=407 13:36:18.970 INF Register > Unathorized. Doing digest auth 13:36:19.428 INF Register > Received status status=403 13:36:19.429 FTL Fail to register error="SIP/2.0 403 Invalid credentials"

emiago commented 3 weeks ago

@tcmartin send SIP trace. SIP_DEBUG=true LOG_LEVEL=true gophone.

Also how you are executing gophone. Consider there is seperate username, password flags. It could be issue with headers. :)

tcmartin commented 3 weeks ago

16:37:59.097 INF Register > sending request expiry=0 uri=sip:3xiWtmCYNZEasDSrse13@cms-voice.nkhconnect.com:5060 16:37:59.504 WRN transportlayer > DNS resolution is slow dur=406.951744 16:37:59.914 INF Register > Received status status=407 16:37:59.914 INF Register > Unathorized. Doing digest auth 16:38:00.269 INF Register > Received status status=403 16:38:00.269 FTL Fail to register error="SIP/2.0 403 Invalid credentials"

SIP_DEBUG=true LOG_LEVEL=true gophone register -username=auth_username -password=password "sip:username@domain:5060" note here auth_username and username are different, but even if I set them to be the same thing, or swap them (all 4 combinations) I get the same exact result

meanwhile in Zoiper, if I set the username and auth_username along with the password, they all work. If you'd like, I could dm you the credentials so you could test it yourself with Zoiper/3cx/other softphones

I thought it could be an outbound proxy issue since I set the domain as the outbound proxy in Zoiper, but even removing it, Zoiper still registers. In other systems, eg pjsip, I noticed that the 407 came with some kind of challenge and pjsip couldn't respond properly to the challenge - the digest auth was the wrong response.

emiago commented 3 weeks ago

Hi @tcmartin please set -ua as well. This is your account. mostly it matches to username