为什么我会收到两个“407 Proxy Authentication Required”SIP响应?

huangapple go评论114阅读模式
英文:

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

问题

我正在使用Golang和Freeswitch开发软电话解决方案。注册功能正常,我可以在Freeswitch上看到我的软电话代码已注册。我还可以从另一个软电话(3CX)向我的代码发送INVITE请求。但是,如果我尝试呼叫3CX,我总是收到两个"407 Proxy Authentication Required"错误。

我期望的流程如下:

  1. 发送INVITE请求
  2. 收到"Proxy Authentication Required"错误
  3. 将认证信息放入第二个INVITE请求中并重新发送
  4. 建立呼叫连接

我实际得到的流程如下:

  1. 发送INVITE请求
  2. 收到"Proxy Authentication Required"错误
  3. 将认证信息放入第二个INVITE请求中并重新发送
  4. 收到"Proxy Authentication Required"错误
  5. 没有进一步的操作

(我删除了SIP Body(offer)因为它太大)

以上是您提供的日志信息,其中包含了发送和接收的SIP请求和响应。

英文:

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

得分: 1

好的,现在我找到了我的错误。我写成了Proxy-Authenticate而不是Proxy-Authorization。但是现在我得到了一个合并的请求响应。所以Freeswitch将其视为重复的请求。

英文:

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.

huangapple
  • 本文由 发表于 2022年7月14日 15:56:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/72977072.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定