Archive for the ‘Mashups’ Category

Slides: Mashups: Integrate Multiple Web Services Into Your App

Friday, August 13th, 2010

At SpeechTEK last week in New York, Voxeo’s Dan Burnett was part of a panel session on the topic of “speech mashups.” The session description was:

10:15 AM – 11:00 AM - C101 – Mashups: Integrate Multiple Web Services into Your App - Dan Burnett, Director of Speech Technologies

Learn how speech technologies from recognition to transcription and beyond, now available in the cloud, are being accessed to create multimodal applications. Learn how new licensing models are emerging; novel partnerships are being formed; and the role of vendors, operators, and developers is being redefined. See demonstrations of some new service opportunities made possible with speech mashups. Discover how easy it is to create your own mashups that use speech and how they compare to what you can do with VoiceXML.

Dan talked about mashups and then demonstrated a mashup using Tropo and the Ruby programming language. His slides are available for viewing or download:


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Video from eComm: Voxeo CTO RJ Auburn on Building Voice Mashups using Tropo.com

Monday, May 18th, 2009

eComm organizer Lee Dryburgh recently made the video available of Voxeo CTO RJ Auburn’s talk at eComm in March titled “Building Voice Mashups using SIP Servlets” but which really focused on all the cool things you can do with Tropo.com (and Tropo is built on top of SIP Servlets). You can view it here – and the slides are embedded below the video:

RJ’s slides are available here:


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


Technorati Tags: , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Adding Call Control to Voxeo Designer Applications via CCXML

Wednesday, November 26th, 2008

voicexmlcertifieddeveloper.gif

Lately, the Voxeo Designer platform has become increasingly popular. However, it can be somewhat limited in terms of call control. Customers who are used to a combination of CCXML and VoiceXML may be turned away by this idea. Well, fear not, as we can easily integrate CCXML and Designer now, adding that game-changing call control aspect that CCXML brings to the table. Why use a CCXML front end, you say? Well, lots of reasons. CCXML brings call control, conferencing, whisper dialogs, hold dialogs, as well as the ability to pass in parameters to your Designer application. Whether it’s “you have a call from John Smith, press 1 to accept this call,” or a simple repeating hold music dialog, it is now possible with Designer dialogs.

So now let’s take a look at how we put it all together. Let’s assume that you already have a basic Designer application established. At this point, we don’t care what it does. Now, we need to write a CCXML front end for it.

<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">
  <var name="myDialogID"/>
  <eventprocessor>

    <transition event="connection.alerting">
      <log expr="'Preparing to answer the call.'"/>
      <accept/>
    </transition>

    <transition event="connection.connected">
      <log expr="'Caller has connected.  Executing VoiceXML dialog now.'"/>
      <dialogstart src="'helloworld.vxml'" type="'application/voicexml+xml'" dialogid="myDialogID"/>
    </transition>

    <transition event="dialog.exit">
      <log expr="'The dialog is now complete.  Exiting application.'"/>
      <exit/>
    </transition>

    <transition event="error.*">
      <log expr="'An error has occured (' + event$.reason + ').  Exiting application.'"/>
      <exit/>
    </transition>

  </eventprocessor>
</ccxml>

This simple CCXML code snippet accept a user’s call, and launches a VoiceXML dialog titled helloworld.vxml. Now, all we need to do is modify the “src” attribute to reference the Designer application. How, you ask? Well, it’s a little tricky, but far from impossible. All we need to do is grab the Designer URL from the Application Debugger (or the Prophecy Log Viewer, for all the local installations out there). The full URLs will look something like this, and may require copying the link to the clipboard (in Evolution, at least) in order to see the entire thing:

Evolution Designer:

  http://evodesigner-internal.voxeo.com/CallRouter?vr.application.id=XXXX   (where XXXX is your specific Application ID)

Prophecy Designer:

  http://127.0.0.1:9992/CallRouter?vr.application.id=X   (where X is your specific Application ID)

