20
Thomas Howe - http://www.thomashowe.com Writing Voice Mashups

Writing Voice Mashups with Amazon Turks

Embed Size (px)

DESCRIPTION

A few short years ago, communications applications required millions of dollars, teams of highly skilled engineers, access to networks, and many months of time. Telephony Mashups rewrite that equation, and make it possible to blend communications services into applications quickly and easily. In this workshop, led by 2007 O'Reilly Mashup Winner Thomas Howe, we look at how these mashups are created, and at the implementation details in depth. Using After Hours Doctor's Office as an example, every part of the mashup will be reviewed in code-level detail, including a Voice XML front end, the software interfaces to the Amazon Mechanical Turk nurses, and mapping displays to help direct the patient to a local health care facility. The attendees will leave with a good understanding of the technology and effort required to write their own compelling application.

Citation preview

Page 1: Writing Voice Mashups with Amazon Turks

Thomas Howe - http://www.thomashowe.com

Writing Voice Mashups

Page 2: Writing Voice Mashups with Amazon Turks

2

Agenda

• Introduce the After Hours Doctor’s Office

• Scenario

• The goals of the Mashup

• Introduce the architecture

• Go over every component

• Functionality, interface, code

• Give you some ingredients, ideas

• What this isn’t

• A complete, and coherent, application

• Utterly scalable, but surprisingly close

• What is this?

• Think of Lewis and Clark

• Today’s telephony is very far from this. Very far.

• With a bit of luck, this is tomorrow’s telephony

Page 3: Writing Voice Mashups with Amazon Turks

3

After Hours Doctor’s Office

• Mashup written specifically for the Contest• I quit my job because I was technically bothered

• Goals• Show you the money

• Explore the use of Amazon Turks in Telephony Mashups

• Demonstrate the effects of modern Web technologies in telephony applications

• Resources• Me, 40 hours and a PowerMac G5 Server

• TellMe Studio - Voice XML hosting

• Strike-Iron - SMS Messaging

• Amazon Web Services - Amazon Mechanical Turks

• Web Hosting Provider - PHP and Ruby on Rails

• Source and commentary available at thomashowe.com

Page 4: Writing Voice Mashups with Amazon Turks

4

Application Scenario

• Mr. Kraus feels sick, calls Dr. McCarthy• After hours - no one’s there.

• Decision to make - emergency room? Tomorrow?

• Application takes voice mail message• Forwards into pool of Amazon Turk Nurses

• SMS messages increase reaction time for small service

• Immediately responds to patient - constant feedback

• Turk Nurse determines urgency• Listens to the message, summarizes and forwards

• Application gives direction to patient• Routine? A message from nurse reassuring patient

• Urgent? A call from the Doctor, right away

• Benefits?• Faster, cheaper with a higher quality of care

Page 5: Writing Voice Mashups with Amazon Turks

5

The Money

• Where is the money?• 50 million unnecessary emergency room visits in the US

• Each costs about $900.00 more than a doctor’s office visit

• Where isn’t the money?• Customer education that the service exists

• Repeated marketing to habituate the service

• Costly market trials

• Why?• Integration of real time communications into the business

process makes it more efficient, saving money for the enterprise and increasing customer satisfaction

Page 6: Writing Voice Mashups with Amazon Turks

6

Amazon Turks

• Internet Scale Workforce• One doctor needs 1/10 of a nurse

• One thousand doctors needs 100.

• More use, more turks, faster service

• Practical? Absolutely• Nurses get $3.00 for three minutes work == $60/hour

• Down time, family time, sick time, whatever

• Off-shoring?

• Comprehensive Quality• Amazon Turks automatically

• Record urgency accuracy, compare history

• Transcriptions

Page 7: Writing Voice Mashups with Amazon Turks

7

Bringing a knife to a gun fight…

• What did I use?• 40 hours, web services and a rapidly aging geek

• Ruby on Rails, SOA, PHP

• $25.00 to Strike Iron, and I’d probably have to pay x cents a minute to TellMe, Angel, or Voxeo

• What did I not use?• Big Iron ==> NO LARGE INVESTMENT

• A Contract ==> NO CARRIER INVOLVEMENT

