Tropo is part of CiscoLearn More

Making a Call

Application wise, making an outgoing call requires two steps - first, you need to write the code telling Tropo who to call and what to do if/when they answer. The second step is telling Tropo to run your code. However, in order to make outbound calls or send outbound SMS at all, you will also need to verify your account. To verify your account, you'll provide a credit card to verify your identity and explain your use case. Please open an account ticket to begin the process.

Here's an example of a simple outbound app that places a quick call:

call("+447700900444");
say("Tag, you’re it!");
call "+447700900444"
say "Tag, you’re it!"
<?php
call("+447700900444");
say("Tag, you're it!");
?>
call("+447700900444")
say("Tag, you're it!")
call("+447700900444")
say("Tag, you’re it!")

You can also call multiple phone numbers or SIP addresses (or both) as an array; first to pick up, wins!

call(["+14075551212","sip:12345678912@example.com"]);
say("Tag, you’re it!");
call ["+14075551212","sip:12345678912@example.com"]
say "Tag, you’re it!"
<?php
call(array("+14075551212","sip:12345678912@example.com"));
say("Tag, you're it!");
?>
call(["+14075551212","sip:12345678912@example.com"])
say("Tag, you're it!")
call(["+14075551212","sip:12345678912@example.com"])
say("Tag, you’re it!")

To then launch the code, Tropo provides you with a URL to hit, which tells Tropo to launch your application. You also get a secret API key called a “token” that ensures only you can start your code (we recommend guarding the token like you would a password, or that exclusive ability could be jeopardized). Your token is found just under the phone numbers when you view your application in the Tropo User Interface:

To launch an application using your secret token, you can embed it directly into a URL like this:

    https://api.tropo.com/1.0/sessions?action=create&token=TOKEN

Then either run the link through a browser or utilize an HTTP client like curl or the HTTP client that comes with your favorite programming language and set it to use GET. You can also use a POST with XML if you'd prefer - this page outlines the syntax you would use.

As an alternative, you can also initiate an outbound call using an inbound text rather than via a token launch; you would need to modify the code slightly, however:

event = call("+447700900444");
event.value.say("Tag, you’re it!");
event = call "+447700900444"
event.value.say "Tag, you’re it!"
<?php
$event=call("+447700900444");
$event->value->say("Tag, you're it!");
?>
event = call("+447700900444")
event.value.say("Tag, you're it!")
event = call("+447700900444")
event.value.say("Tag, you're it!")

Note, if you're attempting to make an call to non-U.S. destinations, there are restrictions. Review this page for more information. Also, the maximum session time with Tropo is four hours, so the maximum time a call can be connected is also four hours.