We can then inject this into the <dialogstart> keeping everything else the same. The dialog “type” remains “application/voicexml+xml” since Designer is pure VoiceXML behind the scenes, coupled with a custom GUI.

Now let’s take a look at the finalized code, with our Designer dialog in place.

<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">
  <var name="myDialogID"/>
  <eventprocessor>

    <transition event="connection.alerting">
      <log expr="'Preparing to answer the call.'"/>
      <accept/>
    </transition>

    <transition event="connection.connected">
      <log expr="'Caller has connected.  Executing Designer dialog now.'"/>
      <dialogstart src="'http://127.0.0.1:9992/CallRouter?vr.application.id=1'" type="'application/voicexml+xml'" dialogid="myDialogID"/>
    </transition>

    <transition event="dialog.exit">
      <log expr="'The dialog is now complete.  Exiting application.'"/>
      <exit/>
    </transition>

    <transition event="error.*">
      <log expr="'An error has occured (' + event$.reason + ').  Exiting application.'"/>
      <exit/>
    </transition>

  </eventprocessor>
</ccxml>

And there you have it — a basic application which launches a Designer dialog. Hopefully this will help shed some light on how developers can combine the utility of CCXML with the usability of Voxeo Designer.

Jeff Menkel VXML Certified Developer


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Code Walk: OSCON 2008 Demo #1: Is Twitter Down? (VXML & JavaScript)

Monday, September 29th, 2008

As I mentioned previously over on our Voxeo Talks blog, I’m going to walk through here in this blog several of the demonstrations that I did at the O’Reilly Open Source Convention (OSCON) back in July. The slide deck is embedded in the previous post, and I’m going to jump right to slide 48 where I began Demo #1: Is Twitter Down?

This was just a short little demo that was designed to show how VoiceXML can be used with embedded JavaScript/ECMAScript. It performs three basic steps:

  • Connects to www.istwitterdown.com

  • Uses JavaScript to parse the result
  • Relays result to caller using Text-To-Speech

If you’d like to hear it, you can actually call it – but do note the Big Caveat noted farther down in the article – at either of these numbers:

WALKING THE CODE

So let’s take a walk through the code. The first part is simply the initial VoiceXML starting statements, a declaration of a variable called “MyData” and the start of a form called “F1″:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
  <var name="MyData"/>
  <form id="F1">

The next part is a JavaScript function that uses the JavaScript “getElementsByTagName” function to walk the HTML of the page that is loaded in:

    <script>
      <![CDATA[
          function GetData(d,t,n)  {       
            return (d.getElementsByTagName(t).item(n).firstChild.data);
          } 
      ]]>
    </script>

Now I can’t claim credit for this code – I really just modified the example provided in the VoiceXML documentation for the <data> element. The way to think about it is this – the system loads the entire document requested by the <data> element into memory as an XML tree (even though it is in fact HTML). The ‘getElementsByTagName’ function then walks the XML tree to find the tag requested.

Let’s look at how I called the function to see how this makes sense:

    <block>
      <data name="MyData" src="http://www.istwitterdown.com/"/>
      <assign name="status" expr="GetData(MyData,'a',0)"/>

Now the first line uses the <data> command in VoiceXML to retrieve the contents of the web page at www.istwitterdown.com and assign that to a variable called “MyData”.

The second line calls the JavaScript function above with the “MyData” variable and says that I am interested in all the <a> tags and specifically the first <a> tag (numbered “0″). Now to figure out what tag I wanted, I didn’t honestly do anything overly brilliant. I just went to www.istwitterdown.com, did a “View Page Source” in my browser and then looked for where the word “No” appeared in the body text. Now this site happens to have a very simple page structure and so finding the node to use was trivial:

<body>
<h1><a href="link removed">No</a></h1>

So the site had the content I wanted (“No” or “Yes”) right in the very first <a> tag. Filling in the contents of the getElementsByTagName call with the variables sent to the JavaScript function, it looked like this:

d.getElementsByTagName('a').item(0).firstChild.data

Which translates to wanting the “data” of the first <a> tag in the document. In this case, “No” or “Yes”.