• Marketing ==> NO CUSTOMER EDUCATION

• Risk ==> NO LONG DEVELOPMENT CYCLES

• Traditional carriers will get their clocks cleaned.

Page 8: Writing Voice Mashups with Amazon Turks

8

After Hours Mashup Architecture

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 9: Writing Voice Mashups with Amazon Turks

9

VoiceXML

• Accepts inbound phone calls with rich media experience• Voice detection, ASR, IVR, recording audio

• Use CCXML from Voxeo for outdial operations

• May be blended with other voice applications

• Standards Compliant Operation• I can choose among hosted options, local platform

• Little lock in

• Records audio and posts it to Web Server• Store it, record it, play it

• Web Server can produce VoiceXML files to play• Stateful processing

• Many choices for hosted providers• TellMe, Voxeo

• Some have platform/hosted options

Page 10: Writing Voice Mashups with Amazon Turks

10

After Hours Mashup Architecture

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 11: Writing Voice Mashups with Amazon Turks

11

Uploader.php

• PHP file for accepting inbound request• Called by VoiceXML file

• Handles uploading voice files, data

• Calls shell scripts to issue SMS requests

• Returns VoiceXML files back• Could be dynamic; template procesing

• Complete integration with other Web Tech• Database integration

• Instant Messaging and Presence Information

Page 12: Writing Voice Mashups with Amazon Turks

12

After Hours Mashup Architecture

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 13: Writing Voice Mashups with Amazon Turks

13

Strike Iron SMS

• Web Service to send text messages

• One of many online, paid services

• Reverse phone number lookup

• Address verification, currency rate, background check

• Pay per click model

• First 100 clicks are free, small fee thereafter

• 168 characters per message

• User interface issues

• URL issues (TinyURL)

• Extraordinarily Powerful

• Ubiquitous

• Immediate

Page 14: Writing Voice Mashups with Amazon Turks

14

After Hours Mashup Architecture

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 15: Writing Voice Mashups with Amazon Turks

15

Amazon Web Services

• Amazon Mechanical Turks• Human Intelligence Tasks

• Things that humans can do easily, difficult for computers

• A9 Search Engine

• Artificial Artificial Intelligence• It’s now OK to cheat

• Humans become subroutines

• S3, EC2 have unique telephony implications• Mr. Erlang never worked for Amazon

• True defense against DDOS

• S3 == linear scalability == holy grail of telephony

Page 16: Writing Voice Mashups with Amazon Turks

16

After Hours Mashup Architecture

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 17: Writing Voice Mashups with Amazon Turks

17

Extensions

• Call Centers• Expert based call centers, makes response even faster

• Better for larger scale installations

• Integrates well with Amazon Turks

• Geolocation• Give the data right to the nurse, showing hospitals, medical

centers, etc.

• Combines well with text messages (text directions)

• Get location from reverse phone number lookup, zip code from VxML, GPS inside phone, or all of the above for fraud detection

• Medical Transcriptions to Testing• Use medical transcriptions to check for consistency,

accuracy, training.

Page 18: Writing Voice Mashups with Amazon Turks

18

Call Center : Sylantro

• Integrating with Sylantro switch• Accepts inbound calls into expert queue

• Nurses login to the system from soft client or PSTN phone

• Turks are used to manage larger schedules

• Even better response for patient• Nurse is right there to answer questions

• Use VoiceXML to do pre-processing, skills based routing

• SOAP based interface using Java

• Better choice for larger setups• Dedicated equipment, staff

• Other functionality• Conferencing in Doctor or other expert

• Past history integration with CRM for accuracy

• Click to dial for post care support through e-mail

Page 19: Writing Voice Mashups with Amazon Turks

19

Yahoo! Local

• Nurses page shows location of caller• Location derived from inbound calling info

• Alternatives are GPS, asked

• Gives nurse immediate information to share with patient• Nearest clinic, hospital, etc.

• Directions; call ahead; 911 conference

• Flash based API• Many APIs available… this was wicked simple to use

Page 20: Writing Voice Mashups with Amazon Turks

20

Thank you!!!

For more information, source code, and this presentation,

see my site at

thomashowe.com