\subsection{Device Capabilities}
\label{sec:capabilities}

The \emph{Caller Preferences and Callee Capabilities} document
\citenorm{draft-ietf-sip-callerprefs} defines a set of extensions which
allow callers and callees to express preferences about how requests
should be handled in SIP servers.  The same information also provides
value to presence watchers so that they can make more informed decisions
on how the presentity should be contacted.  This information is
generally used by a human watcher to choose the appropriate means of
contact and therefore, matching rules that mediate between caller
preferences and callee capabilities are not needed here.

Below, we present the caller preferences and callee capabilities
extension namespace, its elements, their values, and semantics.  This
section also describes how this extension can be further extended.  This
extension is intended to be used with the
\verb|application/cpim-pidf+xml| content type and that particular
usage is described here.  This extension may also be used with other
content types if appropriate.

\subsubsection{Capabilities Extension Overview}

This extension adds most of the features presented in Caller Preferences
and Callee Capabilities document \citenorm{draft-ietf-sip-callerprefs}
into the PIDF presence document format.  Features presented in
\citenorm{draft-ietf-sip-callerprefs} are added here without any change
in their semantics, simply by mapping them into XML elements.  The
priority feature is not needed here because PIDF can already express
this notion.

When this extension namespace is congregated with base PIDF document,
combined document {\MUST} follow the formatting rules specified in
\citenorm{draft-ietf-impp-cpim-pidf}, Section 4.1.

\subsubsection{Handling of Caller Preferences and Callee Capabilities
Matching Rules}

The Caller Preferences and Callee Capabilities document defines a set of
matching rules which can be used to determine if capabilities
represented by two different URLs are equal.  This extension does not
provide means to compare two presence documents to determine whether
capabilities represented by those two documents match.

\subsubsection{\xmlelement{capabilities} Element}

The root element of this extension namespace is \xmlelement{capabilities}. 
The root element {\MUST} be always present.  This element {\MAY} contain
one or more \xmlelement{feature} elements as specified below.

The \xmlelement{capabilities} element does not have any attributes and
it {\MAY} contain other namespace declarations for other extensions used
in the presence XML document.

\subsubsection{\xmlelement{feature} Element}

The \xmlelement{feature} element can represent any feature tag as
defined in Caller Preferences and Callee Capabilities
\citenorm{draft-ietf-sip-callerprefs} or any media feature tag
registered through \citenorm{rfc2506}.  This element {\MAY} appear under
\xmlelement{capabilities} element one or more times.  <feature> element
has one mandatory attribute called name.  This attribute represents the
name of the feature tag.  Each media feature tag (e.g., media, feature)
{\SHOULD} appear only once inside the root element.  If a media feature
tag has multiple values, these values {\SHOULD} be nested inside a
single \xmlelement{feature} element.  The \xmlelement{feature} cannot be
extended using other namespace declarations.

\subsubsection{\xmlelement{value} Element}

The \xmlelement{value} element represents the value of media feature
tag.  Each value element {\SHOULD} contain only a single tag value.  If
an \xmlelement{feature} contains multiple values, then all these values
should be presented in different \xmlelement{value} elements.  The
\xmlelement{value} element has an optional attribute called ``negated''. 
This attribute is of boolean type.  It can be used to indicate whether
the feature value is supported or not.  The value 'true' indicates that
the value is not supported and the value 'false' indicates that the
value is supported.  The default value is 'false'.  The
\xmlelement{value} element cannot be extended using other namespace
declarations.

\subsubsection{Handling of the Caller Preferences and Callee
Capabilities Priority Feature Tag}

The PIDF document format allows priority attribute to be used within
\xmlelement{contact} element.  The Caller Preferences and Callee
Capabilities priority feature tag can be mapped into this attribute and
so there is no need to represent the priority feature tag in this
extension.

