How to Build a Smarter International Phone with Twilio in Just 15 Minutes

Matthew Guay
Matthew Guay / Published September 9, 2014

The phone app is one of the least smart parts of your phone. It’s still tied to one phone network, with a number from your local area, and likely costs per minute you talk, depending on where you’re calling and where you live. Travel outside your country, and your phone app will either cease to work or charge you an arm and a leg for roaming.

Plenty of apps—from now-defunct services like Dialpad.com to modern standbys like Skype and Google Voice—have tried to change the way we make calls, but most still leave the original phone service untouched. Google Voice changed that by actually taking over your phone's calls and texts and making them smarter, but it requires you to have a U.S. number. Plus, Google itself seems more focused on Hangout video calls than improving legacy calls.

Then, there’s Twilio, the phone service for the internet. It’s turned voice calls and SMS messages into an API that you can easily integrate with another app. And, for the rest of us who aren’t developers—especially those who live abroad, like myself—it’s an easy way to get a phone number in dozens of countries, make calls on the cheap to almost anywhere, automate text messages through Zapier, and so much more without any coding.

Here’s how I’ve put together a nearly perfect U.S. phone number setup that pushes all calls and SMS messages to my Thailand cell phone, and some great ways to put your much smarter phone to work for you and your business.

The Twilio Setup

Twilio Setup

Setting up Twilio is surprising easy, especially when you contrast it with the amount of paperwork you’ll have to go through to get a normal phone number. Go to twilio.com/try-twilio, enter your contact info, then enter your phone number, and you’ll get a new US phone number at the next screen. It’s a fully functional number that’s yours to keep. If you prefer another number, just search through the available options and find the area code you like, and pick the new number of your choice.

It sounds too simple to be true, so Twilio has you test it out. On the next screen, you can enter a message, then call your new number and hear it read back or have your new number call you and read the message aloud. Then, you can send and receive an SMS right from your new number—yes, your Twilio number acts like a cell phone number. It’s way simpler than you’d likely have expected for a phone service aimed at developers.

Testing Twilio

You still have a bit of work to do to get your new number working with your real phone number, though, so don’t start celebrating just yet. You’ll first need to add credit to Twilio, with a minimum deposit of $20 from PayPal, though you likely won’t go through it quick with low call and SMS rates and numbers costing $1/month.

Then it’s time to hook everything up. Here are the steps:

1. Redirect Calls to Your Real Phone Number

Twimlets Robots

The simplest way to receive calls with Twilio—short of coding a new solution, something we’re specifically avoiding in this tutorial—is to have Twilio forward your calls to your real number. That’s made simple with Twimlets, tiny web apps with URL parameters to let you do just about anything you want with Twilio voice calls. With them, you can forward calls to another number or to voicemail, play a recording, build a conference call line, and so much more with just a little URL. We’ll take a closer look at Twimlets in a minute, but first, let’s get your calls forwarded.

Go to your Twilio Phone Numbers page, select your phone number, then in the Request URL box under Voice, enter the following URL, replacing the phone number with your phone number, with or without dashes (and with your country code if it’s a non-U.S. number):

http://twimlets.com/forward?PhoneNumber=123-456-7890

Save your settings, then call your new number from a different phone, and your original number specified in the URL should ring with the call. Feel free to talk to yourself as much as you want, marveling at how easily it was to get your new number connected.

Now, there’s one more thing to mention if you have a non-U.S. number, as I do, and want to use Twilio. For most countries, you’ll need to enable your Geographic Permissions and likely email Twilio support to get your account approved for international calls. That could take a day or two, but once that’s done, you can add your phone number with the Twimlet just like everyone else, and get calls on your international number on your local phone.

Twilio settings

There’s also a lot more you can do with Twimlets; call forwarding is only scratching the surface. Be sure to check out the Twimlets page to see how to add voicemail, call forwarding to another number if the first didn’t pick up, and more just by adding bits of text to that Twimlet URL.

2. Make Calls from Your New Number

Twilio Phone Apps

You won’t be able to make calls out from your Twilio number directly from your smartphone’s phone app anytime soon, but you can get pretty close with a few apps. With a bit of configuring in the Twilio SIP page, you can get most SIP (Session Initiation Protocol) apps to work with Twilio for making calls—and receiving them, of course, if you’d rather receive calls via software rather than via your traditional phone number. The steps will vary depending on the app, but in general, it should be relatively simple.