This data is then assigned to the VoiceXML variable “status”.

The rest of the VoiceXML app is then simply branching on what the “status” variable is. If it is “No”, then Twitter is up. (A bit of a double negative kind of thing going on.) If it is anything else, the site is down:

      <if cond="status=='No'">
          <prompt>Twitter is currently up.  Yea!</prompt>
      <else/>
          <prompt>Twitter is currently down. </prompt>
      </if>
    </block> 
   </form>
</vxml> 

I then close off the block, the form and the VXML file. Note that I could have checked to see if status=='Yes' but I just made the assumption that if it was not “No” then there was a problem with Twitter.

THE BIG CAVEAT

Which does bring me to the big caveat of this application – because I was relying on some other web site (istwitterdown.com in this case) I made a big assumption that the external site would work!

It didn’t.

When I was out at OSCON, I was delighted by the fact that at one point Twitter was actually down! However, throughout all the time that Twitter was down and despite multiple browser hard refreshes, the www.istwitterdown.com site always said “No”, meaning Twitter was up.

Oops.

Now, the site did work in the past. I know because I used it successfully when Twitter was going up and down earlier this year. However, sometime along the way whatever logic the folks at the site were using to detect that Twitter was down seemed to stop working. Or, at least it stopped working on the day that I was testing it. Maybe it’s working now… I don’t know… the good news is that Twitter hasn’t been down much at all in recent weeks.

Anyway, it’s a good lesson that if you rely on external sites, you do need to ensure that the external site is in fact giving you the correct data that you want.

WRAPPING UP

I hope this little example gave you a useful glimpse into how VoiceXML’s <data> tag can be used to pull in web pages and how JavaScript can be used to parse those web pages. More information can be found on the VoiceXML documentation page for the data element. I would encourage you to read both the main documentation page as well as the comments to that page.

In my next blog posts walking through my subsequent OSCON 2008 demos, I’ll explore what else can be done with the data element and other tools. Stay tuned…


THE WHOLE CODE

For those of you who want to do a straight copy-and-paste to play with the code, here it is in its entirety:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
  <var name="MyData"/>
  <form id="F1">
    <script>
      <![CDATA[
          function GetData(d,t,n)  {       
            return (d.getElementsByTagName(t).item(n).firstChild.data);
          } 
      ]]>
    </script>
    <block>
      <data name="MyData" src="http://www.istwitterdown.com/"/>
      <assign name="status" expr="GetData(MyData,'a',0)"/>
      <if cond="status=='No'">
          <prompt>Twitter is currently up.  Yea!</prompt>
      <else/>
          <prompt>Twitter is currently down. </prompt>
      </if>
    </block> 
   </form>
</vxml> 

Technorati Tags: , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


OSCON – Greetings… and voice mashups with identi.ca

Wednesday, July 23rd, 2008

