<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by Eric Burger (Snowshore Networks Inc.) -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='http://xml.resource.org/authoring/rfc2629.xslt' ?>
<!--
<?xml-stylesheet type='text/xsl'
                 href='file:C:\Documents and Settings\eburger\My Documents\xml2rfc-1.21\rfc2629.xslt' ?>
-->
<?rfc toc="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc strict="yes" ?>
<rfc category="std" ipr="full2026" docName="draft-ietf-sipping-kpml-02">
	<front>
		<title abbrev="KPML">Keypad Stimulus Protocol (KPML)</title>
		<author initials="E." surname="Burger" fullname="Eric Burger">
			<organization>SnowShore Networks, Inc.</organization>
			<address>
				<postal>
					<street>285 Billerica Rd.</street>
					<city>Chelmsford</city>
					<region>MA</region>
					<code>01824-4120</code>
					<country>USA</country>
				</postal>
				<email>e.burger@ieee.org</email>
			</address>
		</author>
		<author initials="M." surname="Dolly" fullname="Martin Dolly">
			<organization>AT&amp;T Labs</organization>
			<address>
				<email>mdolly@att.com</email>
			</address>
		</author>
		<date year="2004" month="February" day="2"/>
		<area>Transport</area>
		<workgroup>SIPPING</workgroup>
		<keyword>SIP</keyword>
		<keyword>Media Services</keyword>
		<abstract>
			<t>
The Key Press Stimulus Protocol uses the SIP SUBSCRIBE/NOTIFY mechanism and Keypad Markup Language (KPML) to provide instructions to SIP User Agents for the reporting of user key presses.
			</t>
		</abstract>
		<note title="Conventions used in this document">
			<t>
				<xref target="RFC2119">RFC2119</xref> provides the
interpretations for the key words &quot;MUST&quot;, 
&quot;MUST NOT&quot;, 
&quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
&quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,
&quot;MAY&quot;, and &quot;OPTIONAL&quot; found in this document.
			</t>
			<t>
In the narrative discussion, the "user device" is a User Agent that will report stimulus.  it could be, for example, a SIP phone, edge media processor, or media gateway.  An "application" is a User Agent requesting the user device to report stimulus.  The "user" is an entity that stimulates the user device.  In English, the user device is a phone, the application is an application server or proxy server, and the user presses keys to generate stimulus.
			</t>
		</note>
	</front>
	<middle>
		<section title="Introduction">
			<t>
This document describes the Key Press Stimulus Protocol.  The Key Press Stimulus Protocol exchanges messages using the <xref target="RFC3265">SUBSCIBE and NOTIFY methods of SIP</xref> with message bodies formed from the Keypad Markup Language, KPML.  KPML is a <xref target="W3C.REC-xml-20001006">markup</xref> that enables "dumb phones" to report user key-press events.  Colloquially, this mechanism provides for "digit reporting" or "DTMF reporting."
			</t>
			<t>A goal of KPML is to fit in an extremely small memory and processing footprint.  Note KPML has a corresponding lack of functionality.  For those applications that require more functionality, please refer to <xref target="refs.VXML">VoiceXML</xref> and <xref target="I-D.vandyke-mscml">MSCML</xref>.</t>
			<t>We strongly discourage the use of non-validating XML parsers, as one can expect problems with future versions of KPML.</t>
			<t>
The name of the markup, KPML, reflects its legacy support role.  The public switched telephony network (PSTN) accomplished end-to-end signaling by transporting Dual-Tone, Multi-Frequency (DTMF) tones in the bearer channel.  This is in-band signaling.
			</t>
			<t>
From the point of view of an application being signaled, what is important is the fact the stimulus occurred, not the tones used to transport the stimulus.  For example, an application may ask the caller to press the "1" key.  What the application cares about is the key press, not that there were two cosine waves of 697 Hz and 1209 Hz transmitted.
			</t>
			<t>
A <xref target="RFC3261">SIP-signaled</xref> network transports end-to-end signaling with <xref target="RFC2833">RFC2833</xref> packets.  In RFC2833, the signaling application inserts RFC2833 named signal packets as well as or instead of generating tones in the media path.  The receiving application gets the signal information, which is what it wanted in the first place.
			</t>
			<t>
RFC2833 correlates the time the end user pressed a digit with the user's media.  However, out-of-band signaling methods, as are appropriate for user device to application signaling, do not need millisecond accuracy.  On the other hand, they do need reliability, which RFC2833 does not provide.
			</t>
			<t>
