Posts Tagged ‘Twitter’

Tweets from the Cloud

Tuesday, April 17th, 2012

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!

How to link VoiceObjects to IMified to create apps for Twitter or IM/chat

Thursday, December 2nd, 2010

In this week’s Developer Jam Session, Serving the Social Customer: Scaling Your Support for Twitter, Facebook and more, I touched on how to use VoiceObjects to create an application that interacts with users over Twitter. The steps are rather straightforward:

  1. Create your application in VoiceObjects (and include a text layer).
  2. Deploy the application to an Internet-accessible VoiceObjects Server.
  3. Create a “bot” at IMified.com that points to the URL of your VoiceObjects application.
  4. Link that bot to the appropriate Twitter or IM/chat accounts.

For this to work, you naturally need to have an IMified account, which are free to developers if you don’t already have one.

You also need to make one critical addition to the URL for your VoiceObjects server when you enter the URL into the IMified bot configuration. You need to add this text to the end of the URL:

&vsDriver=173&User-Agent=IMified

For example, your URL might be:

http://myserver.com:8070/VoiceObjects/DialogMapping?VSN=testService&vsDriver=173&User-Agent=IMified

With that, your app will be all set to communicate out to Twitter or the various chat networks via IMified!

For more detailed information about this process, Tobias Göbel, wrote up a great post last year called “How to IMify your voice application” that goes through the steps.