As per Relevance of the word subscribe, we have this rfc below:











Network Working Group A. B.
Request for Comments: 3265
Updates: 2543 June 2002
Category: Standards


Session Initiation Protocol (SIP)-Specific Event

Status of this

This document specifies an Internet standards track protocol for
Internet community, and requests discussion and suggestions
improvements. Please refer to the current edition of the "
Official Protocol Standards" (STD 1) for the standardization
and status of this protocol. Distribution of this memo is unlimited

Copyright

Copyright (C) The Internet Society (2002). All Rights Reserved



This document describes an extension to the Session
Protocol (SIP). The purpose of this extension is to provide
extensible framework by which SIP nodes can request notification
remote nodes indicating that certain events have occurred

Concrete uses of the mechanism described in this document may
standardized in the future

Note that the event notification mechanisms defined herein are
intended to be a general-purpose infrastructure for all classes
event subscription and notification

Table of

1. Introduction........................................... 3
1.1. Overview of Operation.................................. 4
1.2. Documentation Conventions.............................. 4
2. Definitions............................................ 5
3. Node Behavior.......................................... 6
3.1. Description of SUBSCRIBE Behavior...................... 6
3.1.1. Subscription Duration.................................. 6
3.1.2. Identification of Subscribed Events and Event Classes.. 6
3.1.3. Additional SUBSCRIBE Header Values..................... 7
3.1.4. Subscriber SUBSCRIBE Behavior.......................... 7
3.1.5. Proxy SUBSCRIBE Behavior............................... 9
3.1.6. Notifier SUBSCRIBE Behavior............................ 10



Roach Standards Track [Page 1]

RFC 3265 SIP-Specific Event Notification June 2002


3.2. Description of NOTIFY Behavior......................... 13
3.2.1. Identification of Reported Events, Event Classes,
Current State.......................................... 13
3.2.2. Notifier NOTIFY Behavior............................... 14
3.2.3. Proxy NOTIFY Behavior.................................. 15
3.2.4. Subscriber NOTIFY Behavior............................. 16
3.3. General................................................ 18
3.3.1. Detecting support for SUBSCRIBE and NOTIFY............. 18
3.3.2. CANCEL requests........................................ 18
3.3.3. Forking................................................ 18
3.3.4. Dialog creation and termination........................ 18
3.3.5. State Agents and Notifier Migration.................... 19
3.3.6. Polling Resource State................................. 20
3.3.7. Allow-Events header usage.............................. 21
3.3.8. PINT Compatibility..................................... 21
4. Event Packages......................................... 21
4.1. Appropriateness of Usage............................... 21
4.2. Event Template-packages................................ 22
4.3. Amount of State to be Conveyed......................... 22
4.3.1. Complete State Information............................. 23
4.3.2. State Deltas........................................... 23
4.4. Event Package Responsibilities......................... 24
4.4.1. Event Package Name..................................... 24
4.4.2. Event Package Parameters............................... 24
4.4.3. SUBSCRIBE Bodies....................................... 24
4.4.4. Subscription Duration.................................. 25
4.4.5. NOTIFY Bodies.......................................... 25
4.4.6. Notifier processing of SUBSCRIBE requests.............. 25
4.4.7. Notifier generation of NOTIFY requests................. 25
4.4.8. Subscriber processing of NOTIFY requests............... 26
4.4.9. Handling of forked requests............................ 26
4.4.10. Rate of notifications.................................. 26
4.4.11. State Agents........................................... 27
4.4.12. Examples............................................... 27
4.4.13. Use of URIs to Retrieve State.......................... 27
5. Security Considerations................................ 28
5.1. Access Control......................................... 28
5.2. Notifier Privacy Mechanism............................. 28
5.3. Denial-of-Service attacks.............................. 28
5.4. Replay Attacks......................................... 29
5.5. Man-in-the middle attacks.............................. 29
5.6. Confidentiality........................................ 29
6. IANA Considerations.................................... 30
6.1. Registration Information............................... 30
6.2. Registration Template.................................. 31
6.3. Header Field Names..................................... 31
6.4. Response Codes......................................... 32
7. Syntax................................................. 32



Roach Standards Track [Page 2]

RFC 3265 SIP-Specific Event Notification June 2002


7.1. New Methods............................................ 32
7.1.1. SUBSCRIBE method....................................... 34
7.1.2. NOTIFY method.......................................... 34
7.2. New Headers............................................ 34
7.2.1. "Event" header......................................... 34
7.2.2. "Allow-Events" Header.................................. 35
7.2.3. "Subscription-State" Header............................ 35
7.3. New Response Codes..................................... 35
7.3.1. "202 Accepted" Response Code........................... 35
7.3.2. "489 Bad Event" Response Code.......................... 35
7.4. Augmented BNF Definitions.............................. 35
8. Normative References................................... 36
9. Informative References................................. 37
10. Acknowledgements....................................... 37
11. Notice Regarding Intellectual Property Rights.......... 37
12. Author's Address....................................... 37
13. Full Copyright Statement............................... 38

1.