An interested application could request notifications of every key press.  However, many of the use cases for such signaling has the application interested in only one or a few keystrokes.  Thus we need a mechanism for specifying to the user device what stimulus the application would like notification of.
			</t>
		</section>
		<section title="Key Press Stimulus Protocol">
			<section title="Model">
				<t>There are two usage models for the protocol.  Functionally, they are both equivalent.  However, it is useful to understand the use cases.</t>
				<t>The first model is that of a SIP User Agent (UA) that directly interacts, on a given dialog, with the end device.  <xref target="F.ep"/> shows a two-party SIP dialog.  In this scenario, the SIP UA requests the End Point to report on key press events that would normally emanate from End Point port B.  This could represent, for example, a toll by-pass scenario where the End Point is an ingress gateway and the SIP UA is an egress gateway.</t>
				<t>In this case, the requesting User Agent requests digit notification on the same dialog established for the call, between SIP ports A and X.</t>
				<figure anchor="F.ep" title="Endpoint Model">
					<artwork><![CDATA[
+-------+        SIP         +-----+
|       A--------------------X     |
|  End  |                    | SIP |
| Point |        RTP         | UA  |
|       B--------------------Y     |
+-------+                    +-----+
					]]></artwork>
				</figure>
				<t>The second model is that of a third-party application that is interested in entered key presses.  <xref target="F.3p"/> shows an established two-party SIP dialog between the End Point and the SIP UA.  The requesting application addresses the particular media stream by referencing the established dialog identifier referring to the dialog between SIP ports A and X.</t>
				<figure anchor="F.3p" title="Third-Party Model">
					<artwork><![CDATA[
              +-------------+
              | Requesting  |
          /---| Application |
         /    +-------------+
        /
   SIP / (SUBSCRIBE/NOTIFY)
      /
     /
+---M---+    SIP (INVITE)    +-----+
|       A--------------------X     |
|  End  |                    | SIP |
| Point |        RTP         | UA  |
|       B--------------------Y     |
+-------+                    +-----+
					]]></artwork>
				</figure>
				<t>The third model is that of a media proxy.  A media proxy is a media relay in the terminology of <xref target="RFC1889">RFC1889</xref>.  However, in addition to the RTP forwarding capability of a RFC1889 media relay, the media proxy can also do light media processing, such as tone detection, tone transcoding (tones to <xref target="RFC2833">RFC2833</xref>, and so on.</t>
				<t>The Requesting Application uses dialog identifiers to identify the stream to monitor.  The default is to monitor the media entering the End Point.  For example, if the Requesting Application in <xref target="F.mp"/> uses the dialog represented by SIP ports V-C, then the media coming from SIP UAa RTP port W gets monitored.  Likewise, the dialog represented by A-X directs the End Point to monitor the media coming from SIP UAb RTP Port Y.</t>
				<figure anchor="F.mp" title="Media Proxy Model">
					<artwork><![CDATA[
                                         +-------------+
                                         | Requesting  |
                                     /---| Application |
                                    /    +-------------+
                                   /
                              SIP / (SUBSCRIBE/NOTIFY)
                                 /
                                /
+-----+        SIP         +---M---+        SIP         +-----+
|     V--------------------C       A--------------------X     |
| SIP |                    |  End  |                    | SIP |
| UAa |        RTP         | Point |        RTP         | UAb |
|     W--------------------D       B--------------------Y     |
+-----+                    +-------+                    +-----+
					]]></artwork>
				</figure>
			</section>
			<section title="Monitoring Leg">
				<t>The default leg to monitor is the leg represented by the local tag of the SIP dialog at the monitoring End Point.  A requesting application MAY request monitoring of the leg represented by the remote tag of the SIP dialog at the monitoring End Point.</t>
				<t>Not all End Point devices are able to monitor the remote media stream.  However, the End Point MUST be able to report on local (End Point-generated) key press events.</t>
				<t>If the requesting application wishes to monitor both legs at a given End Point, the application will establish two subscriptions, one for each leg.</t>
				<t>
					<xref target="S.direct"/> describes how to specify to the End Point which leg of the dialog to monitor.</t>
			</section>
			<section title="Operation">
				<t>The key press stimulus protocol uses explicit subscription requests and notification requests, using the semantics of <xref target="RFC3265">SUBSCRIBE/NOTIFY</xref>.</t>
				<t>Following the semantics of SUBSCRIBE, if the user device receives a second subscription on the same dialog, the user device MUST terminate the existing KPML request (if any) and replace it with the new request.</t>
				<t>An application may register multiple digit patterns in a single KPML request.</t>
				<t>If the user device supports multiple, simultaneous KPML requests, the application registers the separate requests either in a new SUBSCRIBE-initiated dialog or on an existing SUBSCRIBE-initiated dialog with a new event id tag.</t>
				<t>If the user device does not support multiple, simultaneous KPML requests, it responds with an error response code.  See <xref target="S.msub"/> for more information.</t>
				<t>A KPML request can be persistent or one-shot.  Persistent requests are active until either the dialog terminates, including normal subscription expiration, the client replaces them, the client deletes them by sending a null document on the dialog, or the client deletes the subscription by sending a SUBCRIBE with an expires of zero (0).</t>
				<t>Standard SUBSCRIBE processing dictates the end point sends a NOTIFY response if it receives a SUBSCRIBE with an expires of zero.  </t>
				<t>One-shot requests terminate themselves once a match occurs.  The "persist" KPML element specifies whether the subscription remains registered for the duration specified in the SUBSCRIBE message or if it automatically terminates after a pattern matches.</t>
				<t>
KPML requests route to the user device using standard SIP request routing. A KPML request identifies the leg in question in one of two ways.  The first method is to send the request on an existing, INVITE-initiated dialog.  The second method is to explicitly identify the call leg by its dialog identifiers.
				</t>
				<t>
Response messages are KPML documents (messages).  If the user device matched a digit map, the response indicates the digits detected and whether the user device suppressed digits.  If the user device had an error, such as a timeout, it will indicate that instead.
				</t>
			</section>
		</section>
		<section title="Protocol Machinery">
			<t>The Key Press Stimulus Protocol uses the <xref target="RFC3261">SIP</xref>
				<xref target="RFC3265">SUBSCRIBE/NOTIFY</xref> mechanism.</t>
			<t>The registration of a digit map is simply setting a digit event notification filter.  When the device detects the digits, it sends an event notification to the application.</t>
			<t>The following sub-sections are the formal specification of the KPML SIP-specific event notification package.</t>
			<section title="Event Package Name">
				<t>The name for the Key Press Stimulus Protocol package is "kpml".</t>
			</section>
			<section title="Event Package Parameters" anchor="S.event">
				<t>The "leg" parameter identifies the call leg being monitored.</t>
				<t>If the "leg" parameter is not present, the SUBSCRIBE MUST be on an established INVITE-initiated SIP dialog.  In this case, the leg the end device monitors is the call leg associated with the established dialog.  If there is no corresponding dialog or call leg, the end device will send a 481 result code in a KPML notification.
					<list style="empty">
						<t>NOTE: The SUBSCRIBE may succeed, resulting in a SIP 200 OK.  However, the "current state" will be the KPML 481 result, and the subscription state will be "terminated."</t>
					</list>
				</t>
				<t>SIP identifies call legs by their dialog identifier. The dialog identifier is the remote-tag, local-tag, and Call-ID entities. </t>
				<t>To identify a specific dialog, all three of these parameters MUST be present.  Usually, the local-tag is the To: entity with the To tag, the remote-tag is the From: entity including tag, and the call-id matches the Call-ID.  Although semantically different, the important entities are the To: and From: tags.</t>
				<t>Note there may be ambiguity in specifying only the SIP dialog to monitor.  The dialog may specify multiple SDP streams that could carry key press events.  For example, a dialog may have multiple audio streams.  Wherever possible, the End Point MAY apply local policy to disambiguate which stream or streams to monitor.  In order to have an extensible mechanism for identifying streams, the mechanism for specifying streams is as an element content to the &lt;stream&gt; tag.  The only content defined today is the &lt;reverse/&gt; tag.</t>
				<t>For most situations, such as a monaural point-to-point call with a single codec, the stream to monitor is obvious.  In such situations the Application need not specify which stream to monitor.</t>
				<t>The BNF for these parameters is as follows. The definitions of callid, token, EQUAL, SWS, and DQUOTE are from <xref target="RFC3261">RFC3261</xref>.</t>
				<figure>
					<artwork>
call-id   =  "call-id" EQUAL DQUOTE callid DQUOTE
from-tag  =  "from-tag" EQUAL token
to-tag    =  "to-tag" EQUAL token
					</artwork>
				</figure>
				<t>The call-id parameter is a quoted string. This is because the BNF for word (which is used by callid) allows for characters not allowed within token.  One usually just copies these elements from the Call-Id, to, and from fields of the SIP INVITE.</t>
				<t>One can use any method of determining the dialog identifier.  One method available, particularly for third-party applications, is the <xref target="I-D.ietf-sipping-dialog-package">SIP Dialog Package</xref>.</t>
			</section>
			<section title="SUBSCRIBE Bodies">
				<t>Key press filtering requests use KPML, as described in <xref target="S.kpml-req"/>.  The MIME type for KPML is application/kpml+xml.</t>
				<t>Because of the potentially sensitive nature of the information reported by KPML, subscribers SHOULD use sips: and SHOULD consider the use of S/MIME on the content.</t>
				<t>Subscribers MUST be prepared for the notifier to insist on authentication at a minimum and encryption as a likelihood.</t>
			</section>
			<section title="Subscription Duration">
				<t>The subscription lifetime should be longer than the expected call time.  The default subscription lifetime (Expires value) MUST be 7200 seconds.  This two-hour subscription time is entirely arbitrary.  Please contact the editor if you have a better suggestion, and why.</t>
				<t>Subscribers MUST be able to handle the end device returning an Expires value smaller than the requested value.  Per <xref target="RFC3265">RFC3265</xref>, the subscription duration is the value returned by the end device in the 200 OK response Expires entity.</t>
			</section>
			<section title="NOTIFY Bodies">
				<t>The key press notification uses KPML, as described in <xref target="S.kpml-resp"/>.  The MIME type for KPML is application/kpml+xml.  The default MIME type for the kpml event package is application/kpml+xml.</t>
				<t>If the requestor is not using a secure transport protocol such as TLS (e.g., by using a sips: URI), the end device SHOULD use S/MIME to protect the user information in responses.</t>
			</section>
			<section title="Notifier Processing of SUBSCRIBE Requests" anchor="S.sub">
				<t>The user information transported by KPML is potentially sensitive.  For example, it could include calling card or credit card numbers.  Thus the first action of the end device (notifier) SHOULD be to authenticate the requesting party.</t>
				<t>End devices MUST support digest authentication at a minimum.</t>
				<t>End devices MUST support the sips: scheme and TLS.</t>
				<t>Upon authenticating the requesting party, the end device determines if the requesting party has authorization to monitor the user's key presses.  Determining authorization policies and procedures is beyond the scope of this specification.
					<list style="empty">
						<t>NOTE:  While it would be good to require both authorization and user notification for KPML, some uses, such as lawful intercept pen registers, have very strict authorization requirements yet have a requirement of no user notification.  Conversely, pre-paid applications running on a private network may have no authorization requirements and already have implicit user acceptance of key press monitoring.  Thus we cannot give any guidelines here.</t>
					</list>
				</t>
				<t>After authorizing the request (RECOMMENDED), the end device checks to see if the request is to terminate a subscription.  If the request will terminate the subscription, the end device does the appropriate processing, including the procedures described in <xref target="S.term"/>.</t>
				<t>If the request has no KPML body, than any KPML document running on that dialog, and addressed by the event id, if present, immediately terminates.  This is a mechanism for unloading a KPML document while keeping the SUBSCRIBE-initiated dialog active.  This can be important for secure sessions that have high costs for session establishment, such as TLS.  The end device follows the procedures described in <xref target="S.auto"/>.</t>
				<t>If the SUBSCRIBE request arrived on an INVITE-initiated dialog, and there is no "leg" parameter to the kpml subscription, then the KPML document acts upon the call legs created by the INVITE-initiated dialog.</t>
				<t>If the SUBSCRIBE request has a "leg" parameter to the kpml subscription, then the KPML document acts upon the call leg referred to by the "leg" parameter.  If appropriate, the end device SHOULD validate the requestor has authorization to monitor a given leg.</t>
				<t>If the SUBSCRIBE request has a "leg" parameter to the kpml subscription, but the referenced leg does not exist, the end device follows the procedures in <xref target="S.none"/>  Note the end device MUST issue a 200 OK before issuing the NOTIFY, as the SUBSCRIBE itself is well-formed.</t>
				<t>If the request has a KPML body, the end device parses the KPML document.  The end device SHOULD validate the XML document against the schema presented in <xref target="S.syntax"/>.  If the document is not valid, the end device performs the procedures described in <xref target="S.bad"/>.  If there is a loaded KPML document on the dialog (and given event id, if present), the end device unloads the document.</t>
				<t>If the KPML document is valid, and the end device is capable of performing the monitoring, the end device performs the filtering specified by the KPML document.  See <xref target="S.kpml"/> for the specification of KPML.</t>
			</section>
			<section title="Notifier Generation of NOTIFY Requests">
				<section title="SIP Protocol-Generated" anchor="S.auto">
					<t>The end device (notifier in SUBSCRIBE/NOTIFY parlance) generates NOTIFY requests based on the requirements of <xref target="RFC3265">RFC3265</xref>.  Specifically, unless a SUBSCRIBE request is not valid, all SUBSCRIBE requests will result in an immediate NOTIFY.</t>
					<t>The KPML payload distinguishes between a NOTIFY that RFC3265 mandates and a NOTIFY informing of key presses.  If there are no digits quarantined at the time of the SUBSCRIBE (see <xref target="S.kpml-req"/> below) or the quarantined digits do not match the new KPML document, then the immediate NOTIFY MUST NOT contain a KPML body.  If end device has digits quarantined that result in a digit match using the new KPML document, then the NOTIFY MUST return the appropriate KPML document.</t>
				</section>
				<section title="Match" anchor="S.match">
					<t>During the subscription lifetime, the end device may detect a key press stimulus that triggers a KPML event.  In this case, the end device (notifier) MUST return the appropriate KPML document.</t>
				</section>
				<section title="Inter-Digit Timeout No Match">
					<t>Once a user starts to enter digits, it is highly likely they will enter all of the digits of interest within a specific time period.  There is a temporal locality of reference for key presses.  It is possible for users to accidentally press a key, however.  Moreover, users may start pressing a key and then be lost as to what to do next.  For applications to handle this situation, KPML allows applications to request notification if the user starts to enter digits but then stops before a digit map matches.</t>
					<t>Once the end point detects a key press that matches the first character of a digit map, the end point starts the interdigit timer specified in the &lt;pattern&gt; tag.  Every subsequent key press detected restarts the interdigit timer.  If the interdigit timer expires, the end point generates a KPML report with the KPML status code 423, Timer Expired.  The report also includes the digits collected up to the time the timer expired.  This could be the null string.  After sending the NOTIFY, the end point will resume quarantining additional detected digits.</t>
					<t>Applications may have different requirements for the interdigit timer.  For example, applications targeted to user populations that tend to key in information slowly may require longer interdigit timers.  The specification of the interdigit timer is in milliseconds.  The default value is 4000, for 4 seconds.  A value of zero indicates disabling the interdigit timer.  The End Device MUST round up the requested interdigit timer to the nearest time increment it is capable of detecting.</t>
				</section>
				<section title="Dialog Terminated" anchor="S.term">
					<t>It is possible for a dialog to terminate during key press collection.  The cases enumerated here are explicit SUBSCRIPTION termination, automatic SUBSCRIPTION termination, and underlying (INVITE-initiated) dialog termination.</t>
					<t>If a SUBSCRIBE request has an expires of zero (explicit SUBSCRIBE termination), includes a KPML request, and there are quarantined digits, then the end device attempts to process the quarantined digits against the document.  If there is a match, the end device generates the appropriate KPML report with the KPML status code of 200.  The SIP NOTIFY body terminates the subscription by setting the subscription state to "terminated" and a reason of "timeout".  If the subscription was on a SUBSCRIBE-initiated dialog, and there are no more active event id's associated with the dialog, then the end point MUST consider the dialog terminated.  If the subscription was on an INVITE-initiated dialog, then the end point MAY release KPML-specific resources related to the dialog, but it MUST NOT alter the state of the INVITE-initiated dialog.</t>
					<t>If the requesting party issues a SUBSCRIBE with an expires of zero and no KPML body or the expires timer on the SUBSCRIBE-initiated dialog fires at the end device (notifier), then the end device issues a KPML report with the KPML status code 487, Subscription Expired.  The report also includes the digits collected up to the time the expires timer expired or when the subscription with expires equal to zero was processed.  This could be the null string.  Also, note that the digits in this case cannot match a digit map.  If they did, the end device would have generated a KPML match report if they did.</t>
					<t>Again, per the mechanisms of <xref target="RFC3265">RFC3265</xref>, the end device will terminate the SIP SUBSCRIBE dialog.  The end device does this via the SIP NOTIFY body transporting the final report described in the preceding paragraph.  In particular, the subscription state will be "terminated" and a reason of "timeout".  If the subscription was on a SUBSCRIBE-initiated dialog, then the end point MUST consider the dialog terminated.  If the subscription was on an INVITE-initiated dialog, then the end point MAY release KPML-specific resources related to the dialog, but it MUST NOT alter the state of the INVITE-initiated dialog.</t>
				</section>
				<section title="No Call Leg" anchor="S.none">
					<t>If a SUBSCRIBE request references a dialog that is not present at the endpoint, usually by specifying a dialog identifier through the leg parameter to the kpml event package, the end point generates a KPML report with the KPML status code 481, Dialog Not Found.  The end device terminates the subscription by setting the subscription state to "terminated".  If the subscription was on a SUBSCRIBE-initiated dialog, and there are no more active event id's associated with the dialog, then the end point MUST consider the dialog terminated.  If the subscription was on an INVITE-initiated dialog, then the end point MAY release KPML-specific resources related to the dialog, but it MUST NOT alter the state of the INVITE-initiated dialog.</t>
					<t>IMPORTANT:  The end device can invoke this procedure if the dialog underlying a subscription terminates.  For example, a SUBSCRIBE-initiated dialog subscribes to the state of a different dialog (call) via the leg kpml parameter.  That different call may terminate before the SUBSCRIBE-initiated dialog terminates.  In this case, the end device MUST terminate the SUBSCRIBE-initiated dialog.  This ensures reauthorization (if necessary) for attaching to subsequent call legs.</t>
				</section>
				<section title="Bad Document" anchor="S.bad">
					<t>If the KPML document is not valid, the end device generates a KPML report with the KPML status code 501, Bad Document.  The end device terminates the subscription by setting the subscription state to "terminated".  If the subscription was on a SUBSCRIBE-initiated dialog, and there are no more active event id's associated with the dialog, then the end point MUST consider the dialog terminated.  If the subscription was on an INVITE-initiated dialog, then the end point MAY release KPML-specific resources related to the dialog, but it MUST NOT alter the state of the INVITE-initiated dialog.</t>
				</section>
				<section title="One-Shot vs. Persistent Requests">
					<t>A one-shot kpml subscription is one that the KPML document does not mark as persistent.  If the end device detects a key press stimulus that triggers a one-shot KPML event, then the end device (notifier) MUST set the "Subscription-State" in the NOTIFY message to "terminated".  At this point the end device MUST consider the subscription destroyed.  The end device MUST quarantine digits per the controls specified in <xref target="S.kpml-req"/>.</t>
					<t>For persistent kpml subscriptions, the KPML document remains active for the lifetime of the subscription.	</t>
				</section>
			</section>
			<section title="Subscriber Processing of NOTIFY Requests">
				<section title="No KPML Body">
					<t>If there is no KPML body, it means the SUBSCRIBE was successful.  This establishes the dialog if there are no quarantined digits to report.</t>
				</section>
				<section title="KPML Body">
					<t>If there is a KPML document, and the KPML status code is 200, then a match occurred.</t>
					<t>If there is a KPML document, and the KPML status code is 4xx, then an error occurred with digit collection.  The most likely cause is a timeout condition.</t>
					<t>If there is a KPML document, and the KPML status code is 5xx, then an error occurred with the subscription.  See <xref target="S.codes"/> for more on the meaning of error codes.</t>
					<t>The subscriber MUST be mindful of the subscription state.  The end device may terminate the subscription at any time.</t>
				</section>
			</section>
			<section title="Handling of Forked Requests">
				<t>The SUBSCRIBE behavior described in <xref target="S.sub"/> ensures that it is only possible to have a subscription where there is an active (e.g., voice) dialog.  Thus the case of multiple subscription installation cannot occur.</t>
			</section>
			<section title="Rate of Notifications">
				<t>The end device MUST NOT generate messages faster than one message every 40 milliseconds.  This is the minimum time period for MF digit spills.  Even 30 millisecond DTMF, as one sometimes finds in Japan, has a 20 millisecond off-time, resulting in a 50 millisecond interdigit time.  This document strongly RECOMMENDS AGAINST using KPML for digit-by-digit messaging, such as would be the case if the only &lt;regex&gt; is "x".</t>
				<t>Because there is no meaningful metric for throttling requests.  In addition, the end device MUST reliably deliver notifications. Thus the end device SHOULD send NOTIFY messages over a congestion-controlled transport, such as TCP or SCTP.</t>
				<t>End devices MUST at a minimum implement SIP over TCP.</t>
			</section>
			<section title="State Agents">
				<t>Not applicable.</t>
			</section>
		</section>
		<section title="Message Format - KPML" anchor="S.kpml">
			<t>The Key Press Stimulus Protocol exchanges KPML messages.  There are two, mutually exclusive elements to KPML: the request and response.</t>
			<section title="KPML Request" anchor="S.kpml-req">
				<t>A KPML request document (message) contains a &lt;request&gt; entity containing a &lt;pattern&gt; tag with a series of &lt;regex&gt; tags.  The &lt;regex&gt; element specifies a digit pattern for the device to report on.  <xref target="S.DRegex"/> describes the DRegex, or digit regular expression, language.</t>
				<t>Some devices can buffer entered digits.  Subsequent KPML requests first apply their patterns against the buffered digits.  Some applications use modal interfaces where the first few key presses determine what the following digits mean.  For a novice user, the application may play a prompt describing what mode the application is in.  However, "power users" often barge through the prompt.</t>
				<t>The protocol provides a &lt;flush&gt; tag in the &lt;pattern&gt; element.  The default is not to flush digits.  Flushing digits means the user device flushes any buffered digits.  This has the effect of ignoring digits entered before the KPML request.  To flush digits, the KPML includes &lt;flush&gt;yes&lt;/flush&gt;.</t>
				<t>The End Device MUST be able to receive &lt;flush&gt;no&lt;/flush&gt;.  This directive is effectively a no-op.</t>
				<t>Other string values for &lt;flush&gt; may be defined in the future.  If the End Device receives a string it does not understand, it MUST treat the string as a no-op.</t>
				<t>If the user presses a key not matched by the &lt;regex&gt; tags, the user device MUST discard the key press from consideration against the current or future KPML messages.  However, as described above, once there is a match, the user device quarantines any key presses the user entered subsequent to the match.</t>
				<t>
					<list>
						<t>NOTE:  This behavior allows for applications to only receive digits that interest them.  For example, a pre-paid application only wishes to monitor for a long pound.  If the user enters other digits, presumably for other systems, the pre-paid applicationd does not want notification of those digits.  This feature is fundamentally different than the behavior of every system receiving every digit that TDM-based equipment provides.</t>
					</list>
				</t>
				<t>The end device MAY support an inter-digit timeout value.  This is the amount of time the end device will wait for user input before returning a timeout error result on a partially matched pattern.  The application can specify the inter-digit timeout as an integer number of milliseconds by using the interdigittimer attribute to the &lt;pattern&gt; tag.  The default is 4000 milliseconds.  If the end device does not support the specification of an inter-digit timeout, the end device MUST silently ignore the specification.  If the end device supports the specification of an inter-digit timeout, but not to the granularity specified by the value presented, the end device MUST round up the requested value to the closest value it can support.</t>
				<t>KPML messages are independent.  Thus it is not possible for the current document to know if a following document will enable barging or want the digits flushed.  Therefore, the user device MUST quarantine all digits detected between the time of the report and the interpretation of the next script, if any.  If the next script indicates a buffer flush, then the interpreter MUST flush all collected digits from consideration from KPML documents received on that dialog with the given event id.  If the next script does not indicate flushing the quarantine digits, then the interpreter MUST apply the collected digits (if possible) against the digit maps presented by the script's &lt;regex&gt; tags.  If there is a match, the interpreter MUST follow the procedures in <xref target="S.match"/>  If there is no match, the interpreter MUST flush all of the collected digits.</t>
				<t>Unless there is a suppress indicator in the digit map, it is not possible to know if the signaled digits are for local KPML processing or for other recipients of the media stream.  Thus, in the absence of a digit suppression indicator, the user device transmits the digits to the far end in real time, using either RFC2833, generating the appropriate tones, or both.</t>
				<t>The section <xref target="S.supp">Digit Suppression</xref> describes the operation of the suppress indicator.</t>
				<section title="Pattern Matching">
					<section title="Inter-Digit Timing">
						<t>The pattern matching logic works as follows.  KPML endpoints MUST follow the logic presented in this section so that multiple implementations will perform deterministically on the same KPML document given the same key press input.</t>
						<t>The pattern match algorithm matches the longest regular expression.  This is the same mode as <xref target="RFC3525">H.248.1</xref> and not the mode presented by <xref target="RFC3435">MGCP</xref>.  The pattern match algorithm choice has an impact on determining when a pattern matches.  Consider the following KPML document.</t>
						<figure title="Greedy Matching" anchor="F.greedy">
							<artwork><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<kpml xmlns="urn:ietf:params:xml:ns:kpml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
      version="1.0">
	<request>
		<pattern>
			<regex>0</regex>
			<regex>011</regex>
		</pattern>
	</request>
</kpml>
					]]></artwork>
						</figure>
						<t>In <xref target="F.greedy"/>, if we were to match on the first found pattern, the string "011" would never match.  This happens because the "0" rule would match first.</t>
						<t>While this behavior is what most applications desire, it does come at a cost.  Consider the following KPML document snippet.</t>
						<figure title="Timeout Matching" anchor="F.timeout">
							<artwork><![CDATA[
			<regex>x{7}</regex>
			<regex>x{10}</regex>
					]]></artwork>
						</figure>
						<t>
							<xref target="F.timeout"/> is a typical NANP dial plan.  From an application perspective, users expect a seven digit number to respond quickly, not waiting the typical inter-digit critical timer (usually four seconds).  From a user's perspective, they do not want the system to cut off their ten digit number at seven digits because they did not enter the number fast enough.</t>
						<t>One approach to this problem is to have an explicit dial string terminator.  Typically, it is the pound key (#).  Now, consider the following snippet.</t>
						<figure title="Timeout Matching with Enter" anchor="F.finish">
							<artwork><![CDATA[
			<regex>x{7}#</regex>
			<regex>x{10}#</regex>
					]]></artwork>
						</figure>
						<t>The problem with the approach in <xref target="F.finish"/> is that the digit collector will still look for a digit after the "#" in the seven-digit case.  Worse yet, the "#" will appear in the returned dial string.</t>
						<t>The approach used in KPML is to have an explicit "Enter Key", as shown in the following snippet.</t>
						<figure title="Timeout Matching with Enter Key" anchor="F.enter">
							<artwork><![CDATA[
	<request>
		<pattern enterkey="#">
			<regex>xxxxxxx</regex>
			<regex>xxxxxxxxxx</regex>
		</pattern>
	</request>
					]]></artwork>
						</figure>
						<t>In <xref target="F.enter"/> the enterkey parameter to the &lt;pattern&gt; tag specifies a string that terminates a pattern.  In this situation, if the user enters seven digits followed by the "#" key, the pattern matches (or fails) immediately.  KPML indicates a terminated nomatch with a KPML status code 402.</t>
						<t>To address the various key press collection scenarios, we define three timers.  The timers are the critical timer (criticaltimer), the inter-digit timer (interdigittimer), and the extra digit timer (extradigittimer).  The critical timer is the time to wait for another digit if the collected digits can match a pattern.  The extra timer is the time to wait after the longest match has occurred (presumably for the return key).  The inter-digit timer inter-digit timer is the time to wait between digits in all other cases.  Note there is no start timer, as that concept does not apply in the KPML context.</t>
						<t>All of these timers are parameters to the &lt;pattern&gt; tag.</t>
					</section>
					<section title="Intra-Digit Timing">
						<t>Some patterns look for long duration key presses.  For example, some applications look for long "#" or long "*".</t>
						<t>KPML uses the "L" modifier to &lt;regex&gt; characters to indicate long key presses.  The following KPML document looks for long pound.</t>
						<figure title="Long Pound">
							<artwork><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<kpml xmlns="urn:ietf:params:xml:ns:kpml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
      version="1.0">
	<request>
		<pattern>
			<regex>L#</regex>
		</pattern>
	</request>
</kpml>
					]]></artwork>
						</figure>
						<t>The request can specify what constitutes "long" by setting the long attribute to the &lt;pattern&gt;.  This attribute is an integer representing the number of milliseconds.  If the user presses a key for longer than longtimer milliseconds, the Long modifier is true.
							<list style="empty">
								<t>NOTE:  It is a local matter at the end device to consider multiple presses of the same key during the longtimer period to be equivalent to the Long version of that key.  This is to support end devices that do not generate continuous key press tones.</t>
							</list>
						</t>
					</section>
				</section>
				<section title="Digit Suppression" anchor="S.supp">
					<t>Under basic operation, a KPML endpoint will transmit in-band tones (<xref target="RFC2833">RFC2833</xref> or actual tone) in parallel with digit reporting.</t>
					<t>
						<list style="empty">
							<t>NOTE: If KPML did not have this behavior, then a user device executing KPML could easily break called applications.  For example, take a personal assistant that uses "*9" for attention.  If the user presses the "*" key, KPML will hold the digit, looking for the "9".  What if the user just enters a "*" key, possibly because they accessed an IVR system that looks for "*"?  In this case, the "*" would get held by the user device, because it is looking for the "*9" pattern.  The user would probably press the "*" key again, hoping that the called IVR system just did not hear the key press.  At that point, the user device would send both "*" entries, as "**" does not match "*9".  However, that would not have the effect the user intended when they pressed "*".</t>
						</list>
					</t>
					<t>On the other hand, there are situations where passing through tones in-band is not desirable.  Such situations include call centers that use in-band tone spills to effect a transfer.</t>
					<t>For those situations, KPML adds a digit suppression tag, "pre", to the &lt;regex&gt; tag.  There MUST NOT be more than one &lt;pre&gt; in any given &lt;regex&gt;.</t>
					<t>If there is only a single &lt;pattern&gt; and a single &lt;regex&gt;, the suppression processing is straightforward.  The end-point passes digits until the stream matches the regular expression pre.  At that point, the endpoint will continue collecting digits, but will suppress the generation or pass-through of any in-band digits.</t>
					<t>If the endpoint suppressed digits, it MUST indicate this by including the attribute "suppressed" with a value of "yes" in the digit report.</t>
					<t>Clearly, if the end device is processing the KPML document against quarantined digits, it is too late to suppress digits, as the end device has long sent the digits.  This is a situation where there is a &lt;pre&gt; specification, but the "suppressed" attribute is not "yes" in the digit report.</t>
					<t>A KPML endpoint MAY perform digit suppression.  If it is not capable of digit suppression, it ignores the digit suppression attribute and will never send a suppressed indication in the digit report.  In this case, it will match concatenated patterns of pre+value.</t>
					<t>At some point in time, the endpoint will collect enough digits to the point it hits a &lt;pre&gt; pattern.  The interdigittimer attribute indicates how long to wait once the user enters digits before reporting a time-out error.  If the interdigittimer expires, the endpoint MUST issue a time-out report, transmit the suppressed digits on the media stream, and stop suppressing digit transmission.</t>
					<t>Once the end device detects a match and it sends a NOTIFY request to report the digit string, the end device MUST stop digit suppression.  Clearly, if subsequent digits match another &lt;pre&gt; expression, then the end device MUST start digit suppression.</t>
					<t>After digit suppression begins, it may become clear that a match will not occur.  For example, take the expression "&lt;regex&gt; &lt;pre&gt;*8&lt;/pre&gt;xxx[2-9]xxxxxx&lt;/regex&gt;".  At the point the endpoint receives "*8", it will stop forwarding digits.  Let us say that the next three digits are "408".  If the next digit is a zero or one, the pattern will not match.</t>
					<t>
						<list style="empty">
							<t>NOTE: It is critically important for the endpoint to have a sensible inter-digit timer.  This is because an errant dot (".") may suppress digit sending forever.  See <xref target="S.kpml-req"/> for setting the inter-digit timer.</t>
						</list>
					</t>
					<t>Applications should be very careful to indicate suppression only when they are fairly sure the user will enter a digit string that will match the regular expression.  In addition, applications should deal with situations such as no-match or time-out.  This is because the endpoint will hold digits, which will have obvious user interface issues in the case of a failure.</t>
				</section>
				<section title="One-Shot and Persistent Triggers" anchor="S.one-shot">
					<t>The KPML document specifies if the patterns are to be persistent by setting the persistent attribute to the &lt;pattern&gt; tag to "true".  Otherwise, the request will be a one-shot subscription.  If the end device does not support persistent subscriptions, it returns a KPML document with the KPML result code set to 531.  If there are digits in the quarantine buffer and the digits match an expression in the KPML document, the end device prepares the appropriate KPML document.</t>
				</section>
				<section title="Multiple Patterns" anchor="S.mp">
					<t>Some end devices may support multiple regular expressions in a given pattern request.  In this situation, the application may wish to know which pattern triggered the event.</t>
					<t>KPML provides a "tag" attribute to the &lt;regex&gt; tag.  The "tag" is an opaque string that the end device sends back in the notification report upon a match in the digit map.  In the case of multiple matches, the end device MUST chose the longest match in the KPML document.  If multiple matches match the same length, the end device MUST chose the first expression listed in the subscription KPML document based on KPML document order.</t>
					<t>If the end device does not support multiple regular expressions in a pattern request, the end device MUST return a KPML document with the KPML result code set to 532.</t>
				</section>
				<section title="Monitoring Direction" anchor="S.direct">
					<t>By default, the end device monitors key presses emanating from the device.  Given a dialog identifier of Call-ID, local-tag, and remote-tag, the end device monitors the key presses associated with the local-tag.</t>
					<t>In the media proxy case, and potentially other cases, there is a need to monitor the key presses arriving from the remote user agent.  The optional &lt;stream&gt; element to the &gt;request&gt; tag specifies which stream to monitor.  The only legal value is "reverse", which means to monitor the stream associated with the remote-tag.  The end point MUST ignore other values.
						<list style="empty">
							<t>NOTE:  The reason this is a tag is so individual stream selection, if needed can be addressed in a backwards-compatible way.</t>
						</list>
					</t>
				</section>
				<section title="Multiple, Simultaneous Subscriptions" anchor="S.msub">
					<t>Some end devices may support multiple key press event notification subscriptions at the same time.  In this situation, the end device honors each subscription individually and independently.</t>
					<t>A SIP user agent may request multiple subscriptions on the same SUBSCRIBE dialog, using the id parameter to the kpml event request.</t>
					<t>One or more SIP user agents may request independent subscriptions on different SIP dialogs.  In the body of the SUBSCRIBE is a leg parameter that indicates which leg to monitor.  <xref target="S.event"/> describes the dialog addressing mechanism in detail.</t>
					<t>If the end device does not support multiple, simultaneous subscriptions, the end device MUST return a KPML document with the KPML result code set to 533 on the dialog that requested the second subscription.  The end device MUST NOT modify the state of the first subscription on the account of the second subscription attempt.</t>
				</section>
			</section>
			<section title="KPML Reports" anchor="S.kpml-resp">
				<t>
