October 02, 2015

Writing asynchronous code is hard. When it comes to JavaScript we rely heavily on callback functions to accomplish asynchronous tasks which can be unintuitive. This cognitive overhead creates a barrier to entry for newcomers to programming and the language and even causes frequent heartburn for those of us who have been using the language a while.

In this post we’ll examine how a proposal for ECMAScript 2016 (ES7) can be used to improve our experience with asynchronous programming in JavaScript, making our code easier to understand and simpler to write.

The World of Today

Let’s start by taking a look at an attempt of asynchronous programming today. The following example uses the request library to make an HTTP request to the Ron Swanson Quotes API and prints the response to the console. Give it a spin by pasting the following into a file named app.js and running npm install request to install the dependency. If you don’t have Node.js installed you can grab it from here.

var request = require('request');

function getQuote() {
  var quote;

  request('http://ron-swanson-quotes.herokuapp.com/quotes', function(error, response, body) {
    quote = body;

  return quote;

function main() {
  var quote = getQuote();


If you’ve worked with asynchronous programming in JavaScript before you might have already spotted why we’re not going to get a quote from this code. If that’s the case then high five.

Running it with node app.js you’ll quickly see undefined printed out.

Why does this happen?

The reason that the quote variable is undefined is because the callback function that assigns it is not called until after the call to the request function is finished. But because the request function executes asynchronously, JavaScript does not wait around for it to finish. Instead, it moves on to the next statement which returns the unassigned variable. For a great explanation on how async in JavaScript works under the hood check out this amazing talk by Philip Roberts at JSConf EU.

Synchronous code is generally easier to understand and write because everything executes in the order in which it is written. Return statements are widely used and pretty intuitive in other languages but unfortunately we’re unable to use them as much as we’d like in JavaScript because they don’t work well with JavaScript’s asynchronous nature.

So why go through the struggle of battling asynchronous code? Performance. Network requests and reading from the disk are what we call I/O (input/output) operations. In synchronous I/O execution the program blocks, sitting around and waiting for data transmission to complete. If it takes 60 seconds for a database query to finish the program is sitting around doing nothing for 60 seconds. However during an asynchronous I/O operation the program can resume normal execution and deal with the results of the I/O operation whenever they come up. This is why callback functions exist but callbacks are far more difficult to work with and grok when reading the source of an application.


Can we get the best of both worlds – asynchronous code that lets us work with blocking operations but is also easier to read and write? The answer is yes thanks to the ES7 proposal for Asynchronous Functions (Async/Await).

When a function is declared as async it is then able to yield execution to the calling code while it awaits for a promise to be resolved. If you’re not familiar with promises check out one of these great resources.

You can replace the code in app.js with the following. We’ll also need to install the Babel transpiler to run it. Do so with npm install babel. Babel will transpile our bleeding edge ES7 code into a version that is runnable in today’s environment. You can learn more about Babel here.

var request = require('request');

function getQuote() {
  var quote;

  return new Promise(function(resolve, reject) {
    request('http://ron-swanson-quotes.herokuapp.com/quotes', function(error, response, body) {
      quote = body;

async function main() {
  var quote = await getQuote();

console.log('Ron once said,');

You can see that we are returning a promise that wraps the network request inside our new getQuote function.

Inside the callback passed to request we are calling the resolve function of the promise with the body of the result.

Execute the following to run this example.

./node_modules/.bin/babel-node app.js

// Ron once said,
// {"quote":"Breakfast food can serve many purposes."}

Woah. That code looks pretty cool and is close to the original attempt. It looks pretty synchronous even though it’s not.

In case you didn’t notice, Ron once said, was printed out first despite being called after main. This shows that we’re not blocking while waiting for the network request to complete.

Making Improvements

We can actually improve this further by adding error handling with a try/catch block. If there is an error during the request we can then call the reject function of the promise which will be caught as an error inside of main. Like return statements, try/catch blocks were very underused in the past because they were hard to use correctly with asynchronous code.

var request = require('request');

function getQuote() {
  return new Promise(function(resolve, reject) {
    request('http://ron-swanson-quotes.herokuapp.com/quotes', function(error, response, body) {
      if (error) return reject(error);

async function main() {
  try {
    var quote = await getQuote();
  } catch(error) {

console.log('Ron once said,');

Run this code again and you can see the exception get caught by changing the request URL to something like http://foo.


These are some pretty awesome benefits that are going to really change the way we write asynchronous JavaScript. Being able to write code that runs asynchronously, but looks synchronous and makes it easier to use common programming constructs like return and try/catch will certainly help make the language more approachable.

The best part is that we can use our new favorite feature with anything that returns a promise. Let’s take the Twilio Node.js library for example. If you haven’t used the Twilio Node.js library before you can read more about it here. You’ll also need to have a Twilio account which you can sign up for here.

Start by running npm install twilio. Then paste the following into a file named twilio.js and replace the fields in the lines marked // TODO with your own credentials and numbers.

./node_modules/.bin/babel-node twilio.js

var twilio = require('twilio');


async function sendTextMessage(to) {
  try {
    await client.sendMessage({
      to: to,
      body: 'Hello, Async/Await!'
    console.log('Request sent');
  } catch(error) {

sendTextMessage('YOUR_PHONE_NUMBER'); // TODO
console.log('I print out first to show I am async!');

Just like we showed above with the getQuote function, we’ve marked sendTextMessage as async which allows it to await the resolution of the promise returned from client.sendMessage.

Wrapping it Up

We’ve seen how we can take advantage of a proposed ES7 feature to improve our experience writing asynchronous JavaScript.

I’m really excited for the Async/Await proposal to move forward but while we wait for that we’re able to use Babel to take advantage of this today with anything that returns a promise. The proposal recently hit the candidate stage (stage 3) and is in need of usage and feedback. Have a go at using it with the next awesome thing that you build and be sure to let me know on in the comments or on Twitter @eddiezane.

Async/Await: The Hero JavaScript Deserved

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

October 01, 2015

If cancer were a person, I’d punch it in the face. But, it turns out that’s neither a viable method of treatment, or a fight that has any chance of actually taking place.


One thing that does help people struggling with cancer is emotional support from friends and family. A simple text or call goes a long way. A friendly reminder to perform self-checks for cancer, or adopt a healthier lifestyle goes even further. This past weekend at the Coders vs Cancer hackathon, a few developers built an app that helps bring friends and family together to form a support network powered by communication called Circly.


For their efforts, Mike, Madelena, Kennedy, and Sarah won $10,000 and are now taking Circly to the next level, this Monday at It Never Was A Dress: STEAM, Social Justice, and Radical Gestures.


Madelena says it plainly – cancer has a stigma. A majority of the conversations surrounding it are negative. But the folks behind Circly believe it doesn’t have to be that way. By giving people a systematic way to support each other to work through or prevent cancer, Circly is hoping to eliminate that stigma.




Here’s how the service works. You sign up, fill out a profile, and invite a few friends. You’ll get Twilio SMS, email, or Twilio Voice alerts reminding you to preform self checks, or change certain habits from your friends.


Mike Caprio, one of the developers behind the service gave us a rundown. “As an example: you get an SMS text saying you should call/contact your mom and ask her if she’s performed her regular breast self-exam. You reply to the text to confirm that you received the message and will contact your mom – otherwise if you don’t reply within a period of time, the system picks the next person in the circle and asks them to contact your mom.”


The crux of Circly’s philosophy is to make the reminders more than an alert or automated prompt – each reminder should feel personal, because it’s from a friend.


We’ll keep you posted on Circly’s news and announcement coming this Monday.


Circly Fights Cancer With Community: Building A Support System With Twilio

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

Part of our Back to the Basics Series. See also: PSTN, VoIP, and SIP Trunking. It’s not cliché to say that telephony comprise some of the... …read more

The post The Wonderful and Complex World of Telephony appeared first on Plum Voice.

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 30, 2015

I'm embarking on a new adventure that doesn't involve Lync, Speech or IVRs

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 29, 2015

Part of our Back to the Basics Series. See also: PSTN, VoIP, and Telephony. SIP trunking sounds like something one does on a vacation in warm... …read more

The post What SIP Trunking is and How it Can Save You Money appeared first on Plum Voice.

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

Regional accents often pose problems for speech recognition systems, and the problems are often compounded further when dealing with in-car voice systems because of road, wind, and traffic noise and other conversations among the vehicles’ occupants. Luckily. Ford, working with Nuance Communicaqtions, has endowed its SYNC in-car voice system with understanding for a wide selection of regional accents. SYNC, which allows Ford […]

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

Programmable phone numbers for SMS, MMS and Voice are at the core of Twilio’s platform. For a new customer, the first interactions in the Account Portal are often the purchase and configuration of a phone number, while advanced users rely on powerful phone number management, through the portal and the Phone Number Search API, to efficiently deploy large-scale applications. Today, we are excited to introduce several changes to how numbers are managed in the Account Portal improving usability across products.

Let’s start with why we made the change. We’ve seen an evolution in the use and value of the humble phone number. Today, a phone number is an identity or a brand as much as it is the identifier of a communication endpoint. Consumers use their phone numbers as a means of authentication. Sharing economy businesses use Twilio Phone Numbers as a proxy to connect customers with service professionals without revealing either party’s personal phone number for privacy reasons. As the importance of phone numbers has grown, we have redesigned our UI to reflect this.

Starting today, all phone numbers associated with your account, as well as the ability to purchase new numbers, are accessible at the highest level in the Account Portal, by selecting Phone Numbers in the drop-down menu. Phone Numbers, as part of the Connectivity group of offerings, provides a comprehensive view of all numbers used across products.


Inside Voice, SMS & MMS, the Phone Numbers section shows all numbers used in conjunction with those services.


We are also introducing an improvement to the number purchasing flow: when buying a number within Voice, SMS & MMS, an overlay window appears to search and select the number, without losing the context from which it was invoked.


We hope you find these changes useful as you deploy your communications apps with Twilio. Please email us at help@twilio.com if you need any assistance.

Introducing New Phone Numbers Management in the Twilio Account Portal

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

When Mario gets his power-ups, do you pay attention to the (fire) flower or what Mario does with the power-up? The answer in all it’s Koopa-crushing glory, is Mario. The same principle applies for this very blog.

Here on the blog, we’re focused on what you build with Twilio, how you did it, and inspiring and equipping you to build the next thing your heart desires. The blog is a critical piece of that process.

With the help of our lovely design team, Swanky, we’ve redesigned the blog to make it easier to navigate, explore and build with Twilio. Think of it as your new Super Mario Bros Global map. We’re trying to make finding resources, inspiration, and updates as simple as finding out that the princess is in another castle.

That said, let’s see what’s new with the blog. As always, your feedback is encouraged.

Build More With …

There’s an uneasy feeling you get when you near the end of an awesome post. You’re not sure what you want to hack on next. To alleviate that, we’ve added a section at the end of  posts that recommends other technical posts in the same language you’re building with.

Screenshot 2015-09-29 13.50.31

See it in action on Sam’s latest jamming JavaScript post.

Explore Posts by Stack or Product

It’s hard to pinpoint a specific hack you want to work on next. But, it’s easy to browse for inspiration. Now you can browse posts by the stack you’re building with or the product you want to hack on. We hope this will be of service the next time you fancy to finally give that new language a try or you want to dive right into your area of expertise…


Try it out by seeing what you can build if you want to sling some Python or maybe enter the wonderful world of building of Voice apps.


Do you like to read the Twilio blog on your phone or tablet? Good news. This new design is responsive. It’s built to be easy to read on screens both large and small.

Have thoughts or suggestions for the new blog? We’d love to hear them, drop ‘em in the comments below.


Here We Go!: Introducing The New Twilio Blog, As Explained In Terms of Super Mario Bros

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 28, 2015

Tropo’s the presenting sponsor at API:World this week in Santa Clara, CA, and we’ve got some big things going on. We participated in a massive hackathon there this weekend (more on that later), have a couple of sessions about how to productize your APIs, and are giving everyone a pocket-sized USB battery to keep your devices charged up while you’re at the show.

But what you really need is coffee. We’ve got you covered there, too. You don’t even need to stand in line to get your double espresso fix.

Visit Tropo in the Expo hall and text our baristas your coffee order. You’ll find the number at our booth. When your coffee’s ready, we’ll text you back so you can go grab it.

Tropo’s communications API: Keeping both you and your mobile phones fueled up for API:World.

The post Grab some Tropo coffee at Integrate + API World appeared first on Tropo.

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 25, 2015

Steph Curry is a champion, and MVP. Here in the Bay Area, he’s more like a demi-god. In a 2009 draft report, a scout lambasted Steph’s abilities saying that he would never lead a team at the highest level. Then, in 2015, Steph led The Golden State Warriors to world championship.

The difference maker for Steph, aside from ignoring critics, was coaching. One on one coaching changed his game, and now he’s investing in a company that helps coaches and players work together, CoachUp.

Typically, booking, paying, and communicating with a coach takes place over multiple platforms and devices. CoachUp takes all of that, simplifies it, and puts it on a platform. Using CoachUp’s platform, coaches can communicate with clients (and vice versa) using Twilio powered text messaging. Neither party has to reveal their “real” number, they’re all assigned Twilio numbers they can use from the app.

CoachUp found out what happens when one coach is almost too good at their job — they get a ton of replies from athletes. The problem is there’s a limit on how many conversations coaches can have – 50. It seemed like CoachUp had two options: cap the coaches’ conversations, or buy more Twilio numbers. They got creative, wrote some great code and made a third option: recycle the numbers.

Let’s Recycle Some Numbers – And Use A Stephen Curry Hypothetical

Let’s say in an alternate (and awesome) universe Steph Curry was your coach. When Steph Curry sends a text message to his pupils from the CoachUp platform, he’s going to get a ton of replies. He’s Steph Curry. To allow Steph to text all his all star students via Twilio, CoachUp recycles numbers so he can have conversations with all his students, 50 at a time.

CoachUp developer Ji Jiapeng explained how the team designed the feature. “Our product manager, Justin actually came up with the idea of recycling allocated phone numbers for the recipient of a repliable SMS” said Ji. “A popular coach could easily exhaust the phone number pool cap when a lot of athletes are contacting him or her. However, not all of the conversations from the athletes are going to be indefinitely ongoing. So to ensure the popular coach, is still able to receive repliable SMS, after the cap for the coach is reached, we will use a preemptive approach to dis-associate (recycle) numbers of a conversation that has been inactive for a while (3 months was the number we picked).”

You can read CoachUp’s rundown on how they built repliable SMS right here.

Here’s how two of the core pieces of code powering repliable SMS work, as explained by Jiapeng.

In code, to find a set of candidate repliable phone numbers, would look something like:

domain_of_repliable_numbers = PhoneNumberDirectory.repliable_phone_numbers

john = User.where(id: john_user_id)
allen = User.where(id: allen_user_id)

in_use_numbers = Conversations.
  for_user('coach_user_id = ? OR client_user_id = ?', john, allen).

available_numbers = domain_of_repliable_numbers - in_use_numbers

The reply endpoint can use the SMS’s from_number and the to_number. It can then retrieve the appropriate conversation based on the assigned repliable number and saved phone numbers associated with our users. In code, this looks like:

from_number = params['From']
to_number = params['To']

conversation = Conversation.

Putting Numbers On The Board

After shipping the feature, CoachUp saw a sizeable uptick in use. They saw 1.7k uses of the feature in the first five days. Since the feature launched and August, the use has steadily increased. They’re putting numbers on the board. No wonder Steph Curry joined their team.

Building Repliable SMS For Coaches And Athletes: CoachUp Scales With Twilio (and Stephen Curry)

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 24, 2015

“Half the money I spend on advertising is wasted. The trouble is, I don’t know which half.”
– John Wanamaker

Dear Saul Goodman, Esq.,

First off, my compliments on your phenomenally effective advertising. I can’t drive down the streets of Albuquerque, sit at a bus stop or watch my favorite shows on AMC without seeing one of your ubiquitous “Better Call Saul” ads.

Judging from the, shall we say, “economical” production quality of your ads, you seem to be a man who wants to squeeze every drop of value from your marketing budget. You’ve probably wondered things like, “Do those billboards actually generate leads, or would I be better off buying another late-night TV spot instead?”

It must be frustrating, given that you use the same phone number for all your ads, to be unable to answer those questions. Fortunately, with Twilio and a few dozen lines of code, you can set up call tracking in Google Analytics in less than ten minutes.

Now, if you want to take a deep dive into call tracking and build your own dashboard, you should check out these in depth tutorials:

But if you just want to get something rudimentary up and running in ten minutes with Google Analytics, keep on reading. All you need to get started is a free Twilio account and a server where you can host a PHP file.

How Call Tracking Works

Call tracking works by associating a unique Twilio phone number to each advertisement (or type of advertisement) you want to track.

For instance, let’s say you want to know which provides a higher ROI: your billboard ads or your late night TV spot. You would would put a unique phone number on each of the two, log when a call came into that number, then forward the number to your office landline.

At a lower level, implementing call tracking with Twilio and Google Analytics looks like this:

  1. A lead calls the Twilio number on the ad.
  2. Twilio makes an HTTP request to a script you’ve set up in the account dashboard.
  3. Your script extracts the phone number that was called from the parameter of Twilio’s HTTP request, then matches that number to the ad type (in our case, we’ll hard code these pairings).
  4. Your script makes its own HTTP request to Google Analytics via the Measurement Protocol API to register the offline event of “Phone Call from X advertisement.”
  5. Your script returns three lines of XML to Twilio to forward the incoming call to your main landline.

To implement this, we’ll work backwards and first look at how to forward a Twilio number to a landline. Then we’ll log that incoming call as an event in Google Analytics.

How To Forward a Call from a Twilio Number

I saw on a billboard that your office number is (505) 503-4455*.

Head over to your Twilio Dashboard and buy two phone numbers in the 505 area code. And don’t worry, Twilio’s inventory includes many easy to remember numbers since I know that many of your clients a) are working with diminished cognitive capacity and b) don’t exactly have access to Google at the time in which they most desperately need you.

For instance, check out this number I found:

Screen Shot 2015-09-21 at 10.54.44 PM

See the box that says (Voice) Request URL? When someone calls your shiny new number, Twilio makes an HTTP request to that URL looking for instructions on what to do next.

Let’s write a simple script to return the XML to forward a call.

Forward a Twilio phone call with PHP

I’m going to write this code in PHP only because it’s easiest to deploy. I’m not sure what stack you’re into, but if you want to set up call tracking in Javascript, Ruby or Python, I’m sure you’ll find it pretty easy to translate these steps into your language of choice.

When a call comes into your Twilio number, Twilio makes an HTTP request to the voice request URL you defined on your dashboard. The script at that URL will respond with Twilio flavored XML that we call TwiML.

Create a new file called

, then add this code:


header('content-type: application/xml');


Save the file, then update the Voice Request URL for both of your shiny new Twilio numbers with your script’s publicly accessible URL, such as

. (By the way, if you’d like to give your local development environment a publicly accessible URL so that you can play around with this script without deploying to the cloud, check out ngrok).

With your script in place, call one of your Twilio numbers and listen to your favorite voicemail message.

Retrieve the inbound phone number

Paste the following array above the

  line to associate your Twilio phone numbers with their advertising source. In fact, any code you see from now ’til the end of this letter should be pasted above that line.

$numbers = array(
  "+1YOURFIRSTTWILIONUMBER" => "billboard",

Make sure that your numbers keep the format of +1XXXYYYZZZZ.

So Saul, you’re probably asking yourself, “But how do we know which Twilio number the lead called?” Good question. When Twilio makes an HTTP request to your script, it passes in a bunch of parameters. The full list can be found here, but the one we’re most interested in is stored in  


Paste these two lines below the array declaration to grab the inbound Twilio number and its corresponding ad source:

$twilioNumber = $_POST['To']
$source = $numbers[$twilioNumber];

Now that we know the source of the inbound call, we can pass it along to Google Analytics using the Measurement Protocol API.

Log Events with the Measurement Protocol API

I took a look at the source code of bettercallsaul.com and saw that you’re already using Google Analytics. This is unsurprising given your marketing savvy and penchant for saving money.

Last year Google released the Google Analytics Measurement Protocol API which, among other things, allows us to log offline events. According to the Measurement Protocol developer’s guide, you log an offline event by making a POST request to the API and including at least these six required fields:

The version of the measurement protocol.
field: v
value: “1”
As of today (September 2015), this is version “1” and will likely stay that way for sometime.

The tracking ID
field: tid
value: “UA-XXXXXX-X”
This is the unique ID of your Google Analytics account. It takes the format of UA-XXXXXX-X and can be found on your Analytics dashboard.


field: t
value: “event”
You can use the Measurement Protocol to track events, clicks, impressions, page views, ecommerce and so on. A phone call is best described as an “event”.

Event Category
field: ec
value: “phonecall”
The Measurement Protocol docs say, “A category is a name that you supply as a way to group objects that you want to track.” Our category will be “phonecall”.

Event Action
field: ea
value: either “billboard” or “tv” as defined in

You can think of these “actions” as shorthand for “made a call from a (billboard|tv).”

A unique anonymous client ID
field: cid
value: a unique UUID

This is the unique identifier for the client. You’ll be tempted to use the caller’s phone number as a unique identifier, which can be found in

. Unfortunately the docs say that the CID “must not itself be PII (personally identifiable information)” but should take the form of a UUID.

Now Saul, I know that you’re okay with occasionally bending the rules, but there’s really no need here when generating an ID is as easy as pasting this code of Roger Stringer into your


function generate_uuid() {
    return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
        mt_rand( 0, 0xffff ),
        mt_rand( 0, 0x0fff ) | 0x4000,
        mt_rand( 0, 0x3fff ) | 0x8000,
        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )

Make a POST request to the Measurement Protocol API

To make your POST request, first make an array with the six required fields and their corresponding values:

$fields = array(
  "v" => "1", //Version
  "tid" => "UA-XXXXXXX-X", //Tracking ID
  "t" => "event", //Event Hit Type
  "ec" => "phone call", //Event category
  "ea" => $source, //Event action 
  "cid" => generate_uuid(), // Client ID/UUID

Convert that array into a URL encoded string:

$fieldsString = http_build_query($fields);

Initiate a POST request by creating a new curl session:

$ch = curl_init();

Set the URL of the POST request to the Google Analytics endpoint:

curl_setopt($ch, CURLOPT_URL, "https://www.google-analytics.com/collect");

Set the number of fields that you’ll be passing along — six right now case, but we’ll calculate it dynamically in case you’d like to log more information later:

curl_setopt($ch, CURLOPT_POST, count($fields));

Include the field string:

curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsString);

Turn on the Return Transfer option to prevent the curl response from being outputted in our HTTP response along with our TwiML:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

Execute your POST request:


And close your session:


Save your file, open up the Real Time Reports in Google Analytics and redial that Twilio number. You’ll see a new event pop up registering the call event. To track your calls over a period of time, click Behavior on the left hand navigation, then Events -> Top Events. Then add Event Action as a secondary metric. You may want to set up a custom report with this selection for easy access. 

Screen Shot 2015-09-22 at 10.57.45 PM


Next Steps

Nice work, Saul. You’ve got basic call tracking setup and will soon have a much better idea how to spend the next $100 of your marketing budget.

To track additional forms of advertising, simply:

  • Buy another Twilio number
  • Set the Voice Request URL to your call_tracking.php
  • Add a line to the phone number array

If you’d like to learn the ins and outs of the Google Analytics Measurement Protocol, these resources might help:

And again, if you want to dive deep into the world of call tracking, check out these in-depth tutorials. If you’d like to chat more about call tracking and Google Analytics, hit me up at @greggyb or gb@twilio.com.

*I punched your office number into our new Phone Number Lookup and saw that, tragically, it’s a landline. You could port that number over to Twilio and make the experience a whole lot more engaging — think IVR, SMS and MMS. Have your people call us.

An Open Letter to Saul Goodman on Call Tracking with Google Analytics

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 23, 2015

Today we are happy to announce the general availability of Secure Trunks. This launch makes further security available on all Elastic SIP Trunks, by enabling customers to use Secure Real-time Protocol (SRTP) to encrypt media and Transport Layer Security (TLS) to encrypt signaling. This encryption allows businesses with strict information security practices to reap the benefits of both SIP trunks and cloud communications.

Secure Trunks

With Secure Trunks, SRTP is used to encrypt and authenticate the media payload of all calls on that trunk. Authentication validates that packets are from the purported source (customer or Twilio), and that the packets have not been altered during transmission. Encryption ensures that the call content has remained secure during transmission. Secure Trunks support TLS for SIP, which ensures the privacy of SIP signaling between Twilio and its customers over the Internet. TLS, the same encryption model used for secure HTTP for websites, uses a handshake with an asymmetric cipher in order to establish a shared key for the session. With signaling encrypted with TLS, Twilio then uses Session Description Protocol (SDP) to negotiate the common capabilities that will be used for the call (eg codec) as well the security parameters and encryption keys for the media using SDES. (Note to encryption fans: this is in contrast to encryption in WebRTC, which uses DTLS, negotiating encryption over the media connection itself. Most SIP infrastructure, like PBXs, only support SDES). To learn more about our implementation and how to configure your VoIP infrastructure with Secure Trunks, take a look at these docs.

For those who don’t live and breath telephony, we will take a step back and explain the predecessor to SIP trunks, the benefits of SIP Trunks, the capabilities of communications in the cloud, and the key challenge for realizing these benefits and capabilities.

The need for SIP

SIP Trunks have been around for nearly two decades and provide dial-tone over an internet connection. SIP trunks are replacing time-division multiplexed (TDM) lines where voice was delivered over a dedicated phone line purchased from a local provider. TDM, in case telecom history isn’t your favorite topic (why not?!), encodes media in a digital binary signal, over a dedicated copper wire. Before SIP Trunking, you’d need to get a T1 line wired into the office, which would allow for a max of 23 concurrent phone calls. If you needed more you’d buy another T1 providing another 23 phone lines. With SIP Trunks you no longer need a dedicated phone line, you can just use your existing internet connection and layer voice on top of it.

Moving to Voice-Over-IP (VoIP) allows businesses to save money and gain flexibility. By combining voice and internet connections into only one pipe you can better optimize utilization, because the two will have different usage peaks over the course of day and year.  This results in needing less capacity overhead to ensure employees can talk on the phone and access the internet, which translates to smaller bill.  Furthermore this means you no longer need to pay a subscription for Primary Rate Interfaces/ T1s.  When you do need to add capacity with SIP Trunks,  you aren’t required to buy voice capacity in groupings of 23. With Elastic SIP Trunks, you simply pay for what you actually use, not the maximum capacity you ever need. Lastly, using SIP enables much more fault tolerant routing configurations where if one data connection goes down, traffic can be re-routed to a different ingress point and then route internally over an intra-enterprise MPLS network. All of these benefits can be further enhanced by the power of the cloud.

Using the cloud for secure, instant, global communications

Elastic SIP Trunks are offered from Twilio’s global cloud platform, which enables new capabilities, instant deployments, and additional resilience. Anyone can create, configure, and manage Elastic SIP trunks instantly through either the web portal or the REST API, taking deployment timeframes from months to seconds. You can also provision phone numbers in real-time, in fifty countries around the globe and associate them with your trunks. Additional features you may want to layer on-top of SIP Trunks are just as easy to add. Whether that’s call recording, SMS enabling the phone numbers on your trunks, connecting to a WebRTC endpoint, skills-based routing of calls to workers, multiple origination URIs for load balancing and resilience, or adding a Disaster Recovery application.

With all of these compelling reasons to leave the TDM lines invented in (I kid you not) the 1870s, why do nearly 80% of businesses still use them? Surveys from industry analysts continue to raise one concern from enterprises above all else: security. Security has been a fair concern, with all of the recent internet breaches and on-going telecom fraud. This is why Twilio has introduced Secure Trunks.

Now that Twilio has introduced Secure Trunks with SRTP and TLS, available from data centers in 6 regions each with multiple isolated availability zones, with numbers in fifty countries, and on-demand provisioning, enterprises can deploy SIP Trunking at scale, knowing it is secured with robust authentication and encryption.

Elastic Secure Trunks encrypted with SRTP & TLSTwilio Account Portal – Secure Trunks

To get started with Secure Trunks you can take a look at our docs or configure a new Secure Trunk through the account portal (pictured above).

Announcing Secure Trunks

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

September 22, 2015

The Japanese conversational robot Pepper, which sold 1,000 units in one minute when it debuted in Japan earlier this summer, is likely to hit the U.S. market next year, and when it does, it will see the cute and courteous personality that is so popular in Japan replaced with a much more sarcastic and rough-around-the-edges […]

Bookmark this post:
Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

Last updated: October 04, 2015 09:01 PM All times are UTC.
Powered by: Planet

Speech Connection and Logos are Trademark of Nu Echo Inc. Copyright 2006-2008.