<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfcXXXX.dtd'>
<?rfc strict="yes" ?>
<?rfc toc="yes" ?>
<rfc ipr='full3978' docName='draft-worley-sip-dialog-00'>

<front>
<title abbrev='Guidelines for the Dialog Event Package'>
Guidelines for Implementing the Dialog Event Package in User Agents
</title>
<author initials='D. R.' surname='Worley' fullname='Dale R. Worley'>
       <organization abbrev='Pingtel'>
           Pingtel Corp.
       </organization>
   <address>
       <postal>
           <street>400 West Cummings Park, Suite 2200</street>
           <city>Woburn</city>
           <region>MA</region>
           <code>01801</code>
           <country>US</country>
       </postal>
       <phone>+1 781 938 5306 x173</phone>
       <email>dworley@pingtel.com</email>
       <uri>http://www.pingtel.com</uri>
   </address>
</author>
<date month='February' year='2006' />
<area>Transport</area>
<workgroup>sip</workgroup>
<keyword>Dialog event package</keyword>
<abstract>
<t>
This document sets out guidelines for how user agents should implement
the dialog event package in order to be usable in systems that
implement end-point controlled call-control (EPCC) features.  It is in
addition to the basic requirements for dialog event package
implementation in RFC 3265 and RFC 4235.
</t>
</abstract>
</front>

<middle>

<section title='Background' anchor='background'>

<t>
SIP implements telephony and similar applications over the Internet.
SIP largely conforms to the "end-to-end principle"<xref
target='end-to-end'/>, putting the major
responsibility for "call-control features" on the user agents
(telephones) themselves, in contrast to traditional telephony, where
the intelligence is concentrated in a small number of centralized
switches.
In order for a user agent to interact with dialogs (calls) that are
present on other
user agents, those user agents must publish the state of the dialogs
in which they are participating in a dialog event package<xref target='ref-dialog-event'/>.
A user agent can retrieve another user agent's dialog event package to
obtain the identifiers of the second user agent's dialogs, and using
those identifiers, it can manipulate those dialogs.
</t>

<t>
Unfortunately, the dialog event package was specified before the
breadth of its importance was fully understood, so its specification
is relatively loose.
Loose enough that many implementations conforming to the standard are not
usable for end-point call control (EPCC).
It is the purpose of this document to provide a specification of
the dialog event package that is tight enough to ensure that a user
agent can fully participate in current and future EPCC operations.
</t>

<t>
This document is not intended to advance toward standardization.
However, if it proves valuable to implementors, it may evolve into a
statement of best common practice.
</t>

</section>

<section title='Guidelines' anchor='guidelines'>

<t>
This section contains the guidelines for implementing high-quality
dialog event packages, and a  discussion of the motivation for
each guideline.
</t>

<section title='Addressing' anchor='addressing'>

<t>
A subscriber to the dialog event package will often know only an
AOR (address of record) to identify the UA with which it desires to
communicate, so the subscriber will have to route its
SUBSCRIBE through a proxy for the AOR.  The proxy will route the
SUBSCRIBE to the registered contact URIs for that AOR.
</t>

<t>
Alternatively, a subscriber may know of a contact URI that the UA has
used within a transaction or dialog.  Contact URIs may route
directly to the UA.
</t>

<t>
<list style='empty'>
<t>
Guideline 1: A UA should accept SUBSCRIBEs to all URIs that it
uses as contacts for AORs, and all URIs that it uses as contacts in
transactions or dialogs.
</t>
</list>
</t>

<t>
A single UA may have contacts for multiple AORs, some of which may
have contacts at other UAs.  So dialog events "for an AOR" should only
contain information about dialogs that were somehow addressed to that
AOR.
</t>

<t>
<list style='empty'>
<t>
Guideline 2: A SUBSCRIBE to a URI that the UA uses as a contact for an
AOR should obtain dialog events that describe only INVITEs "for the
AOR" that corresponds to that URI.
</t>
</list>
</t>

</section>

<section title='Status/Presence' anchor='status'>