When the user enters key press(es) that match a &lt;regex&gt; tag, the end device will issue a report.</t>
				<t>
After reporting, the interpreter terminates the KPML session unless the subscription has a persistence indicator.  If the subscription does not have a persistence indicator, the end device MUST set the state of the subscription to "terminated" in the NOTIFY report.</t>
				<t>If the subscription does not have a persistence indicator, to collect more digits the requestor must issue a new request.</t>
				<t>
					<list style="empty">
						<t>NOTE: This highlights the "one shot" nature of KPML, reflecting the balance of features and ease of implementing an interpreter.  If your goal is to build an IVR session, we strongly suggest you investigate more appropriate technologies such as <xref target="refs.VXML">VoiceXML</xref> or <xref target="I-D.vandyke-mscml">MSCML</xref>.</t>
					</list>
				</t>
				<t>KPML reports have two mandatory attributes, code and text.  These attributes describe the state of the KPML interpreter on the end device.  Note the KPML code is not necessarily related to the SIP result code.  An important example of this is where a legal SIP subscription request gets a normal SIP 200 OK followed by a NOTIFY, but there is something wrong with the KPML request.  In this case, the NOTIFY would include the KPML failure code in the KPML report.  Note that from a SIP perspective, the SUBSCRIBE and NOTIFY were successful.  Also, if the KPML failure is not recoverable, the end device will most likely set the Subscription-Sate to terminated.  This lets the SIP machinery know the subscription is no longer active.</t>
				<section title="Pattern Match Reports">
					<t>If a pattern matches, the end device will emit a KPML report.  Since this is a success report, the code is "200" and the text is "OK".</t>
					<t>The KPML report includes the actual digits matched in the digit attribute.  The digit string uses the conventional characters '*' and '#' for star and octothorpe respectively.  The KPML report also includes the tag attribute if the regex that matched the digits had a tag attribute.</t>
					<t>If the subscription requested <xref target="S.supp">digit suppression</xref> and the end device suppressed digits, the suppressed attribute indicates "true".  The default value of suppressed is "false".</t>
					<t>
						<list style="empty">
							<t>NOTE: KPML does not include a timestamp.  There are a number of reasons for this.  First, what timestamp would in include?  Would it be the time of the first detected key press?  The time the interpreter collected the entire string?  A range?  Second, if the RTP timestamp is a datum of interest, why not simply get RTP in the first place?  That all said, if it is really compelling to have the timestamp in the response, it could be an attribute to the &lt;response&gt; tag.</t>
						</list>
					</t>
				</section>
				<section title="KPML No Match Reports">
					<t>There are a few circumstances in which the end device will emit a no match report.  They are an immediate NOTIFY in response to SUBSCRIBE request (no digits detected yet), a request for service not supported by end device, or a failure of a digit map to match a string (timeout).</t>
					<section title="Immediate NOTIFY">
						<t>The NOTIFY in response to a SUBSCRIBE request has no KPML if there are no matching quarantined digits.  An example of this is in <xref target="F.imed-notify"/>.</t>
						<t>If there are quarantined digits in the SUBSCRIBE request that match a pattern, then the NOTIFY message in response to the SUBSCRIBE request MUST include the appropriate KPML document.</t>
						<figure title="Immediate NOTIFY Example" anchor="F.imed-notify">
							<artwork><![CDATA[
NOTIFY sip:application@example.com SIP/2.0
Via: SIP/2.0/UDP proxy.example.com
Max-Forwards: 70
To: <sip:application@example.com>
From: <sip:endpoint@example.net>
Call-Id: 439hu409h4h09903fj0ioij
Subscription-State: active; expires=7200
CSeq: 49851 NOTIFY
Event: kpml
							]]></artwork>
						</figure>
					</section>
				</section>
			</section>
		</section>
		<section title="DRegex Syntax" anchor="S.DRegex">
			<t>The Digit REGular EXpression (DRegex) syntax follows the Unix egrep and Java Regular Expression syntax.</t>
			<t>White space is removed before parsing DRegex.  This enables sensible pretty printing in XML without affecting the meaning of the DRegex string.</t>
			<t>The following rules describe the use of DRegex in KPML.</t>
			<texttable title="DRegex">
				<ttcol>Entity</ttcol>
				<ttcol>Matches</ttcol>
				<c>digit</c>
				<c>digit 0-9 and A-D</c>
				<c>[digit selector]</c>
				<c>Any digit in selector</c>
				<c>[^digit selector]</c>
				<c>Any digit NOT in selector</c>
				<c>[digit-range]</c>
				<c>Any digit in range</c>
				<c>x</c>
				<c>Any digit 0-9</c>
				<c>.</c>
				<c>Zero or more repetitions of previous pattern</c>
				<c>|</c>
				<c>Alternation</c>
				<c>{m}</c>
				<c>m repetitions of previous pattern</c>
				<c>{m,}</c>
				<c>m or more repetitions of previous pattern</c>
				<c>{,n}</c>
				<c>At most n (including zero) repetitions of previous pattern</c>
				<c>{m,n}</c>
				<c>at least m and at most n repetitions of previous pattern</c>
				<c>Ldigit</c>
				<c>Match the digit if it is "long"</c>
			</texttable>
			<texttable title="DRegex Examples">
				<ttcol>Example</ttcol>
				<ttcol>Description</ttcol>
				<c>1</c>
				<c>Matches the digit 1</c>
				<c>[179]</c>
				<c>Matches 1, 7, or 9</c>
				<c>[^01]</c>
				<c>Matches 2, 3, 4, 5, 6, 7, 8, 9</c>
				<c>[2-9]</c>
				<c>Matches 2, 3, 4, 5, 6, 7, 8, 9</c>
				<c>x</c>
				<c>Any single digit</c>
				<c>2|3</c>
				<c>Matches 2 or 3; same as [23]</c>
				<c>00|011</c>
				<c>Matches the string 00 or 011</c>
				<c>0.</c>
				<c>Zero or more occurrences of 0</c>
				<c>[2-9].</c>
				<c>Zero or more occurrences of 2-9</c>
				<c>011x{7,15}</c>
				<c>011 followed by seven to fifteen digits</c>
				<c>L*</c>
				<c>Long star</c>
			</texttable>
		</section>
		<section title="Formal Syntax" anchor="S.syntax">
			<t>
