Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Migrate from Tropo to the Twilio API

Tropo announced that they are closing their platform to developers and customers.

To the developers who built on Tropo, we know you’re shifting roadmaps and re-allocating story points to migrate your applications as soon as possible. We’re here to help ease your transition from your Tropo application to Twilio's SMS and Voice APIs.

Tropo migration timeline

Tropo stated that the wind-down of their services and support began in October 2018 and would continue in phases. Tropo has notified all of their contracted customers, and their developer program and credit card customers have received or should expect a notification covering timelines and next steps.

To migrate your communication applications without any interruption, we recommend migrating your logic to Twilio as soon as possible. This guide details how to migrate from Tropo's SMS or Voice APIs to Twilio.

Register for a Twilio account

Create a free Twilio by registering here. You should verify your personal phone number when asked. Your new account will be in trial mode, which is perfect for development.

After registering, you may use our promo code welcometotwilio in the developer console for $20 in account credit. We’ll cover more details about your trial account in the Upgrade step below.

Purchase a phone number

Your trial account includes a free phone number. Head over to the Buy a Number page and search for one you like.

Once you find the number, click the Buy button, then in the resulting dialog click Buy this number. We’ll set up this number later in the guide, and it will work seamlessly for development.

You may also port your existing Tropo phone number(s) to Twilio. More information about porting is described in the porting step below.

Download the Twilio server-side SDK

Twilio Server-side SDKs make it easy for you to use Twilio's REST APIs, generate TwiML, and do other common server-side programming tasks. These helper libraries are available in a variety of popular server-side programming languages:

Set up your development environment

The guides below cover how to set up a local environment for Twilio development.

If you already are set up for web development, skip to the next step.

These guides include creating a new project, installing the Twilio server-side SDK, creating a simple web application that responds to TwiML requests, and making your application’s endpoint available to the internet using ngrok.

Develop your Tropo application on Twilio

As an optional step before starting development, it can be helpful to complete a Twilio SMS or Voice Quickstart. These 5-15 minutes tutorials demonstrate what it takes to get a small Twilio application running and will acquaint you with building on the platform.

When you’re ready to begin developing your app, there are a few options to help kick off building your Tropo app on Twilio.

Option 1: Refactor your code to use the Twilio API and TwiML.

Let’s take a look at how we’d migrate a few basic Tropo applications to Twilio. Here’s an example of a Tropo Web API JSON file that will answer a call, play a message using text-to-speech, play an audio file to the caller, and then disconnect.

{
  "tropo":[{"say":{"value":"Guess what? https://www.tropo.com/docs/troporocks.mp3"}}]
}

Tropo also supports a scripting API. Here’s an example of the same application using Tropo Scripting:

say("Guess what? https://www.tropo.com/docs/troporocks.mp3")

To recreate this application in Twilio, we’ll use TwiML, a set of simple XML tags used to pass instructions to Twilio. To replicate the Tropo example above, you would place this XML file on your web server:

<Response>
   <Say>Guess what?</Say>
   <Play>https://www.tropo.com/docs/troporocks.mp3</Play>
</Response>

Though the syntax is different, you can see the file contents and intentions are very similar.

TwiML is a small and simple language, yet it is powerful and expressive.

TwiML can be structured to create longer, more interactive call flows. You can use your favorite web programming language or framework to add conditional logic to the TwiML your application returns or to save caller information or call recordings to a database.

Differences between Tropo and Twilio Development

Tropo

Twilio

Tropo applications specify the file which defines your communication application, and it can be bound to a phone number.

Twilio communications applications are defined by software applications you create which can be hosted on your own servers or hosted on Twilio. These applications contain a combination of REST API calls to initiate outbound communications and a simple XML format called TwiML to handle inbound communication. The entry point for an inbound workflow is a URL on your server which is bound to one or more phone numbers.

The Tropo Scripting API is one option for programming communications applications and is hosted on Tropo.


The Tropo Web API is another option for programming communications applications, using a JSON format and hosted on your server.

Twilio is not compatible with Tropo’s scripting API or Tropo’s Web API. Twilio applications use the APIs, SDKs and TwiML language described above. You can host your application on your own web server or host your application on Twilio using Javascript.

Outbound applications require an HTTP launcher request to initiate the application.

Outbound communications are performed by a catcher app.

Outbound communications in Twilio are initiated by making a POST request to the REST API. Twilio’s API to send SMS does not require any further instruction (StatusCallback can optionally report back to your application message result).

Twilio’s API to make calls requires a URL parameter, which specifies a webhook in your application which instructions that define the call behavior and returns this as TwiML.

Call and message metadata is sent in JSON and stored in the session metadata

Twilio sends this data as parameters in TwiML requests. Check out the list of voice and messaging parameters.

For example, your application can discover the details of an inbound SMS message by examining the To, From, and Body parameters included in the TwiML webhook.

Associating your TwiML app with a phone number

To associate a json flow with a phone number in Tropo, you would create a Tropo application, add a phone number to that application, and enter the json file URL into that application. With Twilio the process is similar.

Start by creating a TwiML application in the Twilio console and enter URLs which return your application’s TwiML. Then, configure your Twilio phone numbers by choosing to configure with TwiML app and set your newly created TwiML app as your Voice or SMS request URLs.

You can also bypass creating TwiML applications by configuring phone numbers with webhook URLs directly - enter the URLs into the phone number’s configuration field. After saving your settings, you’ll find that dialing them triggers Twilio to request the TwiML Url, and Twilio will handle the calls according to the instructions in the TwiML.

