Hello Tropo!

March 26th, 2011 by cmatthieu

By now you have noticed that you can place free 10 minute phone calls to any number in the United States and Canada from the PhonoSDK.  Are you ready to graduate to longer calls and other powerful features such as conferencing, call recording, user input with touch tones and speech recognition, text-to-speech, and call transfers?  This is where Tropo comes in!

Let’s walk you through creating a simple Tropo application that will allow you to place calls to any phone number in the world without a time limit.

1. Sign into your Tropo account using the same credentials as your Phono account.

2. Create a Tropo Scripting API app.

3. Copy and paste this JavaScript code into the app

answer();
say("hold please");
transfer(currentCall.getHeader("x-sbc-numbertodial"));

4. Hit the “Create Application” button and that’s it on the Tropo side. You will notice that this app will also create a Phono AppID for you as well.

5. Open your Phono app and use the following code to pass your own telephone number to your Tropo app:

call = phono.phone.dial(your_phono_app_id_from_tropo, {
headers: [
{
name:"numbertodial",
value:"14805551212"
}
],

That’s it!  Here’s what we did.  We told Phono to place a SIP phone call directly into your Tropo AppID and passed the real phone number to dial in the SIP header.  Tropo answers your SIP call from Phono, says “please hold”, and transfers your SIP call to the real phone number in the SIP header.

The best part is that you did this all using only Javascript!  What will you build now?

No related posts.

Tags: , , , , ,

4 Responses to “Hello Tropo!”

  1. Mike Says:

    Where can we see all the headers passed? And why SBC? Does the provider matter or change?

  2. AJ Says:

    I already use phono app to make outgoing SIP calls using my API key. I’d like to know if the method in this post is any different. And how is Tropo/Phono able to provide SIP to PSTN calls without a time limit? When you say “calls around the world”, are these calls to SIP phones or actual PSTN numbers?

  3. cmatthieu Says:

    Voxeo has SBCs that route and pass SIP headers from Phono to Tropo. In this example, numbertodial is a variable – not a reserved word. You can pass any string name in the header of your app as described in the Phono docs and you can access them in Tropo by adding the prefix “x-sbc-”.

  4. cmatthieu Says:

    Phono can send and receive SIP calls natively. Tropo can route SIP calls to PSTN (and visa versa). This post demonstrates how to connect Phono to your Tropo account to place calls to any country using your Tropo account. If you are placing calls outside of North America, long distance rates will be billed to your Tropo account.

Leave a Reply

Please note: By submitting a comment you agree to comply with our Comment Policy. We welcome all comments, positive or negative, but do reserve the right to remove all or part of blog comments that do not comply with our policy.

Additionally, the first time you leave a comment on this blog, it will be held for moderation. After that first comment has been approved, future comments will be posted without delay.