The following syntax in <xref target="F.schema"/> uses the <xref target="W3C.REC-xmlschema-1-20010502">XML Schema</xref>.
			</t>
			<figure title="XML Schema for KPML" anchor="F.schema">
				<artwork><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)
     by Eric Burger (Snowshore Networks Inc.) -->
<xs:schema targetNamespace="urn:ietf:params:xml:ns:kpml"
 xmlns="urn:ietf:params:xml:ns:kpml"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 elementFormDefault="qualified"
 attributeFormDefault="unqualified">
 <xs:element name="kpml">
  <xs:annotation>
   <xs:documentation>IETF Keypad Markup Language</xs:documentation>
  </xs:annotation>
  <xs:complexType>
   <xs:choice>
    <xs:element name="request">
     <xs:complexType>
      <xs:sequence>
       <xs:element name="pattern">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="flush" type="xs:string" minOccurs="0"/>
          <xs:element name="regex" maxOccurs="unbounded">
           <xs:complexType mixed="true">
            <xs:sequence>
             <xs:element name="pre" type="xs:string" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="tag" type="xs:string"
                          use="optional"/>
           </xs:complexType>
          </xs:element>
         </xs:sequence>
         <xs:attribute name="persistent" type="xs:boolean"
                       use="optional"/>
         <xs:attribute name="enterkey" type="xs:string"
                       use="optional"/>
         <xs:attribute name="interdigittimer" type="xs:integer"
                       use="optional"/>
         <xs:attribute name="criticaldigittimer" type="xs:integer"
                       use="optional"/>
         <xs:attribute name="extradigittimer" type="xs:integer"
                       use="optional"/>
         <xs:attribute name="longtimer" type="xs:integer"
                       use="optional"/>
        </xs:complexType>
       </xs:element>
       <xs:element name="stream" type="xs:string" minOccurs="0"/>
      </xs:sequence>
     </xs:complexType>
    </xs:element>
    <xs:element name="response">
     <xs:complexType>
      <xs:attribute name="code" type="xs:string" use="required"/>
      <xs:attribute name="text" type="xs:string" use="required"/>
      <xs:attribute name="suppressed" type="xs:boolean"
                    use="optional"/>
      <xs:attribute name="digits" type="xs:string" use="optional"/>
      <xs:attribute name="tag" type="xs:string" use="optional"/>
     </xs:complexType>
    </xs:element>
   </xs:choice>
   <xs:attribute name="version" type="xs:string" use="required"/>
  </xs:complexType>
 </xs:element>
