Archive for the ‘applications’ Category

Customer Highlight :: Opiniator

Tuesday, April 5th, 2011

Most businesses have a customer defection issue where customers try the product, service or venue once, never to return. This has a massive cash impact on the business as new customers need to be recruited to replace the ones that leave. More worryingly, most businesses have no idea why customers defect so they cant repair whatever is broken in the offer – so customers continue to leave

This is the problem that Portland based, Opiniator is helping solve and is using Tropo as its backbone technology.

Businesses can now collect point of experience feedback from their customers whilst they are consuming the product or experiencing the service. They do this via SMS, voice or any internet enabled device – via Tropo, on the customer’s own cell phone or web enabled device.

Opiniator takes this feedback data and analyzes it in real-time, whilst the customer is still there. This means that the business can fix any issues, salvage any customer and ensure the offer is satisfying the needs of it’s customer base.

Founded by Matt Selbie, the company launched in 2009 but switched to Tropo earlier this year. Retail, Financial Services, Medical, Auto and Events are the key markets for the company – with current clients including Planned Parenthood and  the Oregon Convention Center.

“The big benefits are that the business is getting analyzed feedback on what the customer is experiencing right there and then – which means they can fix, adjust and implement based on real data, not guesswork and Tropo’s platform allows us to do this quickly and with scale using a variety of convenient methods for the customers” – Matt Selbie, Founder

JavaScript Remote Call Center Solution: Part 3

Monday, March 28th, 2011

As promised in a previous post, this entry will conclude a series we started over on the Phono blog discussing an effort to build a remote call center solution in JavaScript.

In the latest post of that series, we used Asterisk (the open source telephony platform) to make a call to a remote agent with a Phono instance open in their browser. Our call was routed to the remote Phono instance courtesy of Node.js and CouchDB.

In the screncast below, I’ll talk about how you can run an Asterisk AGI application with the Tropo platform.

In the JavaScript remote call center solution we’ve been talking about in this series, our Asterisk FastAGI script is written in Node.js.

Regardless of the language or framework used, you can run your AGI solution through Tropo using AGItate.

For detailed instruction on how to set up and use AGItate to run your Asterisk AGI application on the Tropo platform, check out this earlier post.

So, if you are looking to start a remote call center business, or if you want to work on getting a solution in place for your company, there has never been an easier way to get started.

Tropo and Phono coupled with powerful tools like CouchDB, Node,js and Asterisk can form the basis for a sophisticated call center application.

Any one of the components discussed in this series can be run either in your own data center, or hosted remotely in the cloud. The choice of how to deploy and operate a solution of this type is completely up to you.

Make sure you visit the GitHub repository for this solution – fork it, modify it, make it your own.

Drop us a line if we can help, or just send a pull request.

We’re excited to see what developers can do with this powerful combination of technologies!

New Java based WebApi implementation

Thursday, February 24th, 2011

I’m happy to announce that Tropo finally has a Java based WebAPI implementation.

This implementation will allow every Java developer to create Tropo based applications with a very simple and lightweight API. This API hides all the communication and protocol details, making it much easier to deploy Tropo applications in a Java environment. It can be used with any Java program, including Application Servers like Tomcat, WebSphere or WebLogic as well as stand-alone applications.

As the other WebAPI implementations do, the Java WebAPI library offers a very simple but comprehensive DSL that can be used to create Tropo applications with syntax very close to natural language. However, in contrast to other implementations, the Java WebAPI is statically typed, which means we can catch errors at compile time. This makes it even easier for developers to create Tropo applications. Previous to this implementation, developers who wanted to use Tropo with Java had to create JSON documents by hand, inherently unfriendly and error-prone.

The sources of the Java WebAPI implementation are available from GitHub as usual, including documentation to help get you started. You can download the latest version of this library from the distribution folder, where you will also find all the required dependencies (of which there are not many). Building the Java WebAPI requires Apache Maven and is just a one line: mvn clean install.

