Tropo WebAPI Development Guide Home  |  Frameset Home

  Recording the Entire Call  |  TOC  |  Controlling Calls  

Transcribing Caller Input


Adding transcription to a recording really only needs the inclusion of the transcription parameter and the sub parameter url. There are, however, a couple of optional parameters you can include: id (a user definable ID that can be included when the transcription is posted) and emailFormat (the formatting for the transcription that will be sent to your transcription URI - either 'encoded' or 'omit'. Encoded includes a chunk of JSON, omit leaves it as plain text).

Although the record function will allow extremely long recordings, transcription is limited to three hours. If you attempt to transcribe something longer than that, you will not receive a transcription. Your best bet is to set the maxTime value for less than three hours - we defined it as 60 seconds in the example.

This example is an expanded version of the example shown in the Recording Audio subsection of the Answering Incoming Calls QuickStart:

require 'tropo-webapi-ruby'
require 'sinatra'

post '/index.json' do
  
  t = Tropo::Generator.new
  
  t.record({ :name => 'recording',
             :timeout => 10,
             :maxSilence => 7,
             :maxTime => 60,
             :url => "http://www.example.com/recordings.rb",
             :transcription => { :url => "mailto:you@yourmail.com",
               :id => "1234"}, 
             :choices => { :terminator => "#"}
             }) do
                  say :value => "Please leave a message"
              end
  t.response
  
end
var http = require('http');
var tropo_webapi = require('tropo-webapi');

var server = http.createServer(function (request, response) {

    var tropo = new TropoWebAPI();
	
    var transcription = {"id":"1234", "url":"mailto:you@yourmail.com"};
    var say = new Say("Please leave a message.");
    var choices = new Choices(null, null, "#");

    //function(attempts, bargein, beep, choices, format, maxSilence, maxTime, method, minConfidence, name, required, say, timeout, transcription, url, password, username)
    tropo.record(null, null, null, choices, null, 7, 60, null, null, "recording", null, say, 10, transcription, "http://www.example.com/recordings.js", null, null);
	
    response.end(TropoJSON(tropo));

}).listen(8000); 
<?php

require 'tropo.class.php';

$tropo = new Tropo();

$transcription = new Transcription("mailto:you@yourmail.com","1234", null);

$tropo->record(array(
    'name' => 'recording',
    'say' => 'Please leave a message.',
    'url' => 'http://example.com/recording.php',
    'terminator' => '#',
    'timeout' => 10,
    'maxSilence' => 7,
    'maxTime' => 60,
    'transcription' => $transcription
  ));

$tropo->RenderJson();
?>
from itty import *
from tropo import Tropo

@post('/index.json')
def index(request):

	t = Tropo()

	t.record(name = "recording", timeout = 10, maxSilence = 7, maxTime = 60, choices = {"terminator": "#"}, transcription = {"id":"1234", "url":"mailto:you@yourmail.com"}, say = "Please leave a message.", url = "http://www.example.com/recordings.py")
	
	return t.RenderJson()

run_itty(server='wsgiref', host='0.0.0.0', port=8888)
{
   "tropo":[
      {
         "record":{
            "say":{
               "value":"Please leave a message"
            },
            "name":"recording",
            "timeout":10,
            "maxSilence":7,
            "maxTime":60,
            "url":"http://www.example.com/recordings.php",
            "transcription":{
               "id":"1234",
               "url":"mailto:you@yourmail.com"
            },
            "choices":{
               "terminator":"#"
            }
         }
      }
   ]
}

Once the call finished, we'd likely see something like this in our email:


Comfortable with recording and transcribing?

Next Step: Controlling Calls


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  Recording the Entire Call  |  TOC  |  Controlling Calls  

© 2012 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site