Greetings from the floor of O’Reilly’s Open Source Convention (OSCON) in Portland, ME… {seesmic_video:{“url_thumbnail”:{“value”:”http://t.seesmic.com/thumbnail/3aATDeXXb3_th1.jpg”}”title”:{“value”:”OSCON – Greetings… and a teaser about my talk on voice mashing up with identi.ca ”}”videoUri”:{“value”:”http://www.seesmic.com/video/zQOEEEUNAE”}}}

As I said in the video, I’ll be speaking today at 5:20pm US Pacific time on the topic of “Mashing up Voice and the Web using Open Standards and XML” where I’ll be showing how you can use VoiceXML and CCXML to do interesting connections to “web 2.0″ sites. Needing a site to use for my examples, I decided to this round of demos with identi.ca, the new open source microblogging site (like Twitter, only open source).

Once my talk is over, I’ll post the slide deck here in this blog and also the code to the demos I’ve written. I’m looking forward to it… it should be fun! (If you’re here at OSCON, I will apparently be in room D137 at 5:20pm.)

P.S. You can also follow me on identi.ca at identi.ca/danyork


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Voice Mashups with Twitter, part 2: Sending telephony presence to Twitter

Monday, April 21st, 2008

What if you wanted to share your telephony “presence” information with another application? i.e. you wanted to let the application know whether or not you were on the phone? For instance, when someone called you a message that you were “on the phone” could then be displayed in the other application…. perhaps a web page with a directory of staff – showing who’s on the phone… perhaps an instant messaging client…

twitter.pngWell, out at eComm 2008 in March, our CTO, RJ Auburn, demonstrated exactly that kind of integration using just CCXML and web services. In his talk he showed a quick application in CCXML that would send out your presence information on the current web 2.0 darling Twitter. Essentially, what happens is this:

  • Someone calls a phone number (presumably because you gave it to them)

  • Call is connected to your actual phone
  • Call presence information is sent out in your Twitter stream.

For instance, if you call one of these numbers (please do so only if you actually want to talk to me, and please only from 9am-5pm Eastern US time- thanks!):

You’ll reach me (or my voicemail) and the corresponding status updates will appear in my Twitter stream (shown in reverse chronological order):
twitterphonepresence.jpg

Now I don’t know that I would really personally want to send out this information in my twitter stream every time someone called me (although in all honesty I don’t talk on the phone as much as I used to), but you get the idea. Your “telephony presence” can be sent out to another application. It’s to me a very cool example of how you can easily mashup voice with web services. While Twitter is used here for this example, the code could basically be used to send this presence information to any type of service that lets you communicate using simple web services. Let’s dive in a bit further…

The eComm Slides

First, though, I should mention that this example was part of RJ’s talk at eComm 2008 and you can see it in his slide deck starting at slide 27:

As soon as audio is available for the presentation, we’ll provide a link here to actually listen to the presentation.

The Web Service

Now to jump into the actual code, RJ was able to do this so easily largely because Twitter’s API is so incredibly simple to use, as I discussed in a previous post about Twitter. The full CCXML code is below, but here’s the key part where RJ defined the URL to use to update Twitter:

  <var name="tURL" 
       expr="'http://zscgeek:password@twitter.com/statuses/

That’s it. (Note that while RJ is on Twitter as zscgeek, you can rest assured that his real password is NOT “password”!)

After creating this variable “tURL” (as in “target URL”), RJ proceeds to simply assign some text to a variable “status” and then call the target URL with that “status” variable as an argument. For example:

      <var name="status" expr="'RJ is on the phone'"/>
      <send targettype="'basichttp'" name="'update'" 
            target="tURL" namelist="status"/>

Here “RJ is on the phone” is assigned to “status” and then the Twitter API is called. As shown in the code below, this same block of code is re-used with each different telephony state (and obviously with a different status message).

The Code

So here’s the code… nice and short and sweet… just enough to fit on a Keynote slide without straining eyesight (yes, it would probably fit on a PowerPoint slide, too, but remember that we’re Mac fans here). I’m not going to walk through each step of the code, but if you scan down you can see that basically the code is:

  • Upon connection of the call:
    1. connecting the call to RJ’s cell phone (not his real number)
    2. sending the “RJ is on the phone” status update to Twitter
  • Upon entering one of the other states (no answer, call disconnected), sending the appropriate Twitter status update.

Now if you aren’t familiar with the power of CCXML, you might want to look at our documentation and tutorial on CCXML or view one of the video tutorials on CCXML that we recently posted.

With that, here’s the code:


<?xml version="1.0" encoding="UTF-8"?>
<ccxml xmlns="http://www.w3.org/2002/09/ccxml" version="1.0">
  <var name="state" expr="'init'"/>
  <var name="incomingcall"/>
  <var name="tURL" 
       expr="'http://zscgeek:password@twitter.com/statuses/update.xml'"/>
  <eventprocessor statevariable="state">
    <transition event="connection.alerting" state="init">
      <accept/>
    </transition>
    <transition event="connection.connected" state="init">
      <assign name="state" expr="'calling'"/>
      <assign name="incomingcall" expr="event$.connectionid"/>
      <createcall dest="'tel:+18315551111'"/>
    </transition>
    <transition event="connection.connected" state="calling">
      <assign name="state" expr="'connected'"/>
      <join id1="event$.connectionid" id2="incomingcall"/>
      <var name="status" expr="'RJ is on the phone'"/>
      <send targettype="'basichttp'" name="'update'" 
            target="tURL" namelist="status"/>
    </transition>
    <transition event="connection.failed" state="calling">
      <assign name="state" expr="'done'"/>
      <var name="status" expr="'RJ is not answering his phone'"/>
      <send targettype="'basichttp'" name="'update'" 
            target="tURL" namelist="status"/>
    </transition>
    <transition event="connection.disconnected" state="connected">
      <assign name="state" expr="'done'"/>
      <var name="status" expr="'RJ is off the phone'"/>
      <send targettype="'basichttp'" name="'update'" 
            target="tURL" namelist="status"/>
    </transition>
    <transition event="send.successful" state="done">
      <exit/>
    </transition>
  </eventprocessor>
</ccxml>

Feel free to use it, modify it, etc., etc. (And if you do something cool with it, please do let us know, either as a reply to this post or via email.) While this is with Twitter, we’d love to hear where else you can think of sending telephony presence info…

P.S. If you’d like to experiment with this but are not sure of how to get started, head on over to www.voxeo.com/free and either sign up for a free developer account on our Evolution portal or download our free Prophecy software to run it on your own server.

Technorati Tags: , , , , , , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Creating dynamic voice apps that use Google’s App Engine, part 2

Friday, April 18th, 2008

googleappengine.jpgJust a brief update on my piece about how to use voice with Google’s App Engine… I now have been invited into the preview of Google’s App Engine, so I’ve created a second application on our Evolution platform with this one pointing to my shiny new GAE app at:

http://voicexmltest2.appspot.com/

For now, it’s the same (lame) python code, but the app does have it’s own phone numbers:

Direct Local # (857) 362-8430
PIN Access (800) 289-5570 then PIN: 9996075378
PIN Access (407) 386-2174 then PIN: 9996075378
Skype VoIP +99000936 9996075378
FWD VoIP **86919996075378
SIP VoIP sip:9996075378@sip.voxeo.net

Why didn’t I simply modify the original Evolution application? Well, I could have, but I figured this way I can also still experiment with the AppDrop.com application as well.

The nice thing with a true Google App Engine account is that I can use “appcfg.py” to automagically update the files up on the App Engine site, which is very slick. (Thanks, Google, for the invite!) Next week, my intent is to work with the python code to get it actually manipulating the XML… stay tuned… (and check my original article if you would like to experiment with voice and Google App Engine, too).

Technorati Tags: , , , , , , , , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Creating dynamic voice apps that use Google’s AppEngine (and Amazon’s EC2 via AppDrop), part 1

Tuesday, April 15th, 2008

Update 2008 Apr 18: I now have an App Engine account and have the app running there as well.


googleappengine.jpgCould Google’s AppEngine, the buzz of the developer world right now, be used to create voice applications? That was the question I asked myself and the answer is something you can test yourself by calling one of these numbers (since we support all these forms of calling):

Assuming I haven’t changed the app since writing this post, you should simply hear some text “Your magic number is (some number)…” and then a pointer to this blog site. If you call the number again, you’ll hear the text with a different number. And again and again.

So what’s going on here? Well, you have:

Got all that? :-) Let’s take a look at how the pieces fit together

Google’s AppEngine

Last week Google announced the release of their AppEngine developer tool that lets you run web applications on Google’s massive infrastructure. Basically, you develop your application (currently only in the python language), upload it to Google’s servers and let Google’s infrastructure take care of all the rest. In addition to their web server and distributed database, you also have access to using Google Accounts for usernames which means you don’t have to create your own usernames and passwords (although you are then obviously tied to Google for authentication).

This announcement was immediately the subject of a huge amount of buzz throughout the blogosphere and the web in general. Unfortunately, only the first 10,000 developers could get in to try it out. While they let 10,000 more developers in yesterday, I’m still not one of them. However, I could download the AppEngine SDK and, dusting off my rusty memory of python (which I used to do a lot with) put together a quick program that would dynamically generate a VoiceXML file.

If your browser will display an XML file as raw XML, you can see the result here:

http://voicexmltest.appdrop.com/

If your browser won’t display raw XML, here’s a screenshot of what it should look like:
voicexmlmagicnumberex1.jpg

Your number should be different because it is being randomly generated. If you refresh your browser you should now see a different number in the <prompt> text. I did all this locally using the AppEngine SDK, saw that it generated valid (and dynamic) VoiceXML, and then needed to figure out where to host this so that I could demonstrate the usage – without a Google AppEngine account.

Amazon’s EC2 and AppDrop.com

While I’ve been patiently waiting for Google to send me an email letting me into the AppEngine preview, I stumbled upon the news that Google’s App Engine had been ported to Amazon’s EC2 service. Developer Chris Anderson announced a new service called AppDrop.com which basically hosts a modified version of Google’s AppEngine code on Amazon’s EC2 service. It obviously doesn’t support all of Google’s services like the distributed database or Google Accounts for authentication, but it allows you to develop an app with the AppEngine SDK and then upload it to the AppDrop service. Philosophically, I found this an interesting demonstration that using the AppEngine SDK did not necessarily lock you in to Google’s platform.

More importantly to me, I could create a hosted AppDrop.com application now without yet having my Google AppEngine account (subject to the caveats that AppDrop.com is entirely a proof-of-concept, it may go away at anytime, etc, etc.). So I did. Here’s the steps:

  1. Download the modified Google AppEngine SDK from AppDrop.com. It’s essentially the same thing as the Google SDK but with modifications for the lack of support for Google’s database, accounts, etc.

  2. Create an app in the local SDK. (I just literally copied my files from the Google AppEngine SDK directory over into the AppDrop SDK directory.)
  3. Register an app on AppDrop.com. This was not entirely intuitive as nowhere on the main page does it tell you how to do this. However, if you go to the list of current applications, there is a “Make a new app” link that takes you through the process of creating a new account on the site and then registering the app.
  4. Create a gzipped tar file of your application to upload. Easiest way is on the command line go into the directory containing your app and type “tar -cvzf <appname>.tar.gz *“. (This is taken care of for you in the actual Google environment with “app_cfg.py”, but no such automated script is available for AppDrop.com yet, although they are working on one.)
  5. Upload the file via the AppDrop.com web interface. If it works you get a simple “Upload successful” page.
  6. Go to http://<appname>.appdrop.com/ to see the resulting app. For instance, http://voicexmltest.appdrop.com

With that, I now had a publicly hosted app developed on the Google AppEngine SDK.

Voxeo’s Evolution platform

The last step was to provide the phone interface to this voice app and for that I obviously used our Evolution platform. Using my free developer account (which anyone can get), I basically followed the steps of our Quick Start Guide:

  1. Once logged into Evolution, I clicked on “Application Manager”.
  2. I clicked on “Add Application”.
  3. For the development platform, I chose “Prophecy 8.0 – VoiceXML 2.1″
  4. On the next screen, I completed the form as follows:
    1. Entered a name of the application.

    2. In the “Start URL 1″ box, I entered the URL to my AppDrop.com application – including the trailing slash (very important!)
    3. Under “Application Phone Number” chose the region in which I wanted a phone number. (If you don’t do this, you can still access your application via SIP or Skype, but not direct-dial from the PSTN. And yes, for the free accounts we only give out US phone numbers.)
  5. I clicked the “Create Application” button and my application was done.

Here’s a screen shot of that part of the screen for my app:
evolutionappdropexp.jpg

Do note again that I included the trailing slash on “http://voicexmltest.appdrop.com/”.

If I click on the “Phone Numbers” tab I can see the various numbers that I can use to call into this application:
evolutionappdropexpnumbers.jpg

That’s it! Assuming you are generating correct VoiceXML code, when you call into those numbers you should hear the voice app you created.

Show Me The Code!

So if you’ve read this far I imagine you probably want to see the actual code I wrote, eh?

Well, there are two files needed in a Google AppEngine SDK directory. First you need a file called “app.yaml” that simply provides the name of your app and the name of the main python file (here brilliantly called “main.py”):

application: voicexmltest
version: 1
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py

The second file is the “main.py” python file (which could be called anything as long as it matches what is in the app.yaml file). To be honest, my file is embarrassingly lame as a python app goes but as long as you recite “Remember this was a quick lunch-time hack as a proof of concept”, here it is:

#!/user/bin/env/python
import random

def main():
  print '''<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >
  <form>
    <block>
    <prompt>
'''
  print "Hello! Your magic number today is %d. " % random.randrange(100)
  print '''
     To learn more about this application, please visit blogs dot voxeo dot
     com. Thank you for calling this app.
    </prompt>
    </block>
  </form>
</vxml>
'''

if __name__ == "__main__":
  main()

Like I said, it’s a very simple app that really doesn’t even remotely begin to demonstrate the power of either python or VoiceXML. (Remember “quick proof-of-concept”.) For those not familiar with python or VoiceXML, here is what the main() function does:

  • prints out the first half of the VoiceXML file

  • prints out the dynamically generated part with a random number
  • prints out the second half of the VoiceXML file

Basically a glorified “Hello, world!” program with a random number thrown in. If you’re not familiar with the python construction I’m using here to print these large blocks of text, what I’m doing is putting three single apostrophes together to mark the beginning of the block of text and then three single apostrophes at the end to close off the block. It’s a great way to do simple hacks like this one. :-)

Next Steps

So with the embarrassment of that python file out of the way and now that I’ve proven to myself that you can develop voice apps using Google’s AppEngine (at least via AppDrop), what’s next? Well, when I next get a chance to work on it, I’m going to do two things. First, I’ll do more with VoiceXML, since there’s so much more it can do. Maybe add in some speech recognition, multiple call paths, maybe even upload some small audio files for prompts. Perhaps I’ll play with some outbound dialling and call transfer. Or wrap the VoiceXML inside of a Call Control XML (CCXML) app.

Second, and perhaps more useful to demonstrate Google’s AppEngine, I want to change the python code to actually manipulate the XML rather than simply printing out the XML code as text. There’s a great amount that can be done with python and XML, and even a book on the subject (which happens to be on my bookshelf), so the resources are out there.

In the meantime, though, I would be curious to see what any of you all can do with these pieces. What do you think about using Google’s App Engine to host applications in this way? If you can easily use a language like python to manipulate data and dynamically generate voice apps (using VoiceXML), what can you think of to do with it? What kind of apps will you write?

Do any of you want to give it a try? The steps are really quite simple:

  1. Download either the Google App Engine SDK, or, if like me you don’t have a Google App Engine account yet, download the AppDrop.com modified SDK.
  2. Write your python app locally (Google has intructions and examples) that generates valid VoiceXML (we have tutorials there).
  3. Upload the app to either Google or AppDrop.com.
  4. Create an Evolution account if you don’t have one and follow the steps above to create the app on our service.
  5. Call it up and see how it works.

If you do anything cool with it, please definitely do leave a comment as I’d love to check out what you do (and hey, maybe even spotlight it here on the blog if you are open to that).

With that, I’m going to turn back to experimenting with python and XML… (oh, and waiting for my App Engine invite… hint, hint, Google!)

Technorati Tags: , , , , , , , , , , , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Voice Mashups – Using Phone Numbers as GeoTags to Get Directions

Friday, March 7th, 2008

What if you could use a phone number as a “geotag” to identify a location and get directions? What if you could call into a service, enter in a phone number of where you want to go and then your current phone number – and get directions?

In this video episode of Voxeo Talks, Moshe Yudkowsky discusses his “phone 2 directions” voice mashup that lets you call in, enter in a phone number and get directions spoken to you based on the location associated with that phone number. Here’s the video:

If you want to try it out, just call

+1-312-252-1758

enter in your phone number and you will receive driving directions from your location to the eComm 2008 conference next week in Silicon Valley (where this app will be discussed). And yes, it will give you directions from clear across the country.

Note that there is an obvious caveat with this service – if you use a phone number that’s with a cell phone, a VoIP service or in a different region through Local Number Portability, it probably won’t work.

More information about this voice mashup is available at:

www.phone2directions.com/

For those of you developing apps, Moshe has made the source code available for those who want to create your own mashups at:

p2dir.sourceforge.net

I’ve not yet looked at it myself but Moshe indicates that he’s showing folks how to connect to MapQuest and StrikeIron (source of reverse number address lookups) in his PHP code. Since the code is open source, I’ll be curious to see what else people do with it. Note that Moshe built it for ifbyphone using their developer API. (Ifbyphone is a partner of Voxeo who is providing very cool services to small and medium-size businesses.)

You can, of course, develop your own voice mashups for free using either our hosted Evolution platform or download our Prophecy premise platform at:

www.voxeo.com/free

Meanwhile, enjoy the video, call the demo (1-312-252-1758) and let us know what you think! (And if you are out at eComm you’ll be able to see this demo and talk to both us and folks from Ifbyphone.)

Technorati Tags: , , , , , , , , ,


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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


Voice Mashups with Twitter, part 1: Who will win the 2008 SuperBowl? (A mashup in CallXML.)

Friday, February 1st, 2008

Who will win the 2008 SuperBowl this weekend? The Patriots or the Giants? And by how many points will they win?

With those two questions in mind, please call now into one of these numbers using either your regular phone, Skype or a SIP phone:

Once you have answered those two questions, check out:

http://twitter.com/superbowlguess

Ta da… you have just participated in a voice “mashup” between our services and the Twitter micro-blogging platform!

callxmltwitter.jpgSo what’s going on here? At a high level, you called into our servers where an XML document outlined a series of prompts, collected some information and then sent the result over to a Twitter account for posting. (If you aren’t familiar with Twitter, here’s a post I wrote about it.)

There’s obviously a bit more to it (see our Quick Start guide) and over the next few weeks I’m going to explain both what I did and perhaps more importantly how it can be improved! In this part 1 you are seeing a basic call flow with Text-To-Speech prompts. While TTS is fast and, as you will see, extremely easy to create, the voice does sound… well… computer-generated! (Duh!) So in the next installment in this series I’ll talk about adding recorded prompts (and how incredibly simple it is to do through our platform). Future parts to the series will cover such things as better error handling, moving the XML over into VoiceXML/CCXML, adding other content to the output to Twitter, etc.

Naturally by the time this series is done the SuperBowl will long be over and the <deleted> will of course be victorious! However, we’ll just have to come up with some other event for the final script, eh?

Now, if you are impatient and don’t want to wait, your best bet is to head on over to our excellent CallXML documentation to learn what you need to do. Of course, you should also sign up for a free developer account on our Evolution developer site where you can create all of these applications and whatever other apps you can think of related to voice.

thexmls.jpgBefore I start walking through the code, let’s talk about the version of XML I am using. Here at Voxeo we support three different kinds of XML for developing voice applications (as outlined on our Choosing a Platform page): our own CallXML and then the VoiceXML and CCXML standards of the W3C. We created our CallXML first and then have been and continue to be very involved with the development of VoiceXML and CCXML. (For instance, our CTO RJ Auburn chairs the CCXML Working Group within the W3C and Dan Burnett is very active within those groups as well.) We are huge supporters of open standards and are extremely pleased to be leading the industry in terms of compliance with VoiceXML and CCXML standards. As part of this series, I’ll take you on a tour of how those specifications work.

To keep this first post simple, though, I’ve written this first mashup example in CallXML because the code is easier to understand as we walk through it. In a future part, you’ll see how this looks in VoiceXML.

But enough already, let’s dive into the code…

(more…)


Want to learn how Voxeo can help unlock your communications and deliver a better customer experience? Please contact us!

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