There are plenty of examples on the project’s page at GitHub; I’ll share a couple of them now so you can see how easy it is to create Tropo applications in Java. Let’s start with a simple Java Servlet that will be the entry point to our Tropo application. Tropo sends a POST request to our application server each time a person calls a number, sends an SMS to our app, etc. – we just have to implement the doPost method from our Servlet.

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response) 
                         throws ServletException, IOException {

    Tropo tropo = new Tropo();
    tropo.say("Hello from Tropo. This is our first application.");
    tropo.render(response);
}

How cool is that? No JSON, no response handling, just plain and easy Java code! Let’s look at another example – imagine you have a Tropo hosted application, which sends SMS to a number; this number is passed to Tropo as a parameter. You have a Java standalone application that you want to hook into this hosted app, in order to send an SMS based on a particular criteria (like when a file download is finished). You can simply use this Java implementation to launch your hosted application using the application’s token and pass the phone number at the same time. It would be as simple as this:

public void sendSMS(String number) {

    String token = ...
    Tropo tropo = new Tropo();
    Map params = new HashMap();
    params.put("number", number);
    tropo.launchSession(token, params);
}

Finally, the Java WebAPI also offers classes to deal with all results and incoming information from Tropo. For example, checking Tropo’s session object is very easy:

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response) 
                        throws ServletException, IOException {

	Tropo tropo = new Tropo();
	TropoSession session = tropo.session(request);
	System.out.println("Call id: " + session.getCallId());
}

As you can see, writing Tropo applications in Java has never been that easy. We hope you like this new WebAPI implementation!

Send a Fax with your Voice!

Monday, February 21st, 2011

Tropo just recently partnered with PamFax to deliver faxing capabilities via an API.  Jason Goecke wrapped their API with a very simple Ruby gem called pamfaxr available at GitHub and installable using a “gem install pamfaxr” from your command line.  Using the PamFaxr Ruby gem, I will demonstrate how to send a simple fax as well as how to build a Tropo Voice to Fax transcription application using our Scripting API!

Getting Started

Before you can start sending faxes, you need to head over to the PamFax site and sign up for a PamFax account. After you fill out and submit the form, you’ll get an email with your login credentials and how to get started.

You also need to install the Ruby gem called pamfaxr on to the system where you are going to run the application that will send the fax. The Ruby gem is available at GitHub and should install simply by typing “gem install pamfaxr” from your command line. You will need to edit the code to have your PamFax username and password.

Sending A Fax From The Command Line

Before we involve Tropo, here is the Ruby/Sinatra code for simply sending a fax from the command line using the PamFaxr gem:

require 'rubygems'
require 'pamfaxr'

# Pass user name and password
pamfaxr = PamFaxr.new :username => 'your_username',
                      :password => 'secret'

# Create a new FaxJob
faxjob = pamfaxr.create_fax_job

# Add the cover sheet
covers = pamfaxr.list_available_covers
pamfaxr.set_cover(covers['Covers']['content'][1]['id'], 'Chris was here 2!')

# Add files
# pamfaxr.add_remote_file('https://s3.amazonaws.com/pamfax-test/R-intro.pdf')
# pamfaxr.add_file('examples/R-intro.pdf')

# Add a recipient
pamfaxr.add_recipient('+14802191300')

# Loop until the fax is ready to send
loop do
  fax_state = pamfaxr.get_state
  break if fax_state['FaxContainer']['state'] == 'ready_to_send'
  sleep 5
end

# Send the fax
pamfaxr.send_fax

Just copy that code into a text file, edit it to have your information in it and then run it with ruby from your command line. In a short bit you should have a fax waiting for you.

Sending Faxes From Tropo

Now for the fun Tropo Voice to Fax application code! The first code snippet is written in Ruby runs on the Tropo cloud. It greets the caller, asks for your fax number, records your voice/fax message and sends the transcription via a callback to the Ruby/Sinatra application that sends the actual fax.  Here’s the Tropo code:

