Why do i get two "407 Proxy Authentication Required" SIP responses?

Viewed 156

I am working on a softphone solution with Golang and Freeswitch. The register works and on Freeswitch I can see my softphone code is registered. I also can send an INVITE from a other softphone (3CX) to my code. But if I try to call the 3CX i always get two "407 Proxy Authentication Required".3

What I expect:

  1. Send INVITE
  2. Receive the Proxy Authentication Required
  3. Put the Auth into the second INVITE and send again
  4. Call will be setup

What I get:

  1. Send INVITE
  2. Receive the Proxy Authentication Required
  3. Put the Auth into the second INVITE and send again
  4. Receive the Proxy Authentication Required
  5. Nothing

(I deleted SIP Body (offer) because it's to big)

2022/07/14 09:34:29.300373 invite.go:42: ↑↑↑
INVITE sip:41202@192.168.1.108:5066 SIP/2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE 
Content-Type: application/sdp
CSeq: 1 INVITE
Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bKe92e138a-709b-4329-ac37-1ec2f88a5cb4
To: <sip:41202@192.168.1.108:5066>
Supported: replaces
User-Agent: Pion WebRTC SIP Client
From: "Agent 41201"<sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
Contact: 41201 <sip:41201@192.168.1.108:5066>
Content-Length: 4265
Max-Forwards: 70

2022/07/14 09:34:29.327669 websocket_freeswitch.go:47: ↓↓↓
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bKe92e138a-709b-4329-ac37-1ec2f88a5cb4;received=192.168.1.110;rport=57576
From: "Agent 41201" <sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
To: <sip:41202@192.168.1.108:5066>;tag=5He1p5m60a5DF
Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
CSeq: 1 INVITE
User-Agent: FreeSWITCH-mod_sofia/1.6.20~64bit
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Proxy-Authenticate: Digest realm="192.168.1.108", nonce="81f85e27-b5d0-4b27-9358-5eded4524e3a", algorithm=MD5, qop="auth"
Content-Length: 0

2022/07/14 09:34:29.328234 invite.go:42: ↑↑↑
INVITE sip:41202@192.168.1.108:5066 SIP/2.0
Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bK69967eaa-911f-4b89-8566-7b835b4d3b32
To: <sip:41202@192.168.1.108:5066>
Supported: timer, path, replaces
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE 
Content-Type: application/sdp
CSeq: 4 INVITE
From: "Agent 41201"<sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
Contact: 41201 <sip:41201@192.168.1.108:5066>
Proxy-Authenticate: Digest username="41201", realm="192.168.1.108", nonce="81f85e27-b5d0-4b27-9358-5eded4524e3a", uri="sip:41202@192.168.1.108:5066", response="b7aae35c040dc1f25484eb96d725d6f3",algorithm=MD5,cnonce="0e6758e1adfccffbd0ad9ffdde3ef655",qop=auth,nc=00000001
User-Agent: Pion WebRTC SIP Client
Content-Length: 4265
Max-Forwards: 70


2022/07/14 09:34:29.348968 websocket_freeswitch.go:47: ↓↓↓
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bK69967eaa-911f-4b89-8566-7b835b4d3b32;received=192.168.1.110;rport=57576
From: "Agent 41201" <sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
To: <sip:41202@192.168.1.108:5066>;tag=6t7Sr059XKU0a
Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
CSeq: 4 INVITE
User-Agent: FreeSWITCH-mod_sofia/1.6.20~64bit
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Proxy-Authenticate: Digest realm="192.168.1.108", nonce="edbe6f39-3aa5-4034-8df8-aae050b77e1a", algorithm=MD5, qop="auth"
Content-Length: 0
1 Answers

Okey. Now i found my error. I have written Proxy-Authenticate instead of Proxy-Authorization. But now i am getting an Request merged response. So the Freeswitch sees it as a doublicated request.

Related