Created
October 6, 2011 18:01
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl "http://api.tropo.com/1.0/sessions?action=create&token=your-token-goes-here" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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