4.11 P2P Subscription and XPIDF Presence Format Example
This example demonstrates how XPIDF format can be used in a P2P presence subscription.
Figure 11: P2P subscription and XPIDF presence format example
User1 sends a SUBSCRIBE request to user2 to create a subscription for the presence event-package. This is indicated by the Event: presence header in the SUBSCRIBE request. The Accept header indicates that user1 accepts the XPIDF Presence Document format.
-
SUBSCRIBE sip:user2@193.12.62.199 SIP/2.0 Via: SIP/2.0/UDP 193.12.63.150:13695 Max-Forwards: 70 From: "user1" <sip:host1>;tag=12e78ca4-85f7-4094-bbdf-e8e819188ae6 To: <sip:user2@193.12.62.199> Call-ID: 21824beb-0ee4-4953-ad36-745a0614a0e9@193.12.63.150 CSeq: 1 SUBSCRIBE Contact: <sip:193.12.63.150:13695> User-Agent: Windows RTC/1.2 Event: presence Accept: application/xpidf+xml Content-Length: 0
User2 sends a 200 OK response to indicate that the SUBSCRIBE request has been accepted. The 200 OK response does not have a body.
-
SIP/2.0 200 OK From: "user1" <sip:host1>;tag=12e78ca4-85f7-4094-bbdf-e8e819188ae6 To: <sip:user2@193.12.62.199>;tag=112040_T193.12.62.199 Call-ID: 21824beb-0ee4-4953-ad36-745a0614a0e9@193.12.63.150 CSeq: 1 SUBSCRIBE Via: SIP/2.0/UDP 193.12.63.150:13695 Expires: 28800 Content-Length: 0
User2 then sends a NOTIFY request to user1 to communicate its presence state, which is online in this example. The body of the NOTIFY request is an XML in the XPIDF format. The XML includes the presentity whose presence information is being communicated, the address element representing a particular endpoint for the presentity and the presence status for that endpoint.
-
NOTIFY sip:193.12.63.150:13695 SIP/2.0 From: <sip:user2@193.12.62.199>;tag=112040_T193.12.62.199 To: "user1" <sip:host1>;tag=12e78ca4-85f7-4094-bbdf-e8e819188ae6 Call-ID: 21824beb-0ee4-4953-ad36-745a0614a0e9@193.12.63.150 CSeq: 2 NOTIFY Via: SIP/2.0/UDP 193.12.62.199 Content-Length: 356 Contact: sip:user2@193.12.62.199 Event: presence Content-Type: application/xpidf+xml <?xml version="1.0"?> <!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd"> <presence> <presentity uri="sip:user2@193.12.62.199;method=SUBSCIRBE"/> <atom id="1002"> <address uri="sip:user2@193.12.62.199 priority="0.600000"> <status status="open"/> <msnstatus substatus="online"/> </address> </atom> </presence>
User1 acknowledges the receipt of the notification by sending a 200 OK response. The 200 OK response does not have a body.
-
SIP/2.0 200 OK Via: SIP/2.0/UDP 193.12.62.199 From: <sip:user1@193.12.62.199>;tag=112040_T193.12.62.199 To: "user2" <sip:host2>;tag=12e78ca4-85f7-4094-bbdf-e8e819188ae6 Call-ID: 21824beb-0ee4-4953-ad36-745a0614a0e9@193.12.63.150 CSeq: 2 NOTIFY User-Agent: Windows RTC/1.2 Content-Length: 0