The way in which IBM® XDMS processes a SUBSCRIBE request depends on what is found in the Event header. If the document tag exists in the Event header of the SUBSCRIBE request, then the process flow is simple. However, if no auid tag and no document tag exists in the Event header, then IBM XDMS assumes the subscription will use an rls-services document flow. The following topic gives an example of how to convert the SIP URI provided in the To header to that of a resource-list referenced by a service URI defined in a rls-services document.
To: <sip:john.doe@us.example.com>In order to be able to return an XCAP URI in the NOTIFY response, a mapping is required from a user-defined SIP URI, to an XCAP URI of a document stored in IBM XDMS. This mapping is provided through the use of the rls-services document. .
In order for a subscription to complete properly, there are multiple documents and document elements that must be created properly to reference one another. The SIP URI provided in the To header of the SUBSCRIBE request must be defined in a URI attribute of a <service> element of an rls-services document. That <service> element must contain a resource-list element which contains the XCAP URI that was used to create the resource-lists document (group definition) that is being subscribed to.
The following information shows the required process to create the appropriate documents for a subscription that provides only a SIP URI::
<?xml version="1.0" encoding="UTF-8"?> <resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists"> <list name="friends"> <entry uri="sip:friend1@example.com"> <display-name>My Friend1</display-name> </entry> <entry uri="sip:friend2@example.com"> <display-name>My Friend2</display-name> </entry> </list> </resource-lists>
http://MyHost:9080/services/resource-lists/users/sip:john.doe@us.example.com/MyBuddies.xml
<?xml version="1.0" encoding="UTF-8"?> <rls-services xmlns:rl="urn:ietf:params:xml:ns:resource-lists" xmlns="urn:ietf:params:xml:ns:rls-services"> <service uri="sip:john.doe@us.example.com"> <resource-list> http://MyHost:9080/services/resource-lists/users/sip:john.doe@us.example.com/MyBuddies.xml/~~/resource-lists/list[@name="friends"] </resource-list> <packages> <package>presence</package> </packages> </service> </rls-services>
For this example, the URL used for the PUT of the rls-services document should be something like the following:
http://MyHost:9080/services/rls-services/users/sip:john.doe@us.example.com/MyBuddies.xml
SUBSCRIBE sip:service@1.2.3.4:5060 SIP/2.0 Via: SIP/2.0/TCP 5.6.7.8:5060 From: <sip:user1@5.6.7.8:5060>;tag=1 To: <sip:john.doe@us.example.com> Call-ID: 1.4192.3.4.5.6@call.id Event: ua-profile;profile-type="application" Max-Forwards: 70 CSeq: 1 SUBSCRIBE P-Asserted-Identity: "John Doe" <sip:john.doe@us.example.com> Privacy: none Expires: 3600 Accept: application/xcap-diff+xml Contact: sip:user1@5.6.7.8:5060 Content-Length: 0
NOTIFY sip:user1@5.6.7.8:5060 SIP/2.0 Event: ua-profile;profile-type="application";vendor="ibm";model="xdms";version="7.0"; 9 auid="resource-lists";document="users/sip:joe@us.example.com/mydocument.xml" From: <sip:john.doe@us.example.com>;tag=6211624529223376_local.1149543099406_2_2 To: <sip:user1@5.6.7.8:5060>;tag=1 Call-ID: 11.4192.3.4.5.6@call.id Max-Forwards: 70 CSeq: 1 NOTIFY Content-Type: application/xcap-diff+xml Content-Length: 285 Via: SIP/2.0/TCP 1.2.3.4:5060;branch=z9hG4bK655017094028370 Contact: <sip:1.2.3.4:5060;transport=tcp> Subscription-State: active <?xml version="1.0" encoding="UTF-8"?> <xcap-diff xmlns="urn:ietf:params:xml:ns:xcap-diff" xcap-root="http://MyHost:9080/services/"> <document new-etag="MTE0OTU0MzIxNjkxNQ==" doc-selector="resource-lists/users/sip:john.doe@us.example.com/MyBuddies.xml" previous-etag="MTE0OTU0MzIxNjkxNQ=="/> </xcap-diff>
If you successfully created the resource-lists and rls-services document, and correctly coded the SUBSCRIBE request, you should receive a 200 response from NOTIFY. If you do not receive a 200 response you may want to examine some of the following: