Skip to content

Instantly share code, notes, and snippets.

@mheadd
Created October 6, 2011 18:01
Show Gist options
  • Select an option

  • Save mheadd/1268128 to your computer and use it in GitHub Desktop.

Select an option

Save mheadd/1268128 to your computer and use it in GitHub Desktop.
Simple example showing how to call an number and then transfer to another number with custom caller ID.
curl "http://api.tropo.com/1.0/sessions?action=create&token=your-token-goes-here"
var http = require('http');
require('tropo-webapi');
var server = http.createServer(function (request, response) {
// Create a new instance of the TropoWebAPI object.
var tropo = new TropoWebAPI();
tropo.call('14078887777');
tropo.say('Please hold while your call is transferred.');
// Will transfer call to 14078888888 with a custom caller ID of 4078889999.
tropo.transfer('14078888888', false, null, '4078889999');
// Render out the JSON for Tropo to consume.
response.writeHead(200, {'Content-Type': 'application/json'});
response.end(TropoJSON(tropo));
}).listen(8000); // Listen on port 8000 for requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment