WebSphere brand IBM WebSphere XML Document Management Server, Version 7.0

SUBSCRIBE flow using rls-services documents

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.

If the Event header in the SUBSCRIBE request does not contain an auid tag and document tag, then IBM XDMS assumes that the subscription is based upon the SIP URI provided in the To header:
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::

Create the resource-lists document

  1. Create a resource-lists document containing your group list.
    <?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>
  2. Store the document in IBM XDMS using an XCAP PUT request. The URL used for the PUT should be something like the following:
    http://MyHost:9080/services/resource-lists/users/sip:john.doe@us.example.com/MyBuddies.xml

Create the rls-services document

  1. Create an rls-services document that references the "friends" list within the MyBuddies.xml document which was just stored in the previous step.
    <?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>
  2. Be sure to check that the following sections of the rls-services document are coded correctly:
    • The document selector portion of the XCAP URI (everything before the /~~/ separator) specified in the resource-list element is exactly the same as it was used to create your resource lists. The XCAP spec requires this to point to a list element within that document which is why the XPath extension was added to that URI. Because a subscription is against a document rather than a list, the XPath extension will be ignored for subscription, but it must be there to be a valid rls-services document.
    • The uri tag specified in the service element is the SIP URI which is to be used in the To header of the SUBSCRIBE request.
    • When you store this rls-services document in IBM XDMS, the tree/XUI portion of the XCAP URI that is used to store the rls-services document must be the same as the tree/XUI portion of the XCAP URI that is specified in the resource-list element. In this case, users/sip:john.doe@us.example.com would be the tree/XUI.

      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

Create the SUBSCRIBE Request

After the resource-lists and rls-services documents are stored in IBM XDMS, it is possible to perform a SUBSCRIBE request as follows:
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 response

Here is an example of the NOTIFY response from the previous SUBSCRIBE request:
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>

Verification

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:




Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.