say "Welcome to the Tropo fax demo.", :voice => 'dave'

result = ask "What's your fax number? Please include your country code.", {
   :choices => "[11 DIGITS]", :voice => 'dave'}

record "Please say what you would like for me to fax.", {
    :beep => false,
    :voice => 'dave',
    :maxTIme => 60,
    :silenceTimeout  => 2,
    :transcriptionOutURI => "http://web1.tunnlr.com:11053/transcribe?fax=" + result.value
    }

say "Your voice is being converted to a facsimily!  Go check your fax machine!  Goodbye.", :voice => 'dave'

hangup

Here is the complimentary Ruby/Sinatra code that catches the Tropo transcription callback and sends the fax of the transcription to the number specified in the Tropo script using the PamFaxr gem as demonstrated above. This code needs to be run on a publicly-accessible web server to which Tropo can connect and send the data. You have several options including:

  • Running the code on your own publicly-available webserver
  • Running the code on a hosting service like Heroku
  • Running the code on your local machine and use a service like Tunnlr to make the service available

Once you have the Ruby/Sinatra code below running in one of those locations, you’ll just update the Tropo code above with the correct URL (on line 11).

The code is here:

require "rubygems"
require "sinatra"
require 'json'
require 'pamfaxr'

pamfaxr = PamFaxr.new :username => 'your_username',
                      :password => 'secret'

post "/transcribe" do

  transcript_json = JSON.parse(request.body.read)
  identifier = transcript_json['result']['identifier']
  transcript = transcript_json['result']['transcription']

  # Create a new FaxJob
  faxjob = pamfaxr.create_fax_job

  # Add the cover sheet
  covers = pamfaxr.list_available_covers
  pamfaxr.set_cover(covers['Covers']['content'][1]['id'], transcript)

  # Add a recipient
  pamfaxr.add_recipient('+' + params[:fax])

  # Loop until the fax is ready to send
  loop do
    fax_state = pamfaxr.get_state
    break if fax_state['FaxContainer']['state'] == 'ready_to_send'
    sleep 5
  end

  # Send the fax
  pamfaxr.send_fax

end

Wow, that was fun!  I hope that you enjoyed this demonstration and I hope that you find both our PamFaxr gem and our Tropo Scripting API useful and powerful.

Tweetchat Mobile Lookup Powered by Tropo

Tuesday, February 15th, 2011

Twitter chats – also known as “tweetchats” – are meetings on Twitter. They are usually moderated by an individual or group and meet at a set time each week or each month. They can be on any topic, and they are sometimes associated with businesses or non-profits. Tweetchats have been described as a way to “filter out the chaotic mass of tweets” to focus on a specific topic.

Tweetchats are very popular, but many Twitter users don’t know what they are or how to participate in them. In simplest terms, tweet chats are online conversations, typically held at a pre-arranged time, between a group of Twitter users, and using a specific Twitter hashtag to identify the discussion.

Eric Bryant, Director at Gnosis Arts Multimedia Communications LLC, recently reached out to me on Twitter to share with me a link consisting of existing Tweet Chat time schedules for people to get started and participate in these chats online.  If you participate in Tweetchats, then you know how hard it is to remember the dates – especially seeing as how they’re growing so fast and there are so many of them in existence already.  Anyone can edit the Wiki, all you need to do is create an account.

So here is where Tropo comes in!  Eric and his team created a Tweetchat Mobile Lookup application.

Text a hashtag or a day to 1.513.655.2216 and it will send you the day/time of the tweetchat. Your mobile number is encrypted and never seen or stored.

Now you will never worry about missing a Tweetchat again :)

Friday Fun with Tropo: Send a Friend a Song (Lyric)!

Friday, December 10th, 2010

Want a unique way to send someone a message? Want to tell someone what you really think of them? Or praise someone for doing an awesome job? Or pass along your feelings? Here’s something fun for a Friday – send a friend the lyrics to a song! Just go to:

