XEP-0341: Rayo CPA

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.
Author
Ben Langfeld
Copyright
© 2013 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Deferred

WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.
Type
Standards Track
Version
0.2 (2017-09-11)
Document Lifecycle
  1. Experimental
  2. Deferred
  3. Proposed
  4. Stable
  5. Final

1. Introduction

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.

2. Terminology

2.1 Glossary

CPA
Call progress analysis.

3. Session Flow

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.

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'.

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 below. 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.

Example 1. Client requests CPA from a call, indicating interest in speech detection and DTMF
<iq from='juliet@capulet.lit/balcony'
    to='9f00061@call.shakespeare.lit'
    type='set'
    id='h7ed2'>
  <input xmlns='urn:xmpp:rayo:input:1' mode='cpa'>
    <grammar url="urn:xmpp:rayo:cpa:speech:1?maxTime=4000;minSpeechDuration=4000;minVolume=10;finalSilence=2000;terminate=true" />
    <grammar url="urn:xmpp:rayo:cpa:dtmf:1" />
  </input>
</iq>

The server MUST validate that it has appropriate resources/mechanisms to collect the requested signals before acknowledging the component creation.

3.1 Events

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.

Example 2. Component indicates that a signal was detected
<presence from='9f00061@call.shakespeare.lit/eh3u28' to='juliet@capulet.lit/courtyard'>
  <signal xmlns="urn:xmpp:rayo:cpa:1" type="urn:xmpp:rayo:cpa:dtmf:1" duration="4690" value="1"/>
</presence>

3.2 Completion

The input completion reason MUST be one of the supported reasons from the core specification or a signal, indicating that the CPA engine detected one of the requested signals. Any signals other than those requested by the input grammar should be ignored.

Example 3. Component indicates it has completed due to one of the grammars matching a detected signal
<presence from='9f00061@call.shakespeare.lit/eh3u28'
      to='juliet@capulet.lit/courtyard'
      type='unavailable'>
  <complete xmlns='urn:xmpp:rayo:ext:1'>
    <signal xmlns="urn:xmpp:rayo:cpa:1" type="urn:xmpp:rayo:cpa:speech:1" duration="4690" value="machine"/>
  </complete>
</presence>

4. Formal Definition

4.1 Grammar Format

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 the following list of allowed signal types, 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 above.

4.2 Signal Element

Describes a detected signal.

The attributes of the <grammar/> element are as follows.

Table 1: Attributes of Signal Element
Attribute Definition Possible Values Default Inclusion
type Indicates the type of signal detected. Any URI value from the listed signal types none REQUIRED
duration Indicates the duration of the received signal in milliseconds An integer value in milliseconds. none OPTIONAL
value 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. none OPTIONAL

4.3 Signal Types

Signal types may be one of the following:

Table 2: Signal type URIs
URI Description
urn:xmpp:rayo:cpa:beep:1 Detect a beep.
urn:xmpp:rayo:cpa:dtmf:1 Detect DTMF tones.
urn:xmpp:rayo:cpa:vad:1 Detect voice activity.
urn:xmpp:rayo:cpa:speech:1 Detect speech and decide human or machine.
urn:xmpp:rayo:cpa:fax-ced:1 Detect a fax CED tone.
urn:xmpp:rayo:cpa:fax-cng:1 Detect a fax CNG tone.
urn:xmpp:rayo:cpa:ring:1 Detect a ringing tone.
urn:xmpp:rayo:cpa:busy:1 Detect a busy tone.
urn:xmpp:rayo:cpa:congestion:1 Detect a congestion tone.
urn:xmpp:rayo:cpa:sit:1 Detect a Special Information Tone.
urn:xmpp:rayo:cpa:modem:1 Detect a modem tone.
urn:xmpp:rayo:cpa:offhook:1 Detect an off-hook tone.

5. Determining Support

If a Rayo server supports Rayo CPA, it MUST advertise that fact by returning a feature of "urn:xmpp:rayo|cpa:0" (see Namespace Versioning regarding the possibility of incrementing the version number) in response to a Service Discovery (XEP-0030) [1] information request.

Example 4. Service Discovery Information Request - Client to Server
<iq from='kingclaudius@shakespeare.lit/castle'
    id='disco1'
    to='call.rayo.org'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
Example 5. Service Discovery Information Response - Client to Server
<iq from='call.rayo.org'
    id='disco1'
    to='kingclaudius@shakespeare.lit/castle'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:rayo:0'/>
    <feature var='urn:xmpp:rayo:cpa:0'/>
  </query>