The ability to request asynchronous notification of events
useful in many types of SIP services for which cooperation
end-nodes is required. Examples of such services include
callback services (based on terminal state events), buddy
(based on user presence events), message waiting indications (
on mailbox state change events), and PSTN and
Internetworking (PINT) [2] status (based on call state events).

The methods described in this document provide a framework by
notification of these events can be ordered

The event notification mechanisms defined herein are NOT intended
be a general-purpose infrastructure for all classes of
subscription and notification. Meeting requirements for the
problem set of subscription and notification is far too complex for
single protocol. Our goal is to provide a SIP-specific framework
event notification which is not so complex as to be unusable
simple features, but which is still flexible enough to
powerful services. Note, however, that event packages based on
framework may define arbitrarily elaborate rules which govern
subscription and notification for the events or classes of
they describe

This document does not describe an extension which may be
directly; it must be extended by other documents (herein referred
as "event packages"). In object-oriented design terminology, it





Roach Standards Track [Page 3]

RFC 3265 SIP-Specific Event Notification June 2002


be thought of as an abstract base class which must be derived into
instantiatable class by further extensions. Guidelines for
these extensions are described in section 4.

1.1. Overview of

The general concept is that entities in the network can subscribe
resource or call state for various resources or calls in the network
and those entities (or entities acting on their behalf) can
notifications when those states change

A typical flow of messages would be

Subscriber
|-----SUBSCRIBE---->| Request state
|<-------200--------| Acknowledge
|<------NOTIFY----- | Return current state
|--------200------->|
|<------NOTIFY----- | Return current state
|--------200------->|

Subscriptions are expired and must be refreshed by
SUBSCRIBE messages

1.2. Documentation

There are several paragraphs throughout this document which
motivational or clarifying text. Such passages are non-normative
and are provided only to assist with reader comprehension.
passages are set off from the remainder of the text by being
thus

This is an example of non-normative explanatory text. It does
form part of the specification, and is used only
clarification

Numbers in square brackets (e.g., [1]) denote a reference to one
the entries in the reference sections; see sections 8 and 9.

The all-capital terms "MUST", "SHOULD", "MAY", "SHOULD NOT", "
NOT", and "RECOMMENDED" are used as defined in RFC 2119 [5].

The use of quotation marks next to periods and commas follows
convention used by the American Mathematical Society;
contrary to traditional American English convention, this usage
clarity to certain passages





Roach Standards Track [Page 4]

RFC 3265 SIP-Specific Event Notification June 2002


2.

Event Package: An event package is an additional specification
defines a set of state information to be reported by a notifier
a subscriber. Event packages also define further syntax
semantics based on the framework defined by this document
to convey such state information

Event Template-Package: An event template-package is a special
of event package which defines a set of states which may
applied to all possible event packages, including itself

Notification: Notification is the act of a notifier sending a
message to a subscriber to inform the subscriber of the state of
resource

Notifier: A notifier is a user agent which generates NOTIFY
for the purpose of notifying subscribers of the state of
resource. Notifiers typically also accept SUBSCRIBE requests
create subscriptions

State Agent: A state agent is a notifier which publishes
information on behalf of a resource; in order to do so, it
need to gather such state information from multiple sources
State agents always have complete state information for
resource for which they are creating notifications

Subscriber: A subscriber is a user agent which receives
requests from notifiers; these NOTIFY requests contain
about the state of a resource in which the subscriber
interested. Subscribers typically also generate
requests and send them to notifiers to create subscriptions

Subscription: A subscription is a set of application state
with a dialog. This application state includes a pointer to
associated dialog, the event package name, and possibly
identification token. Event packages will define
subscription state information. By definition,
exist in both a subscriber and a notifier

Subscription Migration: Subscription migration is the act of moving
subscription from one notifier to another notifier









Roach Standards Track [Page 5]

RFC 3265 SIP-Specific Event Notification June 2002


3. Node

3.1. Description of SUBSCRIBE

The SUBSCRIBE method is used to request current state and
updates from a remote node

3.1.1. Subscription

SUBSCRIBE requests SHOULD contain an "Expires" header (defined in
[1]). This expires value indicates the duration of the subscription
In order to keep subscriptions effective beyond the
communicated in the "Expires" header, subscribers need to
subscriptions on a periodic basis using a new SUBSCRIBE message
the same dialog as defined in SIP [1].

If no "Expires" header is present in a SUBSCRIBE request, the
default is defined by the event package being used

200-class responses to SUBSCRIBE requests also MUST contain
"Expires" header. The period of time in the response MAY be
but MUST NOT be longer than specified in the request. The period
time in the response is the one which defines the duration of
subscription

An "expires" parameter on the "Contact" header has no semantics
SUBSCRIBE and is explicitly not equivalent to an "Expires" header
a SUBSCRIBE request or response

A natural consequence of this scheme is that a SUBSCRIBE with
"Expires" of 0 constitutes a request to unsubscribe from an event

In addition to being a request to unsubscribe, a SUBSCRIBE
with "Expires" of 0 also causes a fetch of state; see
3.3.6.

Notifiers may also wish to cancel subscriptions to events; this
useful, for example, when the resource to which a subscription
is no longer available. Further details on this mechanism
discussed in section 3.2.2.

3.1.2. Identification of Subscribed Events and Event

Identification of events is provided by three pieces of information
Request URI, Event Type, and (optionally) message body






Roach Standards Track [Page 6]

RFC 3265 SIP-Specific Event Notification June 2002


The Request URI of a SUBSCRIBE request, most importantly,
enough information to route the request to the appropriate entity
the request routing procedures outlined in SIP [1]. It also
enough information to identify the resource for which
notification is desired, but not necessarily enough information
uniquely identify the nature of the event (e.g.,
"sip:adam@dynamicsoft.com" would be an appropriate URI to
to for my presence state; it would also be an appropriate URI
subscribe to the state of my voice mailbox).

Subscribers MUST include exactly one "Event" header in
requests, indicating to which event or class of events they
subscribing. The "Event" header will contain a token which
the type of state for which a subscription is being requested.
token will be registered with the IANA and will correspond to
event package which further describes the semantics of the event
event class. The "Event" header MAY also contain an "id" parameter
This "id" parameter, if present, contains an opaque token
identifies the specific subscription within a dialog. An "id
parameter is only valid within the scope of a single dialog

If the event package to which the event token corresponds
behavior associated with the body of its SUBSCRIBE requests,
semantics apply

Event packages may also define parameters for the Event header;
they do so, they must define the semantics for such parameters

3.1.3. Additional SUBSCRIBE Header

Because SUBSCRIBE requests create a dialog as defined in SIP [1],
they MAY contain an "Accept" header. This header, if present
indicates the body formats allowed in subsequent NOTIFY requests
Event packages MUST define the behavior for SUBSCRIBE
without "Accept" headers; usually, this will connote a single
default body type

Header values not described in this document are to be interpreted
described in SIP [1].

3.1.4. Subscriber SUBSCRIBE

3.1.4.1. Requesting a

SUBSCRIBE is a dialog-creating method, as described in SIP [1].

When a subscriber wishes to subscribe to a particular state for
resource, it forms a SUBSCRIBE message. If the initial



Roach Standards Track [Page 7]

RFC 3265 SIP-Specific Event Notification June 2002


represents a request outside of a dialog (as it typically will),
construction follows the procedures outlined in SIP [1] for
request generation outside of a dialog

This 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
that the subscription has been accepted and that the user
authorized to subscribe to the requested resource. A 202
merely indicates that the subscription has been understood, and
authorization may or may not have been granted

The "Expires" header in a 200-class response to SUBSCRIBE
the actual duration for which the subscription will remain
(unless refreshed).

Non-200 class final responses indicate that no subscription or
has been created, and no subsequent NOTIFY message will be sent.
non-200 class responses (with the exception of "489",
herein) have the same meanings and handling as described in SIP [1].

A SUBSCRIBE request MAY include an "id" parameter in its "Event
header to allow differentiation between multiple subscriptions in
same dialog

3.1.4.2. Refreshing of

At any time before a subscription expires, the subscriber may
the timer on such a subscription by sending another SUBSCRIBE
on the same dialog as the existing subscription, and with the
"Event" header "id" parameter (if one was present in the
subscription). The handling for such a request is the same as
the initial creation of a subscription except as described below

If the initial SUBSCRIBE message contained an "id" parameter
the "Event" header, then refreshes of the subscription must
contain an identical "id" parameter; they will otherwise
considered new subscriptions in an existing dialog

If a SUBSCRIBE request to refresh a subscription receives a "481"
response, this indicates that the subscription has been
and that the subscriber did not receive notification of this fact
In this case, the subscriber should consider the
invalid. If the subscriber wishes to re-subscribe to the state,
does so by composing an unrelated initial SUBSCRIBE request with
freshly-generated Call-ID and a new, unique "From" tag (see
3.1.4.1.)




Roach Standards Track [Page 8]

RFC 3265 SIP-Specific Event Notification June 2002


If a SUBSCRIBE request to refresh a subscription fails with a non-481
response, the original subscription is still considered valid for
duration of the most recently known "Expires" value as negotiated
SUBSCRIBE and its response, or as communicated by NOTIFY in
"Subscription-State" header "expires" parameter

Note that many such errors indicate that there may be a
with the network or the notifier such that no further
messages will be received

3.1.4.3.

Unsubscribing is handled in the same way as refreshing of
subscription, with the "Expires" header set to "0". Note that
successful unsubscription will also trigger a final NOTIFY message

3.1.4.4. Confirmation of Subscription

The subscriber can expect to receive a NOTIFY message from each
which has processed a successful subscription or
refresh. Until the first NOTIFY message arrives, the
should consider the state of the subscribed resource to be in
neutral state. Documents which define new event packages MUST
this "neutral state" in such a way that makes sense for
application (see section 4.4.7.).

Due to the potential for both out-of-order messages and forking,
subscriber MUST be prepared to receive NOTIFY messages before
SUBSCRIBE transaction has completed

Except as noted above, processing of this NOTIFY is the same as
section 3.2.4.

3.1.5. Proxy SUBSCRIBE

Proxies need no additional behavior beyond that described in SIP [1]
to support SUBSCRIBE. If a proxy wishes to see all of the
and NOTIFY requests for a given dialog, it MUST record-route
initial SUBSCRIBE and any dialog-establishing NOTIFY requests.
proxies SHOULD also record-route all other SUBSCRIBE and
requests

Note that subscribers and notifiers may elect to use S/
encryption of SUBSCRIBE and NOTIFY requests; consequently,
cannot rely on being able to access any information that is
explicitly required to be proxy-readable by SIP [1].





Roach Standards Track [Page 9]

RFC 3265 SIP-Specific Event Notification June 2002


3.1.6. Notifier SUBSCRIBE

3.1.6.1. Initial SUBSCRIBE Transaction

In no case should a SUBSCRIBE transaction extend for any longer
the time necessary for automated processing. In particular
notifiers MUST NOT wait for a user response before returning a
response to a SUBSCRIBE request

This requirement is imposed primarily to prevent the non-
transaction timeout timer F (see [1]) from firing during
SUBSCRIBE transaction, since interaction with a user would
exceed 64*T1 seconds

The notifier SHOULD check that the event package specified in
"Event" header is understood. If not, the notifier SHOULD return
"489 Bad Event" response to indicate that the specified event/
class is not understood

The notifier SHOULD also perform any necessary authentication
authorization per its local policy. See section 3.1.6.3.

The notifier MAY also check that the duration in the "Expires"
is not too small. If and only if the expiration interval is
than zero AND smaller than one hour AND less than a notifier
configured minimum, the notifier MAY return a "423 Interval
small" error which contains a "Min-Expires" header field. The "Min
Expires" header field is described in SIP [1].

If the notifier is able to immediately determine that it
the event package, that the authenticated subscriber is authorized
subscribe, and that there are no other barriers to creating
subscription, it creates the subscription and a dialog (
necessary), and returns a "200 OK" response (unless doing so
reveal authorization policy in an undesirable fashion; see
5.2.).

If the notifier cannot immediately create the subscription (e.g.,
needs to wait for user input for authorization, or is acting
another node which is not currently reachable), or wishes to
authorization policy, it will return a "202 Accepted" response.
response indicates that the request has been received and understood
but does not necessarily imply that the subscription has
authorized yet

When a subscription is created in the notifier, it stores the
package name and the "Event" header "id" parameter (if present)
part of the subscription information



Roach Standards Track [Page 10]

RFC 3265 SIP-Specific Event Notification June 2002


The "Expires" values present in SUBSCRIBE 200-class responses
in the same way as they do in REGISTER responses: the server
shorten the interval, but MUST NOT lengthen it

If the duration specified in a SUBSCRIBE message is
short, the notifier may be able to send a 423 response,
described earlier in this section

200-class responses to SUBSCRIBE requests will not generally
any useful information beyond subscription duration; their
purpose is to serve as a reliability mechanism. State
will be communicated via a subsequent NOTIFY request from
notifier

The other response codes defined in SIP [1] may be used in
to SUBSCRIBE requests, as appropriate

3.1.6.2. Confirmation of Subscription Creation/

Upon successfully accepting or refreshing a subscription,
MUST send a NOTIFY message immediately to communicate the
resource state to the subscriber. This NOTIFY message is sent on
same dialog as created by the SUBSCRIBE response. If the
has no meaningful state at the time that the SUBSCRIBE message
processed, this NOTIFY message MAY contain an empty or neutral body
See section 3.2.2. for further details on NOTIFY message generation

Note that a NOTIFY message is always sent immediately after any 200-
class response to a SUBSCRIBE request, regardless of whether
subscription has already been authorized

3.1.6.3. Authentication/Authorization of SUBSCRIBE

Privacy concerns may require that notifiers apply policy to
whether a particular subscriber is authorized to subscribe to
certain set of events. Such policy may be defined by mechanisms
as access control lists or real-time interaction with a user.
general, authorization of subscribers prior to authentication is
particularly useful

SIP authentication mechanisms are discussed in SIP [1]. Note that
even if the notifier node typically acts as a proxy,
for SUBSCRIBE requests will always be performed via a "401" response
not a "407;" notifiers always act as a user agents when
subscriptions and sending notifications






Roach Standards Track [Page 11]

RFC 3265 SIP-Specific Event Notification June 2002


Of course, when acting as a proxy, a node will perform
proxy authentication (using 407). The foregoing explanation is
reminder that notifiers are always UAs, and as such perform
authentication

If authorization fails based on an access list or some
automated mechanism (i.e., it can be automatically
determined that the subscriber is not authorized to subscribe),
notifier SHOULD reply to the request with a "403 Forbidden" or "603
Decline" response, unless doing so might reveal information
should stay private; see section 5.2.

If the notifier owner is interactively queried to determine whether
subscription is allowed, a "202 Accept" response is
immediately. Note that a NOTIFY message is still formed and
under these circumstances, as described in the previous section

If subscription authorization was delayed and the notifier wishes
convey that such authorization has been declined, it may do so
sending a NOTIFY message containing a "Subscription-State"
with a value of "terminated" and a reason parameter of "rejected".

3.1.6.4. Refreshing of

When a notifier receives a subscription refresh, assuming that
subscriber is still authorized, the notifier updates the
time for the subscription. As with the initial subscription,
server MAY shorten the amount of time until expiration, but MUST
increase it. The final expiration time is placed in the "Expires
header in the response. If the duration specified in a
message is unacceptably short, the notifier SHOULD respond with
"423 Subscription Too Brief" message

If no refresh for a notification address is received before
expiration time, the subscription is removed. When removing
subscription, the notifier SHOULD send a NOTIFY message with
"Subscription-State" value of "terminated" to inform it that
subscription is being removed. If such a message is sent,
"Subscription-State" header SHOULD contain a "reason=timeout
parameter

The sending of a NOTIFY when a subscription expires allows
corresponding dialog to be terminated, if appropriate








Roach Standards Track [Page 12]

RFC 3265 SIP-Specific Event Notification June 2002


3.2. Description of NOTIFY

NOTIFY messages are sent to inform subscribers of changes in state
which the subscriber has a subscription. Subscriptions are
put in place using the SUBSCRIBE method; however, it is possible
other means have been used

If any non-SUBSCRIBE mechanisms are defined to create subscriptions
it is the responsibility of the parties defining those mechanisms
ensure that correlation of a NOTIFY message to the
subscription is possible. Designers of such mechanisms are
warned to make a distinction between sending a NOTIFY message to
subscriber who is aware of the subscription, and sending a
message to an unsuspecting node. The latter behavior is invalid,
MUST receive a "481 Subscription does not exist" response (
some other 400- or 500-class error code is more applicable),
described in section 3.2.4. In other words, knowledge of
subscription must exist in both the subscriber and the notifier to
valid, even if installed via a non-SUBSCRIBE mechanism

A NOTIFY does not terminate its corresponding subscription; in
words, a single SUBSCRIBE request may trigger several
requests

3.2.1. Identification of Reported Events, Event Classes, and


Identification of events being reported in a notification is
similar to that described for subscription to events (see
3.1.2.).

As in SUBSCRIBE requests, NOTIFY "Event" headers will contain
single event package name for which a notification is
generated. The package name in the "Event" header MUST match
"Event" header in the corresponding SUBSCRIBE message. If an "id
parameter was present in the SUBSCRIBE message, that "id"
MUST also be present in the corresponding NOTIFY messages

Event packages may define semantics associated with the body of
NOTIFY requests; if they do so, those semantics apply. NOTIFY
are expected to provide additional details about the nature of
event which has occurred and the resultant resource state

When present, the body of the NOTIFY request MUST be formatted
one of the body formats specified in the "Accept" header of
corresponding SUBSCRIBE request. This body will contain either
state of the subscribed resource or a pointer to such state in
form of a URI (see section 4.4.13).



Roach Standards Track [Page 13]

RFC 3265 SIP-Specific Event Notification June 2002


3.2.2. Notifier NOTIFY

When a SUBSCRIBE request is answered with a 200-class response,
notifier MUST immediately construct and send a NOTIFY request to
subscriber. When a change in the subscribed state occurs,
notifier SHOULD immediately construct and send a NOTIFY request
subject to authorization, local policy, and
considerations

A NOTIFY request is considered failed if the response times out, or
non-200 class response code is received which has no "Retry-After
header and no implied further action which can be taken to retry
request (e.g., "401 Authorization Required".)

If the NOTIFY request fails (as defined above) due to a
condition, and the subscription was installed using a soft-
mechanism (such as SUBSCRIBE), the notifier SHOULD remove
subscription

This behavior prevents unnecessary transmission of
information for subscribers who have crashed or disappeared
the network. Because such transmissions will be sent
times, per the retransmission algorithm defined in SIP [1]
(instead of the typical single transmission for
clients), continuing to service them when no client is
to acknowledge them could place undue strain on a network.
client restart or reestablishment of a network connection, it
expected that clients will send SUBSCRIBE messages to
potentially stale state information; such messages will re-
subscriptions in all relevant nodes

If the NOTIFY request fails (as defined above) due to an
response, and the subscription was installed using a soft-
mechanism, the notifier MUST remove the corresponding subscription

A notify error response would generally indicate that
has gone wrong with the subscriber or with some proxy on the
to the subscriber. If the subscriber is in error, it makes
most sense to allow the subscriber to rectify the situation (
re-subscribing) once the error condition has been handled. If
proxy is in error, the periodic SUBSCRIBE refreshes will re
install subscription state once the network problem has
resolved

If a NOTIFY request receives a 481 response, the notifier MUST
the corresponding subscription even if such subscription
installed by non-SUBSCRIBE means (such as an
interface).



Roach Standards Track [Page 14]

RFC 3265 SIP-Specific Event Notification June 2002


If the above behavior were not required, subscribers receiving
notify for an unknown subscription would need to send an
status code in response to the NOTIFY and also send a
request to remove the subscription. Since this behavior
make subscribers available for use as amplifiers in denial
service attacks, we have instead elected to give the 481
special meaning: it is used to indicate that a subscription
be cancelled under all circumstances

NOTIFY requests MUST contain a "Subscription-State" header with
value of "active", "pending", or "terminated". The "active"
indicates that the subscription has been accepted and has
authorized (in most cases; see section 5.2.). The "pending"
indicates that the subscription has been received, but that
information is insufficient to accept or deny the subscription
this time. The "terminated" value indicates that the subscription
not active

If the value of the "Subscription-State" header is "active"
"pending", the notifier SHOULD also include in the "Subscription
State" header an "expires" parameter which indicates the
remaining on the subscription. The notifier MAY use this
to shorten a subscription; however, this mechanism MUST NOT be
to lengthen a subscription

Including expiration information for active and
subscriptions is useful in case the SUBSCRIBE request forks,
the response to a forked SUBSCRIBE may not be received by
subscriber. Note well that this "expires" value is a parameter
the "Subscription-State" header, NOT an "Expires" header

If the value of the "Subscription-State" header is "terminated",
notifier SHOULD also include a "reason" parameter. The notifier
also include a "retry-after" parameter, where appropriate.
details on the value and semantics of the "reason" and "retry-after
parameters, see section 3.2.4.

3.2.3. Proxy NOTIFY

Proxies need no additional behavior beyond that described in SIP [1]
to support NOTIFY. If a proxy wishes to see all of the SUBSCRIBE
NOTIFY requests for a given dialog, it MUST record-route the
SUBSCRIBE and any dialog-establishing NOTIFY requests. Such
SHOULD also record-route all other SUBSCRIBE and NOTIFY requests







Roach Standards Track [Page 15]

RFC 3265 SIP-Specific Event Notification June 2002


Note that subscribers and notifiers may elect to use S/
encryption of SUBSCRIBE and NOTIFY requests; consequently,
cannot rely on being able to access any information that is
explicitly required to be proxy-readable by SIP [1].

3.2.4. Subscriber NOTIFY

Upon receiving a NOTIFY request, the subscriber should check that
matches at least one of its outstanding subscriptions; if not,
MUST return a "481 Subscription does not exist" response
another 400- or 500-class response is more appropriate. The
for matching NOTIFY requests with subscriptions that create a
dialog are described in section 3.3.4. Notifications
subscriptions which were created inside an existing dialog match
they are in the same dialog and the "Event" headers match (
described in section 7.2.1.)

If, for some reason, the event package designated in the "Event
header of the NOTIFY request is not supported, the subscriber
respond with a "489 Bad Event" response

To prevent spoofing of events, NOTIFY requests SHOULD
authenticated, using any defined SIP authentication mechanism

NOTIFY requests MUST contain "Subscription-State" headers
indicate the status of the subscription

If the "Subscription-State" header value is "active", it means
the subscription has been accepted and (in general) has
authorized. If the header also contains an "expires" parameter,
subscriber SHOULD take it as the authoritative subscription
and adjust accordingly. The "retry-after" and "reason"
have no semantics for "active".

If the "Subscription-State" value is "pending", the subscription
been received by the notifier, but there is insufficient
information to grant or deny the subscription yet. If the
also contains an "expires" parameter, the subscriber SHOULD take
as the authoritative subscription duration and adjust accordingly
No further action is necessary on the part of the subscriber.
"retry-after" and "reason" parameters have no semantics
"pending".

If the "Subscription-State" value is "terminated", the
should consider the subscription terminated. The "expires"
has no semantics for "terminated". If a reason code is present,
client should behave as described below. If no reason code or
unknown reason code is present, the client MAY attempt to re



Roach Standards Track [Page 16]

RFC 3265 SIP-Specific Event Notification June 2002


subscribe at any time (unless a "retry-after" parameter is present
in which case the client SHOULD NOT attempt re-subscription
after the number of seconds specified by the "retry-after
parameter). The defined reason codes are

deactivated: The subscription has been terminated, but the
SHOULD retry immediately with a new subscription. One primary
of such a status code is to allow migration of
between nodes. The "retry-after" parameter has no semantics
"deactivated".

probation: The subscription has been terminated, but the
SHOULD retry at some later time. If a "retry-after" parameter
also present, the client SHOULD wait at least the number
seconds specified by that parameter before attempting to re
subscribe

rejected: The subscription has been terminated due to change
authorization policy. Clients SHOULD NOT attempt to re-subscribe
The "retry-after" parameter has no semantics for "rejected".

timeout: The subscription has been terminated because it was
refreshed before it expired. Clients MAY re-
immediately. The "retry-after" parameter has no semantics
"timeout".

giveup: The subscription has been terminated because the
could not obtain authorization in a timely fashion. If a "retry
after" parameter is also present, the client SHOULD wait at
the number of seconds specified by that parameter
attempting to re-subscribe; otherwise, the client MAY
immediately, but will likely get put back into pending state

noresource: The subscription has been terminated because the
state which was being monitored no longer exists. Clients
NOT attempt to re-subscribe. The "retry-after" parameter has
semantics for "noresource".

Once the notification is deemed acceptable to the subscriber,
subscriber SHOULD return a 200 response. In general, it is
expected that NOTIFY responses will contain bodies; however,
MAY, if the NOTIFY request contained an "Accept" header

Other responses defined in SIP [1] may also be returned,
appropriate. In no case should a NOTIFY transaction extend for
longer than the time necessary for automated processing.
particular, subscribers MUST NOT wait for a user response
returning a final response to a NOTIFY request



Roach Standards Track [Page 17]

RFC 3265 SIP-Specific Event Notification June 2002


3.3.

3.3.1. Detecting support for SUBSCRIBE and

Neither SUBSCRIBE nor NOTIFY necessitate the use of "Require"
"Proxy-Require" headers; similarly, there is no token defined
"Supported" headers. If necessary, clients may probe for the
of SUBSCRIBE and NOTIFY using the OPTIONS request defined in SIP [1].

The presence of the "Allow-Events" header in a message is
to indicate support for SUBSCRIBE and NOTIFY

The "methods" parameter for Contact may also be used
specifically announce support for SUBSCRIBE and NOTIFY
when registering. (See reference [8] for details on the "methods
parameter).

3.3.2. CANCEL

No semantics are associated with cancelling SUBSCRIBE or NOTIFY

3.3.3.

In accordance with the rules for proxying non-INVITE requests
defined in SIP [1], successful SUBSCRIBE requests will receive
one 200-class response; however, due to forking, the subscription
have been accepted by multiple nodes. The subscriber MUST
be prepared to receive NOTIFY requests with "From:" tags which
from the "To:" tag received in the SUBSCRIBE 200-class response

If multiple NOTIFY messages are received in different dialogs
response to a single SUBSCRIBE message, each dialog represents
different destination to which the SUBSCRIBE request was forked.
information on subscriber handling in such situations, see
4.4.9.

3.3.4. Dialog creation and

If an initial SUBSCRIBE request is not sent on a pre-existing dialog
the subscriber will wait for a response to the SUBSCRIBE request or
matching NOTIFY

Responses are matched to such SUBSCRIBE requests if they contain
same the same "Call-ID", the same "From" header "tag", and the
"CSeq". Rules for the comparison of these headers are described
SIP [1]. If a 200-class response matches such a SUBSCRIBE request
it creates a new subscription and a new dialog (unless they
already been created by a matching NOTIFY request; see below).



Roach Standards Track [Page 18]

RFC 3265 SIP-Specific Event Notification June 2002


NOTIFY requests are matched to such SUBSCRIBE requests if
contain the same "Call-ID", a "To" header "tag" parameter
matches the "From" header "tag" parameter of the SUBSCRIBE, and
same "Event" header field. Rules for comparisons of the "Event
headers are described in section 7.2.1. If a matching NOTIFY
contains a "Subscription-State" of "active" or "pending", it
a new subscription and a new dialog (unless they have already
created by a matching response, as described above).

If an initial SUBSCRIBE is sent on a pre-existing dialog, a
200-class response or successful NOTIFY request merely creates a
subscription associated with that dialog

Multiple subscriptions can be associated with a single dialog
Subscriptions may also exist in dialogs associated with INVITE
created application state and other application state created
mechanisms defined in other specifications. These sets
application state do not interact beyond the behavior described for
dialog (e.g., route set handling).

A subscription is destroyed when a notifier sends a NOTIFY
with a "Subscription-State" of "terminated".

A subscriber may send a SUBSCRIBE request with an "Expires"
of 0 in order to trigger the sending of such a NOTIFY request
however, for the purposes of subscription and dialog lifetime,
subscription is not considered terminated until the NOTIFY with
"Subscription-State" of "terminated" is sent

If a subscription's destruction leaves no other application
associated with the dialog, the dialog terminates. The
of other application state (such as that created by an INVITE)
not terminate the dialog if a subscription is still associated
that dialog

Note that the above behavior means that a dialog created with
INVITE does not necessarily terminate upon receipt of a BYE
Similarly, in the case that several subscriptions are
with a single dialog, the dialog does not terminate until all
subscriptions in it are destroyed

3.3.5. State Agents and Notifier

When state agents (see section 4.4.11.) are used, it is often
to allow migration of subscriptions between state agents and
nodes for which they are providing state aggregation (or even
various state agents). Such migration may be effected by sending




Roach Standards Track [Page 19]

RFC 3265 SIP-Specific Event Notification June 2002


NOTIFY message with a "Subscription-State" header of "terminated",
and a reason parameter of "deactivated". This NOTIFY request
otherwise normal, and is formed as described in section 3.2.2.

Upon receipt of this NOTIFY message, the subscriber SHOULD attempt
re-subscribe (as described in the preceding sections). Note
this subscription is established on a new dialog, and does not re-
the route set from the previous subscription dialog

The actual migration is effected by making a change to the
(such as routing decisions) of one or more servers to which
SUBSCRIBE request will be sent in such a way that a different
ends up responding to the SUBSCRIBE request. This may be as
as a change in the local policy in the notifier from which
subscription is migrating so that it serves as a proxy or
server instead of a notifier

Whether, when, and why to perform notifier migrations may
described in individual event packages; otherwise, such decisions
a matter of local notifier policy, and are left up to
implementations

3.3.6. Polling Resource

A natural consequence of the behavior described in the
sections is that an immediate fetch without a persistent
may be effected by sending a SUBSCRIBE with an "Expires" of 0.