<t>
Attendant consoles and other status reporting devices sometimes want
information about the status of a UA as a whole (and thus implicitly
its user's status), rather than about all dialogs
that were addressed to a particular AOR.
It would be desirable if there was a way to  subscribe
to events for all dialogs on a UA, but there seems to be no way for
the UA to disseminate such a URI, and no standardized way to construct
one.  Perhaps a parameter on the request URI, or a parameter on the
event package name in the Event header, could be used to indicate a
desire for information for the entire UA.
</t>

<t>
The concept of such a subscription
raises the question of "What are all the URIs for a UA?",
since the UA may not be a discrete physical object.
The concept of to "URIs being lines on the same UA" doesn't seem to
be intrinsic to SIP.  Perhaps the set of contact URIs that share a
+sip.instance value should be considered to comprise "a UA".
</t>

</section>

<section title='Dialog Package Data' anchor='data'>

<t>
<xref target='ref-dialog-event'/> does not define what is to be considered
the "resource" that is the subject of a dialog event subscription, and
thus, what is to be the value of the entity attribute of the
dialog-info element.  But the examples in <xref
target='ref-dialog-event'/> make its intended use clear:
</t>

<t>
<list style='empty'>
<t>
Guideline 3: The entity attribute of the dialog-info element should
contain the AOR corresponding to the contact URI that was the
request-URI of the SUBSCRIBE establishing the subscription.
</t>
</list>
</t>

<t>
In order to implement EPCC, the dialog event package needs to contain
enough information to allow the subscriber to construct requests (REFER, INVITE
with Replaces, etc) that can operate on the dialog.
</t>

<t>
<list style='empty'>
<t>
Guideline 4: The dialog event package should include the call-id,
local-tag, remote-tag, and direction attributes of the dialog element.
</t>
</list>
</t>

<t>
In order to allow a variety of EPCC functions, the data in the dialog event
package needs to comprehensively describe the dialog's endpoints in a
standard way.
The examples in <xref target='ref-dialog-event'/> show the intended usage:
</t>

<t>
<list style='empty'>

<t>
Guideline 5: The dialog event package should use the following sources
for the following elements:
</t> 

<t>
The local and remote elements are to report the initiator's or
recipient's information, as determined by the direction attribute.

<list style='hanging'>

<t hangText="initiator's identity:">
the "From" header of the original INVITE
</t>

<t hangText="initiator's target:">
the "Contact" header of the original INVITE, updated by any UPDATE or
re-INVITE
</t>

<t hangText="recipient's identity:">
the "From"
header that would be used when initiating a call from the AOR
corresponding to the request-URI as seen by the recipient, or
the "To" header of the original INVITE
</t>

<t hangText="recipient's target:">
the "Contact" header of the original 2xx response to the INVITE,
updated by any UPDATE or re-INVITE
</t>

</list>
</t>

</list>
</t>

<t>
Note that both Contact headers can be updated by re-INVITE and
UPDATE requests during the dialog:
</t>

<t>
<list style='empty'>
<t>
Guideline 6:  The target elements in the dialog event package should
be updated when the contacts of the endpoints change.
</t>
</list>
</t>

</section>

</section>

<section title='Security Considerations' anchor='security'>

<t>
Privacy and security considerations suggest that different components
of the dialog package should be accessible to different subscribers.
At a minimum, three levels of access can be distinguished:  all dialog
information, busy/not-busy information, and no information.
Further work is needed to determine appropriate levels of access and
how to restrict each level of access to the appropriate subscribers.
</t>

<section title='Access to All Information'>

<t>
Because an agent that knows a dialog's parameters has total control
over the dialog, dissemination of the parameters should be
restricted to trusted agents.  (E.g., imagine the Jerkey Boys
subscribing to dialog events for your organization's customer service
line.)
</t>

<t>
<list style='empty'>
<t>
Guideline 7:  A UA should have a way of restricting dialog information
to trusted subscribers.  A UA should provide one of the following
methods to determine which subscribers are trusted:

<list style='letters'>

<t>
only SUBSCRIBEs coming directly from specified IP address(es) are
trusted (which delegates security decisions to the SIP agent(s) at those
address(es)), or
</t>

<t>
only SUBSCRIBEs authorized by appropriate keys are trusted (which
requires a keying infrastructure).
</t>

</list>
</t>

<t>
If method A is used, an additional mechanism may be needed for the SIP
agent(s) which make the security decisions to communicate to the UA
the level of disclosure to be made by the subscription.
</t>

</list>
</t>

</section>

<section title='Access to Busy/Not-busy Information'>

<t>
Untrusted SUBSCRIBEs may come from any place on the Internet.  Because
the dialog event package provides presence information even if the
dialog identifiers are removed, and presence information has privacy
implications:
</t>

<t>
<list style='empty'>
<t>
Guideline 8:  A UA should provided even edited versions of the dialog
event package  (e.g., omitting the dialog
identifiers and only providing the state) only to subscribers which
pass a security/privacy policy, and not indiscriminately.
</t>
</list>
</t>

</section>

</section>

<section title='Current Implementations' anchor='impl'>

<t>
The information in this section of the previous version of this
document was collected at SIPit 17, which was held in September 2005.  As
most UA software has been updated since then, the information gathered
there is now obsolete.
This section will be revised once current information is collected.
</t>

<!--

<t>
This section compares the dialog event packages generated by five
current, popular commercial UAs.
The data was taken by a test tool from current products that claimed
to implement the dialog event package.
</t>

<t>
The <xref target='methods'>first table</xref> lists the responses to
SUBSCRIBEs and INVITEs to both the URI specifying the first "line number" supported by
the UA and to the URI that gives the phone's IP address but no user.
Only one of the five implementations will accept SUBSCRIBES to both
URIs (Guidelines 2 and 4).
</t>

<texttable anchor='methods'>
<preamble>Method/user combinations accepted:</preamble>
<ttcol align='left'>User Agent</ttcol>
<ttcol align='left'>SUBSCRIBE to Line 1</ttcol>
<ttcol align='left'>SUBSCRIBE to no user</ttcol>
<ttcol align='left'>INVITE to Line 1</ttcol>
<ttcol align='left'>INVITE to no user</ttcol>
<c>A</c><c>200</c><c>404</c><c>200</c><c>404</c>
<c>B</c><c>200</c><c>404</c><c>200</c><c>404</c>
<c>C</c><c>404</c><c>200</c><c>200</c><c>200</c>
<c>D</c><c>200</c><c>200</c><c>200</c><c>200</c>
<c>E</c><c>200</c><c>404</c><c>200</c><c>404</c>
</texttable>

<t>
The <xref target='reports'>second table</xref> lists which INVITEs
will be reported in the dialog event packages returned for which
SUBSCRIBEs.
Only one of the five UAs accepts all recommended SUBSCRIBEs, and it
does not return all the dialogs specified by Guideline 4.
</t>

<texttable anchor='reports'>
<preamble>Which SUBSCRIBEs report which INVITEs:</preamble>
<ttcol align='left'>User Agent</ttcol>
<ttcol align='left'>INVITE on Line 1, SUBSCRIBE on Line 1</ttcol>
<ttcol align='left'>INVITE on Line 1, SUBSCRIBE on no user</ttcol>
<ttcol align='left'>INVITE on no user, SUBSCRIBE on Line 1</ttcol>
<ttcol align='left'>INVITE on no user, SUBSCRIBE on no user</ttcol>
<c>A</c><c>Y</c><c>-</c><c>-</c><c>-</c>
<c>B</c><c>Y</c><c>-</c><c>-</c><c>-</c>
<c>C</c><c>-</c><c>Y</c><c>-</c><c>Y</c>
<c>D</c><c>Y</c><c>N</c><c>N</c><c>Y</c>
<c>E</c><c>Y</c><c>-</c><c>-</c><c>-</c>
<postamble>"Y" means that the INVITE is reported for the SUBSCRIBE,
"N" means that it is not, "-" means that the UA does not accept the
INVITE or SUBSCRIBE</postamble>
</texttable>

<t>
The <xref target='data-items'>third table</xref> lists the data items
present in the dialog events generated by each UA.
Four of the five UAs provide all of the dialog identifiers (Guideline
5), but the populating of the identity and target fields is quite weak
(Guideline 6).
</t>

<texttable anchor='data-items'>
<preamble>Which data are present in the dialog events (for incoming calls):</preamble>
<ttcol align='left'>User Agent</ttcol>
<ttcol align='left'>Call-Id, Tags</ttcol>
<ttcol align='left'>Direction</ttcol>
<c>A</c><c>N</c><c>N</c>
<c>B</c><c>Y</c><c>Y</c>
<c>C</c><c>Y</c><c>Y</c>
<c>D</c><c>Y</c><c>Y</c>
<c>E</c><c>Y</c><c>Y</c>
</texttable>

<texttable>
<preamble>Which data are present in the dialog events (part 2):</preamble>
<ttcol align='left'>User Agent</ttcol>
<ttcol align='left'>Local identity</ttcol>
<ttcol align='left'>Local target</ttcol>
<ttcol align='left'>Remote identity</ttcol>
<ttcol align='left'>Remote target</ttcol>
<c>A</c><c>-</c><c>-</c><c>-</c><c>-</c>
<c>B</c><c>To</c><c>Contact</c><c>From</c><c>-</c>
<c>C</c><c>-</c><c>To</c><c>Contact</c><c>-</c>
<c>D</c><c>To</c><c>To</c><c>From</c><c>From</c>
<c>E</c><c>To</c><c>Fixed value</c><c>From</c><c>Contact</c>
<postamble>"To" means value of the To header, "Contact" means value
of the appropriate Contact header, "From" means value of the From
header, "Fixed value" means a fixed string, "-" means no value
</postamble>
</texttable>

-->

</section>

<section title='Revision history' anchor='revision'>

<section title='Changes from draft-worley-sipping-dialog-00 to draft-worley-sipp-dialog-00' anchor='00-00'>

<t>
<list style='empty'>
<t>
Changed document name base from "draft-worley-sipping-dialog" to
"draft-worley-sip-dialog" since the dialog event package now is an RFC
and is now a SIP WG responsibility.
</t>
<t>
Add a statement regarding the intended future of this draft.
</t>
<t>
Narrowed the URIs that a UA must accept to contacts that it has
registered or used in transactions, since a subscriber cannot reliably
guess at any other URI.
(Thanks to Michael Procter.)
</t>
<t>
Added a discussion of the open question of how to subscribe to
information about all the dialogs on a single UA.
(Thanks to Michael Procter.)
</t>
<t>
Added guideline on correspondence between the SUBSCRIBE request-URI 
and the entity attribute.
</t>
<t>
Renumbered the guidelines.
</t>
<t>
Removed information on current implementations.
</t>
<t>
Start correcting reference for "End-to-End Arguments in System
Design".
</t>
<t>
Various edits to improve clarity.
</t>
</list>
</t>

</section>

</section>

</middle>

<back>

<references title='Normative References'>

<reference anchor='ref-dialog-event'>
<!-- rfc4235.txt -->
    <front>
	<title>An INVITE-Initiated Dialog Event Package for the
               Session Initiation Protocol (SIP)</title>
        <author initials='J.' surname='Rosenberg'><organization/></author>
        <author initials='H.' surname='Schulzrinne'><organization/></author>
        <author initials='R.' surname='Mahy'><organization/></author>
	<date month='November' year='2005' />
    </front>
    <seriesInfo name='RFC' value='4235' />
    <format type='TXT'
            target='ftp://ftp.isi.edu/in-notes/rfc4235.txt' />
</reference>

<reference anchor='ref-event'>
<!-- rfc3265.txt -->
    <front>
	<title>Session Initiation Protocol (SIP)-Specific Event Notification</title>
        <author initials='A. B.' surname='Roach'><organization/></author>
	<date month='June' year='2002' />
    </front>
    <seriesInfo name='RFC' value='3265' />
    <format type='TXT'
            target='ftp://ftp.isi.edu/in-notes/rfc3265.txt' />
</reference>

</references>

<references title='Informative References'>

<reference anchor='end-to-end'>
    <front>
	<title>End-to-End Arguments in System Design</title>
        <author initials='J. H.' surname='Salzer'><organization/></author>
        <author initials='D. P.' surname='Reed'><organization/></author>
        <author initials='D. D.' surname='Clark'><organization/></author>
	<date month='November' year='1984' />
    </front>
    <annotation>
        ACM TOCS, Vol 2, Number 4, November 1984, pp 277-288.
    </annotation>
</reference>

</references>
</back>

</rfc>