</iq>

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 Entity Capabilities (XEP-0115) [2]. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

6. Implementation Notes

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.

7. Security Considerations

This document introduces no additional security considerations above and beyond those defined in the documents on which it depends.

8. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [3].

9. XMPP Registrar Considerations

9.1 Protocol Namespaces

This specification defines the following XML namespaces:

The XMPP Registrar [4] includes the foregoing namespaces in its registry at <https://xmpp.org/registrar/namespaces.html>, as governed by XMPP Registrar Function (XEP-0053) [5].

9.2 Namespace Versioning

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 XEP-0053.

10. XML Schema

10.1 Rayo CPA

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="urn:xmpp:rayo:input:1"
  xmlns:tns="urn:xmpp:rayo:cpa:1"
  elementFormDefault="qualified"
  xmlns:core="urn:xmpp:rayo:1">

  <annotation>
    <documentation>
      The protocol documented by this schema is defined at http://rayo.org/xep
    </documentation>
  </annotation>

  <!-- Signal element -->
  <element name="signal">
    <annotation>
      <documentation>
        Describes a detected signal.
      </documentation>
    </annotation>
    <complexType>
      <simpleContent>
        <attribute name="type" use="required">
          <annotation>
            <documentation>
              Indicates the type of signal detected.
            </documentation>
          </annotation>
          <simpleType>
            <restriction base="token">
              <enumeration value="urn:xmpp:rayo:cpa:beep:1" />
              <enumeration value="urn:xmpp:rayo:cpa:dtmf:1" />
              <enumeration value="urn:xmpp:rayo:cpa:vad:1" />
              <enumeration value="urn:xmpp:rayo:cpa:speech:1" />
              <enumeration value="urn:xmpp:rayo:cpa:fax-ced:1" />
              <enumeration value="urn:xmpp:rayo:cpa:fax-cng:1" />
              <enumeration value="urn:xmpp:rayo:cpa:ring:1" />
              <enumeration value="urn:xmpp:rayo:cpa:busy:1" />
              <enumeration value="urn:xmpp:rayo:cpa:congestion:1" />
              <enumeration value="urn:xmpp:rayo:cpa:sit:1" />
              <enumeration value="urn:xmpp:rayo:cpa:modem:1" />
              <enumeration value="urn:xmpp:rayo:cpa:offhook:1" />
            </restriction>
          </simpleType>
        </attribute>
        <attribute name="duration" type="core:durationType" use="optional" default="">
          <annotation>
            <documentation>
              Indicates the duration of the received signal in milliseconds
            </documentation>
          </annotation>
        </attribute>
        <attribute name="value" type="token" use="optional" default="">
          <annotation>
            <documentation>
              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.
            </documentation>
          </annotation>
        </attribute>
      </simpleContent>
    </complexType>
  </element>
</schema>

11. Acknowledgements

The authors would like to acknowledge the input of teams at Tropo Inc, Mojo Lingo and Grasshopper in the development of this specification.

Specific individuals who have contributed to the specification or to software significant to its completion include:


Appendices

Appendix A: Document Information

Series
XEP
Number
0341
Publisher
XMPP Standards Foundation
Status
Deferred
Type
Standards Track
Version
0.2
Last Updated
2017-09-11
Approving Body
XMPP Council
Dependencies
XMPP Core, XEP-0327 Rayo
Supersedes
None
Superseded By
None
Short Name
NOT_YET_ASSIGNED
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Ben Langfeld
Email
ben@langfeld.me
JabberID
ben@langfeld.me
URI
http://langfeld.me

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

2. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.

3. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

4. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

5. XEP-0053: XMPP Registrar Function <https://xmpp.org/extensions/xep-0053.html>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.2 (2017-09-11)
    Defer due to lack of activity.
    XEP Editor (jwi)
  2. Version 0.1 (2014-01-14)

    Initial published version approved by the XMPP Council.

    psa
  3. Version 0.0.2 (2014-01-14)

    Second draft.

    bl
  4. Version 0.0.1 (2013-10-02)

    First draft.

    bl

Appendix I: Bib(La)TeX Entry

@report{langfeld2013xep0341,
  title = {Rayo CPA},
  author = {Langfeld, Ben},
  type = {XEP},
  number = {0341},
  version = {0.2},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0341.html},
  date = {2013-10-02/2017-09-11},
}

END