SIP Hisham Khartabil Internet Draft Eva Leppanen Expires: 23 August 2003 Nokia 24 February 2003 Event Notification Filtering for Watcher Info draft-khartabil-simple-winfo-filter-00.txt STATUS OF THIS MEMO This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet- Drafts a reference material or to cite them other than as work in progress. The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet Draft will expire on 23rd August 2003. Copyright Notice Copyright (C) The Internet Society (2003). All Rights Reserved. Abstract Watcher information template-package for the SIP event framework refers to the set of users subscribed to a particular resource within a particular event package. The Watcher Information I-D does not describe a mechanism of how filtering of watcher information can be achieved. This document defines a watcher info filter. It provides the mechanism whereby a watcherinfo subscriber can specify the watcher info event filtering rules, using XML, for the notifier and how that notifier is to behave when receiving such filter. Khartabil, Leppanen. [Page 1] Internet Draft Watcher Info Filtering February 2003 Table of Contents 1.0 Terminology...................................................3 2.0 Introduction..................................................3 2.1 Motivation For Using XML......................................4 3.0 Watcherinfo Package Specific Filters..........................4 3.1 Package ID....................................................4 3.3 Transport mechanism...........................................4 3.4 Structure of XML-Encoded winfo Filter Criteria................4 3.4.1 The Root Element............................5 3.4.2 The Element.....................................5 3.4.3 The Element..........................................5 5.0 Client and server operation...................................6 5.1 Client Operation..............................................6 5.1.1 SUBSCRIBE Bodies............................................6 5.1.2 Subscriber Generating SUBSCRIBE requests....................6 5.1.2.1 To-Header vs. Filter URI..................................6 5.1.2.2 Changing The Filter Criteria Within A Dialog..............7 5.1.2.3 Subscriber Interpreting SIP responses.....................7 5.1.3 Subscriber processing NOTIFY requests.......................7 5.2 Server Operation..............................................8 5.2.1 NOTIFY Bodies...............................................8 5.2.2 Notifier processing SUBSCRIBE Requests......................8 5.2.3 Notifier Generation of NOTIFY requests......................8 5.2.3.1 Generating NOTIFY Contents................................9 5.2.4 Handling of abnormal cases..................................9 6.0 IANA Considerations..........................................10 7.0 Examples.....................................................10 7.1 Presentity makes subscription to get all the information about active watchers..............................................11 7.2 Presentity makes subscription to get information about defined, new and unauthorized watchers................................12 7.3 Presentity requests history information of watchers..........13 8.0 XML Schema...................................................14 9.0 Security Considerations......................................15 10.0 Acknowledgements............................................16 11.0 References..................................................16 AuthorsÆ Addresses...............................................17 Full Copyright Statement.........................................17 Acknowledgement..................................................18 Khartabil, Leppanen. [Page 2] Internet Draft Watcher Info Filtering February 2003 1.0 Terminology In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED" "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119 [1]. The document uses the terms as defined in [2] and [3]. 2.0 Introduction Watcher information template-package for the SIP event framework refers to the set of users subscribed to a particular resource within a particular event package [2]. SIP event notification is described in [4]. It defines a general framework for sending subscriptions and receiving notifications in SIP based systems. It introduces the concept of event packages, which are concrete applications of the general event framework to a specific usage of events. Filtering is a mechanism for controlling the content of event notifications [5]. The filtering mechanism is expected to be particularly valuable to users of mobile wireless access devices. The characteristics of the devices typically include high latency, low bandwidth, low data processing capabilities, small display, and limited battery power. Such devices can benefit from the ability to filter the amount of information generated at the source of the event notification. It is stated in [2] that Watcherinfo notifications are generated every time there is any change in the state of the watcher information. It also states that Watcherinfo notifications triggered from a change in watcher state only contain information on the watcher whose state has changed. The format of such information defined in [3]. This document presents a mechanism for the filtering of the watcherinfo information. The document specifically describes how the subscriber is able to both limit the content and indicate more specifically the preferred content of the notifications using XML and Xpath [14] technologies. It also describes how the notifier functions when generating notifications by taking into account filters, authorisation rules and default functionality of the watcherinfo notification service. The watcherinfo specific filtering solution presented here is compatible with the watcherinfo event template-package [2]. Requirements for the watcherinfo filter criteria can be found [5] and [13]. Khartabil, Leppanen. [Page 3] Internet Draft Watcher Info Filtering February 2003 Events Notification RFC [4] and the SIMPLE working group both identify filtering work as potential work. 2.1 Motivation For Using XML When trying to select the schema and protocol for defining the filter criteria, it can be found that there are several alternatives available. The best practice is to modularise the problem and work on smaller modules (the protocol and the filter information schema). The selection of the schema for defining the filter criteria requires a readable syntax with enough flexibility to define the semantics. Among the multiple possibilities (i.e. XML, Perl, TCL, etc), XML provides a generic framework where a schema for the filter logic including a namespace allowing the definition of the filter criteria. Thus, an XML schema provides an extensible mechanism where the logic required for the filtering functionality can be built. XML provides extensibility based on "namespaces" associated with a globally unique URI. The XML also enables the use of Xpath [14] for referencing items in an XML document (which in the case is watcher information in the format of watcherinfo). In addition, by using XML the need for reliance on the transport protocol in order to interpret the filter criteria can be eliminated. 3.0 Watcherinfo Package Specific Filters This section describes the technologies and information needed to provide a filter specification relevant to watcherinfo filtering. 3.1 Package ID The package ID is æwinfoÆ. This ID is carried in the event-header of the SUBSCRIBE as well as within the XML document carrying filter criteria. 3.3 Transport mechanism Transportation of the filter criteria to the server is achieved by inserting the filter XML document in the body of a SIP SUBSCRIBE request. Alternatively, the document can be uploaded to the server using a transport specific for data manipulation. 3.4 Structure of XML-Encoded winfo Filter Criteria Khartabil, Leppanen. [Page 4] Internet Draft Watcher Info Filtering February 2003 Winfo Filter Criteria is an XML document [7] that MUST be well- formed and SHOULD be valid. Winfo Filter Criteria XML documents MUST have the XML declaration and it SHOULD contain an encoding declaration in the XML declaration e.g. "". This specification makes use of XML namespaces for identifying the XML schema of the Winfo Filter Criteria documents and document fragments. The namespace identifier for elements defined by this specification is a URN [8]; using the namespace identifier 'ietf' defined by [9] and extended by [10]. This urn is: urn:ietf:params:xml:ns:simple-winfo-filter+xml. This namespace declaration indicates the namespace on which the filter criteria are based on. 3.4.1 The Root Element The root element of the filter criteria is . The MAY have a 'pkgdef' attribute that defines the æwinfoÆ as package for the filter criteria. The root element MUST contain the namespace mentioned above. This element MUST contain one or more elements. 3.4.2 The Element The element is used to specify the content of an individual filter. MUST have an 'id' attribute. The value of the 'id' attribute MUST be unique within the root element. MAY have an 'uri' attribute. The value of the 'uri' attribute is the URI of a watcher-list resource. The element MUST contain a element. 3.4.3 The Element The element is used to specify the content to be delivered to the watcherinfo subscriber. It does not specify the exact content but rules that are used to construct that information. The element MUST contain the 'report' attribute. The value of the 'report' is either 'default'. The 'default' value means that the whole content of selected watcher elements are delivered. The æstateÆ attribute is optional and indicates whether the document to be delivered to the watcherinfo subscriber contains the ôfullö watcherinfo state, or whether it contains only information on those Khartabil, Leppanen. [Page 5] Internet Draft Watcher Info Filtering February 2003 watchers which have changed since the previous document (ôpartialö) [2]. The delivered content depends on the XPath rules and the selected state. If this attribute is not present, the default value is a matter of local policy [2]. OPEN ISSUE: the æreportÆ attribute may be later removed if it is asserted that no other value (e.g. ôonly-selectedö) is needed. 3.4.3.1 Defining the delivered content It must be possible in the filter criteria to be able to select watchers from which watcher information is delivered. The selection is based on any XML elements and attributes of the default watcherinfo format [3]. The preferred watcher information is indicated using the capabilities of XPath [14]. The XPath clause is stated in the value of the element. 4.0 Client and server operation 4.1 Client Operation 4.1.1 SUBSCRIBE Bodies SIP entities compliant with this specification MUST support content- type æapplication/simple-winfo-filter+xmlÆ. 4.1.2 Subscriber Generating SUBSCRIBE requests This section presents additional functionalities required from the subscriber when filters are used in SUBSCRIBE requests bodies. Normal operations as defined in [2] are then followed. As defined in [2], a SUBSCRIBE for winfo MAY contain a body. This body, as defined in this document, would serve the purpose of filtering. Honouring of these filters is at the policy discretion of the notifier. No content in the body of a SUBSCRIBE indicates to the notifier that no filter is being requested; so that the notifier is instructed to send all NOTIFY requests using the notifierÆs default watcherinfo subscription filtering policy as described in [2]. If present, the body MUST be of MIME-Type æapplication/simple-winfo- filter+xmlÆ. 4.1.2.1 To-Header vs. Filter URI Khartabil, Leppanen. [Page 6] Internet Draft Watcher Info Filtering February 2003 The Event package "winfo" in Event-header of the SUBSCRIBE request specifies that the filter rules apply to the watcherinfo of a watcher-list resource whose URI appears in the filter. If no watcher-list resource URI is indicated by the filter, the filter rules apply to the watcher-list of the resource identified in the To-header. If the resource URI indicated by the filter is not the same as the one in the To-header, that filterÆs rules do not apply and are ignored. The filter does not affect Watcherinfo documents sent to the watcherinfo subscriber. 4.1.2.2 Changing The Filter Criteria Within A Dialog The client MAY reset or change the filter criteria by re-issuing a new SUBSCRIBE request within the existing dialog. The SUBSCRIBE provides the "replace" semantics. This means that all filters are replaced. A SUBSCRIBE within the exiting dialogs that does not contain a filter is assumed to be removing all filter criteria. The filter MAY be incorporated within an existing subscription (an active dialog) by the subscriber sending a re-SUBSCRIBE that includes the filter in the body. 4.1.2.3 Subscriber Interpreting SIP responses The SUBSCRIBE request will be confirmed with a final response. 200- class responses indicate that the subscription has been accepted, and that a NOTIFY will be sent immediately. A 200 response indicates that the subscription has been accepted, the user is authorized and that the filter is accepted. A 202 response merely indicates that the subscription has been understood, the content type has been accepted, and that authorization may or may not have been granted. A 202 response also indicates that the filter has not been accepted yet. The acceptation of the filter MAY arrive in a subsequent NOTIFY. Non-200 class final responses indicate that no subscription or dialog has been created, and no subsequent NOTIFY message will be sent. All non-200 class responses have the same meanings and handling as described in RFC 3261 [11] and RFC 3265[4]. Specifically, a 415 response indicates that the server does not understand the MIME-type æapplication/simple-pres-filter+xmlÆ. A 488 response indicates that the content (filter) is understood but some aspects of it were either not understood or not accepted. 4.1.3 Subscriber processing NOTIFY requests Khartabil, Leppanen. [Page 7] Internet Draft Watcher Info Filtering February 2003 If a 2xx response was returned for the SUBSCRIBE, the NOTIFY that follows MAY contain a body that describes the state of the watcher after the filter has been applied. If the NOTIFY indicates that a subscription has been terminated [4], the subscription is assumed to be terminated. Behaviour in such events is also described in [4]. If the subscription is indicated as active, NOTIFY requests are handled as described in [2] and [4]. 4.2 Server Operation 4.2.1 NOTIFY Bodies SIP entities compliant with this specification MUST support content- type æapplication/simple-winfo-filter+xmlÆ. 4.2.2 Notifier processing SUBSCRIBE Requests This section presents addition functionalities required from the notifier when filters are used in SUBSCRIBE requests bodies. Normal operations as defined in [2] are then followed. The notifier will examine the content-type header and will return a 415 response if it does not understand content-type æapplication/simple-pres-filter+xmlÆ. If the notifier accepts the content-type, it then starts parsing the body. If the body is understood but some aspects of the contents (filter) were not understood and accepted, then procedures described in section 4.2.4 are followed. A 200-class responses indicate that the subscription has been accepted, and that a NOTIFY will be sent immediately. A 200 response indicates that the subscription has been accepted, the user is authorized and that the filter is accepted. A 202 response merely indicates that the subscription has been understood, and that authorization may or may not have been granted. A 202 response also indicates that the filter has not been accepted yet. The acceptation of the filter MAY arrive in a subsequent NOTIFY. The filter MAY be incorporated within an existing subscription (an active dialog) by the notifier receiving a re-SUBSCRIBE that includes the filter in the body. 4.2.3 Notifier Generation of NOTIFY requests Upon receiving the SUBSCRIBE with the filtering rules, the notifier SHOULD retain the filter as long as the subscription persists. The filter SHOULD be used as long as the subscription is active. Khartabil, Leppanen. [Page 8] Internet Draft Watcher Info Filtering February 2003 If the response sent to the SUBSCRIBE was a 202, and the 202 was chosen because the filter could not be accepted in time, the NOTIFY MAY be used to terminate the subscription if the filter was not found acceptable. See Section 4.2.4. As described in [2], the NOTIFY message MAY contain a body that describes the state of the watchers. This body MUST be in one of the formats listed in the Accept header of the SUBSCRIBE, or the presence specific default æapplication/watcherinfo+xmlÆ if the Accept header is omitted. 4.2.3.1 Generating NOTIFY Contents The input to the filter is a watcherinfo document [3] derived according to the normal functionality defined in [2]. Before applying the Xpath expression to the watcherinfo document, the æstateÆ attribute is considered. If the value is ôpartialö, the information of watchers, whose state has not changed since the last document, is removed before any further processing. If the value is ôfullö, all watchersÆ information is included in the next processing step. If the æstateÆ attribute is omitted from the filter, the notifierÆs local policies are applied to determine the watchers whose information is filtered. The content is then filtered according to the XPath expression. The XPath expression indicates the delivered watcher elements. The 'report' attribute indicates the delivered content. The value ôdefaultö of the 'report' attribute means that all the values and attributes of the selected watcher elements are delivered. In addition to the selected watcher elements, the namespace definitions are also conveyed. 4.2.4 Handling of abnormal cases In case of an invalid filter definition û the filter XML document is not aligned with the filter XML schema, the notifier rejects the SUBSCRIBE request with a 488. A warning header in the response may give a better indication why the filters are not accepted. If the subscription was accepted with a 202 response and the filter is being evaluated after that, a NOTIFY with a subscription-state of terminated is sent. An event-reason-value of ôbadfilterö MAY be included. The above paragraph uses the extension to the event-reason-value of subexp-params as defined in [6]. Khartabil, Leppanen. [Page 9] Internet Draft Watcher Info Filtering February 2003 In case of an erroneous XPath clause in the filter definition the notifier either ignores the filter definition or terminates the subscription. In case of indication of empty content by the XPath clause the presence agent functions according to the normal procedure for the content filtering described in this document. 5.0 IANA Considerations A new content type "application/simple-winfo-filter+xml" is defined to represent an XML MIME for the filter criteria of Presence. This specification follows the guidelines of RFC3023 [12]. OPEN ISSUE: IANA registration template must be added later. 6.0 Examples The examples in this section use the ôpresenceö event package with the ôwinfoö template-package. Watcher information to a Presentity: sip:watcherA@example.com" sip:watcherB@example.com" sip:watcherC@example.com" sip:watcherD@domain.com" Khartabil, Leppanen. [Page 10] Internet Draft Watcher Info Filtering February 2003 6.1 Presentity makes subscription to get all the information about active watchers SUBSCRIBE request from the presentity including the filter: SUBSCRIBE sip:presentity@domain.com Via: SIP/2.0/TCP 10.0.0.1:5060;branch=xjfdsjfk To: From: ;tag:12341111 Call-ID: 121212@10.0.0.1 Cseq: 1 SUBSCRIBE Expires: 3600 Event: Presence.winfo Contact: Content-Type: application/simple-winfo-filter+xml Content-Length: à //*[(. . /@package="presence" and / /@status="active")]/ancestor-or-self: :* Notification to the subscriber: NOTIFY sip:presentity@dom.com SIP/2.0 Via: SIP/2.0/TCP presence.domain.com:5060;branch=xjfder To: sip:presentity@domain.com;tag:12341111 From: sip:presentity@domain.com;tag:232321 Call-ID: 121212@10.0.0.1 Cseq: 1 NOTIFY Contact: sip:presentity@server.domain.com Event: Presence.winfo Content-Type: application/watcherinfo+xml Content-Length: à sip:watcherA@example.com" sip:watcherD@domain.com" 6.2 Presentity makes subscription to get information about defined, new and unauthorized watchers SUBSCRIBE request from the presentity including the filter: SUBSCRIBE sip:presentity@domain.com Via: SIP/2.0/TCP 10.0.0.1:5060;branch=xjfdsjfk To: From: ;tag:12341111 Call-ID: 121212@10.0.0.1 Cseq: 1 SUBSCRIBE Expires: 3600 Event: Presence.winfo Contact: Content-Type: application/simple-winfo-filter+xml Content-Length: à //*[(. . /@package="presence" and ((@status="terminated" and @event="rejected") or @event="subscribe" or contains(.,"domain.com"))]/ancestor-or-self: : * Notification to the subscriber: NOTIFY sip:presentity@dom.com SIP/2.0 Via: SIP/2.0/TCP presence.domain.com:5060;branch=xjfder To: sip:presentity@domain.com;tag:12341111 From: sip:presentity@domain.com;tag:232321 Call-ID: 121212@10.0.0.1 Cseq: 1 NOTIFY Contact: sip:presentity@server.domain.com Event: Presence.winfo Content-Type: application/watcherinfo+xml Content-Length: à Khartabil, Leppanen. [Page 12] Internet Draft Watcher Info Filtering February 2003 sip:watcherB@example.com" sip:watcherC@example.com" sip:watcherD@domain.com" 6.3 Presentity requests history information of watchers SUBSCRIBE request from the presentity including the filter: SUBSCRIBE sip:presentity@domain.com Via: SIP/2.0/TCP 10.0.0.1:5060;branch=xjfdsjfk To: ;tag:12341111 From: Call-ID: 121212@10.0.0.1 Cseq: 1 SUBSCRIBE Expires: 0 Event: Presence.winfo Contact: Content-Type: application/simple-winfo-filter+xml Content-Length: à //*[(. . /@package="presence" and (@duration-subscribed>500)]/ancestor-or- self: :* Notification to the subscriber: NOTIFY sip:presentity@dom.com SIP/2.0 Via: SIP/2.0/TCP presence.domain.com:5060;branch=xjfder To: sip:presentity@domain.com;tag:12341111 From: sip:presentity@domain.com;tag:232321 Call-ID: 121212@10.0.0.1 Cseq: 1 NOTIFY Contact: sip:presentity@server.domain.com Khartabil, Leppanen. [Page 13] Internet Draft Watcher Info Filtering February 2003 Event: Presence.winfo Content-Type: application/watcherinfo+xml Content-Length: à sip:watcherA@example.com" sip:watcherB@example.com" 7.0 XML Schema The XML Schema for the watcher information filter. ******************* XML Schema Implementation (Normative) XML Schema Definition for SIP Event Filtering for Winfo. Khartabil, Leppanen. [Page 14] Internet Draft Watcher Info Filtering February 2003