Option 2: Modify a Tutorial

Twilio tutorials provide complete and annotated code listings for example apps that solve many communications use cases. Sample code is available in many programming languages and can be customized to your needs. Re-using these code samples can speed your time to production.

Find the tutorial for the use case closest to your Tropo application below:

Option 3: Build your Twilio application from scratch

Sometimes a fresh start is easiest.

Start a new Twilio project and take advantage of all our APIs, tools, and flexibility.

Whichever option you choose, here are some Twilio API basics to help you along the way:

Twilio REST API

Use the REST API to initiate outbound communications, such as placing calls or sending messages, as well as to find and purchase phone numbers and manage your Twilio account configuration.

API Authentication is done using HTTP basic auth - provide your Account Sid and Auth Token found here. The REST API documentation is the definitive guide to this service and will come in handy during development.

Client SDKs in your favorite programming language of choice are available and are typically preferred for development.

The API Explorer is an interactive tool to explore and make API requests from your browser and is a great place to start when getting to know the Twilio REST API.

Webhooks and TwiML

Twilio uses webhooks to notify your application when certain events in the telecom network occur, such as when calls or text messages to your phone numbers are received. You can configure your Twilio numbers and specify the URLs Twilio should request for these events.

These requests contain parameters detailing who the call or text is from as well as the status of the call or message. Check out the list of voice and messaging parameters. For example, your application can discover the details of an inbound SMS message by examining the To, From, and Body parameters included in the webhook.

TwiML (Twilio Markup Language) is the way your application responds to Twilio’s webhooks and instructs Twilio on how to respond to message or calls in progress.

TwiML is a set of roughly a dozen XML tags which use verbs and nouns to define a call or message flow.

For example, let's say you want Twilio to read a text-to-speech message, then take a 20-second recording of the caller's voice. When Twilio sends your app a webhook request, you could respond with TwiML (XML) that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <Say voice="alice">Please leave a message after the tone.</Say>
   <Record maxLength="20" />
</Response>

To get more detailed information and sample code, please visit these links:

Upgrade your Twilio account to remove trial restrictions

New Twilio accounts come with a free trial which includes a complimentary billing balance for you as you develop and prototype. However, there are some limitations to the trial, and you may wish to upgrade during development or when you are ready for production.

To upgrade, please go to the billing page and provide your payment information.

Here are some common limitations you’ll observe when developing with a Twilio trial account. You can also view more details about how the trial works.

  • Only one Twilio number is allowed per trial account.
  • As a security measure, you must verify any non-Twilio phone number before calling it.
  • Calls from your trial account will play a short trial message before your TwiML runs.
  • Calls are limited to 10 minutes.
  • There are a limited number of countries your Twilio account can make calls to in trial.
  • If your trial phone number is unused for more than 30 days, it will be removed from your trial account.

Deploy your application to production

When development is complete, you’re almost to the finish line.

Running your application on a laptop is great for testing, but in production Twilio needs to be able to access your application reliably whenever a call or message comes in. If your application happens to be unavailable or takes too long to respond, the caller may hear an error message.

Your own hosting

If you already maintain a server in a data center or other location, you can utilize it to host your Twilio application. Other popular self-hosting options include cloud providers like Amazon AWS, Google Cloud Platform, Windows Azure. Platform services such as Heroku are also popular.

Twilio hosted options

Twilio offers several solutions that can host your application. If your application only requires TwiML (e.g., only relies on inbound flows), consider TwimlBins or Twimlets. If you need complete access to Twilio’s the server-side Javascript SDK and the REST API, Twilio Functions has you covered.

  • TwiMLBins provide cloud hosting of TwiML documents. You can prototype simple solutions like SMS or call forwarding and conference calls.
  • Twimlets are tiny web applications that implement a set of basic voice functionality. Twimlets can quickly enable Call Forwarding, Voicemail, Conferencing and more.
  • Twilio Functions is a 'serverless' Node.js service which allows you to write and run Twilio code without dealing with servers. You provide Node.js code for handling events such as an incoming phone call and Twilio executes this code on your behalf.

Submit a porting request and configure your ported numbers

The process of moving a phone number from one operator to another is called porting. If your requirements call for keeping your current phone numbers operational, you can port your numbers to Twilio where they can seamlessly continue to operate.

To avoid any service interruption, you can port your Tropo phone number(s). You will need to complete these steps about a month before Tropo services are retired:

  1. Do not terminate your existing service with Tropo.
  2. Fill out a Letter of Authorization.
  3. Obtain a Customer Service Record.
  4. Create a porting in request in the Twilo console, listing all the Tropo number you would like to bring to Twilio.
  5. When Twilio accepts the porting request, your Tropo numbers will be available for configuration in the Twilio console, even though they haven’t ported yet. This gives you the opportunity to pre-configure voice application URLs and SMS application URLs.
  6. When the porting completes, your numbers will cut over to Twilio. If you pre-configured settings as described above, it will be a seamless transition.

Porting a telephone number can take up to four weeks. Please refer to this guide for complete information about porting phone numbers to Twilio. We encourage you to start development as early as possible to get ahead of this process.

When the phone number port completes in approximately 1-4 weeks, you’re all set!

Looking ahead

Twilio is here to support the Tropo community. We hope this guide provides you a foundation for migrating your Tropo application to Twilio.

Our team is available to assist you along the way. If you have any questions or encounter development hurdles, please contact our sales or support team – we’re happy to help.

We can’t wait to see what you build!

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.