Tropo: Telephony in the Cloud

3,330 views

Published on

Presentation at Houston Code Camp, August 20th, 2011- an overview of Tropo (tropo.com)

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,330
On SlideShare
0
From Embeds
0
Number of Embeds
26
Actions
Shares
0
Downloads
176
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • Next slide is video\n
  • Next slide is video\n
  • Next slide is video\n
  • Next slide is video\n
  • \n
  • A big server\nplus money\nplus telephony geek\n
  • A big server\nplus money\nplus telephony geek\n
  • A big server\nplus money\nplus telephony geek\n
  • A big server\nplus money\nplus telephony geek\n
  • Tropo\nplus Web geek\n
  • Tropo\nplus Web geek\n
  • Voxeo back end is a big Java program using SIP Servlet API\nThink of Tropo as ODBC for communication \n
  • Voxeo back end is a big Java program using SIP Servlet API\nThink of Tropo as ODBC for communication \n
  • Voxeo back end is a big Java program using SIP Servlet API\nThink of Tropo as ODBC for communication \n
  • Voxeo back end is a big Java program using SIP Servlet API\nThink of Tropo as ODBC for communication \n
  • Voxeo back end is a big Java program using SIP Servlet API\nThink of Tropo as ODBC for communication \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 1) Show hcc_demo configuration screen: voice URL vs. SMS/messaging URL.\n2) Show application debugger.\n3) Call this # and mic the phone.\n4) Discuss how you can do this with SMS - invite someone in the audience to send anything to this number, and countdown will begin.\n
  • Walk through code - high level.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Show documentation for scripting/Web API\n
  • Show documentation for scripting/Web API\n
  • Show documentation for scripting/Web API\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Talk about grammars\n\n
  • Talk about grammars\n\n
  • Talk about grammars\n\n
  • Talk about grammars\n\n
  • Talk about grammars\n\n
  • Talk about grammars\n\n
  • Talk about grammars\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 1) Mic phone and click on outbound voice link in Tropo app.\n
  • Show call verb and “if $currentCall” code.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 1) Conference: Get one person to call 713 489 7524 and choose 1; get another person to call and choose 1. They should be able to talk to each other.\n2) Get a volunteer number from the audience - change number in code, call and choose #2, call should be transferred.\n3) Call 713 489 7524 and choose #3, hear audio.\n\n
  • Show demo3 code\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • 1) Show hcc_demo configuration screen: voice URL vs. SMS/messaging URL.\n2) Show application debugger.\n3) Call this # and mic the phone.\n4) Discuss how you can do this with SMS - invite someone in the audience to send anything to this number, and countdown will begin.\n
  • 1) Talk about Koached Tropo Generator - add functionality to stock Ruby Tropo Generator\n2) Tropo Controller - generic tropo functionality, convenience methods\n3) Prospecting controller - actual endpoint\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • Show Tropo documentation\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Tropo: Telephony in the Cloud

    1. 1. TROPO:TELEPHONY IN THE CLOUD Wes Gamble Bison Consulting koached.com
    2. 2. Wes Gamble• Bison Consulting• koached.com• weyus@att.net• @weyus
    3. 3. What We’ll Discuss Today
    4. 4. What We’ll Discuss Today• Why?
    5. 5. What We’ll Discuss Today• Why?• Tropo offerings
    6. 6. What We’ll Discuss Today• Why?• Tropo offerings• Tropo code examples
    7. 7. What We’ll Discuss Today• Why?• Tropo offerings• Tropo code examples• Other stuff
    8. 8. Why?
    9. 9. BEFORE
    10. 10. BEFORE
    11. 11. BEFORE+
    12. 12. BEFORE+ + (Telephony)
    13. 13. BEFORE + + (Telephony)(cheaper: computer + telephony HW + Asterisk)
    14. 14. NOW
    15. 15. NOW
    16. 16. NOW +(Web)
    17. 17. WHY TROPO?
    18. 18. WHY TROPO?• FREE to develop (pay for production)
    19. 19. WHY TROPO?• FREE to develop (pay for production)• 10+ years of voice application experience, infrastructure (Voxeo)
    20. 20. WHY TROPO?• FREE to develop (pay for production)• 10+ years of voice application experience, infrastructure (Voxeo)• Multiple channels with one back-end (Voice, SMS, IM, Twitter)
    21. 21. WHY TROPO?• FREE to develop (pay for production)• 10+ years of voice application experience, infrastructure (Voxeo)• Multiple channels with one back-end (Voice, SMS, IM, Twitter)• Open-source, standards-based (SIP)
    22. 22. WHY TROPO?• FREE to develop (pay for production)• 10+ years of voice application experience, infrastructure (Voxeo)• Multiple channels with one back-end (Voice, SMS, IM, Twitter)• Open-source, standards-based (SIP)• Web developers can do telephony now
    23. 23. Language Support
    24. 24. Language Support• APIs are available in:
    25. 25. Language Support• APIs are available in: • JavaScript
    26. 26. Language Support• APIs are available in: • JavaScript • PHP
    27. 27. Language Support• APIs are available in: • JavaScript • PHP • Ruby
    28. 28. Language Support• APIs are available in: • JavaScript • PHP • Ruby • Python
    29. 29. Language Support• APIs are available in: • JavaScript • PHP • Ruby • Python • Groovy
    30. 30. APIs
    31. 31. APIs• Scripting API: execute one script file • Tropo-hosted or self-hosted
    32. 32. APIs• Scripting API: execute one script file • Tropo-hosted or self-hosted• Web API • Arbitrary Web application endpoint
    33. 33. APIs• Scripting API: execute one script file • Tropo-hosted or self-hosted• Web API • Arbitrary Web application endpoint• REST API • Session initiation, provisioning, signal/event passing
    34. 34. Getting Started with Tropo
    35. 35. Getting Started with Tropo• Establish an account at Tropo.com
    36. 36. Getting Started with Tropo• Establish an account at Tropo.com• Create an application
    37. 37. Getting Started with Tropo• Establish an account at Tropo.com• Create an application• Choose Scripting or Web API
    38. 38. Getting Started with Tropo• Establish an account at Tropo.com• Create an application• Choose Scripting or Web API• Set script location (scripting) or Web app. endpoints (Web API)
    39. 39. Getting Started with Tropo• Establish an account at Tropo.com• Create an application• Choose Scripting or Web API• Set script location (scripting) or Web app. endpoints (Web API)• Provision numbers
    40. 40. DEMO 1: First Steps Username: hcc_demo Password: hcc_demo Calling to: 281 968 8698 “2012 Doomsday Clock” https://github.com/weyus/hcc_tropo_demos/ blob/master/demo1/2012_Doomsday_Countdown_inbound.rb
    41. 41. DEMO 1: First Steps Username: hcc_demo Password: hcc_demo Let’s look at the code
    42. 42. Receiving inbound Calls with Tropo(*) Scripting API - script resides on Tropo server
    43. 43. Receiving inbound Calls with Tropo(*) Scripting API - script resides on Tropo server
    44. 44. Receiving inbound Calls with Tropo Script or APP(*) Scripting API - script resides on Tropo server
    45. 45. Receiving inbound Calls with Tropo Script or APP(*) Scripting API - script resides on Tropo server
    46. 46. Receiving inbound Calls with Tropo Script or APP ca ll pho ne #(*) Scripting API - script resides on Tropo server
    47. 47. Receiving inbound Calls with Tropo Script or callback APP ca ll pho ne #(*) Scripting API - script resides on Tropo server
    48. 48. DEMO: First Steps Key Pieces
    49. 49. DEMO: First Steps Key Pieces• Bare Ruby script - just gets executed
    50. 50. DEMO: First Steps Key Pieces• Bare Ruby script - just gets executed• Tropo API is a DSL that emits JSON for consumption by Tropo server
    51. 51. DEMO: First Steps Key Pieces• Bare Ruby script - just gets executed• Tropo API is a DSL that emits JSON for consumption by Tropo server• Important verbs: • say • ask, call • hangup • message (= call + say + hangup)
    52. 52. DEMO: First Steps Lessons Learned
    53. 53. DEMO: First Steps Lessons Learned• When an incoming call is picked up by Tropo, script is immediately run
    54. 54. DEMO: First Steps Lessons Learned• When an incoming call is picked up by Tropo, script is immediately run• “ask” keyword is synchronous, and result is returned when user responds
    55. 55. DEMO: First Steps Lessons Learned• When an incoming call is picked up by Tropo, script is immediately run• “ask” keyword is synchronous, and result is returned when user responds• Voice recognition on input
    56. 56. DEMO: First Steps Lessons Learned• When an incoming call is picked up by Tropo, script is immediately run• “ask” keyword is synchronous, and result is returned when user responds• Voice recognition on input• Text-to-speech on output
    57. 57. DEMO: First Steps Lessons Learned• When an incoming call is picked up by Tropo, script is immediately run• “ask” keyword is synchronous, and result is returned when user responds• Voice recognition on input• Text-to-speech on output• Can be used with voice or SMS
    58. 58. Scripting API:Current call metadata
    59. 59. Scripting API:Current call metadata• There are properties that are set on the $currentCall object in Ruby for incoming calls
    60. 60. Scripting API:Current call metadata• There are properties that are set on the $currentCall object in Ruby for incoming calls • callerID
    61. 61. Scripting API:Current call metadata• There are properties that are set on the $currentCall object in Ruby for incoming calls • callerID • channel
    62. 62. Scripting API:Current call metadata• There are properties that are set on the $currentCall object in Ruby for incoming calls • callerID • channel • network
    63. 63. Scripting API:Current call metadata• There are properties that are set on the $currentCall object in Ruby for incoming calls • callerID • channel • network• https://www.tropo.com/docs/ scripting/call_properties.htm
    64. 64. Scripting API - Basics SAY
    65. 65. Scripting API - Basics SAYsay “I’m a computer and I’m talking to you”, options
    66. 66. Scripting API - Basics SAY say “I’m a computer and I’m talking to you”, options• Say something to the user
    67. 67. Scripting API - Basics SAY say “I’m a computer and I’m talking to you”, options• Say something to the user • Options
    68. 68. Scripting API - Basics SAY say “I’m a computer and I’m talking to you”, options• Say something to the user • Options • voice: Use a different voice - there are ~60 voices from which to choose
    69. 69. Scripting API - Basics SAY say “I’m a computer and I’m talking to you”, options• Say something to the user • Options • voice: Use a different voice - there are ~60 voices from which to choose • as: type of data (DATE, DIGITS, NUMBER)
    70. 70. Scripting API - Basics ASK
    71. 71. Scripting API - Basics ASKresult = ask “Do you like stuff?”, options
    72. 72. Scripting API - Basics ASK result = ask “Do you like stuff?”, options• Ask the user a question (say + wait)
    73. 73. Scripting API - Basics ASK result = ask “Do you like stuff?”, options• Ask the user a question (say + wait)• Blocks while waiting for result
    74. 74. Scripting API - Basics ASK result = ask “Do you like stuff?”, options• Ask the user a question (say + wait)• Blocks while waiting for result• Options
    75. 75. Scripting API - Basics ASK result = ask “Do you like stuff?”, options• Ask the user a question (say + wait)• Blocks while waiting for result• Options • attempts: how many tries do you get?
    76. 76. Scripting API - Basics ASK result = ask “Do you like stuff?”, options• Ask the user a question (say + wait)• Blocks while waiting for result• Options • attempts: how many tries do you get? • choices: grammar (allowable input)
    77. 77. Scripting API - Basics ASK result = ask “Do you like stuff?”, options• Ask the user a question (say + wait)• Blocks while waiting for result• Options • attempts: how many tries do you get? • choices: grammar (allowable input) • onXXXX: Event handlers for: timeout, bad input, etc.
    78. 78. Scripting API - Basics CALL
    79. 79. Scripting API - Basics CALL call “+17135551212ppp123”, options
    80. 80. Scripting API - Basics CALL call “+17135551212ppp123”, options• Makes an outbound call after session initiation (REST API)
    81. 81. Scripting API - Basics CALL call “+17135551212ppp123”, options• Makes an outbound call after session initiation (REST API) • pauses can be inserted into destination
    82. 82. Scripting API - Basics CALL call “+17135551212ppp123”, options• Makes an outbound call after session initiation (REST API) • pauses can be inserted into destination• Options
    83. 83. Scripting API - Basics CALL call “+17135551212ppp123”, options• Makes an outbound call after session initiation (REST API) • pauses can be inserted into destination• Options • channel: VOICE or TEXT
    84. 84. Scripting API - Basics CALL call “+17135551212ppp123”, options• Makes an outbound call after session initiation (REST API) • pauses can be inserted into destination• Options • channel: VOICE or TEXT • network: SIP, GTALK, JABBER, etc.
    85. 85. Scripting API - Basics CALL call “+17135551212ppp123”, options• Makes an outbound call after session initiation (REST API) • pauses can be inserted into destination• Options • channel: VOICE or TEXT • network: SIP, GTALK, JABBER, etc. • onXXXX: Event handlers
    86. 86. Scripting API - Basics HANGUP
    87. 87. Scripting API - Basics HANGUP hangup
    88. 88. Scripting API - Basics HANGUP hangup• Terminates the call
    89. 89. Scripting API - Basics MESSAGE
    90. 90. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}
    91. 91. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}• Used for one-off messages to user
    92. 92. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}• Used for one-off messages to user• Equivalent to a call, say, and hangup
    93. 93. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}• Used for one-off messages to user• Equivalent to a call, say, and hangup• Options
    94. 94. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}• Used for one-off messages to user• Equivalent to a call, say, and hangup• Options • channel: VOICE or TEXT
    95. 95. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}• Used for one-off messages to user• Equivalent to a call, say, and hangup• Options • channel: VOICE or TEXT • network: SIP, MSN, YAHOO
    96. 96. Scripting API - Basics MESSAGE message “Howdy”,{:channel => ‘TEXT’, :network => ‘YAHOO’, :to => ‘homeboy987’}• Used for one-off messages to user• Equivalent to a call, say, and hangup• Options • channel: VOICE or TEXT • network: SIP, MSN, YAHOO • to: destination number, username
    97. 97. Scripting API - Basics Events
    98. 98. Scripting API - Basics Events• Handlers can be specified for events on some verbs
    99. 99. Scripting API - Basics Events• Handlers can be specified for events on some verbs• ask • onBadChoice, onChoice
    100. 100. Scripting API - Basics Events• Handlers can be specified for events on some verbs• ask • onBadChoice, onChoice• call • onAnswer, onHangup
    101. 101. Scripting API - Basics Events• Handlers can be specified for events on some verbs• ask • onBadChoice, onChoice• call • onAnswer, onHangup• Signals - generic interrupts • https://www.tropo.com/docs/rest/ rest_tutorials.htm#event_tutorials
    102. 102. Making Outbound Calls with Tropo
    103. 103. Making Outbound Calls with Tropo• An outbound call is kicked off using the REST API to initiate a session
    104. 104. Making Outbound Calls with Tropo• An outbound call is kicked off using the REST API to initiate a session• Simulates an inbound message
    105. 105. Making Outbound Calls with Tropo• An outbound call is kicked off using the REST API to initiate a session• Simulates an inbound message• Programmatic or on-demand
    106. 106. Making Outbound Calls with Tropo• An outbound call is kicked off using the REST API to initiate a session• Simulates an inbound message• Programmatic or on-demand • http://api.tropo.com/1.0/sessions? action=create&token=voice_or_text_tok en[&custom_param_1=custom_value_1]
    107. 107. Making Outbound Calls with Tropo(*) Scripting API - script resides on Tropo server
    108. 108. Making Outbound Calls with Tropo(*) Scripting API - script resides on Tropo server
    109. 109. Making Outbound Calls with Tropo Script or APP(*) Scripting API - script resides on Tropo server
    110. 110. Making Outbound Calls with Tropo Script or APP(*) Scripting API - script resides on Tropo server
    111. 111. Making Outbound Calls with Tropo Script or APPHTTP Client (*) Scripting API - script resides on Tropo server
    112. 112. Making Outbound Calls with Tropo Script or APP (POST) GETHTTP Client (*) Scripting API - script resides on Tropo server
    113. 113. Making Outbound Calls with Tropo Script callback or APP (POST) GETHTTP Client (*) Scripting API - script resides on Tropo server
    114. 114. Making Outbound Calls with Tropo Script callback or “call” (JSON) APP (POST) GETHTTP Client (*) Scripting API - script resides on Tropo server
    115. 115. Making Outbound Calls with Tropo Script callback or “call” (JSON) APP Ca ll U (POST) se GET rHTTP Client (*) Scripting API - script resides on Tropo server
    116. 116. DEMO 2: First Steps, Outbound Username: hcc_demo Password: hcc_demo Calls Received From: 713 489 7498 “2012 Doomsday Clock”https://github.com/weyus/hcc_tropo_demos/blob/ master/demo2/2012_Doomsday_Countdown_outbound.rb
    117. 117. DEMO 2: First Steps, outbound Username: hcc_demo Password: hcc_demo Let’s look at the code
    118. 118. DEMO: First Steps, Outbound Lessons Learned
    119. 119. DEMO: First Steps, Outbound Lessons Learned • Simulated inbound call to app. via HTTP GET or POST call to session API
    120. 120. DEMO: First Steps, Outbound Lessons Learned • Simulated inbound call to app. via HTTP GET or POST call to session API • Can be used with voice or SMS
    121. 121. DEMO: First Steps, Outbound Lessons Learned • Simulated inbound call to app. via HTTP GET or POST call to session API • Can be used with voice or SMS • $currentCall is not populated on outbound call before “call”
    122. 122. INTERNATIONALIZATION SUPPORT
    123. 123. INTERNATIONALIZATION SUPPORT• Multi-language voice recognition • “recognizer” option on “ask” command • https://www.tropo.com/docs/webapi/ international_speech_recognition.htm
    124. 124. INTERNATIONALIZATION SUPPORT• Multi-language voice recognition • “recognizer” option on “ask” command • https://www.tropo.com/docs/webapi/ international_speech_recognition.htm• Multi-language text-to-speech output
    125. 125. INTERNATIONALIZATION SUPPORT• Multi-language voice recognition • “recognizer” option on “ask” command • https://www.tropo.com/docs/webapi/ international_speech_recognition.htm• Multi-language text-to-speech output• Voices: 60+ • https://www.tropo.com/docs/scripting/ international_speaking_other_languages.htm
    126. 126. INTERNATIONALIZATION SUPPORT• Multi-language voice recognition • “recognizer” option on “ask” command • https://www.tropo.com/docs/webapi/ international_speech_recognition.htm• Multi-language text-to-speech output• Voices: 60+ • https://www.tropo.com/docs/scripting/ international_speaking_other_languages.htm• Lots of international numbers
    127. 127. ADDITIONALCAPABILITIES
    128. 128. ADDITIONAL CAPABILITIES• Record calls and generate transcriptions (up to 2 hours)
    129. 129. ADDITIONAL CAPABILITIES• Record calls and generate transcriptions (up to 2 hours)• Transfer calls
    130. 130. ADDITIONAL CAPABILITIES• Record calls and generate transcriptions (up to 2 hours)• Transfer calls• Conference calling
    131. 131. ADDITIONAL CAPABILITIES• Record calls and generate transcriptions (up to 2 hours)• Transfer calls• Conference calling• Play audio files • Tropo-hosted or self-hosted
    132. 132. ADDITIONAL CAPABILITIES• Record calls and generate transcriptions (up to 2 hours)• Transfer calls• Conference calling• Play audio files • Tropo-hosted or self-hosted• Reject calls (voice only)
    133. 133. ADDITIONAL CAPABILITIES• Record calls and generate transcriptions (up to 2 hours)• Transfer calls• Conference calling• Play audio files • Tropo-hosted or self-hosted• Reject calls (voice only)• Advanced grammars (SRGS/GRXML)
    134. 134. VOICE VS. TEXT
    135. 135. VOICE VS. TEXT• Inspect channel on inbound message to determine what kind of message
    136. 136. VOICE VS. TEXT• Inspect channel on inbound message to determine what kind of message• Keep in mind for text channel: • initialText is set on the “session” input when a text comes • Throw away the initial text with a blank ask if you don’t want to use the inbound text
    137. 137. DEMO 3: Conferences, Transfers, Audio Username: hcc_demo Password: hcc_demo Calling to: 713 489 7524 “Conferences, Transfers, and Audio Files”https://github.com/weyus/hcc_tropo_demos/blob/ master/demo3/examples.rb
    138. 138. DEMO 3: Conferences, Transfers, Audio Username: hcc_demo Password: hcc_demo Let’s look at the code
    139. 139. Web API
    140. 140. Web API• Instead of compiling a script internally, Tropo issues a HTTP POST to your back end Web application (you specify the initial call in the app. setup)
    141. 141. Web API• Instead of compiling a script internally, Tropo issues a HTTP POST to your back end Web application (you specify the initial call in the app. setup)• Example back end code is from a Rails app.
    142. 142. Web API• Instead of compiling a script internally, Tropo issues a HTTP POST to your back end Web application (you specify the initial call in the app. setup)• Example back end code is from a Rails app.• Valid back end is anything that provides an HTTP endpoint and emits valid Tropo JSON
    143. 143. Web API• Instead of compiling a script internally, Tropo issues a HTTP POST to your back end Web application (you specify the initial call in the app. setup)• Example back end code is from a Rails app.• Valid back end is anything that provides an HTTP endpoint and emits valid Tropo JSON• API helpers for each language • Also Node.js, C#, Java, Grails, Erlang (?) • Basically provide wrappers for JSON generation
    144. 144. Web API
    145. 145. Web API• More seamless integration into existing application infrastructure than scripts
    146. 146. Web API• More seamless integration into existing application infrastructure than scripts• Scripts die, apps. (hopefully) do not
    147. 147. Web API• More seamless integration into existing application infrastructure than scripts• Scripts die, apps. (hopefully) do not• When you use the session API to make an outbound call, each additional parameter in the GET (or POST) call are passed in the POST back to the application as parameters[param_name]
    148. 148. Web API• More seamless integration into existing application infrastructure than scripts• Scripts die, apps. (hopefully) do not• When you use the session API to make an outbound call, each additional parameter in the GET (or POST) call are passed in the POST back to the application as parameters[param_name]• POST params come in differently depending on whether a new session or not
    149. 149. Web API - Events
    150. 150. Web API - Events• Slightly different event model
    151. 151. Web API - Events• Slightly different event model• Each Tropo request must be routed to next request URI
    152. 152. Web API - Events• Slightly different event model• Each Tropo request must be routed to next request URI• “on” JSON object • continue - required • timeout
    153. 153. Web API - Events t.on :event => continue, :next => process_answer_url• Slightly different event model• Each Tropo request must be routed to next request URI• “on” JSON object • continue - required • timeout
    154. 154. DEMO 4: WEB API Username: hcc_demo Password: hcc_demo Calls Received From: 713 489 5682KOACHED ARBITRARY MESSAGE SEND
    155. 155. DEMO 4: WEB API Username: hcc_demo Password: hcc_demo Let’s look at the code
    156. 156. Web API - HTTP Request Voice MessageStarted POST "/start.json?auth_token=6XcenKYWjthpe2x8jdRs" for66.193.54.21 at Fri Aug 19 16:44:00 -0700Processing by ProspectingController#start as JSONParameters: {"session"=> {"timestamp"=>Fri Aug 19 23:44:00 UTC 2011, "parameters"=>{"outbound_number"=>"17134895682", "token"=>"0622c2ed2295ff41baf5d2d2990156a29965361898 08a336e06225b1a77f0391f841405ee974299bb3ab5508", "username"=>"+1xxxxxxxxxx", "action"=>"create", "network"=>"SIP", "channel"=>"VOICE", "voice"=>"katrin", "message"=>"Test message."}, "callId"=>nil, "userType"=>"NONE", "id"=>"8c89342759e29279df6de3954bb7f0ea", "initialText"=>nil, "accountId"=>"52396"}, "auth_token"=>"6XcenKYWjthpe2x8jdRs"}
    157. 157. Web API - JSON Response Voice MessageResponse is: {"tropo": [{"message": {"say":[{"value":"Test message."}], "from":"17134895682", "network":"SIP", "to":"+1xxxxxxxxx;postd=p", "channel":"VOICE", "voice":"katrin"}}]}
    158. 158. Web API - HTTP Request SMS MessageStarted POST "/start.json?auth_token=6XcenKYWjthpe2x8jdRs" for66.193.54.21 at Fri Aug 19 16:44:35 -0700 2011Processing by ProspectingController#start as JSONParameters: {"session"=> {"timestamp"=>Fri Aug 19 23:44:35 UTC 2011, "parameters"=>{"outbound_number"=>"17134895682", "token"=>"0622c2ed2295ff41baf5d2d2990156a2996536189808 a336e06225b1a77f0391f841405ee974299bb3ab5508", "username"=>"+1xxxxxxxxx", "action"=>"create", "network"=>"SMS", "channel"=>"TEXT", "voice"=>"carmen", "message"=>"http://houstoncodecamp.com/"}, "callId"=>nil, "userType"=>"NONE", "id"=>"6b74525cf06e29cc911c3e5b86ea6353", "initialText"=>nil, "accountId"=>"52396"}, "auth_token"=>"6XcenKYWjthpe2x8jdRs"}
    159. 159. Web API - JSON Response SMS MessageResponse is: {"tropo": [{"message": {"say":[{"value":"Test message."}], "from":"17134895682", "network":"SMS", "to":"+1xxxxxxxxxx", "channel":"TEXT", "voice":"carmen"}}]}
    160. 160. Voice Recognition Metadata
    161. 161. Voice Recognition Metadata• Tropo provides lots of information about what it thinks the user said, which you can use to make decisions about it’s validity as application input
    162. 162. Voice Recognition Metadata• Tropo provides lots of information about what it thinks the user said, which you can use to make decisions about it’s validity as application input• "actions": { "name": "account_number", "attempts": 1, "disposition": "SUCCESS", "confidence": 100, "interpretation": "12345", "utterance": "1 2 3 4 5", "concept": "12345" }
    163. 163. Pricing
    164. 164. Pricing• $0.01 / SMS message
    165. 165. Pricing• $0.01 / SMS message• $0.03 / voice minute
    166. 166. Pricing• $0.01 / SMS message• $0.03 / voice minute• $3 / month / phone number
    167. 167. Pricing• $0.01 / SMS message• $0.03 / voice minute• $3 / month / phone number• $5 / month / toll-free phone number
    168. 168. Pricing• $0.01 / SMS message• $0.03 / voice minute• $3 / month / phone number• $5 / month / toll-free phone number• International rates vary
    169. 169. Pricing• $0.01 / SMS message• $0.03 / voice minute• $3 / month / phone number• $5 / month / toll-free phone number• International rates vary• https://www.tropo.com/pricing/
    170. 170. Phono.com and SMSified.com
    171. 171. Phono.com and SMSified.com• phono.com: “a simply jQuery plugin and Javascript library that turns any web browser into a phone”
    172. 172. Phono.com and SMSified.com• phono.com: “a simply jQuery plugin and Javascript library that turns any web browser into a phone”• smsified.com: “Build powerful SMS applications with our easy API”
    173. 173. MISCELLANY
    174. 174. MISCELLANY• Use Tunnlr to have a local Web server be able to be addressed by Tropo • https://www.tropo.com/docs/webapi/ using_tunnlr_reverse_ssh.htm
    175. 175. MISCELLANY• Use Tunnlr to have a local Web server be able to be addressed by Tropo • https://www.tropo.com/docs/webapi/ using_tunnlr_reverse_ssh.htm• Use Adhearsion (Ruby Asterisk API) for integration into Asterisk
    176. 176. MISCELLANY• Use Tunnlr to have a local Web server be able to be addressed by Tropo • https://www.tropo.com/docs/webapi/ using_tunnlr_reverse_ssh.htm• Use Adhearsion (Ruby Asterisk API) for integration into Asterisk• Tropo vs. Twilio Video: http:// www.youtube.com/watch?v=1y11S3cajUk
    177. 177. MISCELLANY• Use Tunnlr to have a local Web server be able to be addressed by Tropo • https://www.tropo.com/docs/webapi/ using_tunnlr_reverse_ssh.htm• Use Adhearsion (Ruby Asterisk API) for integration into Asterisk• Tropo vs. Twilio Video: http:// www.youtube.com/watch?v=1y11S3cajUk• Support has good response time for development
    178. 178. Resources
    179. 179. Resources• https://github.com/weyus/hcc_tropo_demos
    180. 180. Resources• https://github.com/weyus/hcc_tropo_demos• https://github.com/tropo/tropo-samples
    181. 181. Resources• https://github.com/weyus/hcc_tropo_demos• https://github.com/tropo/tropo-samples• https://github.com/tropo/tropo-webapi-ruby
    182. 182. Resources• https://github.com/weyus/hcc_tropo_demos• https://github.com/tropo/tropo-samples• https://github.com/tropo/tropo-webapi-ruby• tropo.com
    183. 183. Resources• https://github.com/weyus/hcc_tropo_demos• https://github.com/tropo/tropo-samples• https://github.com/tropo/tropo-webapi-ruby• tropo.com• smsified.com
    184. 184. Resources• https://github.com/weyus/hcc_tropo_demos• https://github.com/tropo/tropo-samples• https://github.com/tropo/tropo-webapi-ruby• tropo.com• smsified.com• phono.com
    185. 185. QUESTIONS?
    186. 186. QUESTIONS?• weyus@att.net
    187. 187. QUESTIONS?• weyus@att.net• @weyus
    188. 188. THANKS!

    ×