http://dial-a-lyric.heroku.com/

Written by Christopher Durtschi, this app has you choose the artist, choose the song, choose the voice you want to use, and enter in the phone info for you and the recipient. They will get a phone call reading them the lyrics to whatever song you chose. (Voice and calling powered by Tropo, of course.)

I wanted to send someone “Let It Be” from the Beatles, so naturally you can guess the voice I chose ;-)

Dial-a-Lyric.jpg

Kudos to Christopher Durtschi for cooking up a fun little app like this!

JavaScript Goes First Class With Tropo

Tuesday, November 30th, 2010

In the last couple of years, there have been some significant changes in the development landscape that have elevated the status of JavaScript.

Lots of hard-core developers and engineers used to look down their noses at JavaScript as something only front-end “designers” used to make web sites look pretty.

And while the advent of AJAX-driven web development and powerful frameworks like jQuery have eroded this sentiment somewhat, a few key tools have developed in the last couple of years that have really vaulted JavaScript into first class status in the development world:

  • CouchDB – the document-oriented database that uses JSON for document structure and JavaScript for map/reduce functions.
  • Node.js – a framework for the V8 JavaScript engine from Google that lets you write sophisticated, event-driven applications in JavaScript.

In addition, the Tropo platform lets you write powerful, multichannel communication applications in pure JavaScript. Here is an example of a very simple Tropo application in JavaScript:

say("Channels are like hugs, more are better.");

One line – that’s it!

This script can be hosted and run in the Tropo cloud (much like how Google AppEngine works) and provisioned across multiple communication channels – phone, SMS, IM and even Twitter.

You can serve this humble message up to inbound callers, or send it out over all of the channels mentioned previously by kicking off an outbound session. Your choice.

Tropo blows the old notions that you can’t build powerful applications with JavaScript and that building communication apps is hard right out of the water. But what’s even cooler are the synergies that are possible when you mix up all this JavaScript goodness.

For example you can also build Tropo apps with Node.js using our WebAPI platform. Just download our Node.js library from GitHub and use the examples included with it to get started.

In addition, Tropo plays very nicely with CouchDB and you can build some really sophisticated apps that combine Tropo, Node.js and everyone’s favorite document-oriented database. (Look for a future post to cover Node.js + CouchDB + Tropo apps in detail.)

So if you’re a JavaScript ninja, or just someone who has used it on past projects, the time has never been better to sink your teeth into some exciting new applications.

Sign up for your Tropo account today and celebrate JavaScript’s promotion to first class status!

Something Fun and Quick To Make – the Toddler Amusement Line!

Monday, November 22nd, 2010
Toddler on a phone

Flickr credit: danyork

Noticing this weekend: a) how much our 18-month-old loves to play with the phone; and b) how limited her actual “conversation” is with anyone on the phone… I decided to have a wee bit of fun and make an app that would “talk back to her”. And thus was born the Toddler Amusement Line!

You call the number and it simply loops through saying a canned set of phrases (currently “hi”, “hello”, “how are you”) 10 times with a pause between each. You can try it yourself at:

+1-617-870-3360
Skype: +990009369991480349
SIP: sip:9991480349@sip.tropo.com

Here’s all it took in python on Tropo:

import time

for i in range(0,10):
    for text in ("hi", "hello", "how are you"):
        say (text)
        time.sleep(2)

say("Thank you. Goodbye.")

I start out setting up a loop to go through the inner for loop 10 times. Main reason to do this is so that I don’t create an infinite loop running on Tropo. If the caller hangs up before the app is done, the loop will just keep going and then end. If they stay on, they’ll just get the “Thank you. Goodbye.” message.[1]

The inner loop just cycles through a series of phrases, saying each one, waiting 2 seconds and then saying the next.

