Ben Langfeld edited this page Oct 1, 2013 · 10 revisions

Call Progress Analysis is built on top of the Input component. To start a CPA request we use a special SRGS based grammar with a 'cpa' mode:

<iq type='set' to='' from=''>
  <input xmlns='urn:xmpp:rayo:input:1' mode='cpa'>
    <grammar content-type='application/srgs+xml'>
        <?xml version="1.0"?>
        <grammar mode="dtmf" version="1.0"

          <meta name="maxTime" content="4000"/>
          <meta name="minSpeechDuration" content="4000"/>
          <meta name="minVolume" content="10"/>
          <meta name="finalSilence" content="2000"/>
          <meta name="terminate" content="true"/>
          <ruleref uri="urn:xmpp:rayo:cpa:dtmf:1"/>
          <ruleref uri="urn:xmpp:rayo:cpa:modem:1"/>

The grammar sets which signals are we interested in and passes attributes to the CPA module using meta elements.


<!-- Stop accepting input and completely stop the CPA Input Component -->
<iq type='set' to='' from=''>
  <stop xmlns='urn:xmpp:rayo:ext:1' />    

As with a regular input component, we can stop the CPA detection.


<!-- Signal Received -->
<presence to='' from=''>
  <signal type="beep" duration="2000"/>
  <signal type="dtmf" tone="1"/>
  <signal type="speech" source="human|machine"/>
  <signal type="fax" duration="2000"/>
  <signal type="fax-cng" duration="2000"/>
  <signal type="ring" duration="2000"/>
  <signal type="sit" duration="2000"/>
  <signal type="modem" duration="2000"/>
  <signal type="offhook" duration="2000"/>

We use the signal element to report CPA occurrences. Signal in this case is not wrapped by complete as we will keep getting occurrences until we stop the CPA input component.


The termination meta attribute tells the Rayo server whether the Input component should be completed upon receiving any of the specified signals or not. When termination is set to true and any of the expected signals is received your Rayo client will receive a complete event as usual, but in this case it will have the signal that triggered termination inside:

<presence to='' from=''>
  <complete xmlns="urn:xmpp:rayo:ext:1">
    <signal xmlns="urn:xmpp:rayo:input:1" duration="4690" source="machine" type="speech"/>