Tropo WebAPI Development Guide Home  |  Frameset Home

  Quickstarts  |  TOC  |  Playing Audio Files  

Answering Incoming Calls


Voice applications are at the heart of Tropo - it's where it all began. We took all the complexity out of the process and made both responding to phone calls and making new calls as simple as possible. Behind Tropo's simplicity is a powerful voice API that includes features like speech recognition, text to speech, call recording and more.

This Quickstart will walk you through receiving and manipulating an incoming call using Tropo.

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

post '/index.json' do

    t = Tropo::Generator.new

    t.say "Welcome to Tropo!"

    t.response
end

var http = require('http');
var tropo_webapi = require('tropo-webapi');

var server = http.createServer(function (request, response) {
	
	var tropo = new TropoWebAPI();

	tropo.say("Welcome to Tropo!");
	
	response.end(TropoJSON(tropo));

}).listen(8000); 
<?php

require 'tropo.class.php';

$tropo = new Tropo();
$tropo->say("Welcome to Tropo!");
$tropo->RenderJson();

?>
from itty import *
from tropo import Tropo

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

    t = Tropo()
    t.say("Welcome to Tropo!")
    return t.RenderJson()

run_itty(server='wsgiref', host='0.0.0.0', port=8888)

{
   "tropo":[{"say":{"value":"Welcome to Tropo!"}}]
}

Answer is handled automatically for you, and hangup is optional as the call will disconnect when the script ends.

Want to use an audio file instead of Text To Speech (TTS)?

Next Step: Playing Audio



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

login
  Quickstarts  |  TOC  |  Playing Audio Files  

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