Tropo rayo extensions

mpermar edited this page Sep 19, 2011 · 2 revisions

These extensions to the Rayo protocol are high-level application constructs from Tropo. They are not necessary for a complete implementation of Rayo.

Say Component

  <iq id='1234' type='set' to='9f00061@call.rayo.net/1' from='16577@app.rayo.net/1'>
    <say xmlns='urn:xmpp:tropo:say:1' 
        voice='allison'>
      <audio src='http://acme.com/greeting.mp3'>
          Thanks for calling ACME company
      </audio>
      <audio src='http://acme.com/package-shipped.mp3'>
          Your package was shipped on
      </audio>
      <say-as interpret-as='date'>12/01/2011</say-as>
    </say>
  </iq>

Commands

  <!-- Client pause the say -->
  <iq id='1234' type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <pause xmlns='urn:xmpp:tropo:say:1' />    
  </iq>

  <!-- Client resumes the say -->
  <iq id='1234' type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <resume xmlns='urn:xmpp:tropo:say:1' />    
  </iq>

Events

  <!-- Playback completed successfully -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <success xmlns='urn:xmpp:tropo:say:complete:1' />
    </complete>
  </presence>
  
  <!-- Component was stopped -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <stop xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>
  
  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <hangup xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <error xmlns='urn:xmpp:rayo:ext:complete:1'>
        Something really bad happened
      </error>
    </complete>
  </presence>
  

Ask Component

  <iq id='1234' type='set' to='9f00061@call.rayo.net/1' from='16577@app.rayo.net/1'>
    <ask xmlns='urn:xmpp:tropo:ask:1'
        bargein='true'
        min-confidence='0.3'
        mode='speech|dtmf|any'
        recognizer='en-US'
        terminator='#'
        timeout='12000'>
      <prompt voice='allison'>
        Please enter your four digit pin
      </prompt>
      <choices content-type='application/grammar+voxeo'>
        [4 DIGITS]
      </choices>
    </ask>
  </iq>
<choices /> is required

Events

  <!-- Successfull Input -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <success mode="speech" confidence="0.45" xmlns='urn:xmpp:tropo:ask:complete:1'>
        <interpretation>1234</interpretation>
        <utterance>one two three four</utterance>
      </success>
    </complete>
  </presence>
  
  <!-- Incorrect Input -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <nomatch xmlns='urn:xmpp:tropo:ask:complete:1' />
    </complete>
  </presence>  

  <!-- No Input Provided -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <noinput xmlns='urn:xmpp:tropo:ask:complete:1' />
    </complete>
  </presence>  

  <!-- Component was stopped -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <stop xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <hangup xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <error xmlns='urn:xmpp:rayo:ext:complete:1'>
        Something really bad happened
      </error>
    </complete>
  </presence>

Transfer Component

  <iq id='1234' type='set' to='9f00061@call.rayo.net/1' from='16577@app.rayo.net/1'>
    <transfer xmlns='urn:xmpp:tropo:transfer:1'
        from='tel:+14152226789'
        terminator='*'
        timeout='120000'
        answer-on-media='true'>
      <to>tel:+4159996565</to>
      <to>tel:+3059871234</to>
      <ringback voice='allison'>
        <audio src='http://acme.com/transfering.mp3'>
            Please wait while your call is being transfered.
        </audio>
      </ringback>
      <header name="x-skill" value="agent" />
      <header name="x-customer-id" value="8877" />
    </transfer>
  </iq>

Events

  <!-- Transfer completed and B leg disconnected. The A leg is joined back to 
       the media server and is free to run additional components -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <success xmlns='urn:xmpp:tropo:transfer:complete:1' />
    </complete>
  </presence>

  <!-- Timeout Expired  -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <timeout xmlns='urn:xmpp:tropo:transfer:complete:1' />
    </complete>
  </presence>

  <!-- Caller pressed terminator  -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <terminator xmlns='urn:xmpp:tropo:transfer:complete:1' />
    </complete>
  </presence>

  <!-- Destination was busy  -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <busy xmlns='urn:xmpp:tropo:transfer:complete:1' />
    </complete>
  </presence>

  <!-- Destination rejected the call  -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <reject xmlns='urn:xmpp:tropo:transfer:complete:1' />
    </complete>
  </presence>

  <!-- Component was stopped -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <stop xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <hangup xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <error xmlns='urn:xmpp:rayo:ext:complete:1'>
        Something really bad happened
      </error>
    </complete>
  </presence>

Conference Component

  <iq id='1234' type='set' to='9f00061@call.rayo.net/1' from='16577@app.rayo.net/1'>
    <conference xmlns='urn:xmpp:tropo:conference:1'
        name='1234'
        mute='false'
        terminator='#'
        tone-passthrough='true'
        moderator='true'>
      <announcement voice="allison">
        Jose de Castro has entered the conference
      </announcement>
      <music voice="herbert">
        The moderator how not yet joined.. Listen to this awesome music while you wait.
        <audio src='http://www.yanni.com/music/awesome.mp3' />
      </music>
    </conference>
  </iq>

Commands

  <!-- Mute this participant -->
  <iq id='1234' type='set' to='9f00061@rayo.net/d951cc41' from='16577@app.rayo.net/1'>
    <mute xmlns='urn:xmpp:rayo:1' />
  </iq>

  <!-- Unmute this participant -->
  <iq id='1234' type='set' to='9f00061@rayo.net/d951cc41' from='16577@app.rayo.net/1'>
    <unmute xmlns='urn:xmpp:rayo:1' />
  </iq>

  <!-- Kick this participant, Do we need this? -->
  <iq id='1234' type='set' to='9f00061@rayo.net/d951cc41' from='16577@app.rayo.net/1'>
    <kick xmlns='urn:xmpp:tropo:conference:1'>asshole</kick>
  </iq>

Events

  <!-- Indicates that this participant has been put on hold -->
  <presence to='16577@app.rayo.net/1' from='9f00061@rayo.net/d951cc41'>
    <on-hold xmlns='urn:xmpp:tropo:conference:1'/>
  </presence>

  <!-- Indicates that this participant has been put back into the conference -->
  <presence to='16577@app.rayo.net/1' from='9f00061@rayo.net/d951cc41'>
    <off-hold xmlns='urn:xmpp:tropo:conference:1'/>
  </presence>

  <!-- Participant was kicked from the conference -->
  <presence to='16577@app.rayo.net/1' from='9f00061@rayo.net/d951cc41'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <kick xmlns='urn:xmpp:tropo:conference:complete:1'>wouldn't stop talking</kick>
    </complete>
  </presence>

  <!-- Participant pressed the terminator -->
  <presence to='16577@app.rayo.net/1' from='9f00061@rayo.net/d951cc41'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <terminator xmlns='urn:xmpp:tropo:conference:complete:1' />
    </complete>
  </presence>
  
  <!-- Component was stopped -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <stop xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <hangup xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <error xmlns='urn:xmpp:rayo:ext:complete:1'>
        Something really bad happened
      </error>
    </complete>
  </presence>