Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building Tropo Apps with Grails


Published on

Building IVR applications with Tropo, a cloud-based telephony and messaging system, is easy. This presentation details support for Tropo in Grails using the tropo-webapi-grails plugin.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Building Tropo Apps with Grails

  1. 1. Building Tropo Appswith GrailsChristopher Bartling
  2. 2. Summary 2■ What is Tropo?■ How do I integrate Tropo with Grails?■ Tropo WebAPI overview■ Lessons learned
  3. 3. Terminology 3■ IVR: Interactive Voice Response■ VoiceXML or VXML:■ CCXML: Call Control XML■ TTS: Text to Speech
  4. 4. What is Tropo? 4■ Cloud-based services for telephony and messaging ■ Make and receive phone calls ■ Use voice recognition ■ Messaging via SMS, IM, or Twitter■ Backed by ■ Industry leader in IVR and VoIP solutions
  5. 5. Why should I care? 5■ Many applications benefit from voice and messaging user interfaces■ Tropo provides telephony and messaging infrastructure and APIs for integrating these services into your applications ■ Traditionally this was hosted in-house■ APIs insulate developers from needing to write in VoiceXML, CCXML, and other markups
  6. 6. How do I use it with Grails? 6■ Install the Tropo WebAPI Grails plugin (version 0.21) ■ tropo-webapi-grails ■ Provides the TropoBuilder object for building standard Tropo JSON documents ■ TropoService for provisioning and servicing Tropo applications
  7. 7. TropoBuilder 7■ Builds Tropo JSON response documents■ Provides an array of JSON objects to control the Tropo-based applications hosted in the cloud ■ ask, call, conference, hangup, message, on, record, redirect, reject, result, say, session, startRecording, stopRecording, transfer
  8. 8. TropoService 8■ Grails service for administering Tropo applications ■ Abstraction around Tropo’s REST API ■ Create, update, and delete Tropo applications ■ Provision phone numbers, IM addresses, tokens ■ Retrieve information about applications
  9. 9. 9■ Web-based administration UI ■ Create, update, and delete Tropo applications in the cloud ■ Provision telephone numbers (both local and toll- free) and IM accounts for your applications ■ Application debugging tool ■ Billing profile
  10. 10. Tropo Development 10■ Create your Grails application■ Add tropo-webapi-grails Grails plugin■ Create your starting endpoint in your Grails app■ Create application on ■ Need externally available starting endpoint for your Grails app ■ Provision local phone number
  11. 11. Tropo WebAPI 11■ Use the TropoBuilder object to create Tropo-compliant JSON objects■ Tropo calls back to your application for instructions on how to power the IVR infrastructure in the Tropo cloud■ You application is a collection of interconnected endpoints, rendering Tropo JSON objects to control the IVR infrastructure in the Tropo cloud
  12. 12. Tropo WebAPI JSON objects 12
  13. 13. session 13■ Sent to your application in the first Tropo request■ The callId field identifies this request body to a unique call in Tropo ■ You will use the callId as the correlation identifier for all requests■
  14. 14. result 14■ Sent to your application in all subsequent requests from Tropo■ The callId field identifies this request body to a unique call in Tropo ■ You will use the callId as the correlation identifier for all requests■
  15. 15. say 15■ Say something to the caller ■ Can be TTS or pre-recorded audio ■ Does not wait for user response■
  16. 16. ask 16■ Say something to the caller and wait for a response from the caller ■ Can be TTS or audio file for say ■ Response can be collected speech or touch-tone keypad (DTMF) ■ The choices object specifies how Tropo handles user input■
  17. 17. on 17■ Specifies event handling ■ continue ■ error ■ incomplete ■ hangup■
  18. 18. hangup 18■ Hangs up the current call.■
  19. 19. record 19■ Plays a prompt and then waits for a response from the caller, which it records■ Responses may be speech recognition or touch-tone keypresses (DTMF)■ At the conclusion of the recording, the collected audio file is sent to FTP or HTTP POST/Multipart Form endpoint
  20. 20. transfer 20■ Transfer an in-progress call to another destination or phone number ■ Can be a phone number or a SIP address■
  21. 21. startRecordingstopRecording 21■ Start and stop recording a call session■ Resultant recording can be sent via FTP or HTTP POST/Multipart form to a URL■ You have to provide an endpoint or FTP server to receive the binary file■■
  22. 22. Lessons Learned 22■ Testing ■ Test call flow in isolation by using a testing Tropo application and a testing endpoint to bootstrap the call session appropriately ■ In the future, look to building an automated test runner that can be scripted and exercise the Grails app through HTTP calls
  23. 23. Lessons Learned 23■ The ask noinput and timeout APIs don’t work well ■ Issues with audio getting played out of sequence ■ Build this functionality into our call flow explicitly using on events
  24. 24. Lessons Learned 24■ Call recording is all or nothing ■ Unable to start and stop recording to allow for omission of sensitive data recording ■ We toggle recording for debugging call flow ■ Keep it off for production usage
  25. 25. Lessons Learned 25■ Call duration can be difficult to determine ■ Maintain a last Tropo callback timestamp on call session domain object ■ Update the timestamp on each Tropo callback invocation ■ Allows approximation of the call duration
  26. 26. Lessons Learned 26■ Abandoned calls can be difficult to determine ■ We used a Quartz job in Grails ■ Periodically inspect in-progress calls ■ If last Tropo callback timestamp is beyond a specified threshold, set the call session to abandoned
  27. 27. Contact Information 27■ Twitter: @cbartling■ Blog:■