为什么需要标签来识别 SIP 对话?
本地和远程标记以及 Call-ID 的组合用于标识对话。据说Call-ID是一次呼叫的唯一值。那么为什么 Call-ID 不单独用于识别对话呢?
A combination of local and remote tags along with Call-ID is used to identify a dialog. It is said that Call-ID is a unique value for a call. Why then is Call-ID not used solely to identify the dialog?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一句话:“发夹”。
“Hairpinning”是指用户代理向自身发出呼叫,主要是出于自测试的目的。 (您可能遇到这种情况的另一个原因是您的代理将您的呼叫路由给您自己,称为“tromboning”。如果有意完成,这是对您的基础设施的有用的端到端测试。)
因此,假设您发送了一个 邀请自己并回答。然后,您的用户代理必须有两个对话框(每个对话框都有标识符),每个对话框代表呼叫的一端。如果您只有
Call-ID
,那么您不知道哪个对话框是调用者,哪个是被调用者。这里的
From
和To
标签是您可以明确确定哪个对话框是哪个的方法。In a word: "hairpinning".
"Hairpinning" is when a user agent makes a call to itself, mainly for the purposes of self-testing. (The other reason you might have this is because your proxy routes your call to yourself, called "tromboning". When done intentionally, it's a useful end-to-end test of your infrastructure.)
So let's say you send an INVITE to yourself, and answer it. Your user agent must then have two dialogs (each with identifiers), each representing one end of the call. If you only have a
Call-ID
, then you don't know which dialog is the caller and which the callee.The
From
andTo
tags here are the way you can unambiguously determine which dialog is which.From Tag 和 To tag 不足以唯一标识 Alice 和 Bob 之间的 SIP 对话。您还必须结合Call-ID。
在 RFC 3261 第 12 页中,我们发现:
SIP RFC 3261
From Tag and To tag are not sufficient to uniquely identify a SIP dialog between Alice and Bob. You must combine the Call-ID too.
In the RFC 3261 page 12, we find this :
SIP RFC 3261
尽管唯一的 call-ID 保证了消息发送时的唯一性,但在分叉的情况下,call-ID 并不能保证唯一性。例如,如果 alice 呼叫 bob,邀请消息将发送到 bob 的所有注册端点 — Bob 的智能手机和 Bob 的 PC。这就是标签发挥作用的地方,以识别响应来自哪个端点。每个端点将发送具有相同呼叫 ID 但不同标签的响应。
even though a unique call-ID guarantees uniqueness when message is send but in case of forking call-ID does not guarantees uniqueness. For example if alice call bob, Invite messages to be sent to all bob's registered endpoints — bob's smart phone and bob's PC. That's where tag comes into picture to identify the response comes from which endpoint. Each endpoint will send the response with same call-ID but different tags.