<abstract>This specification defines an extension to the Rayo protocol (XEP-0327) to provide provision for performing Call Progress Analysis on a call under the control of a Rayo client.</abstract>
<p>Rayo allows for the third-party control of media sessions such as telephone calls. A common requirement in telephony applications is to establish the progress characteristics of the session, such as dtmf, fax or modem tones, or to differentiate between a human and an answering machine. This specification extends the core Rayo specification, and specifically its Input component to describe a protocol for establishing such progress analysis and gathering its results.</p>
</section1>
<section1topic='Terminology'anchor='terms'>
<section2topic='Glossary'anchor='terms-glossary'>
<dl>
<di>
<dt>CPA</dt>
<dd>Call progress analysis.</dd>
</di>
</dl>
</section2>
</section1>
<section1topic='Session Flow'anchor='session'>
<p>This section describes the form, function and order of Rayo stanzas sent across the wire, and the circumstances in which they apply and/or may arise.</p>
<p>CPA is achieved as a special case of the core input component. All rules regarding component execution and the input component in particular apply from the core specification. When a call's controlling party wishes to begin detection of signals from the suported set, it SHOULD begin an input component with the mode attribute set as 'cpa'.</p>
<p>The grammars supplied determine the types of signal detected and parameters applied to their detection. The grammars MUST be referenced by URI in the format described <linkurl="#def-grammar">below</link>. If a Rayo server supports this specification, it MUST invoke its supported CPA function using the parameters provided from the grammars; if it does not support this specification or any of the supplied parameters within the grammar, it MUST raise an error according to the rules in the core specification.</p>
<examplecaption='Client requests CPA from a call, indicating interest in speech detection and DTMF'><![CDATA[
<p>The server MUST validate that it has appropriate resources/mechanisms to collect the requested signals before acknowledging the component creation.</p>
<section2topic='Events'anchor='session-events'>
<p>If the meta-attribute named 'terminate' is set to true in the grammar, the component MUST terminate on the first signal match it detects. If it is set to false, signals MUST be reported as events until the component is instructed to stop.</p>
<examplecaption="Component indicates that a signal was detected"><![CDATA[
<p>The input completion reason MUST be one of the supported reasons from the core specification or a <linkurl='#def-signal'>signal</link>, indicating that the CPA engine detected one of the requested signals. Any signals other than those requested by the input grammar should be ignored.</p>
<examplecaption="Component indicates it has completed due to one of the grammars matching a detected signal"><![CDATA[
<p>The grammar URI declares the signal type of interest and the parameters which apply to their detection. The URI should be composed of a URN from <linkurl='#def-signal-types'>the following list of allowed signal types</link>, and parameters to modify their detection as a query string. The names and allowed values of these parameters are implementation specific. Servers MUST support one reserved parameter named 'terminate', whose value indicates the termination behaviour of the component on signal detection as described <linkurl='#session-events'>above</link>.</p>
<p>If a Rayo server supports Rayo CPA, it MUST advertise that fact by returning a feature of "urn:xmpp:rayo|cpa:0" &VNOTE; in response to a &xep0030; information request.</p>
<examplecaption="Service Discovery Information Request - Client to Server"><![CDATA[
<p>In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.</p>
<p>A server MUST document any cases where its behaviour differs from that in this specification (such as lack of support for particular options/components/etc) and return an error whenever a command is not understood. A server MUST NOT silently ignore any instructions.</p>
<p>If the protocol defined in this specification undergoes a major revision that is not fully backward-compatible with an older version, or that contains significant new features, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of <cite>XEP-0053</cite>.</p>
Indicates the value of the signal received if applicable. For dtmf tones it is the digit detected, for speech may be human|machine|notsure and for beeps may be a frequency in Hz.