Posting Tropo Transcriptions to Google AppEngine

August 27th, 2009 by Jason Goecke

Now that Tropo offers transcriptions, I would like to provide another example of using cloud services to manage your transcription results. In this case we will use Google AppEngine’s (GAE) Java implementation by deploying with JRuby, leveraging a similar architecture to what we use on Tropo for hosting our scripting languages.

I have created another Sinatra application (tropo-transcriptions) that provides an HTTP REST API for receiving POSTs of transcriptions from the Tropo cloud. The same application then allows you to get those results, either by fetching all or a single transcription. The app takes advantage of Google’s BigTable on GAE, storing all of the transcriptions right in the cloud in a schemaless data store. Using the unofficial Ruby/JRuby Google library, appengine-jruby, I have already created everything you need to simply download and deploy the application. This means that it already has JRuby and all of the Ruby gems baked into the app, so you get running with minimal fuss.

The first step is to install the google-appengine gem and download the tropo-transcriptions source code (you may do a Git clone or download from Github):

TropoTranscriptionInstall

After having signed up for Google AppEngine and creating an application, then you need to make one configuration change to your application you just downloaded. Editing the file tropo-transcriptions/config.ru, make the following change to line 3:

  :application => 'tropo-transcriptions'

becomes:

  :application => 'your-app-name'

Then the last step is to deploy your application to Google AppEngine. To do this simply cd into your application’s directory and enter:

  appcfg.rb update .

You will be prompted for your GAE username and password and you should then see:

TropoTranscriptionDeployGAE

Thats it, you are now up and running. There are now three resources available on your new HTTP web services app:

1. POST to receive transcriptions

  http://your-app-name.appspot.com/receive_transcription

2. GET to fetch all transcriptions

  http://your-app-name.appspot.com/transcriptions

3. GET to fetch a single transcription based on GUID

  http://your-app-name.appspot.com/transcription?guid=5fad8750-7316-012c-00bd-0400580fde23

Now, you may start using your new server to store your transcription results. Simply use the first URL in the transcriptionOutURI portion of your recording request of your Tropo script:

  answer
  say 'Welcome to ruby recording test'

  event = record('Say something after the beep.',
                           { :repeat              => 0,
                             :bargein             => true,
                             :beep                => true,
                             :silenceTimeout      => 2,
                             :maxTime             => 30,
                             :timeout             => 4,
                             :recordURI           => 'http://tropo.to-a-domain.com/post_audio?filename=file123456.wav',
                             :transcriptionOutURI => 'http://your-app-name.appspot.com/receive_transcription',
                             :transcriptionID     => '123456' })

  log 'Recorded file: ' + event.recordURI
  say 'Thanks for your testing ruby on Tropo platform'
  hangup

Make a few calls and you should see this when you put the second URL above in your browser:

TranscriptionResult

There is more to come…

No related posts.


If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


2 Responses to “Posting Tropo Transcriptions to Google AppEngine”

  1. Qamal Wimax Says:

    Hi, interesting post. I have been thinking about this issue,so thanks for writing. I will certainly be subscribing to your site.

  2. adi imam pratomo Says:

    Love this post! Thanks for this. I

Leave a Reply

Please note: By submitting a comment you agree to comply with our Comment Policy. We welcome all comments, positive or negative, but do reserve the right to remove all or part of blog comments that do not comply with our policy.

Additionally, the first time you leave a comment on this blog, it will be held for moderation. After that first comment has been approved, future comments will be posted without delay.