Tweets from the Cloud

April 17th, 2012 by Tobias Goebel

I recently pondered some facts:

  • VoiceObjects now has an extension to integrate with Twitter as another channel of communication (check it out)
  • The Voxeo cloud can:
    • make outbound phone calls,
    • read back dynamic information,
    • record the caller’s voice.

So why not combine all of this, I thought to myself, and build a Twitter Reader mash-up?

So I went and built an app that would:

  • call me on my phone whenever someone mentioned me (i.e. my user name @tpgoebel) on Twitter,
  • read the tweet to me, and
  • allow me to record a response and post a URL to that recording back to Twitter.

I was preparing for a trip to present Voxeo technology to an automaker that offers in-car infotainment services, so this seemed like a perfect way to show off what we can do. Now, let me show you how I did it!

Monitoring Twitter

Our VoiceObjects Twitter channel extension can be setup to either monitor the public timeline for keywords (people tweeting about a product, a brand, or whatever else), or monitor a user’s timeline for direct messages (DMs) or mentions (“@tpgoebel How cool is that?? #Voxeo #VoiceObjects #Twitter”). So I set it up to monitor the timeline of my own Twitter account, @tpgoebel. It is currently configurable through an XML configuration file, so here is a snippet of my configuration:

Socialite Configuration Example

So now, whenever someone mentions my name, it triggers a VoiceObjects service called “TwitterReader”.

Launching a phone call

I built one VoiceObjects application to serve three purposes in one:

  1. When launched via a tweet, trigger the outbound call and end the VoiceObjects session.
  2. When launched via the outbound call, check if an answering machine was reached and if so, leave the tweet as a message.
  3. When launched via an outbound call and a human picked up (wait, that’s me!), play the tweet, and give me options to hear it again, respond to it, or send out a general tweet (ie without mentioning the original Twitterer).

So my application starts with a branch:

TwitterReader Call Flow

I am using Modules for each branch mainly for reporting purposes, so I can easily consume a report that shows me how often a tweet was left on my answering machine vs. me listening to it right away.

Launching the outbound call is done via Voxeo’s HTTP-based token API, i.e. a simple call to our CCXML launcher URL:

http://session.voxeo.net/SessionControl/4.5.40/CCXML10.start?tokenid=108797a718975342a8ed&callerid=14074564555&numbertodial=3212011725&TwitterMsg=XXX

The CCXML places the outbound call and applies Call Progress Analysis to determine if it’s me or my voicebox answering. It passes a Boolean parameter detectedMachine into the VoiceObjects session, upon which I can do my branching.

If you want to learn more about outbound calling with VoiceObjects, read my recent post on the topic.

Reading the tweet and tweeting back

Once I know a human picked up, I read the tweet back using TTS (VoiceObjects’ Twitter channel makes parameters like the message, its author, and a lot of other meta information available in the session context) and offer an option to record a response using VO’s Recording object. I then use bit.ly’s REST API to shorten URLs and convert the URL that points to the recording to a conveniently short URL I can use in my tweet:

TwitterReader Call Flow

Finally, I use VoiceObjects’ own REST API to send a tweet out to the world, mentioning the original Tweeter’s name (so that my response shows up in his “mentions inbox”), and include the shortened URL pointing to my recording. That way he can listen to my response:

Tweet mentioning meMy response

(That’s an “I” ;-) )

Pretty simple, huh? Now I should go out and sell it and become rich

While the Twitter extension to VoiceObjects was rather built to help automate Twitter as another dialog channel of customer communication, I felt this would be a compelling way of showing what Voxeo technology can do. And the in-car application actually makes sense, don’t you think? And if we take it a step further and integrate this with our partners at Interactions, to add transcription to it, you’ll have a reliable hands-free Twitter client on your phone!

Message me at @tpgoebel if you would like to try it out yourself!

Tags: , ,

One Response to “Tweets from the Cloud”

  1. VoiceObjects Developer Portal » Blog Archive » Exploring Twitter as a Self-Service Channel Says:

    [...] the topic of Twitter applications, also check out my recent blog post on a personal Twitter reader for the mobile [...]

Leave a Reply