idnits 2.17.1 draft-saintandre-sip-xmpp-presence-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 02, 2013) is 4039 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 705 -- Looks like a reference, but probably isn't: '2' on line 604 -- Looks like a reference, but probably isn't: '3' on line 608 -- Looks like a reference, but probably isn't: '4' on line 608 -- Looks like a reference, but probably isn't: '5' on line 611 == Outdated reference: A later version (-05) exists of draft-saintandre-sip-xmpp-core-04 Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. Saint-Andre 3 Internet-Draft Cisco Systems, Inc. 4 Intended status: Standards Track A. Houri 5 Expires: October 04, 2013 IBM 6 J. Hildebrand 7 Cisco Systems, Inc. 8 April 02, 2013 10 Interworking between the Session Initiation Protocol (SIP) and the 11 Extensible Messaging and Presence Protocol (XMPP): Presence 12 draft-saintandre-sip-xmpp-presence-05 14 Abstract 16 This document defines a bi-directional protocol mapping for the 17 exchange of presence information between the Session Initiation 18 Protocol (SIP) and the Extensible Messaging and Presence Protocol 19 (XMPP). 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on October 04, 2013. 38 Copyright Notice 40 Copyright (c) 2013 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 3. Presence Subscriptions . . . . . . . . . . . . . . . . . . . 3 58 3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 3 59 3.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 4 60 3.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 8 61 4. Presence Notifications . . . . . . . . . . . . . . . . . . . 11 62 4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 11 63 4.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 12 64 4.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 15 65 5. Security Considerations . . . . . . . . . . . . . . . . . . . 17 66 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 67 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 68 7.1. Normative References . . . . . . . . . . . . . . . . . . 18 69 7.2. Informative References . . . . . . . . . . . . . . . . . 19 70 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 19 71 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19 73 1. Introduction 75 In order to help ensure interworking between presence systems that 76 conform to the instant message / presence requirements [RFC2779], it 77 is important to clearly define protocol mappings between such 78 systems. Within the IETF, work has proceeded on two presence 79 technologies: 81 o Various extensions to the Session Initiation Protocol ([RFC3261]) 82 for instant messaging, as developed within the SIP for Instant 83 Messaging and Presence Leveraging Extensions (SIMPLE) Working 84 Group; the relevant specification for presence is [RFC3856] 86 o The Extensible Messaging and Presence Protocol (XMPP), which 87 consists of a formalization of the core XML streaming protocols 88 developed originally by the Jabber open-source community; the 89 relevant specifications are [RFC6120] for the XML streaming layer 90 and [RFC6121] for basic presence and instant messaging extensions 92 One approach to helping ensure interworking between these protocols 93 is to map each protocol to the abstract semantics described in 94 [RFC3860]; that is the approach taken by both [RFC3922] and 95 [I-D.ietf-simple-cpim-mapping]. The approach taken in this document 96 is to directly map semantics from one protocol to another (i.e., from 97 SIP/SIMPLE to XMPP and vice-versa). 99 The architectural assumptions underlying such direct mappings are 100 provided in [I-D.saintandre-sip-xmpp-core], including mapping of 101 addresses and error conditions. The mappings specified in this 102 document cover basic presence functionality. Mapping of more 103 advanced functionality (e.g., so-called "rich presence") is out of 104 scope for this document. 106 The discussion venue for this document is the mailing list of the 107 DISPATCH WG; visit https://www.ietf.org/mailman/listinfo/dispatch for 108 subscription information and discussion archives. 110 2. Terminology 112 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 113 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 114 "OPTIONAL" in this document are to be interpreted as described in 115 [RFC2119]. 117 3. Presence Subscriptions 119 3.1. Overview 121 Both XMPP and presence-aware SIP systems enable entities (often but 122 not necessarily human users) to subscribe to the presence of other 123 entities. XMPP presence subscriptions are specified in [RFC6121]. 124 Presence subscriptions using a SIP event package for presence are 125 specified in [RFC3856]. 127 As described in [RFC6121], XMPP presence subscriptions are managed 128 using XMPP presence stanzas of type "subscribe", "subscribed", 129 "unsubscribe", and "unsubscribed". The main subscription states are 130 "none" (neither the user nor the contact is subscribed to the other's 131 presence information), "from" (the user has a subscription from the 132 contact), "to" (the user has a subscription to the contact's presence 133 information), and "both" (both user and contact are subscribed to 134 each other's presence information). 136 As described in [RFC3856], SIP presence subscriptions are managed 137 through the use of SIP SUBSCRIBE events sent from a SIP user agent to 138 an intended recipient who is most generally referenced by an Instant 139 Message URI of the form but who might be 140 referenced by a SIP or SIPS URI of the form or 141 . 143 The subscription models underlying XMPP and SIP are quite different. 144 For instance, XMPP presence subscriptions are long-lived (indeed 145 permanent if not explicitly cancelled), whereas SIP presence 146 subscriptions are short-lived (the default time-to-live of a SIP 147 presence subscription is 3600 seconds, as specified in Section 6.4 of 148 [RFC3856]). These differences are addressed below. 150 3.2. XMPP to SIP 152 3.2.1. Establishing 154 An XMPP user (e.g., juliet@example.com) initiates a subscription by 155 sending a subscription request to another entity (e.g., 156 romeo@example.net), and the other entity (conventionally called a 157 "contact") either accepts or declines the request. If the contact 158 accepts the request, the user will have a subscription to the 159 contact's presence information until (1) the user unsubscribes or (2) 160 the contact cancels the subscription. The subscription request is 161 encapsulated in a presence stanza of type "subscribe": 163 Example: XMPP user subscribes to SIP contact: 165 | 169 Upon receiving such a stanza, the XMPP server to which the user has 170 connected needs to determine the identity of the foreign domain, 171 which it does by performing one or more DNS SRV lookups [RFC2782]. 172 For presence stanzas, the order of lookups recommended by [RFC6121] 173 is to first try the "_xmpp-server" service as specified in [RFC6120] 174 and to then try the "_pres" service as specified in [RFC3861]. Here 175 we assume that the first lookup will fail but that the second lookup 176 will succeed and return a resolution "_pres._simple.example.net.", 177 since we have already assumed that the example.net hostname is 178 running a SIP presence service. 180 Once the XMPP server has determined that the foreign domain is 181 serviced by a SIMPLE server, it needs to determine how to proceed. 182 We here assume that the XMPP server contains or has available to it 183 an XMPP-SIMPLE gateway or connection manager (which enables it to 184 speak natively to SIMPLE servers). The XMPP server would then 185 deliver the presence stanza to the XMPP-SIMPLE gateway. 187 The XMPP-SIMPLE gateway is then responsible for translating the XMPP 188 subscription request into a SIP SUBSCRIBE request from the XMPP user 189 to the SIP user: 191 Example: XMPP user subscribes to SIP contact (SIP transformation): 193 | SUBSCRIBE sip:romeo@example.net SIP/2.0 194 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk 195 | From: ;tag=ffd2 196 | To: 197 | Call-ID: l04th3s1p@example.com 198 | Event: presence 199 | Max-Forwards: 70 200 | CSeq: 123 SUBSCRIBE 201 | Contact: 202 | Accept: application/pidf+xml 203 | Expires: 3600 204 | Content-Length: 0 206 The SIP user then SHOULD send a response indicating acceptance of the 207 subscription request: 209 Example: SIP accepts subscription request: 211 | SIP/2.0 200 OK 212 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk 213 | From: ;tag=ffd2 214 | To: ;tag=j89d 215 | Call-ID: l04th3s1p@example.com 216 | CSeq: 234 SUBSCRIBE 217 | Contact: 218 | Expires: 3600 219 | Content-Length: 0 221 In accordance with [RFC6665], the XMPP-SIMPLE gateway SHOULD consider 222 the subscription state to be "neutral" until it receives a NOTIFY 223 message. Therefore the SIP user or SIP-XMPP gateway at the SIP 224 user's domain SHOULD immediately send a NOTIFY message containing a 225 "Subscription-State" header whose value contains the string "active" 226 (see Section 4). 228 Example: SIP user sends presence notification: 230 | NOTIFY sip:192.0.2.1 SIP/2.0 231 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk 232 | From: ;tag=yt66 233 | To: ;tag=bi54 234 | Call-ID: l04th3s1p@example.com 235 | Event: presence 236 | Subscription-State: active;expires=499 237 | Max-Forwards: 70 238 | CSeq: 8775 NOTIFY 239 | Contact: 240 | Content-Type: application/pidf+xml 241 | Content-Length: 193 242 | 243 | 244 | 246 | 247 | 248 | open 249 | away 250 | 251 | 252 | 254 Upon receiving the first NOTIFY with a subscription state of active, 255 the XMPP-SIMPLE gateway MUST generate a presence stanza of type 256 "subscribed": 258 Example: XMPP user receives acknowledgement from SIP contact: 260 | 264 As described under Section 4, the gateway MUST also generate a 265 presence notification to the XMPP user: 267 Example: XMPP user receives presence notification from SIP contact: 269 | 272 3.2.2. Refreshing 273 It is the responsibility of the XMPP-SIMPLE gateway to set the value 274 of the "Expires" header and to periodically renew the subscription on 275 the SIMPLE side of the gateway so that the subscription appears to be 276 permanent to the XMPP user (e.g., the XMPP-SIMPLE gateway SHOULD send 277 a new SUBSCRIBE request to the SIP user whenever the XMPP user sends 278 initial presence to its XMPP server, i.e., upon initiating a presence 279 session with the XMPP server). See the Security Considerations 280 (Section 5) of this document for important information and 281 requirements regarding the security implications of this 282 functionality. 284 3.2.3. Cancelling 286 At any time after subscribing, the XMPP user can unsubscribe from the 287 contact's presence. This is done by sending a presence stanza of 288 type "unsubscribe": 290 Example: XMPP user unsubscribes from SIP contact: 292 | 296 The XMPP-SIMPLE gateway is responsible for translating the 297 unsubscribe command into a SIP SUBSCRIBE request with the "Expires" 298 header set to a value of zero: 300 Example: XMPP user unsubscribes from SIP contact (SIP 301 transformation): 303 | SUBSCRIBE sip:romeo@example.net SIP/2.0 304 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk 305 | From: ;tag=j89d 306 | To: ;tag=xfg9 307 | Call-ID: 1ckm32@example.com 308 | Event: presence 309 | Max-Forwards: 70 310 | CSeq: 789 SUBSCRIBE 311 | Contact: 312 | Accept: application/pidf+xml 313 | Expires: 0 314 | Content-Length: 0 316 Upon sending the transformed unsubscribe, the XMPP-SIMPLE gateway 317 SHOULD a presence stanza of type "unsubscribed" to the XMPP user: 319 Example: XMPP user receives unsubscribed notification: 321 | 325 3.3. SIP to XMPP 327 3.3.1. Establishing 329 A SIP user initiates a subscription to a contact's presence 330 information by sending a SIP SUBSCRIBE request to the contact. The 331 following is an example of such a request: 333 Example: SIP user subscribes to XMPP contact: 335 | SUBSCRIBE sip:juliet@example.com SIP/2.0 336 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk 337 | From: ;tag=xfg9 338 | To: ;tag=ur93 339 | Call-ID: 4wcm0n@example.net 340 | Event: presence 341 | Max-Forwards: 70 342 | CSeq: 263 SUBSCRIBE 343 | Contact: 344 | Accept: application/pidf+xml 345 | Content-Length: 0 347 Notice that the "Expires" header was not included in the SUBSCRIBE 348 request; this means that the default value of 3600 (i.e., 3600 349 seconds = 1 hour) applies. 351 Upon receiving such a request, a SIMPLE-XMPP gateway is responsible 352 for translating it into an XMPP subscription request from the SIP 353 user to the XMPP user: 355 Example: SIP user subscribes to XMPP contact (XMPP transformation): 357 | 361 In accordance with [RFC6121], the XMPP user's server MUST deliver the 362 presence subscription request to the XMPP user (or, if a subscription 363 already exists in the XMPP user's roster, discard the subscribe 364 request). If the XMPP user approves the subscription request, the 365 XMPP server then MUST return a presence stanza of type "subscribed" 366 from the XMPP user to the SIP user; if a subscription already exists, 367 the XMPP server SHOULD auto-reply with a presence stanza of type 368 "subscribed". In any case, if the SIMPLE-XMPP gateway receives a 369 presence stanza of type "subscribed" from the XMPP user, it SHOULD 370 silently discard the stanza. 372 3.3.2. Refreshing 374 It is the responsibility of the SIMPLE-XMPP gateway to properly 375 handle the difference between short-lived SIP presence subscriptions 376 and long-lived XMPP presence subscriptions. The gateway has two 377 options when the SIP user's subscription expires: 379 o Cancel the subscription (i.e., treat it as temporary) and send an 380 XMPP presence stanza of type "unsubscribe" to the XMPP contact; 381 this honors the SIP semantic but will seem rather odd to the XMPP 382 contact. 384 o Maintain the subscription (i.e., treat it as long-lived) and (1) 385 send a SIP NOTIFY request to the SIP user containing a PIDF 386 document specifying that the XMPP contact now has a basic status 387 of "closed", including a Subscription-State of "terminated" and 388 (2) send an XMPP presence stanza of type "unavailable" to the XMPP 389 contact; this violates the letter of the SIP semantic but will 390 seem more natural to the XMPP contact. 392 Which of these options the SIMPLE-XMPP gateway chooses is up to the 393 implementation. 395 If the implementation chooses the first option, the protocol 396 generated would be as follows: 398 Example: SIP subscription expires (treated as temporary by gateway): 400 | 404 If the implementation chooses the second option, the protocol 405 generated would be as follows: 407 Example: SIP subscription expires (treated as long-lived by gateway): 409 | NOTIFY sip:192.0.2.2 SIP/2.0 410 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk 411 | From: ;tag=ur93 412 | To: ;tag=pq72 413 | Call-ID: j4s0h4vny@example.com 414 | Event: presence 415 | Subscription-State: terminated;reason=timeout 416 | Max-Forwards: 70 417 | CSeq: 232 NOTIFY 418 | Contact: 419 | Content-Type: application/pidf+xml 420 | Content-Length: 194 421 | 422 | 423 | 425 | 426 | 427 | closed 428 | 429 | 430 | 432 Example: SIP subscription expires (treated as long-lived by gateway): 434 | 438 3.3.3. Cancelling 440 At any time, the SIP user can cancel the subscription by sending a 441 SUBSCRIBE message whose "Expires" header is set to a value of zero 442 ("0"): 444 Example: SIP user cancels subscription: 446 | SUBSCRIBE sip:192.0.2.1 SIP/2.0 447 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk 448 | From: ;tag=yt66 449 | To: ;tag=bi54 450 | Call-ID: 1tsn1ce@example.net 451 | Event: presence 452 | Max-Forwards: 70 453 | CSeq: 8775 SUBSCRIBE 454 | Contact: 455 | Expires: 0 456 | Content-Length: 0 458 As above, upon receiving such a request, a SIMPLE-XMPP gateway is 459 responsible for doing one of the following: 461 o Cancel the subscription (i.e., treat it as temporary) and send an 462 XMPP presence stanza of type "unsubscribe" to the XMPP contact. 464 o Maintain the subscription (i.e., treat it as long-lived) and (1) 465 send a SIP NOTIFY request to the SIP user containing a PIDF 466 document specifying that the XMPP contact now has a basic status 467 of "closed", (2) send a SIP SUBSCRIBE request to the SIP user with 468 an "Expires" header set to a value of "0" (zero) when it receives 469 XMPP presence of type "unavailable" from the XMPP contact, and (3) 470 send an XMPP presence stanza of type "unavailable" to the XMPP 471 contact. 473 4. Presence Notifications 475 4.1. Overview 477 Both XMPP and presence-aware SIP systems enable entities (often but 478 not necessarily human users) to send presence notifications to other 479 entities. At a minimum, the term "presence" refers to information 480 about an entity's availability for communication on a network (on/ 481 off), often supplemented by information that further specifies the 482 entity's communications context (e.g., "do not disturb"). Some 483 systems and protocols extend this notion even further and refer to 484 any relatively ephemeral information about an entity as a kind of 485 presence; categories of such "extended presence" include geographical 486 location (e.g., GPS coordinates), user mood (e.g., grumpy), user 487 activity (e.g., walking), and ambient environment (e.g., noisy). In 488 this document, we focus on the "least common denominator" of network 489 availability only, although future documents might address broader 490 notions of presence, including extended presence. 492 [RFC6121] defines how XMPP presence stanzas can indicate availability 493 (via absence of a 'type' attribute) or lack of availability (via a 494 'type' attribute with a value of "unavailable"). SIP presence using 495 a SIP event package for presence is specified in [RFC3856]. 497 As described in [RFC6121], presence information about an entity is 498 communicated by means of an XML stanza sent over an XML 499 stream. In this document we will assume that such a presence stanza 500 is sent from an XMPP client to an XMPP server over an XML stream 501 negotiated between the client and the server, and that the client is 502 controlled by a human user (again, this is a simplifying assumption 503 introduced for explanatory purposes only). In general, XMPP presence 504 is sent by the user to the user's server and then broadcasted to all 505 entities who are subscribed to the user's presence information. 507 As described in [RFC3856], presence information about an entity is 508 communicated by means of a SIP NOTIFY event sent from a SIP user 509 agent to an intended recipient who is most generally referenced by an 510 Instant Message URI of the form but who might be 511 referenced by a SIP or SIPS URI of the form or 512 . Here again we introduce the simplifying 513 assumption that the user agent is controlled by a human user. 515 This document addresses basic presence or network availability only, 516 not the various extensions to SIP and XMPP for "rich presence", such 517 as [RFC4480], [XEP-0107], and [XEP-0108]. 519 4.2. XMPP to SIP 521 When Juliet interacts with her XMPP client to modify her presence 522 information (or when her client automatically updates her presence 523 information, e.g. via an "auto-away" feature), her client generates 524 an XMPP stanza. The syntax of the stanza, 525 including required and optional elements and attributes, is defined 526 in [RFC6121]. The following is an example of such a stanza: 528 Example: XMPP user sends presence notification: 530 | 532 Upon receiving such a stanza, the XMPP server to which Juliet has 533 connected broadcasts it to all subscribers who are authorized to 534 receive presence notifications from Juliet (this is similar to the 535 SIP NOTIFY method). For each subscriber, broadcasting the presence 536 notification involves either delivering it to a local recipient (if 537 the hostname in the subscriber's address matches one of the hostnames 538 serviced by the XMPP server) or attempting to route it to the foreign 539 domain that services the hostname in the subscriber's address. 540 Naturally, in this document we assume that the hostname is a SIP 541 presence service hosted by a separate server. As specified in 542 [RFC6121], the XMPP server needs to determine the identity of the 543 foreign domain, which it does by performing one or more DNS SRV 544 lookups [RFC2782]. For presence stanzas, the order of lookups 545 recommended by [RFC6121] is to first try the "_xmpp-server" service 546 as specified in [RFC6120] and to then try the "_pres" service as 547 specified in [RFC3861]. Here we assume that the first lookup will 548 fail but that the second lookup will succeed and return a resolution 549 "_pres._simple.example.net.", since we have already assumed that the 550 example.net hostname is running a SIP presence service. (Note: The 551 XMPP server might have previously determined that the foreign domain 552 is a SIMPLE server, e.g., when it sent a SIP SUBSCRIBE to the SIP 553 user when Juliet sent initial presence to the XMPP server, in which 554 case it would not need to perform the SRV lookups; the caching of 555 such information is a matter of implementation and local service 556 policy, and is therefore out of scope for this document.) 558 Once the XMPP server has determined that the foreign domain is 559 serviced by a SIMPLE server, it needs to determine how to proceed. 560 We here assume that the XMPP server contains or has available to it 561 an XMPP-SIMPLE gateway. The XMPP server would then deliver the 562 presence stanza to the XMPP-SIMPLE gateway. 564 The XMPP-SIMPLE gateway is then responsible for translating the XMPP 565 presence stanza into a SIP NOTIFY request and included PIDF document 566 from the XMPP user to the SIP user. 568 Example: XMPP user sends presence notification (SIP transformation): 570 | NOTIFY sip:192.0.2.2 SIP/2.0 571 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk 572 | From: ;tag=gh19 573 | To: ;tag=yt66 574 | Call-ID: j4s0h4vny@example.com 575 | Event: presence 576 | Subscription-State: active;expires=599 577 | Max-Forwards: 70 578 | CSeq: 157 NOTIFY 579 | Contact: 580 | Content-Type: application/pidf+xml 581 | Content-Length: 192 582 | 583 | 584 | 586 | 587 | 588 | open 589 | away 590 | 591 | 592 | 594 The mapping of XMPP syntax elements to SIP syntax elements SHOULD be 595 as shown in the following table. (Mappings for elements not 596 mentioned are undefined.) 598 Table 6: Presence syntax mapping from XMPP to SIP 600 +-----------------------------+---------------------------+ 601 | XMPP Element or Attribute | SIP Header or PIDF Data | 602 +-----------------------------+---------------------------+ 603 | stanza | "Event: presence" [1] | 604 | XMPP resource identifer | tuple 'id' attribute [2] | 605 | from | From | 606 | id | Call-ID | 607 | to | To | 608 | type | basic status [3] [4] | 609 | xml:lang | Content-Language | 610 | | PIDF priority for tuple | 611 | | no mapping [5] | 612 | | | 613 +-----------------------------+---------------------------+ 615 Note the following regarding these mappings: 617 1. Only a presence stanza that lacks a 'type' attribute or whose 618 'type' attribute has a value of "unavailable" SHOULD be mapped by 619 an XMPP-SIMPLE gateway to a SIP NOTIFY request, since those are 620 the only presence stanzas that represent notifications. 622 2. The PIDF schema defines the tuple 'id' attribute as having a 623 datatype of "xs:ID"; because this datatype is more restrictive 624 than the "xs:string" datatype for XMPP resourceparts (in 625 particular, a number is not allowed as the first character of an 626 ID), it is RECOMMENDED to prepend the resourcepart with "ID-" or 627 some other alphabetic string when mapping from XMPP to SIP. 629 3. Because the lack of a 'type' attribute indicates that an XMPP 630 entity is available for communications, the gateway SHOULD map 631 that information to a PIDF status of "open". Because a 632 'type' attribute with a value of "unavailable" indicates that an 633 XMPP entity is not available for communications, the gateway 634 SHOULD map that information to a PIDF status of 635 "closed". 637 4. When the XMPP-SIMPLE gateway receives XMPP presence of type 638 "unavailable" from the XMPP contact, it SHOULD (1) send a SIP 639 NOTIFY request to the SIP user containing a PIDF document 640 specifying that the XMPP contact now has a basic status of 641 "closed" and (2) send a SIP SUBSCRIBE request to the SIP user 642 with an "Expires" header set to a value of "0" (zero). 644 5. Some implementations support custom extensions to encapsulate 645 this information; however, there is no need to standardize a PIDF 646 extension for this purpose, since PIDF is already extensible and 647 thus the element can be included directly, qualified by 648 the 'jabber:client' namespace in the PIDF XML. The examples in 649 this document illustrate this usage, which is RECOMMENDED. The 650 most useful values are likely "away" and "dnd", although note 651 that the latter value merely means "busy" and does not imply that 652 a server or client ought to block incoming traffic while the user 653 is in that state. 655 4.3. SIP to XMPP 657 When Romeo changes his presence, his SIP user agent generates a SIP 658 NOTIFY request for any active subscriptions. The syntax of the 659 NOTIFY request is defined in [RFC3856]. The following is an example 660 of such a request: 662 Example: SIP user sends presence notification: 664 | NOTIFY sip:192.0.2.1 SIP/2.0 665 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk 666 | From: ;tag=yt66 667 | To: ;tag=bi54 668 | Call-ID: j0sj4sv1m@example.net 669 | Event: presence 670 | Subscription-State: active;expires=499 671 | Max-Forwards: 70 672 | CSeq: 8775 NOTIFY 673 | Contact: 674 | Content-Type: application/pidf+xml 675 | Content-Length: 193 676 | 677 | 678 | 680 | 681 | 682 | closed 683 | 684 | 685 | 687 Upon receiving such a request, a SIMPLE-XMPP gateway is responsible 688 for translating it into an XMPP presence stanza from the SIP user to 689 the XMPP user: 691 Example: SIP user sends presence notification (XMPP transformation): 693 | 697 The mapping of SIP syntax elements to XMPP syntax elements SHOULD be 698 as shown in the following table. (Mappings for elements not 699 mentioned are undefined.) 701 Table 7: Presence syntax mapping from SIP to XMPP 702 +---------------------------+-----------------------------+ 703 | SIP Header or PIDF Data | XMPP Element or Attribute | 704 +---------------------------+-----------------------------+ 705 | basic status | type [1] | 706 | Content-Language | xml:lang | 707 | CSeq | id (OPTIONAL) | 708 | From | from | 709 | priority for tuple | | 710 | To | to | 711 | body of MESSAGE | | 712 | | | 713 +---------------------------+-----------------------------+ 715 Note the following regarding these mappings: 717 1. A PIDF basic status of "open" SHOULD be mapped to no 'type' 718 attribute, and a PIDF basic status of "closed" SHOULD be mapped 719 to a 'type' attribute whose value is "unavailable". 721 5. Security Considerations 723 Detailed security considerations for presence protocols are given in 724 [RFC2779], for SIP-based presence in [RFC3856] (see also [RFC3261]), 725 and for XMPP-based presence in [RFC6121] (see also [RFC6120]). 727 The mismatch between long-lived XMPP presence subscriptions and 728 short-lived SIP presence subscriptions introduces the possibility of 729 an amplification attack launched from the XMPP network against a SIP 730 presence server. To help prevent such an attack, access to an XMPP- 731 SIMPLE gateway that is hosted on the XMPP network SHOULD be 732 restricted to XMPP users associated with a single domain or trust 733 realm (e.g., a gateway hosted at simple.example.com ought to allow 734 only users within the example.com domain to access the gateway, not 735 users within example.org, example.net, or any other domain); if a SIP 736 presence server receives communications through an XMPP-SIMPLE 737 gateway from users who are not associated with a domain that is so 738 related to the hostname of the gateway, it MAY (based on local 739 service provisioning) refuse to service such users or refuse to 740 communicate with the gateway. Furthermore, whenever an XMPP-SIMPLE 741 gateway seeks to refresh an XMPP user's long-lived subscription to a 742 SIP user's presence, it MUST first send an XMPP stanza of 743 type "probe" from the address of the gateway to the "bare JID" 744 (user@domain.tld) of the XMPP user, to which the user's XMPP server 745 MUST respond in accordance with [RFC6121]; however, the administrator 746 of an XMPP-SIMPLE gateway MAY (based on local service provisioning) 747 exempt "known good" XMPP servers from this check (e.g., the XMPP 748 server associated with the XMPP-SIMPLE gateway as described above). 750 6. IANA Considerations 752 This document requests no actions of IANA. 754 7. References 756 7.1. Normative References 758 [I-D.saintandre-sip-xmpp-core] 759 Saint-Andre, P., Houri, A., and J. Hildebrand, 760 "Interworking between the Session Initiation Protocol 761 (SIP) and the Extensible Messaging and Presence Protocol 762 (XMPP): Core", draft-saintandre-sip-xmpp-core-04 (work in 763 progress), April 2013. 765 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 766 Requirement Levels", BCP 14, RFC 2119, March 1997. 768 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 769 specifying the location of services (DNS SRV)", RFC 2782, 770 February 2000. 772 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 773 A., Peterson, J., Sparks, R., Handley, M., and E. 774 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 775 June 2002. 777 [RFC3856] Rosenberg, J., "A Presence Event Package for the Session 778 Initiation Protocol (SIP)", RFC 3856, August 2004. 780 [RFC3861] Peterson, J., "Address Resolution for Instant Messaging 781 and Presence", RFC 3861, August 2004. 783 [RFC6665] Roach, A.B., "SIP-Specific Event Notification", RFC 6665, 784 July 2012. 786 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 787 Protocol (XMPP): Core", RFC 6120, March 2011. 789 [RFC6121] Saint-Andre, P., "Extensible Messaging and Presence 790 Protocol (XMPP): Instant Messaging and Presence", RFC 791 6121, March 2011. 793 7.2. Informative References 795 [I-D.ietf-simple-cpim-mapping] 796 Rosenberg, J. and B. Campbell, "CPIM Mapping of SIMPLE 797 Presence and Instant Messaging", draft-ietf-simple-cpim- 798 mapping-01 (work in progress), June 2002. 800 [RFC2779] Day, M., Aggarwal, S., and J. Vincent, "Instant Messaging 801 / Presence Protocol Requirements", RFC 2779, February 802 2000. 804 [RFC3860] Peterson, J., "Common Profile for Instant Messaging 805 (CPIM)", RFC 3860, August 2004. 807 [RFC3922] Saint-Andre, P., "Mapping the Extensible Messaging and 808 Presence Protocol (XMPP) to Common Presence and Instant 809 Messaging (CPIM)", RFC 3922, October 2004. 811 [RFC4480] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. 812 Rosenberg, "RPID: Rich Presence Extensions to the Presence 813 Information Data Format (PIDF)", RFC 4480, July 2006. 815 [XEP-0107] 816 Saint-Andre, P. and R. Meijer, "User Mood", XSF XEP 0107, 817 October 2008. 819 [XEP-0108] 820 Meijer, R. and P. Saint-Andre, "User Activity", XSF XEP 821 0108, October 2008. 823 Appendix A. Acknowledgements 825 The authors wish to thank the following individuals for their 826 feedback: Chris Christou, Fabio Forno, Adrian Georgescu, Saul Ibarra, 827 Salvatore Loreto, Michael Lundberg, Daniel-Constantin Mierla, and 828 Tory Patnoe. 830 Authors' Addresses 832 Peter Saint-Andre 833 Cisco Systems, Inc. 834 1899 Wynkoop Street, Suite 600 835 Denver, CO 80202 836 USA 838 Phone: +1-303-308-3282 839 Email: psaintan@cisco.com 840 Avshalom Houri 841 IBM 842 Building 18/D, Kiryat Weizmann Science Park 843 Rehovot 76123 844 Israel 846 Email: avshalom@il.ibm.com 848 Joe Hildebrand 849 Cisco Systems, Inc. 850 1899 Wynkoop Street, Suite 600 851 Denver, CO 80202 852 USA 854 Email: jhildebr@cisco.com