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

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

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)

  1. 2022/07/14 09:34:29.300373 invite.go:42: ↑↑↑
  2. INVITE sip:41202@192.168.1.108:5066 SIP/2.0
  3. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
  4. Content-Type: application/sdp
  5. CSeq: 1 INVITE
  6. Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
  7. Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bKe92e138a-709b-4329-ac37-1ec2f88a5cb4
  8. To: <sip:41202@192.168.1.108:5066>
  9. Supported: replaces
  10. User-Agent: Pion WebRTC SIP Client
  11. From: "Agent 41201"<sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
  12. Contact: 41201 <sip:41201@192.168.1.108:5066>
  13. Content-Length: 4265
  14. Max-Forwards: 70
  15. 2022/07/14 09:34:29.327669 websocket_freeswitch.go:47: ↓↓↓
  16. SIP/2.0 407 Proxy Authentication Required
  17. Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bKe92e138a-709b-4329-ac37-1ec2f88a5cb4;received=192.168.1.110;rport=57576
  18. From: "Agent 41201" <sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
  19. To: <sip:41202@192.168.1.108:5066>;tag=5He1p5m60a5DF
  20. Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
  21. CSeq: 1 INVITE
  22. User-Agent: FreeSWITCH-mod_sofia/1.6.20~64bit
  23. Accept: application/sdp
  24. Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
  25. Supported: timer, path, replaces
  26. Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
  27. Proxy-Authenticate: Digest realm="192.168.1.108", nonce="81f85e27-b5d0-4b27-9358-5eded4524e3a", algorithm=MD5, qop="auth"
  28. Content-Length: 0
  29. 2022/07/14 09:34:29.328234 invite.go:42: ↑↑↑
  30. INVITE sip:41202@192.168.1.108:5066 SIP/2.0
  31. Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
  32. Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bK69967eaa-911f-4b89-8566-7b835b4d3b32
  33. To: <sip:41202@192.168.1.108:5066>
  34. Supported: timer, path, replaces
  35. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
  36. Content-Type: application/sdp
  37. CSeq: 4 INVITE
  38. From: "Agent 41201"<sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
  39. Contact: 41201 <sip:41201@192.168.1.108:5066>
  40. 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
  41. User-Agent: Pion WebRTC SIP Client
  42. Content-Length: 4265
  43. Max-Forwards: 70
  44. 2022/07/14 09:34:29.348968 websocket_freeswitch.go:47: ↓↓↓
  45. SIP/2.0 407 Proxy Authentication Required
  46. Via: SIP/2.0/WS 192.168.1.108;branch=z9hG4bK69967eaa-911f-4b89-8566-7b835b4d3b32;received=192.168.1.110;rport=57576
  47. From: "Agent 41201" <sip:41201@192.168.1.108:5066>;tag=1693e249-a531-4012-964e-f9b4133cf6e5
  48. To: <sip:41202@192.168.1.108:5066>;tag=6t7Sr059XKU0a
  49. Call-ID: b31a98fa-c7d2-46a0-9d3b-ffbe60331dcf
  50. CSeq: 4 INVITE
  51. User-Agent: FreeSWITCH-mod_sofia/1.6.20~64bit
  52. Accept: application/sdp
  53. Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
  54. Supported: timer, path, replaces
  55. Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
  56. Proxy-Authenticate: Digest realm="192.168.1.108", nonce="edbe6f39-3aa5-4034-8df8-aae050b77e1a", algorithm=MD5, qop="auth"
  57. 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:

确定