Internet Engineering Task Force (IETF) P. Saint-Andre Request for Comments: 8048 Filament Obsoletes: 7248 December 2016 Category: Standards Track ISSN: 2070-1721
Internet Engineering Task Force (IETF) P. Saint-Andre Request for Comments: 8048 Filament Obsoletes: 7248 December 2016 Category: Standards Track ISSN: 2070-1721
Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Presence
会话启动协议(SIP)和可扩展消息和状态协议(XMPP)之间的互通:状态
Abstract
摘要
This document defines a bidirectional protocol mapping for the exchange of presence information between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP). This document obsoletes RFC 7248.
本文档定义了一个双向协议映射,用于在会话启动协议(SIP)和可扩展消息和状态协议(XMPP)之间交换状态信息。本文件淘汰了RFC 7248。
Status of This Memo
关于下段备忘
This is an Internet Standards Track document.
这是一份互联网标准跟踪文件。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.
本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 7841第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc8048.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc8048.
Copyright Notice
版权公告
Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.
版权所有(c)2016 IETF信托基金和确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。
Table of Contents
目录
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Intended Audience . . . . . . . . . . . . . . . . . . . . . . 4 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 4. Architectural Assumptions . . . . . . . . . . . . . . . . . . 5 5. Presence Authorizations . . . . . . . . . . . . . . . . . . . 6 5.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 6 5.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 7 5.2.1. Requesting a Presence Authorization . . . . . . . . . 7 5.2.2. Refreshing a Notification Dialog . . . . . . . . . . 11 5.2.3. Cancelling a Presence Authorization . . . . . . . . . 11 5.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 15 5.3.1. Requesting a Presence Authorization . . . . . . . . . 15 5.3.2. Refreshing a Notification Dialog . . . . . . . . . . 18 5.3.3. Cancelling a Presence Authorization . . . . . . . . . 19 6. Notifications of Presence Information . . . . . . . . . . . . 19 6.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 19 6.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 20 6.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 25 7. Polling for Presence Information . . . . . . . . . . . . . . 27 7.1. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 27 7.2. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 28 8. Privacy and Security Considerations . . . . . . . . . . . . . 28 8.1. Amplification Attacks . . . . . . . . . . . . . . . . . . 28 8.2. Presence Leaks . . . . . . . . . . . . . . . . . . . . . 29 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 9.1. Normative References . . . . . . . . . . . . . . . . . . 30 9.2. Informative References . . . . . . . . . . . . . . . . . 31 Appendix A. Changes from RFC 7248 . . . . . . . . . . . . . . . 33 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 34 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 34
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Intended Audience . . . . . . . . . . . . . . . . . . . . . . 4 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 4. Architectural Assumptions . . . . . . . . . . . . . . . . . . 5 5. Presence Authorizations . . . . . . . . . . . . . . . . . . . 6 5.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 6 5.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 7 5.2.1. Requesting a Presence Authorization . . . . . . . . . 7 5.2.2. Refreshing a Notification Dialog . . . . . . . . . . 11 5.2.3. Cancelling a Presence Authorization . . . . . . . . . 11 5.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 15 5.3.1. Requesting a Presence Authorization . . . . . . . . . 15 5.3.2. Refreshing a Notification Dialog . . . . . . . . . . 18 5.3.3. Cancelling a Presence Authorization . . . . . . . . . 19 6. Notifications of Presence Information . . . . . . . . . . . . 19 6.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 19 6.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 20 6.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 25 7. Polling for Presence Information . . . . . . . . . . . . . . 27 7.1. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 27 7.2. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 28 8. Privacy and Security Considerations . . . . . . . . . . . . . 28 8.1. Amplification Attacks . . . . . . . . . . . . . . . . . . 28 8.2. Presence Leaks . . . . . . . . . . . . . . . . . . . . . 29 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 9.1. Normative References . . . . . . . . . . . . . . . . . . 30 9.2. Informative References . . . . . . . . . . . . . . . . . 31 Appendix A. Changes from RFC 7248 . . . . . . . . . . . . . . . 33 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 34 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 34
Presence is information about the availability of an entity (such as network availability or availability for communication). Presence features in both SIP and XMPP involve several aspects:
状态是有关实体可用性的信息(例如网络可用性或通信可用性)。SIP和XMPP中的状态特征都涉及几个方面:
o A long-lived authorization for a user to receive notifications about a contact's presence across presence and notification sessions; such an authorization is formally requested by the user, approved (or not) by the contact, and often associated with a record in an address list or "buddy list".
o 用户在状态和通知会话中接收关于联系人状态的通知的长期授权;此类授权由用户正式请求,由联系人批准(或不批准),并且通常与地址列表或“好友列表”中的记录相关联。
o An ephemeral presence session, during which the contact is online (i.e., available for interaction) and after which the contact is offline again.
o 一种短暂的状态会话,在此会话期间联系人处于在线状态(即,可用于交互),之后联系人再次处于离线状态。
o An ephemeral notification session, during which the user requests presence notifications from the contact (these are implicit in XMPP, but explicit in SIP where they are managed by means of notification dialogs).
o 一种短暂的通知会话,在此会话期间,用户请求联系人发送状态通知(这些通知在XMPP中是隐式的,但在SIP中是显式的,在SIP中通过通知对话框进行管理)。
o Notifications that are sent from the contact to the user for the life of either the contact's presence session or the user's notification session.
o 在联系人的状态会话或用户的通知会话期间从联系人发送给用户的通知。
Although specifications for both SIP and XMPP use the term "subscription", they do so in different ways. In SIP, a "subscription" is the specific mechanism whereby a subscriber (or an entity acting on the subscriber's behalf, such as a SIP Presence Server) requests presence notifications from the contact over a relatively short period of time, renewed as necessary to keep receiving presence notifications during a presence session. By contrast, in XMPP a "subscription" is essentially shorthand for a long-lived presence authorization. To prevent confusion, this document uses the term "notification dialog" for a SIP subscription and the term "presence authorization" for an XMPP subscription.
尽管SIP和XMPP的规范都使用术语“订阅”,但它们使用的方式不同。在SIP中,“订阅”是订阅者(或代表订阅者行事的实体,例如SIP呈现服务器)在相对较短的时间内从联系人请求呈现通知的特定机制,必要时更新以在呈现会话期间保持接收呈现通知。相比之下,在XMPP中,“订阅”本质上是长期存在授权的简写。为了避免混淆,本文档对SIP订阅使用术语“通知对话框”,对XMPP订阅使用术语“存在授权”。
In order to help ensure interworking between presence systems that conform to the instant messaging and presence protocol requirements [RFC2779], it is important to clearly define protocol mappings between such systems. Within the IETF, work has proceeded on two presence technologies:
为了帮助确保符合即时消息和状态协议要求的状态系统之间的互通[RFC2779],必须明确定义此类系统之间的协议映射。在IETF内,两项存在技术的工作正在进行:
o Various extensions to the Session Initiation Protocol ([RFC3261]) for presence, in particular [RFC3856]
o 会话启动协议([RFC3261])的各种存在扩展,特别是[RFC3856]
o The Extensible Messaging and Presence Protocol (XMPP), which consists of a formalization of the core XML-streaming protocols developed originally by the Jabber open-source community; the relevant specifications are [RFC6120] for the XML-streaming layer and [RFC6121] for basic presence and instant-messaging extensions
o 可扩展消息和状态协议(XMPP),它由最初由Jabber开源社区开发的核心XML流协议的形式化组成;XML流媒体层的相关规范为[RFC6120],基本状态和即时消息扩展的相关规范为[RFC6121]
One approach to help ensure interworking between these protocols is to map each protocol to the abstract semantics described in [RFC3860]; however, apparently that approach has never been implemented. The approach taken in this document is to directly map semantics from one protocol to another (i.e., from SIP/SIMPLE (SIP for Instant Messaging and Presence Leveraging Extensions) to XMPP and vice versa), because that is how existing systems solve the interworking problem.
帮助确保这些协议之间互通的一种方法是将每个协议映射到[RFC3860]中描述的抽象语义;然而,显然这一方法从未得到实施。本文档中采用的方法是直接将语义从一个协议映射到另一个协议(即,从SIP/SIMPLE(SIP用于即时消息和状态利用扩展)映射到XMPP,反之亦然),因为现有系统就是这样解决互通问题的。
The architectural assumptions underlying such direct mappings are provided in [RFC7247], including mapping of addresses and error conditions. The mappings specified in this document cover basic presence functionality. Mapping of more advanced functionality (e.g., so-called "rich presence") is out of scope for this document.
[RFC7247]中提供了此类直接映射的基础架构假设,包括地址映射和错误条件。本文档中指定的映射包括基本的状态信息功能。更高级功能的映射(例如,所谓的“丰富存在”)超出了本文档的范围。
This document obsoletes RFC 7248.
本文件淘汰了RFC 7248。
The documents in this series (which include [RFC7247], [RFC7572], [RFC7573], and [RFC7702]) are intended for use by software developers who have an existing system based on one of these technologies (e.g., SIP) and would like to enable communication from that existing system to systems based on the other technology (e.g., XMPP). We assume that readers are familiar with the core specifications for both SIP [RFC3261] and XMPP [RFC6120], with the base document for this series [RFC7247], and with the following presence-related specifications:
The documents in this series (which include [RFC7247], [RFC7572], [RFC7573], and [RFC7702]) are intended for use by software developers who have an existing system based on one of these technologies (e.g., SIP) and would like to enable communication from that existing system to systems based on the other technology (e.g., XMPP). We assume that readers are familiar with the core specifications for both SIP [RFC3261] and XMPP [RFC6120], with the base document for this series [RFC7247], and with the following presence-related specifications:
o "A Presence Event Package for the Session Initiation Protocol" [RFC3856]
o “会话启动协议的状态事件包”[RFC3856]
o "Presence Information Data Format (PIDF)" [RFC3863]
o “状态信息数据格式(PIDF)”[RFC3863]
o "Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence" [RFC6121]
o “可扩展消息和状态协议(XMPP):即时消息和状态”[RFC6121]
o "SIP-Specific Event Notification" [RFC6665]
o “SIP特定事件通知”[RFC6665]
A number of terms used here ("user", "contact", "notification", etc.) are explained in [RFC3261], [RFC3856], [RFC3857], [RFC6120], and [RFC6121]. This document uses some, but not all, of the presence-related terms defined in the Model for Presence and Instant Messaging [RFC2778]. In particular, the term "presence session" is used as described in [RFC6121] to mean a delimited time period during which an endpoint is online and available for communications.
[RFC3261]、[RFC3856]、[RFC3857]、[RFC6120]和[RFC6121]中解释了此处使用的许多术语(“用户”、“联系人”、“通知”等)。本文档使用了状态和即时消息模型[RFC2778]中定义的部分(但不是全部)状态相关术语。具体而言,术语“存在会话”如[RFC6121]中所述被用于表示端点在线且可用于通信的限定时间段。
In flow diagrams, SIP traffic is shown using arrows such as "***>", whereas XMPP traffic is shown using arrows such as "...>". As in [RFC7247], the terms "SIP to XMPP Gateway" and "XMPP to SIP Gateway" are abbreviated as "S2X GW" and "X2S GW", respectively.
In flow diagrams, SIP traffic is shown using arrows such as "***>", whereas XMPP traffic is shown using arrows such as "...>". As in [RFC7247], the terms "SIP to XMPP Gateway" and "XMPP to SIP Gateway" are abbreviated as "S2X GW" and "X2S GW", respectively.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”应按照[RFC2119]中的说明进行解释。
The fundamental architectural assumptions underlying SIP-XMPP interworking are described in [RFC7247].
[RFC7247]中描述了SIP-XMPP互通的基本架构假设。
Note that, in SIP, there are two ways that presence services can be deployed on the server side:
请注意,在SIP中,有两种方式可以在服务器端部署状态服务:
1. Under this model, described most fully in [RFC3857], a dedicated SIP Presence Server handles events related to the presence event package. Instead of forwarding a SUBSCRIBE message to the SIP user, the Presence Server would inform the user of subscription activity using the 'presence.winfo' event package. The SIP User Agent would then authorize the subscribing contact through some interaction with the Presence Server (for instance, using XML Configuration Access Protocol (XCAP) [RFC4825]). Therefore, presence updates from the SIP User Agent would not be sent as NOTIFY messages to the XMPP user but as PUBLISH messages to the Presence Server, which would then generate NOTIFY messages to all active subscribers.
1. 在[RFC3857]中详细描述的该模型下,专用SIP状态服务器处理与状态事件包相关的事件。状态服务器将使用“Presence.winfo”事件包通知用户订阅活动,而不是将订阅消息转发给SIP用户。然后,SIP用户代理将通过与状态服务器的某种交互来授权订阅联系人(例如,使用XML配置访问协议(XCAP)[RFC4825])。因此,来自SIP用户代理的状态更新不会作为通知消息发送给XMPP用户,而是作为发布消息发送给状态服务器,然后状态服务器将生成通知消息发送给所有活动订阅者。
2. Under this model, a SIP Presence Server acts in proxy mode and merely passes through the SUBSCRIBE and NOTIFY messages to the SIP User Agent.
2. 在该模型下,SIP状态服务器以代理模式运行,仅将订阅和通知消息传递给SIP用户代理。
Because the behavior of the XMPP-to-SIP gateway is not changed by the SIP architectural model that is used, the diagrams and protocol flows in this document cover both options by labeling the end entity a "SIP User Agent or Presence Server".
由于所使用的SIP体系结构模型不会改变XMPP到SIP网关的行为,因此本文档中的图表和协议流通过将最终实体标记为“SIP用户代理或状态服务器”来涵盖这两个选项。
Both XMPP and presence-aware SIP systems enable entities (often, but not necessarily, human users) to subscribe to the presence of other entities. XMPP presence is specified in [RFC6121]. Presence using a SIP event package is specified in [RFC3856].
XMPP和感知状态的SIP系统都允许实体(通常但不一定是人类用户)订阅其他实体的状态。[RFC6121]中规定了XMPP的存在。[RFC3856]中规定了使用SIP事件包的状态。
As described in [RFC6121], XMPP presence authorizations are managed using XMPP <presence/> stanzas of type "subscribe", "subscribed", "unsubscribe", and "unsubscribed". The main states are:
如[RFC6121]所述,XMPP状态授权使用类型为“订阅”、“订阅”、“取消订阅”和“取消订阅”的XMPP<presence/>节进行管理。主要国家是:
o "none" (neither the user nor the contact is subscribed to the other's presence information)
o “无”(用户和联系人均未订阅对方的状态信息)
o "from" (the contact will receive presence notifications from the user)
o “发件人”(联系人将收到来自用户的状态通知)
o "to" (the contact will send presence notifications to the user)
o “收件人”(联系人将向用户发送状态通知)
o "both" (both user and contact will receive each other's presence notifications)
o “两者”(用户和联系人都将收到对方的状态通知)
As described in [RFC3856], in SIP the subscriber does not explicitly request the creation or removal of presence authorizations. Rather, the authorizations are triggered by subscription activity. When a SIP user receives an initial SIP SUBSCRIBE event from a contact, the recipient's SIP User Agent or SIP Presence Server asks the user to make an authorization policy decision. This decision is recorded in the SIP User Agent or SIP Presence Server, so that in the future any notification dialogs from the contact are automatically approved. (Note that addresses for SIP users and contacts are most generally referenced by a Presence URI of the form <pres:user@domain> but might be referenced by a SIP or SIPS (Session Initiation Protocol Secure) URI of the form <sip:user@domain> or <sips:user@domain>; because, in practice, 'pres' URIs are rarely used, the examples in this document use 'sip' URIs.)
如[RFC3856]所述,在SIP中,订户没有明确请求创建或删除状态授权。相反,授权是由订阅活动触发的。当SIP用户从联系人接收到初始SIP订阅事件时,接收方的SIP用户代理或SIP状态服务器要求用户做出授权策略决策。此决定记录在SIP用户代理或SIP状态服务器中,以便将来自动批准联系人的任何通知对话框。(注意,SIP用户和联系人的地址通常由<pres:user@domain>但可能被SIP或SIPS(会话启动协议安全)引用格式为<sip:user@domain>或<sips:user@domain>;因为在实践中很少使用“pres”URI,所以本文中的示例使用“sip”URI。)
In both SIP and XMPP, presence authorizations are long-lived (indeed permanent if not explicitly cancelled). In SIP, by default a notification session is typically short-lived unless explicitly extended (the default time-to-live of a SIP notification dialog is
在SIP和XMPP中,状态授权都是长期存在的(如果没有明确取消,则是永久的)。在SIP中,默认情况下,除非显式延长,否则通知会话通常是短暂的(SIP通知对话框的默认生存时间为
3600 seconds, as specified in Section 6.4 of [RFC3856], so that a notification dialog needs to be explicitly refreshed in order for a user's notification session to last as long as the contact's presence session). In XMPP, a user's notification session with a contact is almost always automatically handled by the user's server based on the user's presence state (see [RFC6121] for details).
3600秒,如[RFC3856]第6.4节所述,因此需要显式刷新通知对话框,以便用户通知会话的持续时间与联系人在场会话的持续时间相同)。在XMPP中,用户与联系人的通知会话几乎总是由用户的服务器根据用户的状态自动处理(有关详细信息,请参见[RFC6121])。
The following diagram illustrates the protocol flow necessary to establish an authorization for an XMPP user to a receive presence notifications from a SIP contact, as further explained in the text and examples after the diagram.
下图说明了为XMPP用户建立从SIP联系人接收状态通知的授权所需的协议流,如图后的文本和示例中进一步解释的。
XMPP XMPP SIP SIP UA or Client Server Proxy Presence Server | + X2S GW | | | | | | | (F1) XMPP | | | | subscribe | | | |...........>| | | | | (F2) SIP | | | | SUBSCRIBE | | | |***********>| | | | | (F3) SIP | | | | SUBSCRIBE | | | |***********>| | | | (F4) SIP | | | | 200 OK | | | |<***********| | | (F5) SIP | | | | 200 OK | | | |<***********| | | | | (F6) SIP | | | | NOTIFY | | | | (pending) | | | |<***********| | | (F7) SIP | | | | NOTIFY | | | |<***********| | | | (F8) SIP | | | | 200 OK | | | |***********>| | | | | (F9) SIP | | | | 200 OK | | | |***********>|
XMPP XMPP SIP SIP UA or Client Server Proxy Presence Server | + X2S GW | | | | | | | (F1) XMPP | | | | subscribe | | | |...........>| | | | | (F2) SIP | | | | SUBSCRIBE | | | |***********>| | | | | (F3) SIP | | | | SUBSCRIBE | | | |***********>| | | | (F4) SIP | | | | 200 OK | | | |<***********| | | (F5) SIP | | | | 200 OK | | | |<***********| | | | | (F6) SIP | | | | NOTIFY | | | | (pending) | | | |<***********| | | (F7) SIP | | | | NOTIFY | | | |<***********| | | | (F8) SIP | | | | 200 OK | | | |***********>| | | | | (F9) SIP | | | | 200 OK | | | |***********>|
| | | (F10) SIP | | | | NOTIFY | | | | (active) | | | |<***********| | | (F11) SIP | | | | NOTIFY | | | |<***********| | | | (F12) SIP | | | | 200 OK | | | |***********>| | | | | (F13) SIP | | | | 200 OK | | | |***********>| | (F14) XMPP | | | | subscribed | | | |<...........| | | | (F15) XMPP | | | | presence | | | |<...........| | | | | | |
| | | (F10) SIP | | | | NOTIFY | | | | (active) | | | |<***********| | | (F11) SIP | | | | NOTIFY | | | |<***********| | | | (F12) SIP | | | | 200 OK | | | |***********>| | | | | (F13) SIP | | | | 200 OK | | | |***********>| | (F14) XMPP | | | | subscribed | | | |<...........| | | | (F15) XMPP | | | | presence | | | |<...........| | | | | | |
An XMPP user (e.g., juliet@example.com) asks for a presence authorization by sending a request to a SIP contact (e.g., romeo@example.net), and the contact either accepts or declines the request. If the SIP contact accepts the request, the XMPP user will have a long-lived authorization to receive the SIP contact's presence information until (1) the XMPP user unsubscribes or (2) the SIP contact cancels the authorization. The request is encapsulated in a <presence/> stanza of type "subscribe":
XMPP用户(例如:。,juliet@example.com)通过向SIP联系人发送请求(例如。,romeo@example.net),联系人接受或拒绝请求。如果SIP联系人接受该请求,XMPP用户将拥有接收SIP联系人的状态信息的长期授权,直到(1)XMPP用户取消订阅或(2)SIP联系人取消授权为止。请求封装在类型为“subscribe”的<presence/>节中:
Example 1: XMPP User Subscribes to SIP Contact (F1)
示例1:XMPP用户订阅SIP联系人(F1)
| <presence from='juliet@example.com' | to='romeo@example.net' | type='subscribe'/>
| <presence from='juliet@example.com' | to='romeo@example.net' | type='subscribe'/>
Upon receiving such a <presence/> stanza, the XMPP server to which Juliet has connected needs to determine the identity of the domainpart in the 'to' address, which it does by following the procedures explained in Section 5 of [RFC7247]. If the domain is a SIP domain, the XMPP server will hand off the <presence/> stanza to an associated XMPP-to-SIP gateway or connection manager that natively communicates with presence-aware SIP proxies.
在收到这样一个<presence/>节时,Juliet所连接的XMPP服务器需要确定“to”地址中domainpart的身份,这是通过遵循[RFC7247]第5节中解释的程序来实现的。如果域是SIP域,XMPP服务器将把<presence/>节移交给关联的XMPP-to-SIP网关或连接管理器,该网关或连接管理器本机与感知状态的SIP代理进行通信。
The XMPP-to-SIP gateway is then responsible for translating the XMPP request into a SIP SUBSCRIBE request addressed from the XMPP user to the SIP contact:
然后,XMPP到SIP网关负责将XMPP请求转换为SIP订阅请求,从XMPP用户发送到SIP联系人:
Example 2: SIP Transformation of XMPP Presence Authorization Request (F2)
示例2:XMPP状态授权请求的SIP转换(F2)
| SUBSCRIBE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Accept: application/pidf+xml | Expires: 3600 | Content-Length: 0
| SUBSCRIBE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Accept: application/pidf+xml | Expires: 3600 | Content-Length: 0
Once the SIP proxy has delivered the SIP SUBSCRIBE to the SIP User Agent or Presence Server (F3, no example shown), the SIP User Agent would then send a response indicating acceptance of the request:
一旦SIP代理已将SIP订阅交付给SIP用户代理或状态服务器(F3,未示出示例),SIP用户代理随后将发送指示接受请求的响应:
Example 3: SIP User Accepts Presence Authorization Request (F4)
示例3:SIP用户接受状态授权请求(F4)
| SIP/2.0 200 OK | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.net>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | CSeq: 1 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Expires: 3600 | Content-Length: 0
| SIP/2.0 200 OK | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.net>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | CSeq: 1 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Expires: 3600 | Content-Length: 0
In accordance with Section 6.7 of [RFC3856], the XMPP-to-SIP gateway needs to consider the state to be "neutral" until it receives a NOTIFY message with a Subscription-State header [RFC6665] whose value is "active". Therefore, the SIP User Agent or Presence Server SHOULD immediately send such a NOTIFY message (see Section 6 below). If the XMPP-to-SIP gateway initially receives one or more NOTIFY messages with a Subscription-State header whose value is "pending" (F6), then it MUST respond to them on the SIP side but refrain from sending any presence stanzas from the SIP contact to the XMPP user.
根据[RCFC5656]的第6.7节,XMPP到SIP网关需要考虑状态是“中立”的,直到它接收到一个具有订阅状态标头[RCFC666]的通知消息,其值是“活动的”。因此,SIP用户代理或状态服务器应该立即发送这样的通知消息(参见下面的第6节)。如果XMPP-to-SIP网关最初接收到一个或多个具有值为“待定”(F6)的订阅状态标头的NOTIFY消息,则它必须在SIP端响应这些消息,但不要从SIP联系人向XMPP用户发送任何状态节。
Example 4: SIP User Agent or Presence Server Sends Presence Notification (F10)
示例4:SIP用户代理或状态服务器发送状态通知(F10)
| NOTIFY sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.net>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Subscription-State: active;expires=499 | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Type: application/pidf+xml | Content-Length: 193 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:romeo@example.net'> | <tuple id='ID-dr4hcr0st3lup4c'> | <status> | <basic>open</basic> | <show xmlns='jabber:client'>away</show> | </status> | </tuple> | </presence>
| NOTIFY sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.net>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Subscription-State: active;expires=499 | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Type: application/pidf+xml | Content-Length: 193 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:romeo@example.net'> | <tuple id='ID-dr4hcr0st3lup4c'> | <status> | <basic>open</basic> | <show xmlns='jabber:client'>away</show> | </status> | </tuple> | </presence>
Upon receiving the first NOTIFY with a state of active, the XMPP-to-SIP gateway returns a 200 OK to the SIP User Agent or Presence Server (F12, no example shown).
在收到状态为active的第一个通知后,XMPP-to-SIP网关向SIP用户代理或状态服务器返回200 OK(F12,未显示示例)。
The XMPP-to-SIP gateway also generates a <presence/> stanza of type "subscribed":
XMPP到SIP网关还生成类型为“subscribed”的<presence/>节:
Example 5: XMPP User Receives Acknowledgement from SIP Contact (F14)
示例5:XMPP用户从SIP联系人接收确认(F14)
| <presence from='romeo@example.net' | to='juliet@example.com' | type='subscribed'/>
| <presence from='romeo@example.net' | to='juliet@example.com' | type='subscribed'/>
As described in Section 6, if this first NOTIFY in the notification session contains a body, then the XMPP-to-SIP gateway also generates a presence notification addressed to the XMPP user (if the NOTIFY does not contain a body, then the gateway would interpret it as unknown or "closed"):
如第6节所述,如果通知会话中的第一个通知包含正文,则XMPP到SIP网关也会生成一个发送给XMPP用户的状态通知(如果通知不包含正文,则网关会将其解释为未知或“已关闭”):
Example 6: XMPP User Receives Presence Notification from SIP Contact (F15)
示例6:XMPP用户从SIP联系人(F15)接收状态通知
| <presence from='romeo@example.net/dr4hcr0st3lup4c' | to='juliet@example.com'/>
| <presence from='romeo@example.net/dr4hcr0st3lup4c' | to='juliet@example.com'/>
It is the responsibility of the XMPP-to-SIP gateway to set the value of the Expires header and to periodically renew the notification dialog on the SIMPLE side of the gateway. For example, the XMPP-to-SIP gateway SHOULD send a new SUBSCRIBE request to the SIP contact whenever the XMPP user initiates a presence session with the XMPP server by sending initial presence to its XMPP server (this is functionally equivalent to sending an XMPP presence probe). The XMPP-to-SIP gateway SHOULD also send a new SUBSCRIBE request to the SIP contact sufficiently in advance of when the SIP notification dialog is scheduled to expire during the XMPP user's active presence session.
XMPP到SIP网关负责设置Expires头的值,并定期更新网关简单端的通知对话框。例如,每当XMPP用户通过向其XMPP服务器发送初始状态来启动与XMPP服务器的状态会话时,XMPP到SIP网关应向SIP联系人发送新的订阅请求(这在功能上等同于发送XMPP状态探测)。XMPP-to-SIP网关还应在SIP通知对话框计划在XMPP用户的活动状态会话期间到期之前,向SIP联系人发送一个新的订阅请求。
The rules regarding SIP SUBSCRIBE requests for the purpose of establishing and refreshing a notification dialog are provided in [RFC6665]. Those rules also apply to XMPP-to-SIP gateways. Furthermore, an XMPP-to-SIP gateway MUST consider the XMPP presence authorization to be permanently cancelled (and so inform the XMPP user) if it receives a SIP response of 403, 489, or 603. By contrast, it is appropriate to consider a SIP response of 423 or 481 to be a transient error and to honor the long-lived XMPP presence authorization. [RFC6665] explains more detailed considerations about the handling of SIP responses in relation to notification dialogs and refreshes.
[RFC6665]中提供了有关建立和刷新通知对话框的SIP订阅请求的规则。这些规则也适用于XMPP到SIP网关。此外,XMPP到SIP网关必须考虑XMPP存在授权被永久取消(并且因此通知XMPP用户),如果它接收到403, 489或603的SIP响应。相反,考虑423或481的SIP响应是瞬时错误,并尊重长期生存的XMPP存在授权是合适的。[RFC6665]解释了与通知对话框和刷新相关的SIP响应处理的更详细注意事项。
Finally, see the Privacy and Security Considerations section (Section 8) for important information and requirements regarding the security implications of notification refreshes.
最后,有关通知刷新的安全影响的重要信息和要求,请参见隐私和安全注意事项部分(第8节)。
The following diagram illustrates the protocol flow by which an XMPP user cancels her outbound presence authorization with a SIP contact (i.e., indicates that she no longer wishes to be authorized to see the SIP contact's presence). As can be seen, SIMPLE itself does not
下图说明了XMPP用户通过SIP联系人取消其出站状态授权的协议流(即,表示她不再希望被授权查看SIP联系人的状态)。可以看出,简单本身并不是如此
have a construct that enables a user to cancel her outbound presence authorization (however, in many SIP/SIMPLE implementations she could use a technology such as XCAP [RFC4825] to remove the contact from her address list); therefore, this flow instead results in the cancellation of the user's notification dialog (with the implication on the XMPP side that the user will not request a subsequent notification dialog). Additional details are explained in the text and examples after the diagram.
具有允许用户取消其出站状态授权的结构(然而,在许多SIP/SIMPLE实现中,她可以使用诸如XCAP[RFC4825]之类的技术从她的地址列表中删除联系人);因此,此流反而导致取消用户的通知对话框(在XMPP端意味着用户将不会请求后续通知对话框)。图表后的文本和示例中解释了其他细节。
XMPP XMPP SIP SIP UA or Client Server Proxy Presence Server | + X2S GW | | | | | | | (F16) XMPP | | | |unsubscribe | | | |...........>| | | | | (F17) SIP | | | | SUBSCRIBE | | | | Expires: 0 | | | |***********>| | | | | (F18) SIP | | | | SUBSCRIBE | | | | Expires: 0 | | | |***********>| | | | (F19) SIP | | | | 200 OK | | | |<***********| | | (F20) SIP | | | | 200 OK | | | |<***********| | | (F21) XMPP | | | |unsubscribed| | | |<...........| | | | | (F22) SIP | | | | NOTIFY | | | | terminated | | | |***********>| | | | | (F23) SIP | | | | NOTIFY | | | | terminated | | | |***********>| | | | (F24) SIP | | | | 200 OK | | | |<***********| | | (F25) SIP | | | | 200 OK | | | |<***********| | | | | |
XMPP XMPP SIP SIP UA or Client Server Proxy Presence Server | + X2S GW | | | | | | | (F16) XMPP | | | |unsubscribe | | | |...........>| | | | | (F17) SIP | | | | SUBSCRIBE | | | | Expires: 0 | | | |***********>| | | | | (F18) SIP | | | | SUBSCRIBE | | | | Expires: 0 | | | |***********>| | | | (F19) SIP | | | | 200 OK | | | |<***********| | | (F20) SIP | | | | 200 OK | | | |<***********| | | (F21) XMPP | | | |unsubscribed| | | |<...........| | | | | (F22) SIP | | | | NOTIFY | | | | terminated | | | |***********>| | | | | (F23) SIP | | | | NOTIFY | | | | terminated | | | |***********>| | | | (F24) SIP | | | | 200 OK | | | |<***********| | | (F25) SIP | | | | 200 OK | | | |<***********| | | | | |
At any time after subscribing, the XMPP user can indicate that she no longer wishes to be authorized to receive presence notifications from the contact. This is done by sending a <presence/> stanza of type "unsubscribe":
在订阅后的任何时候,XMPP用户都可以表示她不再希望被授权接收联系人的状态通知。这是通过发送类型为“unsubscribe”的<presence/>节来完成的:
Example 7: XMPP User Unsubscribes from SIP Contact (F16)
示例7:XMPP用户取消订阅SIP联系人(F16)
| <presence from='juliet@example.com' | to='romeo@example.net' | type='unsubscribe'/>
| <presence from='juliet@example.com' | to='romeo@example.net' | type='unsubscribe'/>
The XMPP-to-SIP gateway is responsible for translating the XMPP unsubscribe command into a SIP SUBSCRIBE request with the Expires header set to a value of zero ("0"):
XMPP到SIP网关负责将XMPP unsubscribe命令转换为SIP SUBSCRIBE请求,Expires头设置为零值(“0”):
Example 8: SIP Transformation of XMPP Unsubscribe (F17)
示例8:XMPP取消订阅的SIP转换(F17)
| SUBSCRIBE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.com>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Max-Forwards: 70 | CSeq: 42 SUBSCRIBE | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Accept: application/pidf+xml | Expires: 0 | Content-Length: 0
| SUBSCRIBE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.com>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Max-Forwards: 70 | CSeq: 42 SUBSCRIBE | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Accept: application/pidf+xml | Expires: 0 | Content-Length: 0
Upon receiving the SIP 200 OK acknowledging the cancellation, the XMPP-to-SIP gateway SHOULD send a <presence/> stanza of type "unsubscribed" addressed to the XMPP user:
在收到SIP 200 OK确认取消后,XMPP-to-SIP网关应向XMPP用户发送类型为“unsubscribed”的<presence/>节:
Example 9: XMPP User Receives Unsubscribed Notification (F21)
示例9:XMPP用户收到取消订阅的通知(F21)
| <presence from='romeo@example.net' | to='juliet@example.com' | type='unsubscribed'/>
| <presence from='romeo@example.net' | to='juliet@example.com' | type='unsubscribed'/>
In accordance with Section 4.4.1 of [RFC6665], the XMPP-to-SIP gateway is then responsible for sending a NOTIFY message with a Subscription-State header of "terminated" in order to formally end the XMPP user's outbound presence authorization and the associated SIP dialog.
根据[RFC6665]第4.4.1节,XMPP-to-SIP网关随后负责发送订阅状态头为“已终止”的通知消息,以便正式结束XMPP用户的出站状态授权和相关SIP对话框。
Example 10: XMPP-to-SIP Gateway Sends Presence Notification to Terminate Authorization (F25)
示例10:XMPP到SIP网关发送状态通知以终止授权(F25)
| NOTIFY sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.net>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Subscription-State: terminated | Max-Forwards: 70 | CSeq: 43 NOTIFY | Content-Length: 0
| NOTIFY sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | To: <sip:romeo@example.net>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Subscription-State: terminated | Max-Forwards: 70 | CSeq: 43 NOTIFY | Content-Length: 0
Note: When the XMPP user cancels her outbound presence authorization to the SIP user, any inbound authorization that she might have approved (thus enabling the SIP user to see her presence) remains unchanged.
注意:当XMPP用户取消对SIP用户的出站状态授权时,她可能已经批准的任何入站授权(从而使SIP用户能够看到她的状态)保持不变。
The following diagram illustrates the protocol flow for establishing an authorization for a SIP user to receive presence notifications from an XMPP contact, as further explained in the text and examples after the diagram.
下图说明了用于为SIP用户建立从XMPP联系人接收状态通知的授权的协议流,如图后的文本和示例中进一步解释的。
SIP SIP XMPP XMPP UA Proxy Server Client | + S2X GW | | | | | | | (F26) SIP | | | | SUBSCRIBE | | | |**********>| | | | (F27) SIP | | | | 200 OK | | | |<**********| | | | | (F28) XMPP | | | | subscribe | | | |...........>| | | | | (F29) XMPP| | | | subscribe | | | |..........>| | | | (F30) XMPP| | | | subscribed| | | |<..........| | | (F31) XMPP | | | | subscribed | | | |<...........| | | (F32) SIP | | | | NOTIFY | | | | (active) | | | |<**********| | | | (F33) SIP | | | | 200 OK | | | |**********>| | | | | | |
SIP SIP XMPP XMPP UA Proxy Server Client | + S2X GW | | | | | | | (F26) SIP | | | | SUBSCRIBE | | | |**********>| | | | (F27) SIP | | | | 200 OK | | | |<**********| | | | | (F28) XMPP | | | | subscribe | | | |...........>| | | | | (F29) XMPP| | | | subscribe | | | |..........>| | | | (F30) XMPP| | | | subscribed| | | |<..........| | | (F31) XMPP | | | | subscribed | | | |<...........| | | (F32) SIP | | | | NOTIFY | | | | (active) | | | |<**********| | | | (F33) SIP | | | | 200 OK | | | |**********>| | | | | | |
A SIP User Agent initiates a presence authorization to an XMPP contact's presence information by sending a SIP SUBSCRIBE request to the contact. The following is an example of such a request:
SIP用户代理通过向XMPP联系人发送SIP SUBSCRIBE请求,向该联系人的状态信息发起状态授权。以下是此类请求的示例:
Example 11: SIP User Subscribes to XMPP Contact (F26)
示例11:SIP用户订阅XMPP联系人(F26)
| SUBSCRIBE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.net> | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Accept: application/pidf+xml | Content-Length: 0
| SUBSCRIBE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.net> | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Accept: application/pidf+xml | Content-Length: 0
Notice that the Expires header was not included in the SUBSCRIBE request; this means that the default value of 3600 (i.e., 3600 seconds = 1 hour) applies.
请注意,订阅请求中不包括Expires标头;这意味着默认值3600(即3600秒=1小时)适用。
Upon receiving the SUBSCRIBE, the SIP proxy needs to determine the identity of the domain portion of the Request-URI, which it does by following the procedures explained in Section 5 of [RFC7247]. If the domain is an XMPP domain, the SIP proxy will hand off the SUBSCRIBE to an associated SIP-to-XMPP gateway or connection manager that natively communicates with XMPP servers.
收到订阅后,SIP代理需要确定请求URI的域部分的标识,这是通过遵循[RFC7247]第5节中解释的过程来完成的。如果域是XMPP域,则SIP代理将向与XMPP服务器进行本机通信的关联SIP网关或连接管理器发送订阅。
The SIP-to-XMPP gateway is then responsible for translating the SUBSCRIBE into an XMPP authorization request addressed from the SIP user to the XMPP contact:
然后,SIP到XMPP网关负责将订阅转换为从SIP用户发送给XMPP联系人的XMPP授权请求:
Example 12: XMPP Transformation of SIP SUBSCRIBE (F28)
示例12:SIP SUBSCRIBE的XMPP转换(F28)
| <presence from='romeo@example.net' | to='juliet@example.com' | type='subscribe'/>
| <presence from='romeo@example.net' | to='juliet@example.com' | type='subscribe'/>
In accordance with [RFC6121], the XMPP user's server delivers the presence authorization request to the XMPP user (or, if an authorization already exists in the XMPP user's roster, the XMPP server SHOULD auto-reply with a <presence/> stanza of type 'subscribed').
根据[RFC6121],XMPP用户的服务器向XMPP用户发送状态授权请求(或者,如果XMPP用户名册中已经存在授权,则XMPP服务器应使用类型为“subscribed”的<presence/>节自动回复)。
The "happy path" is for the XMPP user to approve the presence authorization request by generating a <presence/> stanza of type "subscribed" (F30). The XMPP server then stamps that presence stanza with the 'from' address of the XMPP contact and sends it to the SIP user (F31). Upon receiving the stanza, the SIP-to-XMPP gateway generates an empty SIP NOTIFY message with a Subscription-State header [RFC6665] of "active", which serves to inform the SIP user that the presence authorization request has been approved (F32).
“快乐路径”用于XMPP用户通过生成类型为“subscribed”(F30)的<presence/>节来批准状态授权请求。然后,XMPP服务器用XMPP联系人的“发件人”地址标记该状态节,并将其发送给SIP用户(F31)。在接收到该节时,SIP到XMPP网关生成一个空的SIP NOTIFY消息,其中订阅状态头[RFC6665]为“活动”,用于通知SIP用户存在授权请求已被批准(F32)。
Example 13: XMPP User Approves Presence Authorization Request (F31)
示例13:XMPP用户批准状态授权请求(F31)
| <presence from='juliet@example.com' | to='romeo@example.net' | type='subscribed'/>
| <presence from='juliet@example.com' | to='romeo@example.net' | type='subscribed'/>
Example 14: Presence Authorization Request Approved (F32)
示例14:已批准的状态授权请求(F32)
| NOTIFY sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.com>;tag=ur93 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Subscription-State: active | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Length: 0
| NOTIFY sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.com>;tag=ur93 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Subscription-State: active | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Length: 0
As an alternative to the "happy path", the XMPP user could decline the presence authorization request by generating a <presence/> stanza of type "unsubscribed". The XMPP server would stamp that presence stanza with the 'from' address of the XMPP contact and would send it to the SIP user. The SIP-to-XMPP gateway then transforms that stanza into an empty SIP NOTIFY with a Subscription-State header [RFC6665] of "terminated" and a reason of "rejected":
作为“快乐路径”的替代方案,XMPP用户可以通过生成类型为“unsubscribed”的<presence/>节来拒绝状态授权请求。XMPP服务器将使用XMPP联系人的“发件人”地址标记该状态节,并将其发送给SIP用户。然后,SIP到XMPP网关将该节转换为一个空SIP NOTIFY,订阅状态头[RFC6665]为“已终止”,原因为“已拒绝”:
Example 15: XMPP User Rejects Presence Authorization Request
示例15:XMPP用户拒绝状态授权请求
| <presence from='juliet@example.com' | to='romeo@example.net' | type='unsubscribed'/>
| <presence from='juliet@example.com' | to='romeo@example.net' | type='unsubscribed'/>
Example 16: Presence Authorization Request Rejected
示例16:状态授权请求被拒绝
| NOTIFY sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.com>;tag=ur93 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Subscription-State: terminated;reason=rejected | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Length: 0
| NOTIFY sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.com>;tag=ur93 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Subscription-State: terminated;reason=rejected | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Length: 0
For as long as a SIP user is online and wishes to maintain a notification session (i.e., receive presence notifications from the XMPP contact), the user's SIP User Agent is responsible for periodically refreshing the notification dialog by sending an updated SUBSCRIBE request with an appropriate value for the Expires header. In response, the presence-aware SIP-to-XMPP gateway sends a SIP NOTIFY message to the SIP User Agent (per [RFC6665]); if the SIP-to-XMPP gateway has meaningful information about the availability state of the XMPP user (e.g., obtained from the core presence session in the XMPP server or learned by sending a presence probe as described under Section 7), then the NOTIFY communicates that information (e.g., by including a PIDF body [RFC3863] with the relevant data), whereas if the SIP-to-XMPP gateway does not have meaningful information about the availability state of the XMPP user, then the NOTIFY MUST be empty as allowed by [RFC6665].
只要SIP用户在线并且希望保持通知会话(即,从XMPP联系人接收状态通知),用户的SIP用户代理就负责通过发送具有适当Expires头值的更新订阅请求来定期刷新通知对话框。作为响应,感知状态的SIP到XMPP网关向SIP用户代理发送SIP通知消息(根据[rfc665]);如果SIP-to-XMPP网关具有关于XMPP用户可用性状态的有意义的信息(例如,从XMPP服务器中的核心存在会话获得,或通过发送第7节所述的存在探测来学习),则通知将传达该信息(例如,通过包括具有相关数据的PIDF主体[RFC3863]),然而,如果SIP到XMPP网关没有关于XMPP用户可用性状态的有意义的信息,则通知必须为空,这是[RFC6665]允许的。
SIP does not directly have a construct for cancelling an outbound presence authorization. Instead, the SIP user would terminate his outbound notification dialog by sending a SUBSCRIBE message whose Expires header is set to a value of zero ("0") and then never renew it:
SIP没有直接用于取消出站状态授权的构造。相反,SIP用户将通过发送一条其Expires头设置为零值(“0”)的订阅消息来终止其出站通知对话框,然后永不续订该消息:
Example 17: SIP User Terminates Notification Dialog
示例17:SIP用户终止通知对话框
| SUBSCRIBE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.com>;tag=ur93 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Max-Forwards: 70 | CSeq: 66 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Expires: 0 | Content-Length: 0
| SUBSCRIBE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=xfg9 | To: <sip:juliet@example.com>;tag=ur93 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Max-Forwards: 70 | CSeq: 66 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Expires: 0 | Content-Length: 0
A presence-aware SIP-to-XMPP gateway is then responsible for:
然后,感知状态的SIP到XMPP网关负责:
1. Sending a SIP NOTIFY request to the SIP User Agent containing a PIDF document specifying that the XMPP contact now has a basic status of "closed", including a Subscription-State header [RFC6665] of "terminated" with a reason of "timeout".
1. 向SIP用户代理发送SIP NOTIFY请求,其中包含一个PIDF文档,指定XMPP联系人现在的基本状态为“已关闭”,包括订阅状态头[RFC6665]为“已终止”,原因为“超时”。
2. Sending an XMPP <presence/> stanza of type "unavailable" to the XMPP contact.
2. 向XMPP联系人发送类型为“不可用”的XMPP<presence/>节。
Note: When the SIP user cancels his outbound presence authorization to the XMPP user, any inbound authorization that he might have approved (enabling the XMPP user to see his presence) remains unchanged.
注意:当SIP用户取消对XMPP用户的出站状态授权时,他可能已经批准的任何入站授权(使XMPP用户能够看到他的状态)保持不变。
Both XMPP and presence-aware SIP systems enable entities (often, but not necessarily, human users) to send presence notifications to other entities. At its most basic, the term "presence" refers to information about an entity's "on/off" availability for communication on a network. Often, this basic concept is supplemented by information that further specifies the entity's context or status while available for communication; these availability states commonly
XMPP和感知状态的SIP系统都支持实体(通常但不一定是人类用户)向其他实体发送状态通知。最基本的术语“存在”是指关于实体在网络上通信的“开/关”可用性的信息。通常,这一基本概念由信息补充,这些信息进一步指定了实体的上下文或状态,同时可用于通信;这些可用性状态通常为
include "away" and "do not disturb". Some systems and protocols extend the concepts of presence and availability even further and refer to any relatively ephemeral information about an entity as a kind of presence; categories of such "extended presence" include geographical location (e.g., GPS coordinates), user mood (e.g., grumpy), user activity (e.g., walking), and ambient environment (e.g., noisy). This document focuses on the "least common denominator" of network availability only. Future documents might address broader notions of presence, including availability states and extended presence or so-called "rich presence" as defined in specifications such as [RFC4480], [XEP-0107], and [XEP-0108].
包括“远离”和“请勿打扰”。一些系统和协议进一步扩展了存在性和可用性的概念,并将关于实体的任何相对短暂的信息称为一种存在;此类“扩展存在”的类别包括地理位置(例如GPS坐标)、用户情绪(例如脾气暴躁)、用户活动(例如步行)和周围环境(例如噪音)。本文档仅关注网络可用性的“最小公分母”。未来的文档可能会涉及更广泛的存在概念,包括可用性状态和扩展存在或所谓的“丰富存在”,如[RFC4480]、[XEP-0107]和[XEP-0108]等规范中所定义。
The XMPP instant messaging and presence specification [RFC6121] defines how XMPP <presence/> stanzas can indicate availability (via the absence of a 'type' attribute) or lack of availability (via a 'type' attribute with a value of "unavailable"). SIP presence using a SIP event package for presence is specified in [RFC3856].
XMPP即时消息和状态规范[RFC6121]定义了XMPP<presence/>节如何表示可用性(通过缺少“type”属性)或不可用性(通过值为“unavailable”的“type”属性)。[RFC3856]中规定了使用SIP事件包进行存在的SIP存在。
As described in [RFC6121], XMPP presence information about an entity is communicated by means of an XML <presence/> stanza sent over an XML stream. This document assumes that such a <presence/> stanza is sent from an XMPP client to an XMPP server over an XML stream negotiated between the client and the server, and that the client is controlled by a human user. In general, XMPP presence is sent by the user's client to the user's server and then broadcast to all entities who are subscribed to the user's presence information.
如[RFC6121]中所述,关于实体的XMPP状态信息通过通过XML流发送的XML<presence/>节进行通信。本文档假设这样一个<presence/>节通过客户机和服务器之间协商的XML流从XMPP客户机发送到XMPP服务器,并且客户机由人工用户控制。通常,XMPP状态由用户的客户端发送到用户的服务器,然后广播到订阅用户状态信息的所有实体。
As described in [RFC3856], presence information about an entity is communicated by means of a SIP NOTIFY event sent from a SIP User Agent to an intended recipient who is most generally referenced by a Presence URI of the form <pres:user@domain> but who might be referenced by a SIP or SIPS URI of the form <sip:user@domain> or <sips:user@domain>.
如[RFC3856]中所述,关于实体的存在信息通过SIP用户代理发送的SIP NOTIFY事件传递给预期接收者,该接收者通常由形式为<pres:user@domain>但SIP或SIPS URI形式为<SIP:user@domain>或<sips:user@domain>.
When Juliet interacts with her XMPP client to modify her presence information (or when her client automatically updates her presence information, e.g., via an "auto-away" feature), her client generates an XMPP <presence/> stanza. The syntax of the <presence/> stanza, including required and optional elements and attributes, is defined in [RFC6121]. The following is an example of such a stanza:
当Juliet与她的XMPP客户端交互以修改她的状态信息时(或者当她的客户端自动更新她的状态信息时,例如通过“自动离开”功能),她的客户端将生成一个XMPP<presence/>节。[RFC6121]中定义了<presence/>节的语法,包括必需的和可选的元素和属性。以下是这一节的一个例子:
Example 18: XMPP User Sends Presence Notification
示例18:XMPP用户发送状态通知
| <presence from='juliet@example.com/yn0cl4bnw0yr3vym'/>
| <presence from='juliet@example.com/yn0cl4bnw0yr3vym'/>
Upon receiving such a stanza, the XMPP server to which Juliet has connected broadcasts it to all subscribers who are authorized to receive presence notifications from Juliet and who have indicated a current interest in receiving notifications (this is similar to the SIP NOTIFY method). For each subscriber, broadcasting the presence notification involves adding the 'to' address of the subscriber and then either delivering the notification to a local recipient (if the hostname in the subscriber's address matches one of the hostnames serviced by the XMPP server) or attempting to route it to the foreign domain that services the hostname in the subscriber's address. If the notification is bound for an address at a foreign domain, the XMPP server needs to determine the identity of the domainpart in the 'to' address, which it does by following the procedures discussed in [RFC7247]. If the domain is a SIP domain, the XMPP server will hand off the <presence/> stanza to an associated XMPP-to-SIP gateway or connection manager that natively communicates with presence-aware SIP proxy.
在接收到这样一个节时,Juliet连接到的XMPP服务器将其广播给所有订阅者,这些订阅者有权从Juliet接收状态通知,并且表示当前对接收通知感兴趣(这类似于SIP NOTIFY方法)。对于每个订阅者,广播状态通知涉及添加订阅者的“收件人”地址,然后将通知发送给本地收件人(如果订阅者地址中的主机名与XMPP服务器提供服务的主机名之一匹配)或者尝试将其路由到为订阅服务器地址中的主机名提供服务的外部域。如果通知绑定到外域中的地址,XMPP服务器需要确定“到”地址中domainpart的标识,这是通过遵循[RFC7247]中讨论的过程完成的。如果域是SIP域,XMPP服务器将把<presence/>节移交给关联的XMPP-to-SIP网关或连接管理器,该网关或连接管理器本机与感知状态的SIP代理进行通信。
The XMPP-to-SIP gateway is then responsible for translating the XMPP <presence/> stanza into a SIP NOTIFY request (including the PIDF document) from the XMPP user to the SIP contact.
然后,XMPP到SIP网关负责将XMPP<presence/>节转换为从XMPP用户到SIP联系人的SIP通知请求(包括PIDF文档)。
Example 19: SIP Transformation of XMPP Presence Notification
示例19:XMPP状态通知的SIP转换
| NOTIFY sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=gh19 | To: <sip:romeo@example.net> | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Call-ID: 2B44E147-3B53-45E4-9D48-C051F3216D14 | Event: presence | Subscription-State: active;expires=599 | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Type: application/pidf+xml | Content-Length: 192 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:juliet@example.com'> | <tuple id='ID-yn0cl4bnw0yr3vym'> | <status> | <basic>open</basic> | <show xmlns='jabber:client'>away</show> | </status> | </tuple> | </presence>
| NOTIFY sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=gh19 | To: <sip:romeo@example.net> | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Call-ID: 2B44E147-3B53-45E4-9D48-C051F3216D14 | Event: presence | Subscription-State: active;expires=599 | Max-Forwards: 70 | CSeq: 2 NOTIFY | Content-Type: application/pidf+xml | Content-Length: 192 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:juliet@example.com'> | <tuple id='ID-yn0cl4bnw0yr3vym'> | <status> | <basic>open</basic> | <show xmlns='jabber:client'>away</show> | </status> | </tuple> | </presence>
The mapping of XMPP syntax elements to SIP syntax elements MUST be as shown in the following table. (Mappings for elements not mentioned are undefined and therefore are a matter of implementation.)
XMPP语法元素到SIP语法元素的映射必须如下表所示。(未提及的元素映射未定义,因此是一个实现问题。)
+-----------------------------+---------------------------+ | XMPP Element or Attribute | SIP Header or PIDF Data | +-----------------------------+---------------------------+ | <presence/> stanza | "Event: presence" (1) | +-----------------------------+---------------------------+ | XMPP resource identifier | tuple 'id' attribute (2) | +-----------------------------+---------------------------+ | from | From | +-----------------------------+---------------------------+ | id | no mapping (3) | +-----------------------------+---------------------------+ | to | To | +-----------------------------+---------------------------+ | type | basic status (4) (5) | +-----------------------------+---------------------------+ | xml:lang | Content-Language | +-----------------------------+---------------------------+ | <priority/> | priority for tuple (6) | +-----------------------------+---------------------------+ | <show/> | no mapping (7) | +-----------------------------+---------------------------+ | <status/> | <note/> | +-----------------------------+---------------------------+
+-----------------------------+---------------------------+ | XMPP Element or Attribute | SIP Header or PIDF Data | +-----------------------------+---------------------------+ | <presence/> stanza | "Event: presence" (1) | +-----------------------------+---------------------------+ | XMPP resource identifier | tuple 'id' attribute (2) | +-----------------------------+---------------------------+ | from | From | +-----------------------------+---------------------------+ | id | no mapping (3) | +-----------------------------+---------------------------+ | to | To | +-----------------------------+---------------------------+ | type | basic status (4) (5) | +-----------------------------+---------------------------+ | xml:lang | Content-Language | +-----------------------------+---------------------------+ | <priority/> | priority for tuple (6) | +-----------------------------+---------------------------+ | <show/> | no mapping (7) | +-----------------------------+---------------------------+ | <status/> | <note/> | +-----------------------------+---------------------------+
Table 1: Presence Syntax Mapping from XMPP to SIP
表1:从XMPP到SIP的状态语法映射
Note the following regarding these mappings:
请注意有关这些映射的以下内容:
1. Only an XMPP <presence/> stanza that lacks a 'type' attribute or whose 'type' attribute has a value of "unavailable" is mapped by an XMPP-to-SIP gateway to a SIP NOTIFY request, because those are the only <presence/> stanzas that represent notifications.
1. XMPP-to-SIP-gateway仅将缺少“type”属性或其“type”属性值为“unavailable”的XMPP<presence/>节映射到SIP-NOTIFY请求,因为这些节是表示通知的唯一<presence/>节。
2. The PIDF schema defines the tuple 'id' attribute as having a datatype of "xs:ID"; because this datatype is more restrictive than the "xs:string" datatype for XMPP resourceparts (in particular, a number is not allowed as the first character of an ID), it is RECOMMENDED to prepend the resourcepart with "ID-" or some other alphabetic string when mapping from XMPP to SIP.
2. PIDF模式将元组“id”属性定义为具有数据类型“xs:id”;由于此数据类型比XMPP resourceparts的“xs:string”数据类型更具限制性(特别是,不允许数字作为ID的第一个字符),因此在从XMPP映射到SIP时,建议在resourcepart前面加上“ID-”或其他字母字符串。
3. In practice, XMPP <presence/> stanzas often do not include the 'id' attribute.
3. 实际上,XMPP<presence/>节通常不包含“id”属性。
4. Because the lack of a 'type' attribute indicates that an XMPP entity is available for communication, the XMPP-to-SIP gateway MUST map that information to a PIDF basic status of "open". Because a 'type' attribute with a value of "unavailable" indicates that an XMPP entity is not available for communication, the XMPP-to-SIP gateway MUST map that information to a PIDF <basic/> status of "closed".
4. 因为缺少“type”属性表示XMPP实体可用于通信,所以XMPP到SIP网关必须将该信息映射到PIDF基本状态“open”。因为值为“unavailable”的“type”属性表示XMPP实体不可用于通信,所以XMPP到SIP网关必须将该信息映射到“closed”的PIDF<basic/>状态。
5. When the XMPP-to-SIP gateway receives an XMPP presence of type "unavailable" from the XMPP contact, it sends a SIP NOTIFY request from the XMPP contact to the SIP User Agent containing a PIDF document specifying that the XMPP contact now has a basic status of "closed".
5. 当XMPP-to-SIP网关从XMPP联系人接收到类型为“不可用”的XMPP存在时,它从XMPP联系人向SIP用户代理发送SIP NOTIFY请求,其中包含一个PIDF文档,指定XMPP联系人现在的基本状态为“已关闭”。
6. The value of the XMPP <priority/> element is an integer between -128 and +127, whereas the value of the PIDF <contact/> element's 'priority' attribute is a decimal number from zero to one inclusive, with a maximum of three decimal places. If the value of the XMPP <priority/> element is negative, an XMPP-to-SIP gateway MUST NOT map the value. If an XMPP-to-SIP gateway maps positive values, it SHOULD treat XMPP priority 0 as PIDF priority 0 and XMPP priority 127 as PIDF priority 1, mapping intermediate values appropriately so that they are unique (e.g., XMPP priority 1 to PIDF priority 0.007, XMPP priority 2 to PIDF priority 0.015, and so on up through mapping XMPP priority 126 to PIDF priority 0.992; note that this is an example only and that the exact mapping is up to the implementation).
6. XMPP<priority/>元素的值是一个介于-128和+127之间的整数,而PIDF<contact/>元素的“priority”属性的值是一个从零到一(含一)的十进制数,最多有三位小数。如果XMPP<priority/>元素的值为负,则XMPP-to-SIP网关不能映射该值。如果XMPP到SIP网关映射正值,则应将XMPP优先级0视为PIDF优先级0,将XMPP优先级127视为PIDF优先级1,并适当映射中间值,使其唯一(例如,通过将XMPP优先级126映射到PIDF优先级0.992,XMPP优先级1到PIDF优先级0.007,XMPP优先级2到PIDF优先级0.015等等;请注意,这只是一个示例,具体映射取决于实现)。
7. Some implementations support custom extensions to encapsulate detailed information about availability; however, there is no need to standardize a PIDF extension for this purpose, because PIDF is already extensible, and thus the XMPP <show/> element (qualified by the 'jabber:client' namespace) can be included directly in the PIDF XML. The examples in this document illustrate this usage, which is RECOMMENDED. The most useful values are likely "away" and "dnd" (both defined in [RFC6121]), although note that in XMPP a value of "dnd" (short for "do not disturb") merely means "busy" and does not imply that a server or client ought to block incoming traffic while the user is in that state. Naturally, an XMPP-to-SIP gateway can choose to translate a custom extension into an established value of the XMPP <show/> element (as defined in [RFC6121]) or translate a <show/> element into a custom extension that the XMPP-to-SIP gateway knows is supported by the SIP User Agent of the intended recipient. Unfortunately, this behavior does not guarantee that information will not be lost; to help prevent information loss, an XMPP-to-SIP gateway ought to include both the <show/> element and the custom extension if it cannot suitably translate the custom value
7. 一些实现支持定制扩展来封装有关可用性的详细信息;但是,没有必要为此标准化PIDF扩展,因为PIDF已经是可扩展的,因此XMPP<show/>元素(由“jabber:client”名称空间限定)可以直接包含在PIDF XML中。本文档中的示例说明了此用法,推荐使用。最有用的值可能是“away”和“dnd”(均在[RFC6121]中定义),但请注意,在XMPP中,“dnd”的值(缩写为“请勿打扰”)仅表示“繁忙”,并不意味着服务器或客户机应在用户处于该状态时阻止传入流量。当然,XMPP-to-SIP网关可以选择将自定义扩展转换为XMPP<show/>元素(如[RFC6121]中定义的)的已建立值,或者将<show/>元素转换为XMPP-to-SIP网关知道目标接收方的SIP用户代理支持的自定义扩展。不幸的是,这种行为不能保证信息不会丢失;为了帮助防止信息丢失,如果XMPP-to-SIP网关不能适当地转换自定义值,那么它应该同时包含<show/>元素和自定义扩展
into a <show/> value. However, there is no guarantee that the SIP receiver will render a standard XMPP <show/> value or custom extension.
转换为<show/>值。但是,不能保证SIP接收器将呈现标准XMPP<show/>值或自定义扩展。
In XMPP, a user can connect with multiple clients at the same time [RFC6120]; for presence notification purposes [RFC6121], each client is associated with a distinct resourcepart [RFC7622] and a contact's SIP User Agent will receive a separate presence notification from each of the XMPP user's clients. Although the interpretation of multiple presence notifications from a single user is a matter of implementation by the contact's SIP User Agent, typically the SIP User Agent will show the "most available" status for the contact (e.g., if the user is online with three devices, one of which is "away", one of which is in "do not disturb" mode, and one of which is "available" with no qualifications, then the status shown will simply be "available"). In SIP, it is reasonable for a SIP User Agent to model multiple presence notifications from an XMPP user in the same way that it would handle multiple tuples from a SIP user.
在XMPP中,用户可以同时连接多个客户端[RFC6120];出于状态通知的目的[RFC6121],每个客户端都与不同的resourcepart[RFC7622]相关联,联系人的SIP用户代理将从每个XMPP用户的客户端接收单独的状态通知。尽管对来自单个用户的多个存在通知的解释是由联系人的SIP用户代理实现的问题,但通常SIP用户代理将显示联系人的“最可用”状态(例如,如果用户与三个设备联机,其中一个设备为“远离”,另一个设备为“请勿打扰”)模式,其中一个是“可用”的,没有任何限制条件,则显示的状态将只是“可用”)。在SIP中,SIP用户代理对来自XMPP用户的多个状态通知进行建模是合理的,就像它处理来自SIP用户的多个元组一样。
When Romeo changes his presence, his SIP User Agent generates a SIP NOTIFY request for any contacts that have presence authorizations and notification sessions. The syntax of the NOTIFY request is defined in [RFC3856]. The following is an example of such a request:
当Romeo更改状态时,他的SIP用户代理会为具有状态授权和通知会话的任何联系人生成SIP NOTIFY请求。通知请求的语法在[RFC3856]中定义。以下是此类请求的示例:
Example 20: SIP User Sends Presence Notification
示例20:SIP用户发送状态通知
| NOTIFY sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=yt66 | To: <sip:juliet@example.com>;tag=bi54 | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Call-ID: C33C6C9D-0F4A-42F9-B95C-7CE86B526B5B | Event: presence | Subscription-State: active;expires=499 | Max-Forwards: 70 | CSeq: 8 NOTIFY | Content-Type: application/pidf+xml | Content-Length: 193 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:romeo@example.net'> | <tuple id='ID-dr4hcr0st3lup4c'> | <status> | <basic>closed</basic> | </status> | </tuple> | </presence>
| NOTIFY sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=yt66 | To: <sip:juliet@example.com>;tag=bi54 | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Call-ID: C33C6C9D-0F4A-42F9-B95C-7CE86B526B5B | Event: presence | Subscription-State: active;expires=499 | Max-Forwards: 70 | CSeq: 8 NOTIFY | Content-Type: application/pidf+xml | Content-Length: 193 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:romeo@example.net'> | <tuple id='ID-dr4hcr0st3lup4c'> | <status> | <basic>closed</basic> | </status> | </tuple> | </presence>
Upon receiving the NOTIFY, the SIP proxy needs to determine the identity of the domain portion of the Request-URI, which it does by following the procedures discussed in [RFC7247]. If the domain is an XMPP domain, the SIP proxy will hand off the NOTIFY to an associated SIP-to-XMPP gateway or connection manager that natively communicates with XMPP servers.
收到通知后,SIP代理需要确定请求URI的域部分的标识,这是通过遵循[RFC7247]中讨论的过程来完成的。如果域是XMPP域,SIP代理将把通知传递给与XMPP服务器进行本机通信的关联SIP到XMPP网关或连接管理器。
The SIP-to-XMPP gateway is then responsible for translating the NOTIFY into an XMPP <presence/> stanza addressed from the SIP user to the XMPP contact:
然后,SIP到XMPP网关负责将通知转换为从SIP用户到XMPP联系人的XMPP<presence/>节:
Example 21: XMPP Transformation of SIP Presence Notification
示例21:SIP状态通知的XMPP转换
| <presence from='romeo@example.net' | to='juliet@example.com/yn0cl4bnw0yr3vym' | type='unavailable'/>
| <presence from='romeo@example.net' | to='juliet@example.com/yn0cl4bnw0yr3vym' | type='unavailable'/>
The mapping of SIP syntax elements to XMPP syntax elements MUST be as shown in the following table. (Mappings for elements not mentioned are undefined and therefore are a matter of implementation.)
SIP语法元素到XMPP语法元素的映射必须如下表所示。(未提及的元素映射未定义,因此是一个实现问题。)
+---------------------------+-----------------------------+ | SIP Header or PIDF Data | XMPP Element or Attribute | +---------------------------+-----------------------------+ | basic status | type (1) | +---------------------------+-----------------------------+ | Content-Language | xml:lang | +---------------------------+-----------------------------+ | From | from | +---------------------------+-----------------------------+ | priority for tuple | <priority/> (2) | +---------------------------+-----------------------------+ | To | to | +---------------------------+-----------------------------+ | <note/> | <status/> | +---------------------------+-----------------------------+ | <show/> | <show/> (3) | +---------------------------+-----------------------------+
+---------------------------+-----------------------------+ | SIP Header or PIDF Data | XMPP Element or Attribute | +---------------------------+-----------------------------+ | basic status | type (1) | +---------------------------+-----------------------------+ | Content-Language | xml:lang | +---------------------------+-----------------------------+ | From | from | +---------------------------+-----------------------------+ | priority for tuple | <priority/> (2) | +---------------------------+-----------------------------+ | To | to | +---------------------------+-----------------------------+ | <note/> | <status/> | +---------------------------+-----------------------------+ | <show/> | <show/> (3) | +---------------------------+-----------------------------+
Table 2: Presence Syntax Mapping from SIP to XMPP
表2:从SIP到XMPP的状态语法映射
Note the following regarding these mappings:
请注意有关这些映射的以下内容:
1. A PIDF basic status of "open" MUST be mapped to a <presence/> stanza with no 'type' attribute, and a PIDF basic status of "closed" MUST be mapped to a <presence/> stanza whose 'type' attribute has a value of "unavailable".
1. PIDF基本状态“打开”必须映射到没有“类型”属性的<presence/>节,PIDF基本状态“关闭”必须映射到其“type”属性值为“unavailable”的<presence/>节。
2. See the notes following Table 1 of this document regarding mapping of presence priority.
2. 请参阅本文档表1中关于状态优先级映射的注释。
3. If a SIP implementation supports the XMPP <show/> element (qualified by the 'jabber:client' namespace) as a PIDF extension for availability status as described in the notes following Table 1 of this document, the SIP-to-XMPP gateway is responsible for including that element in the XMPP presence notification.
3. 如果SIP实现支持XMPP<show/>元素(由“jabber:client”命名空间限定)作为本文档表1下注释中所述的可用性状态的PIDF扩展,则SIP到XMPP网关负责将该元素包括在XMPP存在通知中。
Both SIP and XMPP provide methods for explicitly requesting one-time information about the current presence status of another entity. These are "polling" methods as opposed to the publish-subscribe methods described in the rest of this document.
SIP和XMPP都提供了明确请求关于另一个实体当前存在状态的一次性信息的方法。这些是“轮询”方法,与本文档其余部分中描述的发布-订阅方法不同。
In XMPP, an explicit request for information about current presence status is completed by sending a <presence/> stanza of type "probe":
在XMPP中,通过发送类型为“probe”的<presence/>节来完成对当前状态信息的显式请求:
Example 22: XMPP Server Sends Presence Probe on Behalf of XMPP User
示例22:XMPP服务器代表XMPP用户发送状态探测
| <presence from='juliet@example.com/chamber' | to='romeo@example.net' | type='probe'/>
| <presence from='juliet@example.com/chamber' | to='romeo@example.net' | type='probe'/>
Note: As described in [RFC6121], presence probes are used by XMPP servers to request presence on behalf of XMPP users; XMPP clients are discouraged from sending presence probes, because retrieving presence is a service that XMPP servers provide automatically.
注:如[RFC6121]所述,XMPP服务器使用状态探测代表XMPP用户请求状态;不鼓励XMPP客户端发送状态探测,因为检索状态是XMPP服务器自动提供的服务。
A SIP-to-XMPP gateway would transform the presence probe into its SIP equivalent, which is a SUBSCRIBE request with an Expires header value of zero ("0") in a new dialog:
SIP到XMPP网关将状态探测转换为其SIP等价物,这是一个订阅请求,在一个新对话框中,Expires头值为零(“0”):
Example 23: SIP Transformation of XMPP Presence Probe
示例23:XMPP存在探测的SIP转换
| SUBSCRIBE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | Call-ID: 2398B737-566F-4CBB-A21A-1F8EEF7AF423 | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Accept: application/pidf+xml | Expires: 0 | Content-Length: 0
| SUBSCRIBE sip:romeo@example.net SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:juliet@example.com>;tag=j89d | Call-ID: 2398B737-566F-4CBB-A21A-1F8EEF7AF423 | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:juliet@example.com>;gr=yn0cl4bnw0yr3vym | Accept: application/pidf+xml | Expires: 0 | Content-Length: 0
As described in [RFC3856], this causes a NOTIFY to be sent to the subscriber, just as a presence probe does (the transformation rules for presence notifications have been previously described in Section 6.2 of this document).
如[RFC3856]中所述,这将导致向订阅者发送通知,就像状态探测一样(本文档第6.2节中已经描述了状态通知的转换规则)。
In SIP, an explicit request for information about current presence status is effectively completed by sending a SUBSCRIBE with an Expires header value of zero ("0"):
在SIP中,通过发送Expires头值为零(“0”)的订阅,可以有效地完成对当前状态信息的显式请求:
Example 24: SIP User Sends Presence Request
示例24:SIP用户发送状态请求
| SUBSCRIBE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=yt66 | Call-ID: 717B1B84-F080-4F12-9F44-0EC1ADE767B9 | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Expires: 0 | Content-Length: 0
| SUBSCRIBE sip:juliet@example.com SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:romeo@example.net>;tag=yt66 | Call-ID: 717B1B84-F080-4F12-9F44-0EC1ADE767B9 | Event: presence | Max-Forwards: 70 | CSeq: 1 SUBSCRIBE | Contact: <sip:romeo@example.net>;gr=dr4hcr0st3lup4c | Expires: 0 | Content-Length: 0
A presence-aware SIP-to-XMPP gateway translates such a SIP request into a <presence/> stanza of type "probe" if it does not already have presence information about the contact:
感知状态的SIP-to-XMPP网关将此类SIP请求转换为类型为“probe”的<presence/>节,前提是它还没有关于联系人的状态信息:
Example 25: XMPP Transformation of SIP Presence Request
示例25:SIP状态请求的XMPP转换
| <presence from='romeo@example.net' | to='juliet@example.com' | type='probe'/>
| <presence from='romeo@example.net' | to='juliet@example.com' | type='probe'/>
Detailed privacy and security considerations are given for presence protocols in [RFC2779], for SIP-based presence in [RFC3856] (see also [RFC3261]), and for XMPP-based presence in [RFC6121] (see also [RFC6120]).
[RFC2779]中的存在协议、[RFC3856]中基于SIP的存在(另请参见[RFC3261])以及[RFC6121]中基于XMPP的存在(另请参见[RFC6120])都给出了详细的隐私和安全注意事项。
There exists the possibility of an amplification attack launched from the XMPP network against a SIP Presence Server, because each long-lived XMPP presence authorization would typically result in multiple notification dialog refreshes on the SIP side of an XMPP-to-SIP gateway. Therefore, access to an XMPP-to-SIP gateway SHOULD be restricted in various ways; for example:
存在从XMPP网络针对SIP状态服务器发起放大攻击的可能性,因为每个长期存在的XMPP状态授权通常会导致XMPP-to-SIP网关SIP端的多个通知对话框刷新。因此,应该以各种方式限制对XMPP到SIP网关的访问;例如:
o Only an XMPP service that carefully controls account provisioning and provides effective methods for the administrators to control the behavior of registered users ought to host an XMPP-to-SIP gateway (e.g., not a service that offers open account registration).
o 只有谨慎控制帐户设置并为管理员提供有效方法来控制注册用户行为的XMPP服务才应该托管XMPP-to-SIP网关(例如,不是提供开放帐户注册的服务)。
o An XMPP-to-SIP gateway ought to be associated with only a single domain or trust realm. For example, an XMPP-to-SIP gateway hosted at simple.example.com ought to allow only users within the example.com domain to access the XMPP-to-SIP gateway, not users within example.org, example.net, or any other domain (unless they are part of the same multi-tenanted environment as example.com). This helps to prevent the gateway equivalent of open relays that are shared across XMPP domains from different trust realms.
o XMPP到SIP网关应该只与单个域或信任域相关联。例如,托管在simple.example.com上的XMPP-to-SIP网关应该只允许example.com域中的用户访问XMPP-to-SIP网关,而不允许example.org、example.net或任何其他域中的用户(除非他们与example.com属于同一个多租户环境)。这有助于防止来自不同信任域的XMPP域之间共享的网关等效开放中继。
If a SIP Presence Server receives communications through an XMPP-to-SIP gateway from users who are not associated with a domain that is so related to the hostname of the XMPP-to-SIP gateway, it SHOULD (based on local service provisioning) refuse to service such users or refuse to receive traffic from the XMPP-to-SIP gateway. As a further check, whenever an XMPP-to-SIP gateway seeks to refresh an XMPP user's long-lived authorization to a SIP user's presence, it first sends an XMPP <presence/> stanza of type "probe" from the address of the XMPP-to-SIP gateway to the "bare Jabber Identifier (JID)" (user@domain.tld) of the XMPP user, to which the user's XMPP server responds in accordance with [RFC6121]; this puts an equal burden on the XMPP server and the SIP proxy.
如果SIP状态服务器通过XMPP-to-SIP网关从与XMPP-to-SIP网关的主机名不相关的域的用户接收通信,则它应(基于本地服务提供)拒绝为此类用户提供服务或拒绝接收来自XMPP-to-SIP网关的通信量。作为进一步检查,每当XMPP-to-SIP网关试图将XMPP用户的长期授权刷新到SIP用户的状态时,它首先从XMPP-to-SIP网关的地址向“裸Jabber标识符(JID)”发送类型为“probe”的XMPP<presence/>节(user@domain.tld)对于XMPP用户,用户的XMPP服务器根据[RFC6121]对其作出响应;这给XMPP服务器和SIP代理带来了相同的负担。
Presence notifications can contain sensitive information (e.g., about network availability). In addition, it is possible in both SIP and XMPP for an entity to send different presence notifications to different subscribers. Therefore, a gateway MUST NOT route or deliver a presence notification to any entity other than the intended recipient (as represented by the 'to' address for XMPP and by the Request-URI for SIP), because it does not possess information about authorization to receive presence notifications for such entities -- that information resides at the user's home service, not at the receiving gateway.
状态通知可能包含敏感信息(例如,有关网络可用性的信息)。此外,在SIP和XMPP中,实体可以向不同的订阅者发送不同的状态通知。因此,网关不得将状态通知路由或传递给除预期收件人以外的任何实体(由XMPP的“to”地址和SIP的请求URI表示),因为它不具备关于授权接收此类实体的状态通知的信息——这些信息驻留在用户的家庭服务中,而不是在接收网关中。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<http://www.rfc-editor.org/info/rfc2119>.
[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, DOI 10.17487/RFC3261, June 2002, <http://www.rfc-editor.org/info/rfc3261>.
[RFC3261]Rosenberg,J.,Schulzrinne,H.,Camarillo,G.,Johnston,A.,Peterson,J.,Sparks,R.,Handley,M.,和E.Schooler,“SIP:会话启动协议”,RFC 3261,DOI 10.17487/RFC3261,2002年6月<http://www.rfc-editor.org/info/rfc3261>.
[RFC3856] Rosenberg, J., "A Presence Event Package for the Session Initiation Protocol (SIP)", RFC 3856, DOI 10.17487/RFC3856, August 2004, <http://www.rfc-editor.org/info/rfc3856>.
[RFC3856]Rosenberg,J.,“会话启动协议(SIP)的存在事件包”,RFC 3856,DOI 10.17487/RFC3856,2004年8月<http://www.rfc-editor.org/info/rfc3856>.
[RFC3857] Rosenberg, J., "A Watcher Information Event Template-Package for the Session Initiation Protocol (SIP)", RFC 3857, DOI 10.17487/RFC3857, August 2004, <http://www.rfc-editor.org/info/rfc3857>.
[RFC3857]Rosenberg,J.,“会话启动协议(SIP)的观察者信息事件模板包”,RFC 3857,DOI 10.17487/RFC3857,2004年8月<http://www.rfc-editor.org/info/rfc3857>.
[RFC3863] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, DOI 10.17487/RFC3863, August 2004, <http://www.rfc-editor.org/info/rfc3863>.
[RFC3863]Sugano,H.,Fujimoto,S.,Klyne,G.,Batman,A.,Carr,W.,和J.Peterson,“状态信息数据格式(PIDF)”,RFC 3863,DOI 10.17487/RFC3863,2004年8月<http://www.rfc-editor.org/info/rfc3863>.
[RFC6120] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Core", RFC 6120, DOI 10.17487/RFC6120, March 2011, <http://www.rfc-editor.org/info/rfc6120>.
[RFC6120]Saint Andre,P.,“可扩展消息和状态协议(XMPP):核心”,RFC 6120,DOI 10.17487/RFC6120,2011年3月<http://www.rfc-editor.org/info/rfc6120>.
[RFC6121] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence", RFC 6121, DOI 10.17487/RFC6121, March 2011, <http://www.rfc-editor.org/info/rfc6121>.
[RFC6121]Saint Andre,P.,“可扩展消息和状态协议(XMPP):即时消息和状态”,RFC 6121DOI 10.17487/RFC6121,2011年3月<http://www.rfc-editor.org/info/rfc6121>.
[RFC6665] Roach, A.B., "SIP-Specific Event Notification", RFC 6665, DOI 10.17487/RFC6665, July 2012, <http://www.rfc-editor.org/info/rfc6665>.
[RFC6665]Roach,A.B.,“SIP特定事件通知”,RFC 6665,DOI 10.17487/RFC66652012年7月<http://www.rfc-editor.org/info/rfc6665>.
[RFC7247] Saint-Andre, P., Houri, A., and J. Hildebrand, "Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Architecture, Addresses, and Error Handling", RFC 7247, DOI 10.17487/RFC7247, May 2014, <http://www.rfc-editor.org/info/rfc7247>.
[RFC7247]Saint Andre,P.,Houri,A.,和J.Hildebrand,“会话启动协议(SIP)和可扩展消息和状态协议(XMPP)之间的互通:体系结构、地址和错误处理”,RFC 7247,DOI 10.17487/RFC7247,2014年5月<http://www.rfc-editor.org/info/rfc7247>.
[RFC7622] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Address Format", RFC 7622, DOI 10.17487/RFC7622, September 2015, <http://www.rfc-editor.org/info/rfc7622>.
[RFC7622]Saint Andre,P.,“可扩展消息和状态协议(XMPP):地址格式”,RFC 7622,DOI 10.17487/RFC7622,2015年9月<http://www.rfc-editor.org/info/rfc7622>.
[RFC2778] Day, M., Rosenberg, J., and H. Sugano, "A Model for Presence and Instant Messaging", RFC 2778, DOI 10.17487/RFC2778, February 2000, <http://www.rfc-editor.org/info/rfc2778>.
[RFC2778]Day,M.,Rosenberg,J.,和H.Sugano,“存在和即时消息传递的模型”,RFC 2778,DOI 10.17487/RFC2778,2000年2月<http://www.rfc-editor.org/info/rfc2778>.
[RFC2779] Day, M., Aggarwal, S., Mohr, G., and J. Vincent, "Instant Messaging / Presence Protocol Requirements", RFC 2779, DOI 10.17487/RFC2779, February 2000, <http://www.rfc-editor.org/info/rfc2779>.
[RFC2779]Day,M.,Aggarwal,S.,Mohr,G.,和J.Vincent,“即时消息传递/存在协议要求”,RFC 2779,DOI 10.17487/RFC27792000年2月<http://www.rfc-editor.org/info/rfc2779>.
[RFC3860] Peterson, J., "Common Profile for Instant Messaging (CPIM)", RFC 3860, DOI 10.17487/RFC3860, August 2004, <http://www.rfc-editor.org/info/rfc3860>.
[RFC3860]Peterson,J.,“即时消息的通用配置文件(CPIM)”,RFC 3860,DOI 10.17487/RFC3860,2004年8月<http://www.rfc-editor.org/info/rfc3860>.
[RFC4480] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg, "RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF)", RFC 4480, DOI 10.17487/RFC4480, July 2006, <http://www.rfc-editor.org/info/rfc4480>.
[RFC4480]Schulzrinne,H.,Gurbani,V.,Kyzivat,P.,和J.Rosenberg,“RPID:状态信息数据格式(PIDF)的丰富状态扩展”,RFC 4480,DOI 10.17487/RFC4480,2006年7月<http://www.rfc-editor.org/info/rfc4480>.
[RFC4825] Rosenberg, J., "The Extensible Markup Language (XML) Configuration Access Protocol (XCAP)", RFC 4825, DOI 10.17487/RFC4825, May 2007, <http://www.rfc-editor.org/info/rfc4825>.
[RFC4825]Rosenberg,J.“可扩展标记语言(XML)配置访问协议(XCAP)”,RFC 4825,DOI 10.17487/RFC4825,2007年5月<http://www.rfc-editor.org/info/rfc4825>.
[RFC7572] Saint-Andre, P., Houri, A., and J. Hildebrand, "Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Instant Messaging", RFC 7572, DOI 10.17487/RFC7572, June 2015, <http://www.rfc-editor.org/info/rfc7572>.
[RFC7572]Saint Andre,P.,Houri,A.,和J.Hildebrand,“会话启动协议(SIP)和可扩展消息和状态协议(XMPP)之间的互通:即时消息传递”,RFC 7572,DOI 10.17487/RFC7572,2015年6月<http://www.rfc-editor.org/info/rfc7572>.
[RFC7573] Saint-Andre, P. and S. Loreto, "Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): One-to-One Text Chat Sessions", RFC 7573, DOI 10.17487/RFC7573, June 2015, <http://www.rfc-editor.org/info/rfc7573>.
[RFC7573]Saint Andre,P.和S.Loreto,“会话启动协议(SIP)和可扩展消息和状态协议(XMPP)之间的互通:一对一文本聊天会话”,RFC 7573,DOI 10.17487/RFC7573,2015年6月<http://www.rfc-editor.org/info/rfc7573>.
[RFC7702] Saint-Andre, P., Ibarra, S., and S. Loreto, "Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Groupchat", RFC 7702, DOI 10.17487/RFC7702, December 2015, <http://www.rfc-editor.org/info/rfc7702>.
[RFC7702]Saint Andre,P.,Ibarra,S.,和S.Loreto,“会话启动协议(SIP)和可扩展消息和状态协议(XMPP)之间的互通:群聊”,RFC 7702,DOI 10.17487/RFC7702,2015年12月<http://www.rfc-editor.org/info/rfc7702>.
[XEP-0107] Saint-Andre, P. and R. Meijer, "User Mood", XSF XEP 0107, October 2008, <http://xmpp.org/extensions/xep-0107.html>.
[XEP-0107]Saint Andre,P.和R.Meijer,“用户情绪”,XSF XEP 0107,2008年10月<http://xmpp.org/extensions/xep-0107.html>.
[XEP-0108] Meijer, R. and P. Saint-Andre, "User Activity", XSF XEP 0108, October 2008, <http://xmpp.org/extensions/xep-0108.html>.
[XEP-0108]Meijer,R.和P.Saint Andre,“用户活动”,XSF XEP 0108,2008年10月<http://xmpp.org/extensions/xep-0108.html>.
RFC 7248 had already been published when the STOX working group discovered that a related document (since published as [RFC7702]) contained problems that also applied to RFC 7248. Specifically, the diagrams and protocol flows in RFC 7248 contained errors that reflected an incorrect architecture with gateways on both sides of the protocol exchange; in theory and in practice, presence traffic from an XMPP system would be translated by an XMPP-to-SIMPLE gateway on the XMPP side and received by a normal SIP/SIMPLE system directly (without a receiving gateway on the SIP/SIMPLE side), and traffic from a SIP system would be translated by a SIMPLE-to-XMPP gateway on the SIP side and received by a normal XMPP system (without a receiving gateway on the XMPP side).
当STOX工作组发现相关文件(自发布为[RFC7702])包含同样适用于RFC 7248的问题时,RFC 7248已经发布。具体而言,RFC 7248中的图表和协议流包含错误,这些错误反映了协议交换两侧都有网关的不正确体系结构;在理论和实践中,来自XMPP系统的存在流量将由XMPP转换为XMPP侧的简单网关,并由普通SIP/简单系统直接接收(SIP/简单侧没有接收网关),来自SIP系统的流量将由SIP侧的简单到XMPP网关转换,并由普通XMPP系统接收(XMPP侧没有接收网关)。
Therefore, this document makes the following substantive changes from RFC 7248:
因此,本文件对RFC 7248进行了以下实质性修改:
o Corrects the architectural assumptions, diagrams, and protocol flows to reflect a single-gateway model in each direction.
o 更正了体系结构假设、图表和协议流,以在每个方向上反映单个网关模型。
o Adjusts terminology to replace the term "SIP Server" with the term "SIP Proxy" or "SIP Presence Server" as appropriate, and to use the term "notification dialog" for a SIP subscription and the term "presence authorization" for an XMPP subscription instead of the generic term "subscription" in both contexts.
o 调整术语,将术语“SIP服务器”替换为术语“SIP代理”或“SIP状态服务器”(视情况而定),并将术语“通知对话框”用于SIP订阅,将术语“状态授权”用于XMPP订阅,而不是两种上下文中的通用术语“订阅”。
o Clarifies that SIP notification dialogs are used to handle presence authorizations in SIP (e.g., there is no dedicated way to signal outbound cancellation of an authorization as there is in XMPP).
o 阐明了SIP通知对话框用于处理SIP中的状态授权(例如,没有专用的方式像XMPP中那样发出授权出站取消的信号)。
o Clarifies the use of the 'presence.winfo' event package, of the SIP Subscription-State headers (specifically with values of "pending", "active", "closed", or "terminated"), and of SIP NOTIFY messages with no body.
o 阐明了“presence.winfo”事件包、SIP订阅状态头(特别是具有“pending”、“active”、“closed”或“terminated”值)和SIP NOTIFY消息(无正文)的使用。
o Clarifies the durations of notification dialogs and presence authorizations, and how they are extended in SIP and handled in XMPP.
o 阐明通知对话框和状态授权的持续时间,以及它们在SIP中的扩展方式和在XMPP中的处理方式。
o Removes the mapping of the XMPP 'id' attribute to the SIP "CSeq" header.
o 删除XMPP“id”属性到SIP“CSeq”头的映射。
o Describes the handling of multiple connected resources in XMPP.
o 描述在XMPP中处理多个连接的资源。
o Provides information about mitigations for leaks of presence information.
o 提供有关状态信息泄漏的缓解措施的信息。
Acknowledgements
致谢
Thanks to the authors, contributors, and other individuals acknowledged in RFC 7248.
感谢RFC 7248中确认的作者、贡献者和其他个人。
Thanks to Saul Ibarra Corretge and Markus Isomaki for their reviews during working group consideration.
感谢Saul Ibarra Corretge和Markus Isomaki在工作组审议期间的审查。
Special thanks to Ben Campbell for identifying the underlying discrepancy that resulted in the need to obsolete RFC 7248.
特别感谢Ben Campbell确定了导致需要淘汰RFC 7248的潜在差异。
Thanks also to Markus Isomaki and Yana Stamcheva as the working group chairs and Alissa Cooper as the sponsoring Area Director.
还感谢马库斯·伊索马基和亚娜·斯坦切娃担任工作组主席,艾莉莎·库珀担任赞助区域主任。
Author's Address
作者地址
Peter Saint-Andre Filament
彼得·圣安德烈灯丝
Email: peter@filament.com URI: https://filament.com/
Email: peter@filament.com URI: https://filament.com/