The following are examples of xcap-dff subscription events:
Notification for subscriptions using the xcap-diff event vary depending on the level of subscription. Subscriptions to documents can receive patch operations. The changelog element is not used in xcap-diff events; instead, the patch operations appear in the xcap-diff element. Notifications for subscriptions using xcap-diff events at the element and attribute levels do not return patch operations; instead, the patch operations appear in the document element.
<document new-etag="MTE0OTU0MzIxNjkxNQ==" doc-selector="resource-lists/users/sip:john.doe@us.example.com/MyBuddies.xml" previous-etag="MTE0OTU0MzIxNjkxNQ=="> <add sel="resource-lists/list"><entry uri="buddy1@us.example.com"></entry></add> </document>
<element sel="resource-lists/global/doc.xml/~~/resource-lists/list[@name="friends"]" exists="true"/> <list name="friends"> <display-name>Golf Friends</display-name> <entry uri="sip:tiger.woods@example.com"> <display-name>Tiger Woods</display-name> </entry> <entry uri="sip:vijay.singh@example.com"> <display-name>Vijay Singh</display-name> </entry> </list> </element>The following is an example of an initial notification following a subscribe, showing all the resources you are subscribed to. Subsequent notifies will contain only one resource per notify.
NOTIFY sip:user1@example.com:5060;transport=UDP Subscription-State: active;expires=120 Event: xcap-diff;diff-processing=xcap-patching Content-Type: application/xcap-diff+xml <?xml version="1.0" encoding="UTF-8"?> <xcap-diff xmlns="urn:ietf:params:xml:ns:xcap-diff" xcap-root="localhost:9080/services"> <document sel="resource-lists/users/sip:xdms1@us.acme.com/doc1.xml" new-etag="123213234"/> <document sel="resource-lists/users/sip:xdms1@us.acme.com/doc2.xml" new-etag="434543533"/> <document sel="rls-services/users/sip:xdms1@us.acme.com/index" new-etag="454355765"/> <element sel="resource-lists/global/doc.xml/~~/resource-lists/list[@name="friends"]" exists="true"/> <list name="friends"> <display-name>Golf Friends</display-name> <entry uri="sip:tiger.woods@example.com"> <display-name>Tiger Woods</display-name> </entry> <entry uri="sip:vijay.singth@example.com"> <display-name>Vijay Singh</display-name> </entry> </list> </element> <attribute sel="resource-lists/global/doc.xml/~~/resource-lists/list[@name="buddies"]/@id" exists="true"/>5</attribute> </xcap-diff>