Of course, an immediate fetch while a subscription is active may
effected by sending a SUBSCRIBE with an "Expires" equal to the
of seconds remaining in the subscription

Upon receipt of this SUBSCRIBE request, the notifier (or notifiers
if the SUBSCRIBE request was forked) will send a NOTIFY
containing resource state in the same dialog

Note that the NOTIFY messages triggered by SUBSCRIBE messages
"Expires" headers of 0 will contain a "Subscription-State" value
"terminated", and a "reason" parameter of "timeout".

Polling of event state can cause significant increases in load on
network and notifiers; as such, it should be used only sparingly.
particular, polling SHOULD NOT be used in circumstances in which
will typically result in more network messages than long-
subscriptions






Roach Standards Track [Page 20]

RFC 3265 SIP-Specific Event Notification June 2002


When polling is used, subscribers SHOULD attempt to
authentication credentials between polls so as to reduce the
of messages sent

3.3.7. Allow-Events header

The "Allow-Events" header, if present, includes a list of
which indicates the event packages supported by the client (if
in a request) or server (if sent in a response). In other words,
node sending an "Allow-Events" header is advertising that it
process SUBSCRIBE requests and generate NOTIFY requests for all
the event packages listed in that header

Any node implementing one or more event packages SHOULD include
appropriate "Allow-Events" header indicating all supported events
all methods which initiate dialogs and their responses (such
INVITE) and OPTIONS responses

This information is very useful, for example, in allowing user
to render particular interface elements appropriately according
whether the events required to implement the features they
are supported by the appropriate nodes

Note that "Allow-Events" headers MUST NOT be inserted by proxies

3.3.8. PINT

The "Event" header is considered mandatory for the purposes of
document. However, to maintain compatibility with PINT (see [2]),
servers MAY interpret a SUBSCRIBE request with no "Event" header
requesting a subscription to PINT events. If a server does
support PINT, it SHOULD return "489 Bad Event" to any
messages without an "Event" header

4. Event

This section covers several issues which should be taken
consideration when event packages based on SUBSCRIBE and NOTIFY
proposed

4.1. Appropriateness of

When designing an event package using the methods described in
document for event notification, it is important to consider: is
an appropriate mechanism for the problem set? Is SIP being
because of some unique feature provided by the protocol (e.g.,
mobility), or merely because "it can be done?" If you find




Roach Standards Track [Page 21]

RFC 3265 SIP-Specific Event Notification June 2002


defining event packages for notifications related to, for example
network management or the temperature inside your car's engine,
may want to reconsider your selection of protocols

Those interested in extending the mechanism defined in
document are urged to follow the development of "Guidelines
Authors of SIP Extensions" [7] for further guidance
appropriate uses of SIP

Further, it is expected that this mechanism is not to be used
applications where the frequency of reportable events is
rapid (e.g., more than about once per second). A SIP network
generally going to be provisioned for a reasonable signalling volume
sending a notification every time a user's GPS position changes
one hundredth of a second could easily overload such a network

4.2. Event Template-

Normal event packages define a set of state applied to a
type of resource, such as user presence, call state, and
mailbox state

Event template-packages are a special type of package which define
set of state applied to other packages, such as statistics,
policy, and subscriber lists. Event template-packages may even
applied to other event template-packages

To extend the object-oriented analogy made earlier, event template
packages can be thought of as templatized C++ packages which must
applied to other packages to be useful

The name of an event template-package as applied to a package
formed by appending a period followed by the event template-
name to the end of the package. For example, if a template-
called "winfo" were being applied to a package called "presence",
event token used in "Event" and "Allow-Events" would
"presence.winfo".

Event template-packages must be defined so that they can be
to any arbitrary package. In other words, event template-
cannot be specifically tied to one or a few "parent" packages in
a way that they will not work with other packages

4.3. Amount of State to be

When designing event packages, it is important to consider the
of information which will be conveyed during a notification




Roach Standards Track [Page 22]

RFC 3265 SIP-Specific Event Notification June 2002


A natural temptation is to convey merely the event (e.g., "a
voice message just arrived") without accompanying state (e.g., "7
total voice messages"). This complicates implementation
subscribing entities (since they have to maintain complete state
the entity to which they have subscribed), and also is
susceptible to synchronization problems

There are two possible solutions to this problem that event
may choose to implement

4.3.1. Complete State

For packages which typically convey state information that
reasonably small (on the order of 1 kb or so), it is suggested
event packages are designed so as to send complete state
when an event occurs

In some circumstances, conveying the current state alone may
insufficient for a particular class of events. In these cases,
event packages should include complete state information along
the event that occurred. For example, conveying "no customer
representatives available" may not be as useful as conveying "
customer service representatives available;
sip:46@cs.xyz.int just logged off".

4.3.2. State

In the case that the state information to be conveyed is large,
event package may choose to detail a scheme by which NOTIFY
contain state deltas instead of complete state

Such a scheme would work as follows: any NOTIFY sent in
response to a SUBSCRIBE contains full state information.
messages sent because of a state change will contain only the
information that has changed; the subscriber will then merge
information into its current