英文:
Why do i get two "407 Proxy Authentication Required" SIP responses?
问题
我正在使用Golang和Freeswitch开发软电话解决方案。注册功能正常,我可以在Freeswitch上看到我的软电话代码已注册。我还可以从另一个软电话(3CX)向我的代码发送INVITE请求。但是,如果我尝试呼叫3CX,我总是收到两个"407 Proxy Authentication Required"错误。
我期望的流程如下:
- 发送INVITE请求
- 收到"Proxy Authentication Required"错误
- 将认证信息放入第二个INVITE请求中并重新发送
- 建立呼叫连接
我实际得到的流程如下:
- 发送INVITE请求
- 收到"Proxy Authentication Required"错误
- 将认证信息放入第二个INVITE请求中并重新发送
- 收到"Proxy Authentication Required"错误
- 没有进一步的操作
(我删除了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:
- Send INVITE
- Receive the Proxy Authentication Required
- Put the Auth into the second INVITE and send again
- Call will be setup
What I get:
- Send INVITE
- Receive the Proxy Authentication Required
- Put the Auth into the second INVITE and send again
- Receive the Proxy Authentication Required
- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论