Or, there’s an even simpler way: use an app that works directly with Twilio. There’s not as many as you might think, but there’s at least one each for iOS and Android: PCC Phone and Twilioid, respectively. They’re basic apps, but once you sign in with your Twilio info, you’ll be able to make calls out to nearly any phone number you want around the world.

3. Send an SMS Message

SMS from Google Docs
When you combine Twilio with Zapier, you can set up all sorts of creative SMS integrations, such as sending a text message when you add a row to Google Docs spreadsheet.

Gmail used to let you send SMS messages for free from the Chat in Gmail, and most cell carriers have a site where you can send a one-off message for free, provided you know your recipient’s carrier. But now, with Twilio, you’ll be able to send SMS messages from any app you want, using your own phone number.

The most direct way to send SMS messages through Twilio is via Terminal using the curl command. Open Terminal and enter the following, replacing AccountSID, AuthToken, and YourPhone with the correct info from your account, which you can see on the top of your Twilio dashboard.

curl -X POST https://api.twilio.com/2010-04-01/Accounts/_AccountSID_/SMS/Messages.json \
    -u AccountSID:AuthToken \
    --data-urlencode "From=+YourPhone" \
    --data-urlencode "To=+16304006992" \
    --data-urlencode 'Body=Howdy from terminal'

Replace the Body of the message with anything you want, press your return key, and your SMS will be sent.

Or, you could use Zapier, an app integration and automation tool, to send SMS messages for you. With Zapier, you can send SMS messages via email or add a new row in a Google Docs spreadsheet to send an SMS. Just hook up whichever app’s most handy to you during the day, and set up Zapier to send SMS messages from it via your Twilio account. And if you’re feeling more adventuresome, you could set up more advanced Zapier automations that’d SMS people when they fill out your form, and more. There are hundreds of ways you can automate sending SMS messages with Zapier and Twilio.

Send SMS Messages via Email

4. Receive SMS Messages

Message Log

If you’re sending out SMS messages, odds are you’ll get a few back. Twillo will always store every message sent and received, so the simplest way to get your messages (assuming they’re not urgent, or you know when to expect them—like SMS messages for 2-factor authentication) is from your Twilio account. Go to your Twilio Numbers page, select your number, then click the View Messages Inbound link near the bottom of the page. There, you’ll see all your message records, and can select an individual one to view it.

Or, you can again turn to Zapier to automate your SMS workflow. Use Zapier and your Twilio account to forward any SMS messages received to your real cell phone number, or get a Pushbullet push notification on your phone when you receive a new Twilio SMS which is what I’m using to get my U.S. SMS messages in Thailand. Or, you could forward your SMS messages to your email inbox, a great option if you’re already using Zapier to send SMS messages by email. Once again, you could really use almost any app to receive SMS messages with Zapier, letting them show up in your chat, project management, CRM, or any other app you want. No reason to keep your Twilio messages tied to a phone!

Forward Twilio SMS Messages to Your Cell Phone Number

One more option is receiving your SMS messages directly as push notifications on your Mac, using the open source Lerner webhooks notification app, which was featured by Twilio. It’s a great, simple way to get SMS messages while you’re working, without having to check anything else.

Build the Phone You’ve Always Wanted

Those steps will get you the basics of sending and receiving calls and SMS messages with Twilio, but that’s only scratching the surface of what you can do. The Twimlets give you power to make a simple automated menu system that reroutes calls to the correct number, complete with hold music. You could make a conference call system, your own custom voicemail, or a “find me” routine that rings all of your numbers in order to make sure you get calls no matter where you are.

Then, you can have Twilio save voice recordings of your messages, transcribe them for a small fee if you want, then have Zapier save your voice recordings to Dropbox or another storage service, and log all of your calls in a Google Docs spreadsheet for your records. That way you can have your own visual voicemail of sorts on your virtual number.

Save your Twilio call recordings into Dropbox

There’s so much more you can do with some coding, but even with Twimlets and Zapier, you can do quite a bit with a Twilio number. It’s worked out great for me as an U.S. number that works abroad, and I’d love to hear how you put Twilio to use for your work and more!

Credits: Phone photo courtesy Clemson.

Get Productivity Tips In Your Inbox

Learn about workflow, company building, and how to get things done.

Load Comments...

Comments powered by Disqus

Workflow

Take the Work out of Workflow

Zapier is the easiest way to automate powerful workflows with more than 1,500 apps.