【问题标题】:Where SIP client should send replies to INVITEs?SIP 客户端应该在哪里发送回复到邀请?
【发布时间】:2012-12-09 23:52:52
【问题描述】:

假设有一个 SIP 客户端在 100.0.0.100:5059 监听。

它从 10.0.0.101:5060 接收到一个带有 INVITE 的 UDP 数据包,其中包含某些标头。例如:

  • Contact: <sip:100.0.0.102:5060>
  • Record-Route: <sip:100.0.0.103:5060>(此类标头的第一个)
  • Route: <sip:100.0.0.104:5060>
  • Via: <sip:100.0.0.105:5060>(此类标头中的第一个)

它应该把“ACK”、“Tryinng”、“对话建立”、“BYE”等东西发送到哪里? 100.0.0.什么?

(背景:尝试编写“单个 TCP 连接中的整个 SIP”包装器,将 SIP 中看到的所有地址转换为自身,但出现“请求超时”、“检测到循环”、“中继冻结”错误,使对话持续只有15秒...可能是因为包装器做错了...为什么标头和应用程序/ sdp中有这么多令人困惑的IP地址?...)。

【问题讨论】:

    标签: sip


    【解决方案1】:

    RFC 3261 section 18.2.2 告诉你该怎么做。算法中的第三步是适用的:

      o  Otherwise (for unreliable unicast transports), if the top Via
         has a "received" parameter, the response MUST be sent to the
         address in the "received" parameter, using the port indicated
         in the "sent-by" value, or using port 5060 if none is specified
         explicitly.  If this fails, for example, elicits an ICMP "port
         unreachable" response, the procedures of Section 5 of [4]
         SHOULD be used to determine where to send the response.
      o  Otherwise, if it is not receiver-tagged, the response MUST be
         sent to the address indicated by the "sent-by" value, using the
         procedures in Section 5 of [4].
    

    [4] 指的是here

    通过 TCP 接收请求是一个更简单的情况:如果可以,您可以通过开放连接发送请求。否则,您打开一个 TCP 连接到最顶层 Viareceived 参数中的 IP 地址(如果存在),或者该标头的 sent-by 标记(如果不存在)。如果该尝试失败,您必须退回到上述 RFC 3263 中的算法。

    【讨论】:

    • 哪些客户端能够向域发送邀请?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-22
    • 2011-03-22
    • 2011-10-08
    • 2012-10-24
    • 1970-01-01
    相关资源
    最近更新 更多