</xs:schema>
 				]]></artwork>
			</figure>
		</section>
		<section title="Enumeration of KPML Status Codes" anchor="S.codes">
			<t>KPML failure codes broadly follow their SIP counterparts.  Codes that start with a 2 indicate success.  Codes that start with a 4 indicate failure.  Codes that start with a 5 indicate a server failure, usually a failure to interpret the document or to support a requested feature.</t>
			<t>KPML clients MUST be able to handle arbitrary status codes by examining the first digit only.</t>
			<t>Any text can be in a KPML report document.  KPML clients MUST NOT interpret the text field.</t>
			<texttable anchor="failure-codes" title="KPML Failure Codes">
				<ttcol>Code</ttcol>
				<ttcol>Text</ttcol>
				<c>200</c>
				<c>Success</c>
				<c>402</c>
				<c>User Terminated Without Match</c>
				<c>423</c>
				<c>Timer Expired</c>
				<c>481</c>
				<c>Dialog (call leg) Not Found</c>
				<c>487</c>
				<c>Subscription Expired</c>
				<c>501</c>
				<c>Bad Document</c>
				<c>531</c>
				<c>Persistent Subscriptions Not Supported</c>
				<c>532</c>
				<c>Multiple or Alternate Regular Expressions Not Supported</c>
				<c>533</c>
				<c>Multiple Subscriptions on a Call Leg Not Supported</c>
			</texttable>
		</section>
		<section title="IANA Considerations">
			<section title="MIME Media Type application/kpml+xml">
				<t>
					<list style="hanging">
						<!-- hangIndent="30" -->
						<t hangText="MIME media type name:">application</t>
						<t hangText="MIME subtype name:">kpml+xml</t>
						<t hangText="Required parameters:">none</t>
						<t hangText="Optional parameters:">charset</t>
						<t>
							<list style="hanging">
								<t hangText="charset">This parameter has identical semantics to the charset parameter of the "application/xml" media type as specified in <xref target="RFC3023">XML Media Types</xref>.</t>
							</list>
						</t>
					</list>
				</t>
				<t>
			Encoding considerations: See <xref target="RFC3023">RFC3023</xref>.
			</t>
				<t>
			Interoperability considerations: See <xref target="RFC3023">RFC2023</xref> and this document.
			</t>
				<t>
			Published specification: This document.
			</t>
				<t>
			Applications which use this media type: Session-oriented applications that have primitive user interfaces.
				</t>
				<t>
			Intended usage: COMMON
				</t>
			</section>
			<section title="URN Sub-Namespace Registration for urn:ietf:xml:ns:kpml">
				<t>URI: urn:ietf:params:xml:ns:kpml</t>
				<t>Registrant Contact: Eric Burger &lt;eburger@ietf.org&gt;</t>
				<t>XML:
					<figure>
						<artwork><![CDATA[
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML Basic 1.0//EN"
          "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type"
          content="text/html;charset=iso-8859-1"/>
    <title>Key Press Markup Language</title>
  </head>
  <body>
    <h1>Namespace for Key Press Markup Language</h1>
    <h2>urn:ietf:params:xml:ns:kpml</h2>
    <p>
<a href="ftp://ftp.rfc-editor.org/in-notes/rfcXXXX.txt">RFCXXXX</a>.
    </p>
  </body>
</html>
							]]></artwork>
					</figure>
				</t>
			</section>
			<section title="KPML Schema Registration">
				<t>Please register the XML Schema for KPML as referenced in <xref target="S.syntax"/>.</t>
			</section>
		</section>
		<section anchor="S.security" title="Security Considerations">
			<t>As an XML markup, all of the security considerations of <xref target="RFC3023">RFC3023</xref> and <xref target="RFC3406">RFC3406</xref> apply.  Pay particular attention to the robustness requirements of parsing XML.</t>
			<t>Key press information is potentially sensitive.  Hijacking sessions allow unauthorized entities access to this sensitive information.  Therefore, signaling SHOULD be secure, e.g., use of TLS and sips: SHOULD be used.  Moreover, the information itself is sensitive.  Thus if TLS is not used, S/MIME or other appropriate mechanism SHOULD be used.</t>
			<t>End devices implementing this specification MUST implement TLS and SHOULD implement S/MIME at a minimum.</t>
		</section>
		<section title="Examples">
			<t>This section is informative in nature.  If there is a discrepancy between this section and the normative sections above, the normative sections take precedence.</t>
			<section title="Monitoring for Octothorpe">
				<t>A common need for pre-paid and personal assistant applications is to monitor a conversation for a signal indicating a change in user focus from the party they called through the application to the application itself.  For example, if you call a party using a pre-paid calling card and the party you call redirects you to voice mail, digits you press are for the voice mail system.  However, many applications have a special key sequence, such as the octothorpe (#, or pound sign) or *9 that terminate the called party leg and shift the user's focus to the application.</t>
				<t>
					<xref target="F.e.long"/> shows the KPML for long octothorpe.  Note that the href is really on one line, but divided for clarity.</t>
				<figure title="Long Octothorpe Example" anchor="F.e.long">
					<artwork><![CDATA[
<?xml version="1.0">
<kpml xmlns="urn:ietf:params:xml:ns:kpml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
      version="1.0">
  <request>
    <pattern>
      <regex>L#</regex>
    </pattern>
  </request>
</kpml>
					]]></artwork>
				</figure>
				<t>The regex value L indicates the following digit needs to be a long-duration key press.</t>
			</section>
			<section anchor="S.dsc" title="Dial String Collection">
				<t>In this example, the user device collects a dial string.  The application uses KPML to quickly determine when the user enters a target number.  In addition, KPML indicates what type of number the user entered.</t>
				<figure title="Dial String KPML Example Code" anchor="F.e.dial">
					<artwork><![CDATA[
<?xml version="1.0">
<kpml xmlns="urn:ietf:params:xml:ns:kpml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
      version="1.0">
  <request>
    <pattern>
      <regex tag="local-operator">0</regex>
      <regex tag="ld-operator"/>00</regex>
      <regex tag="vpn">7[x][x][x]</regex>
      <regex tag="local-number7">9xxxxxxx</regex>
      <regex tag="RI-number">9401xxxxxxx</regex>
      <regex tag="local-number10">9xxxxxxxxxx</regex>
      <regex tag="ddd">91xxxxxxxxxx</regex>
      <regex tag="iddd">011x.</regex>
    </pattern>
  </request>
</kpml>
					]]></artwork>
				</figure>
				<t>Note the use of the "tag" attribute to indicate which regex matched the dialed string.  The interesting case here is if the user entered "94015551212".  This string matches both the "9401xxxxxxx" and "9xxxxxxxxxx" regular expressions.  By following the rules described in <xref target="S.mp"/>, the KPML interpreter will pick the "9401xxxxxxx" string, as it occurs first in document order (both expressions match the same length).  <xref target="F.e.dial-resp"/> shows the response.</t>
				<figure title="Dial String KPML Response" anchor="F.e.dial-resp">
					<artwork><![CDATA[
<?xml version="1.0"?>
<kpml xmlns="urn:ietf:params:xml:ns:kpml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
      version="1.0">
  <response code="200" text="OK" 
            digits="94015551212" tag="RI-number"/>
</kpml>
					]]></artwork>
				</figure>
			</section>
			<section title="Interactive Digit Collection">
				<t>
This is an example where one would probably be better off using a full scripting language such as <xref target="refs.VXML">VoiceXML</xref> or <xref target="I-D.vandyke-mscml">MSCML</xref> or a device control language such as <xref target="RFC3525">H.248.1</xref>.
				</t>
				<t>
In this example, an application requests the user device to send the user's signaling directly to the platform in HTTP, rather than monitoring the entire RTP stream.  <xref target="F.e.ivr"/> shows a voice mail menu, where presumably the application played a "Press K to keep the message, R to replay the message, and D to delete the message" prompt.  In addition, the application does not want the user to be able to barge the prompt.
				</t>
				<figure title="IVR KPML Example Code" anchor="F.e.ivr">
					<artwork><![CDATA[
<?xml version="1.0">
<kpml xmlns="urn:ietf:params:xml:ns:kpml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
      version="1.0">
  <request>
    <pattern>
      <flush>yes</flush>
      <regex tag="keep">5</regex>
      <regex tag="replay">7</regex>
      <regex tag="delete">3</regex>
    </pattern>
  </request>
</kpml>
				]]></artwork>
				</figure>
				<t>
					<list style="empty">
						<t>
NOTE: This usage of KPML is clearly inferior to using a device control protocol like H.248.1.  From the application's point of view, it has to do the low-level prompt-collect logic.  Granted, it is relatively easy to change the key mappings for a given menu.  However, often more of the call flow than a given menu mapping gets changed.  Thus there would be little value in such a mapping to KPML.  We STRONGLY suggest using a real scripting language such as VoiceXML or MSCML for this purpose.
						</t>
					</list>
				</t>
			</section>
		</section>
		<section title="Call Flow Example">
			<section title="INVITE-Initiated Dialog">
				<t>This section describes a successful subscription and notification from an Application with an End Device ("User A") in an INVITE-Initiated dialog.  Note the Application can be a Record-Route Proxy, a B2BUA, or another end device.</t>
				<figure title="Ladder Diagram - INVITE-Initiated Dialog">
					<artwork><![CDATA[
User A	       Application
  |                |
  |    INVITE F1   |
  |--------------->|
  |  100 TRYING F2 |
  |<---------------|
  |     180 F3     |
  |<---------------|
  |    200 OK F4   |
  |<---------------|
  |      ACK F5    |
  |--------------->|
  |  Media Session |
  |<==============>|
  | SUBSCRIBE F6   |   Application Subscribes to "***" from User A
  |<---------------|
  |   200 OK F7    |
  |--------------->|
  |   NOTIFY F8    |   Immediate Notify indicating monitoring
  |--------------->|
  |   200 OK F9    |
  |<---------------|
  |       .        |
  |       :        |
  |   NOTIFY F10   |
  |--------------->|   Notification of detection of "***"
  |   200 OK F11   |
  |<---------------|
  |                |
             
					]]></artwork>
				</figure>
				<t>Connection setup between User A and an Application subscribing to a DTMF event of "***" at User A.</t>
				<figure title="Ladder Diagram - INVITE-Initiated Dialog">
					<artwork><![CDATA[
F1 INVITE User A --> Application
      
      INVITE sip:UserB@subB.example.com SIP/2.0
      Via: SIP/2.0/UDP client.subA.example.com:5060;branch=z9hG4bK74
      Max-Forwards: 70
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>
      Call-ID: 12345601@subA.example.com
      CSeq: 1 INVITE
      Contact: <sip:UserA@client.subA.example.com>
      Route: <sip:application.subA.example.com;lr>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, SUBCRIBE, NOTIFY
      Allow-Events: kpml
      Supported: replaces
      Content-Type: application/sdp
      Content-Length: ...

      v=0
      o=UserA 2890844526 2890844526 IN IP4 client.subA.example.com
      s=Session SDP
      c=IN IP4 client.subA.example.com
      t=3034423619 0
      m=audio 49170 RTP/AVP 0
      a=rtpmap:0 PCMU/8000


F2 100 Trying Application --> User A

      SIP/2.0 100 Trying
      Via: SIP/2.0/UDP client.subA.example.com:5060;branch=z9hG4bK74
        ;received=192.168.12.22
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>
      Call-ID: 12345601@subA.example.com
      CSeq: 1 INVITE
      Content-Length: 0


F3 180 Ringing Application --> User A

      SIP/2.0 180 Ringing
      Via: SIP/2.0/UDP client.subA.example.com:5060;branch=z9hG4bK74
        ;received=192.168.12.22
      Record-Route: <sip:application.subA.example.com;lr> 
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 1 INVITE
      Contact: <sip:UserB@client.subB.example.com>
      Content Length: 0


F4 200 OK Application --> User A
      
      SIP/2.0 200 OK
      Via: SIP/2.0/UDP client.subA.example.com:5060;branch=z9hG4bK74
        ;received=192.168.12.22
      Record-Route: <sip:application.subA.example.com;lr> 
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 1 INVITE
      Contact: <sip:UserB@client.subB.example.com>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, SUBSCRIBE, NOTIFY
      Supported: replaces
      Content-Type: application/sdp
      Content-Length: ...

      v=0
      o=UserB 2890844527 2890844527 IN IP4 client.subB.example.com
      s=Session SDP
      c=IN IP4 client.subB.example.com
      t=3034423619 0
      m=audio 3456 RTP/AVP 0
      a=rtpmap:0 PCMU/8000

F5 ACK User A --> Application

      ACK sip:UserB@subB.example.com SIP/2.0
      Via: SIP/2.0/UDP client.subA.example.com:5060;branch=z9hG4bK74
      Max-Forwards: 70
      Route: <sip:application.subA.example.com;lr>
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 1 ACK
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY
      Supported: replaces
      Content-Length: 0

F6 SUBSCRIBE Application --> User A

      SUBSCRIBE sip:UserA@subA.example.com SIP/2.0
      Max-Forwards: 70
      From: <sip:UserB@subB.example.com>;tag=567890
      To: <sip:UserA@subA.example.com>;tag=1234567
      Call-ID: 12345601@subA.example.com
      CSeq: 1 SUBSCRIBE
      Contact: <sip:UserB@client.subB.example.com>
      Event: kpml
      Expires: 7200
      Accept: application/kpml+xml
      Content-Type: application/kmpl+xml
      Content-Length: ...
   
      <?xml version="1.0">
      <kpml xmlns="urn:ietf:params:xml:ns:kpml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
            version="1.0">
        <request>
          <pattern>
            <regex value="***"/>
          </pattern>
        </request>
      </kpml>


F7 200 OK User A --> Application

      SIP/2.0 200 OK
      To: <sip:UserA@subA.example.com>;tag=1234567
      From: <sip:UserB@subB.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 1 SUBSCRIBE
      Contact: <sip:UserB@client.subB.example.com>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, SUBSCRIBE, NOTIFY
      Supported: replaces
      Content-Length: 0


F8 NOTIFY User A --> Application

      NOTIFY sip:UserB@subB.example.com SIP/2.0
      Max-Forwards: 70
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 2 NOTIFY
      Subscription-State: active;expires=3600
      Content-Type: application/kpml+xml
      Content-Length: ...
      Event: kpml

      <?xml version="1.0"?>
      <kpml xmlns="urn:ietf:params:xml:ns:kpml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
            version="1.0">
        <response code="100" text="TRYING"/>
      </kpml>


F9 200 OK Application --> User A

      SIP/2.0 200 OK
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@subB.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 2 NOTIFY
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, SUBSCRIBE, NOTIFY
      Supported: replaces
      Content-Type: application/sdp
      Content-Length: 0


F10 NOTIFY User A --> Application

      NOTIFY sip:UserB@subB.example.com SIP/2.0
      Max-Forwards: 70
      From: <sip:UserA@subA.example.com>;tag=1234567
      To: <sip:UserB@Application.example.com>;tag=567890
      Call-ID: 12345601@subA.example.com
      CSeq: 3 NOTIFY
      Subscription-State: active;expires=3125
      Content-Type: application/kpml+xml
      Content-Length: ...
      Event: kpml

      <?xml version="1.0"?>
      <kpml xmlns="urn:ietf:params:xml:ns:kpml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:ietf:params:xml:ns:kpml kpml.xsd"
            version="1.0">
        <response code="200" text="OK"
                  digits="***"/>
      </kpml>


F11 200 OK Application --> User A

      SIP/2.0 200 OK
      From: <sips:UserA@subA.net>;tag=1234567
      To: <sips:UserB@Application.example.com>
      Call-ID: 12345601@subA.com
      JVD: CSeq: 3 NOTIFY
      Contact: <sips:UserB@Application.example.com>
      Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, SUBSCRIBE, NOTIFY
      Supported: replaces
      Content-Type: application/sdp
      Content-Length: 0
					]]></artwork>
				</figure>
			</section>
			<section title="Third-Party Subscription">
				<t>Coming soon!</t>
			</section>
			<section title="Remote-End Monitoring">
				<t>Coming soon!</t>
			</section>
		</section>
	</middle>
	<back>
		<references title="Normative References">
			<reference anchor="RFC2119">
				<front>
					<title>Key words for use in RFCs to Indicate Requirement Levels</title>
					<author surname="Bradner" initials="S.">
						<organization/>
					</author>
					<date year="1997" month="March"/>
				</front>
				<seriesInfo name="BCP" value="14"/>
				<seriesInfo name="RFC" value="2119"/>
			</reference>
			<reference anchor="RFC3023">
				<front>
					<title>XML Media Types</title>
					<author initials="M." surname="Murata" fullname="M. Murata">
						<organization/>
					</author>
					<author initials="S." surname="St. Laurent" fullname="S. St. Laurent">
						<organization/>
					</author>
					<author initials="D." surname="Kohn" fullname="D. Kohn">
						<organization/>
					</author>
					<date month="January" year="2001"/>
				</front>
				<seriesInfo name="RFC" value="3023"/>
				<format type="TXT" octets="86011" target="ftp://ftp.isi.edu/in-notes/rfc3023.txt"/>
			</reference>
			<reference anchor="RFC3261">
				<front>
					<title>SIP: Session Initiation Protocol</title>
					<author initials="J." surname="Rosenberg" fullname="J. Rosenberg">
						<organization/>
					</author>
					<author initials="H." surname="Schulzrinne" fullname="H. Schulzrinne">
						<organization/>
					</author>
					<author initials="G." surname="Camarillo" fullname="G. Camarillo">
						<organization/>
					</author>
					<author initials="A." surname="Johnston" fullname="A. Johnston">
						<organization/>
					</author>
					<author initials="J." surname="Peterson" fullname="J. Peterson">
						<organization/>
					</author>
					<author initials="R." surname="Sparks" fullname="R. Sparks">
						<organization/>
					</author>
					<author initials="M." surname="Handley" fullname="M. Handley">
						<organization/>
					</author>
					<author initials="E." surname="Schooler" fullname="E. Schooler">
						<organization/>
					</author>
					<date month="June" year="2002"/>
				</front>
				<seriesInfo name="RFC" value="3261"/>
				<format type="TXT" octets="647976" target="ftp://ftp.isi.edu/in-notes/rfc3261.txt"/>
			</reference>
			<reference anchor="RFC3265">
				<front>
					<title>Session Initiation Protocol (SIP)-Specific Event Notification</title>
					<author initials="A.B." surname="Roach" fullname="A.B. Roach">
						<organization/>
					</author>
					<date month="June" year="2002"/>
				</front>
				<seriesInfo name="RFC" value="3265"/>
				<format type="TXT" octets="89005" target="ftp://ftp.isi.edu/in-notes/rfc3265.txt"/>
			</reference>
			<reference anchor="RFC3406">
				<front>
					<title>Uniform Resource Names (URN) Namespace Definition Mechanisms</title>
					<author initials="L." surname="Daigle" fullname="L. Daigle">
						<organization/>
					</author>
					<author initials="D." surname="van Gulik" fullname="D. van Gulik">
						<organization/>
					</author>
					<author initials="R." surname="Iannella" fullname="R. Iannella">
						<organization/>
					</author>
					<author initials="P." surname="Faltstrom" fullname="P. Faltstrom">
						<organization/>
					</author>
					<date month="October" year="2002"/>
				</front>
				<seriesInfo name="BCP" value="66"/>
				<seriesInfo name="RFC" value="3406"/>
				<format type="TXT" octets="43707" target="ftp://ftp.isi.edu/in-notes/rfc3406.txt"/>
			</reference>
			<reference anchor="W3C.REC-xmlschema-1-20010502">
				<front>
					<title>XML Schema Part 1: Structures</title>
					<author initials="H" surname="Thompson" fullname="Henry S. Thompson">
						<organization/>
					</author>
					<author initials="D" surname="Beech" fullname="David Beech">
						<organization/>
					</author>
					<author initials="M" surname="Maloney" fullname="Murray Maloney">
						<organization/>
					</author>
					<author initials="N" surname="Mendelsohn" fullname="Noah Mendelsohn">
						<organization/>
					</author>
					<date month="May" day="2" year="2001"/>
				</front>
				<seriesInfo name="W3C REC" value="REC-xmlschema-1-20010502"/>
				<format type="HTML" target="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502"/>
			</reference>
		</references>
		<references title="Informative References">
			<reference anchor="RFC1889">
				<front>
					<title abbrev="RTP">RTP: A Transport Protocol for Real-Time Applications</title>
					<author initials="H." surname="Schulzrinne" fullname="Henning Schulzrinne">
						<organization>GMD Fokus</organization>
						<address>
							<postal>
								<street>Hardenbergplatz 2</street>
								<city>Berlin</city>
								<region/>
								<code>D-10623</code>
								<country>DE</country>
							</postal>
							<email>schulzrinne@fokus.gmd.de</email>
						</address>
					</author>
					<author initials="S." surname="Casner" fullname="Stephen L. Casner">
						<organization>Precept Software, Inc.</organization>
						<address>
							<postal>
								<street>21580 Stevens Creek Boulevard</street>
								<street>Suite 207</street>
								<city>Cupertino</city>
								<region>CA</region>
								<code>95014</code>
								<country>US</country>
							</postal>
							<email>casner@precept.com</email>
						</address>
					</author>
					<author initials="R." surname="Frederick" fullname="Ron Frederick">
						<organization>Xerox Palo Alto Research Center</organization>
						<address>
							<postal>
								<street>3333 Coyote Hill Road</street>
								<city>Palo Alto</city>
								<region>CA</region>
								<code>94304</code>
								<country>US</country>
							</postal>
							<email>frederic@parc.xerox.com</email>
						</address>
					</author>
					<author initials="V." surname="Jacobson" fullname="Van Jacobson">
						<organization>Lawrence Berkeley National Laboratory</organization>
						<address>
							<postal>
								<street>MS 46a-1121</street>
								<city>Berkeley</city>
								<region>CA</region>
								<code>94720</code>
								<country>US</country>
							</postal>
							<email>van@ee.lbl.gov</email>
						</address>
					</author>
					<date month="January" year="1996"/>
					<abstract>
						<t>This memorandum describes RTP, the real-time transport protocol. RTP provides end-to-end network transport functions suitable for applications transmitting real-time data, such as audio, video or simulation data, over multicast or unicast network services. RTP does not address resource reservation and does not guarantee quality-of- service for real-time services. The data transport is augmented by a control protocol (RTCP) to allow monitoring of the data delivery in a manner scalable to large multicast networks, and to provide minimal control and identification functionality. RTP and RTCP are designed to be independent of the underlying transport and network layers. The protocol supports the use of RTP-level translators and mixers.</t>
					</abstract>
				</front>
				<seriesInfo name="RFC" value="1889"/>
				<format type="TXT" octets="188544" target="ftp://ftp.isi.edu/in-notes/rfc1889.txt"/>
			</reference>
			<reference anchor="RFC2327">
				<front>
					<title abbrev="SDP">SDP: Session Description Protocol</title>
					<author initials="M." surname="Handley" fullname="Mark Handley">
						<organization>
   Information Sciences Institute
</organization>
						<address>
							<postal>
								<street>
   c/o MIT Laboratory for Computer Science
</street>
								<street>
   545 Technology Square
</street>
								<city>Cambridge</city>
								<region>MA</region>
								<code>02139</code>
								<country>US</country>
							</postal>
							<email>mjh@isi.edu</email>
						</address>
					</author>
					<author initials="V." surname="Jacobson" fullname="Van Jacobson">
						<organization>
   Lawrence Berkeley Laboratory
</organization>
						<address>
							<postal>
								<street>
   MS 46a-1121
</street>
								<city>Berkeley</city>
								<region>CA</region>
								<code>94720</code>
								<country>US</country>
							</postal>
							<email>van@ee.lbl.gov</email>
						</address>
					</author>
					<date month="April" year="1998"/>
					<area>Applications</area>
					<keyword>multimedia</keyword>
					<keyword>SDP</keyword>
					<abstract>
						<t>

   This document defines the Session Description Protocol, SDP.  SDP is

   intended for describing multimedia sessions for the purposes of

   session announcement, session invitation, and other forms of

   multimedia session initiation.
</t>
						<t>


   This document is a product of the Multiparty Multimedia Session

   Control (MMUSIC) working group of the Internet Engineering Task

   Force. Comments are solicited and should be addressed to the working

   group's mailing list at confctrl@isi.edu and/or the authors.
</t>
					</abstract>
				</front>
				<seriesInfo name="RFC" value="2327"/>
				<format type="TXT" octets="87096" target="ftp://ftp.isi.edu/in-notes/rfc2327.txt"/>
				<format type="HTML" octets="104429" target="http://xml.resource.org/public/rfc/html/rfc2327.html"/>
				<format type="XML" octets="96873" target="http://xml.resource.org/public/rfc/xml/rfc2327.xml"/>
			</reference>
			<reference anchor="RFC2616">
				<front>
					<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
					<author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
						<organization>University of California, Irvine, Information and Computer Science</organization>
						<address>
							<postal>
								<street/>
								<city>Irvine</city>
								<region>CA</region>
								<code>92697-3425</code>
								<country>US</country>
							</postal>
							<phone>+1 949 824 1715</phone>
							<email>fielding@ics.uci.edu</email>
						</address>
					</author>
					<author initials="J." surname="Gettys" fullname="James Gettys">
						<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
						<address>
							<postal>
								<street>545 Technology Square</street>
								<city>Cambridge</city>
								<region>MA</region>
								<code>02139</code>
								<country>US</country>
							</postal>
							<facsimile>+1 617 258 8682</facsimile>
							<email>jg@w3.org</email>
						</address>
					</author>
					<author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
						<organization>Compaq Computer Corporation, Western Research Laboratory</organization>
						<address>
							<postal>
								<street>250 University Avenue</street>
								<city>Palo Alto</city>
								<region>CA</region>
								<code>94301</code>
								<country>US</country>
							</postal>
							<email>mogul@wrl.dec.com</email>
						</address>
					</author>
					<author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
						<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
						<address>
							<postal>
								<street>545 Technology Square</street>
								<city>Cambridge</city>
								<region>MA</region>
								<code>02139</code>
								<country>US</country>
							</postal>
							<facsimile>+1 617 258 8682</facsimile>
							<email>frystyk@w3.org</email>
						</address>
					</author>
					<author initials="L." surname="Masinter" fullname="Larry Masinter">
						<organization>Xerox Corporation</organization>
						<address>
							<postal>
								<street>3333 Coyote Hill Road</street>
								<city>Palo Alto</city>
								<region>CA</region>
								<code>94034</code>
								<country>US</country>
							</postal>
							<email>masinter@parc.xerox.com</email>
						</address>
					</author>
					<author initials="P.J." surname="Leach" fullname="Paul J. Leach">
						<organization>Microsoft Corporation</organization>
						<address>
							<postal>
								<street>1 Microsoft Way</street>
								<city>Redmond</city>
								<region>WA</region>
								<code>98052</code>
								<country>US</country>
							</postal>
							<email>paulle@microsoft.com</email>
						</address>
					</author>
					<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
						<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
						<address>
							<postal>
								<street>545 Technology Square</street>
								<city>Cambridge</city>
								<region>MA</region>
								<code>02139</code>
								<country>US</country>
							</postal>
							<phone>+1 617 258 8682</phone>
							<email>timbl@w3.org</email>
						</address>
					</author>
					<date month="June" year="1999"/>
					<abstract>
						<t>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.</t>
						<t>HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1", and is an update to RFC 2068.</t>
					</abstract>
				</front>
				<seriesInfo name="RFC" value="2616"/>
				<format type="TXT" octets="422317" target="ftp://ftp.isi.edu/in-notes/rfc2616.txt"/>
				<format type="PS" octets="5529857" target="ftp://ftp.isi.edu/in-notes/rfc2616.ps"/>
				<format type="PDF" octets="550558" target="ftp://ftp.isi.edu/in-notes/rfc2616.pdf"/>
			</reference>
			<reference anchor="RFC2833">
				<front>
					<title>RTP Payload for DTMF Digits, Telephony Tones and Telephony Signals</title>
					<author initials="H." surname="Schulzrinne" fullname="H. Schulzrinne">
						<organization/>
					</author>
					<author initials="S." surname="Petrack" fullname="S. Petrack">
						<organization/>
					</author>
					<date month="May" year="2000"/>
				</front>
				<seriesInfo name="RFC" value="2833"/>
				<format type="TXT" octets="68786" target="ftp://ftp.isi.edu/in-notes/rfc2833.txt"/>
			</reference>
			<reference anchor="RFC3266">
				<front>
					<title>Support for IPv6 in Session Description Protocol (SDP)</title>
					<author initials="S." surname="Olson" fullname="S. Olson">
						<organization/>
					</author>
					<author initials="G." surname="Camarillo" fullname="G. Camarillo">
						<organization/>
					</author>
					<author initials="A.B." surname="Roach" fullname="A.B. Roach">
						<organization/>
					</author>
					<date month="June" year="2002"/>
				</front>
				<seriesInfo name="RFC" value="3266"/>
				<format type="TXT" octets="8693" target="ftp://ftp.isi.edu/in-notes/rfc3266.txt"/>
			</reference>
			<reference anchor="RFC3435">
				<front>
					<title>Media Gateway Control Protocol (MGCP) Version 1.0</title>
					<author initials="F." surname="Andreasen" fullname="F. Andreasen">
						<organization/>
					</author>
					<author initials="B." surname="Foster" fullname="B. Foster">
						<organization/>
					</author>
					<date month="January" year="2003"/>
				</front>
				<seriesInfo name="RFC" value="3435"/>
				<format type="TXT" octets="467084" target="ftp://ftp.isi.edu/in-notes/rfc3435.txt"/>
			</reference>
			<reference anchor="RFC3525">
				<front>
					<title>Gateway Control Protocol Version 1</title>
					<author initials="C." surname="Groves" fullname="C. Groves">
						<organization/>
					</author>
					<author initials="M." surname="Pantaleo" fullname="M. Pantaleo">
						<organization/>
					</author>
					<author initials="T." surname="Anderson" fullname="T. Anderson">
						<organization/>
					</author>
					<author initials="T." surname="Taylor" fullname="T. Taylor">
						<organization/>
					</author>
					<date month="June" year="2003"/>
				</front>
				<seriesInfo name="RFC" value="3525"/>
				<format type="TXT" octets="439674" target="ftp://ftp.isi.edu/in-notes/rfc3525.txt"/>
			</reference>
			<reference anchor="refs.VXML" target="http://www.w3.org/TR/voicexml20/">
				<front>
					<title>Voice Extensible Markup Language (VoiceXML) Version 2.0</title>
					<author>
						<organization>World Wide Web Consortium</organization>
					</author>
					<date year="2002" month="April"/>
				</front>
				<seriesInfo name="W3C Working Draft" value=""/>
			</reference>
			<reference anchor="W3C.REC-xml-20001006">
				<front>
					<title>Extensible Markup Language (XML) 1.0 (Second Edition)</title>
					<author initials="T" surname="Bray" fullname="Tim Bray">
						<organization/>
					</author>
					<author initials="J" surname="Paoli" fullname="Jean Paoli">
						<organization/>
					</author>
					<author initials="C" surname="Sperberg-McQueen" fullname="C. M. Sperberg-McQueen">
						<organization/>
					</author>
					<author initials="E" surname="Maler" fullname="Eve Maler">
						<organization/>
					</author>
					<date month="October" day="6" year="2000"/>
				</front>
				<seriesInfo name="W3C REC" value="REC-xml-20001006"/>
				<format type="HTML" target="http://www.w3.org/TR/2000/REC-xml-20001006"/>
			</reference>
			<reference anchor="W3C.CR-speech-grammar-20020626">
				<front>
					<title>Speech Recognition Grammar Specification Version 1.0</title>
					<author initials="A" surname="Hunt" fullname="Andrew Hunt">
						<organization/>
					</author>
					<author initials="S" surname="McGlashan" fullname="Scott McGlashan">
						<organization/>
					</author>
					<date month="June" day="26" year="2002"/>
				</front>
				<seriesInfo name="W3C CR" value="CR-speech-grammar-20020626"/>
				<format type="HTML" target="http://www.w3.org/TR/2002/CR-speech-grammar-20020626"/>
			</reference>
			<reference anchor="I-D.netann">
				<front>
					<title abbrev="SIP Media Services">
			Basic Network Media Services with SIP
					</title>
					<author initials="E. W." surname="Burger (Ed.)" fullname="Eric Burger">
						<organization>SnowShore Networks, Inc.</organization>
						<address>
							<postal>
								<street>285 Billerica Rd.</street>
								<city>Chelmsford</city>
								<region>MA</region>
								<code>01824-4120</code>
								<country>USA</country>
							</postal>
							<email>e.burger@ieee.org</email>
						</address>
					</author>
					<author initials="J." surname="Van Dyke" fullname="Jeff Van Dyke">
						<organization>SnowShore Networks, Inc.</organization>
						<address>
							<postal>
								<street>285 Billerica Rd.</street>
								<city>Chelmsford</city>
								<region>MA</region>
								<code>01824-4120</code>
								<country>USA</country>
							</postal>
							<email>jvandyke@snowshore.com</email>
						</address>
					</author>
					<author initials="A." surname="Spitzer" fullname="Andy Spitzer">
						<organization>SnowShore Networks, Inc.</organization>
						<address>
							<postal>
								<street>285 Billerica Rd.</street>
								<city>Chelmsford</city>
								<region>MA</region>
								<code>01824-4120</code>
								<country>USA</country>
							</postal>
							<email>woof@snowshore.com</email>
						</address>
					</author>
					<date year="2003" month="September" day="5"/>
				</front>
				<seriesInfo name="Internet-Draft" value="draft-burger-sipping-netann-07"/>
				<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-burger-sipping-netann-07.txt"/>
			</reference>
			<reference anchor="I-D.vandyke-mscml">
				<front>
					<title>Media Server Control Markup Language (MSCML) and Protocol</title>
					<author initials="E" surname="Burger" fullname="Eric Burger">
						<organization>SnowShore Networks, Inc.</organization>
					</author>
					<author initials="J." surname="Van Dyke" fullname="Jeff Van Dyke">
						<organization>SnowShore Networks, Inc.</organization>
					</author>
					<author initials="A." surname="Spitzer" fullname="Andy Spitzer">
						<organization>SnowShore Networks, Inc.</organization>
					</author>
					<date month="June" day="30" year="2003"/>
				</front>
				<seriesInfo name="Internet-Draft" value="draft-vandyke-mscml-02"/>
				<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-vandyke-mscml-02.txt"/>
			</reference>
			<reference anchor="I-D.ietf-sipping-dialog-package">
				<front>
					<title>An INVITE Inititiated Dialog Event Package for the Session Initiation  Protocol (SIP</title>
					<author initials="J" surname="Rosenberg" fullname="Jonathan Rosenberg">
						<organization/>
					</author>
					<author initials="H" surname="Schulzrinne" fullname="Henning Schulzrinne">
						<organization/>
					</author>
					<date month="June" day="30" year="2003"/>
				</front>
				<seriesInfo name="Internet-Draft" value="draft-ietf-sipping-dialog-package-02"/>
				<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-sipping-dialog-package-02.txt"/>
			</reference>
		</references>
		<section title="Contributors">
			<t>Jeff Van Dyke worked enough hours and wrote enough text to be considered an author under the old rules.</t>
			<t>Robert Fairlie-Cuninghame, Cullen Jennings, Jonathan Rosenberg, and I were the members of the Application Stimulus Signaling Design Team.  All members of the team contributed to this work.  In addition, Jonathan Rosenberg postulated DML in his "A Framework for Stimulus Signaling in SIP Using Markup" draft.</t>
			<t>This version of KPML has significant influence from MSCML, the SnowShore Media Server Control Markup Language.  Jeff Van Dyke and Andy Spitzer were the primary contributors to that effort.</t>
			<t>That said, any errors, misinterpretation, or fouls in this document are my own.</t>
		</section>
		<section title="Acknowledgements">
			<t>Hal Purdy and Eric Cheung of AT&amp;T Laboratories helped immensely through many conversations and challenges.</t>
			<t>Steve Fisher of AT&amp;T Laboratories suggested the digit suppression syntax.</t>
			<t>Terence Lobo of SnowShore Networks made it all work.</t>
		</section>
	</back>
</rfc>