If you’d like to experiment with creating an app like this yourself, here’s all you have to do:

  1. Go over and login to Tropo (you can create a free developer account if you don’t already have one).
  2. Create a new application.
  3. Choose “Tropo Scripting” as the type.
  4. Give it a name.
  5. Click on “Hosted File” and choose “Create a new hosted file for this application”
  6. Give it a file name ending in “.py” (I used “tal.py”)
  7. Copy/paste the python code above into the “File Text” area. (Tip: when you move your mouse over the code, some icons will appear in the upper right corner of the block of code – the second icon will copy the code to your clipboard.)
  8. Click “Create File”.
  9. Click “Create Application”.
  10. Start calling!

That’s it… your app is now ready to be called via either Skype or SIP. If you want to add a regular old phone number to it, just click the “Add a new phone number” link and choose from one of the available area codes. (There is no cost for a US phone number – they are free to developers.)

Now, as an added bonus, you could use one of the various international voices available for the “say” command and change the sound of the outgoing text-to-speech. For example, here the app has been changed to be a British female voice:

import time

for i in range(0,10):
    for text in ("hi", "hello", "how are you"):
        say (text, {"voice":"kate"})
        time.sleep(2)

say("Thank you. Goodbye.")

You can see the full list of available male and female voices in the “say” command reference or read our two previous blog posts with more examples about the female and the male voices.

Have fun! And may it amuse your toddler… or anyone else who calls ;-)


[1] And if you do the math, the inner loop is probably 3 seconds for each text (1 second to say and 2 to wait). 3 pieces of text at 3 seconds each equals 9 seconds for the inner loop. Do that 10 times for a total of 90 seconds. I don’t know about your toddler, but mine has probably put (or thrown) the phone down well before 90 seconds and has moved on to something else :-)

Hacking Awesomeness in Baltimore

Sunday, November 21st, 2010

Tropo was in Charm City this weekend for the first Baltimore Hackathon, which took place at Beehive Baltimore – a co-working space in Baltimore’s Canton neighborhood.

This thoroughly awesome location was the appropriate setting for a get together of hardware and software hackers from around the Baltimore area to come together and bang out great ideas over the weekend.

As hackathons go, it was a really special event.

Not only was it the first hackathon in Baltimore, but it was somewhat unique in that it focused on both software development and hardware hacking as well. All of the developers in attendance were smart, passionate technologists; the location along Baltimore’s harbor was outstanding; the event was organized exceptionally well and ran smoothly; the food was great; even the beer was good.

Tropo was on hand as a sponsor of the event and also to lend a hand to developers that wanted to add phone, voice or SMS awesomeness to their apps. Tropo’s APIs were used in some really impressive projects during the event.

For example Brent Frederick of Baltimore built what he refers to as VoiceBump – an app that lets people call a phone number and create a blog post with Tropo’s recording and transcription services.

Another app – Call the Door by Mike Brenner – uses Tropo’s SMS service to unlock the door at the building where the event was held (locked doors can turn into something of a hindrance when your coding all night).

Tropo also provided a special award at the event – giving a prize to the devleoper of the app with the best use of our services. An update with the name of the winner (or winners) and a description of the project will be posted in the next day or two.

In the interim, here are some pictures from the event.

Update: all of the winners from the Baltimore Hackathon are now listed on the Startup Baltimore site. Congratulations to all the winners!

Baltimore Hackathon

Baltimore Hackathon

Baltimore Hackathon

Baltimore Hackathon

Connecting to an External Database with Tropo Scripting

Tuesday, November 16th, 2010

Tropo Scripting is a great way to build powerful, sophisticated communication applications in one of several popular development languages.

It’s easy to get up and running quickly with Tropo Scripting, to build multi-channel applications that leverage powerful features like SIP integration and speech recognition.

If you are developing an application in Tropo Scripting, you might at some point find that you need to send values to a back-end database or to retrieve information from an external system. There are several different ways to do this depending on the language you are using. This post will provide an example of one way to do this using the PHP scripting language. (more…)