SlideShare a Scribd company logo
1 of 33
Introducing  Tropo Powered by Voxeo RJ Auburn  CTO
Once upon a time…
Now XML is in the enterprise…
Write apps directly in leading languages Tropo.com Ruby
Simple to Learn ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Simple to Deploy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Simple Business Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],+ = GO
Powerful Capabilities ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Developing with Voxeo XML-based Telephony Voxeo CallXML The easiest telephony markup ever devised    Tool-based Telephony Voxeo Designer Easy web-based, Visio-  like rapid app dev tool   VoiceObjects Sophisticated service creation environment, personalization, analytics VoiceXML The only 100% compliant browser CCXML The world’s most proven CCXML engine   A Voxeo Company API-based Telephony Tropo Mash-up style API in multiple language    Java Media Control JSR 309 Java SIP Servlets JSR 116/289 A Voxeo Company Simpler apps, all skill levels Sophisticated apps
So lets get to the code already…
T.1: Hello World JavaScript and PHP answer(); say("Hello, world!"); hangup(); Ruby answer say "Hello, world!” hangup Groovy answer() say 'Hello, world!' hangup() Python answer() say("Hello, world !") hangup()
T.2: Asking for Input - JavaScript // ----------- // asking for input // ----------- answer(); result=ask( "Hi. For sales, press 1. For support, press 2.", {choices:"1, 2"} ); if (result.name=='choice') { if (result.value=="1") { say( "sales is not available right now.") } if (result.value=="2") { say( "support is currently on the other line." ) } } hangup();
T.3: Repeating the Question - Ruby # ----------- # repeating the question # ----------- answer options = { :choices => '1, 2',  :repeat  => 3  } result = ask 'For sales, press 1. For support, press 2.', options if result.name == 'choice' case result.value when '1' say 'sales is not available right now.' when '2' say 'support is currently on the other line.' end end hangup
T.4: Changing Timeouts - Groovy // ----------- // changing the default timeout // ----------- answer(); result=ask( "For sales, press 1. For support, press 2.", [choices:"1, 2",repeat:3,  timeout:10 ] ); if (result.name=='choice') { if (result.value=="1") { say( "sales is not available right now.") } if (result.value=="2") { say( "support is currently on the other line." ) } } hangup();
T.5: Speech - Python # Using speech input instead of touch-tone answer() result = ask("Hi. For sales, say sales. For support, say support", {'choices':"sales, support", 'repeat':3}) if (result.name == 'choice'): if (result.value == "sales"):  say("Sales is not available right now") if (result.value == "support"):  say("Support is currently on the other line.") hangup()
T.6: Speech & DTMF - PHP <?php // ----------- // using both speech and touch-tone input // ----------- answer(); $result = ask( &quot;For sales, just say sales or press 1. For support, say support or press 2.&quot;,  array( &quot;choices&quot; => &quot;sales( 1, sales), support( 2, support)&quot; , &quot;repeat&quot; => 3 ) ); if ($result->name==&quot;choice&quot;) { if ($result->value==&quot; sales &quot;) say( &quot;sales is not available right now.&quot;  ) ; if ($result->value==&quot; support &quot;) say( &quot;support is currently on the other line.&quot; ) ;  } hangup(); ?>
T.7: Transfer Time - Ruby # ----------- # connecting the call to another number () # ----------- answer options = { :choices => 'sales( 1, sales), support( 2, support)',  :repeat  => 3 } result = ask 'For sales, say sales or press 1. For support, say support or press 2.', options if result.name == 'choice' case result.value when 'sales' say 'Ok, let me transfer you to sales.' transfer '14075551212' when 'support' say 'Sure, let me get support.  Please hold.' transfer '14085551212' end end hangup
T.8: Wrong Choices - Groovy answer(); result=ask( &quot;For sales, say sales or press 1. For support, say support or press 2.&quot;,  [choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3] ); if (result.name=='choice') { if (result.value==&quot;sales&quot;)  {  say( &quot;Ok, let me transfer you to sales.&quot;); transfer( &quot;14075551212&quot;); } if (result.value==&quot;support&quot;)  {  say( &quot;Sure, let me get support.  Please hold.&quot; ); transfer( &quot;14085551212&quot;); } } if( result.name=='badChoice') { say( &quot;I'm not sure what you wanted.  Goodbye.&quot;) }
T.9: Event Handlers - JavaScript answer(); result=ask( &quot;For sales, just say sales or press 1. For support, say support or press 2.&quot;,  { choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3, onBadChoice: function() { say(&quot;I'm sorry, I didn't understand what you said.&quot;) }  } ); if (result.name=='choice') { if (result.value==&quot;sales&quot;)  {  say( &quot;Ok, let me transfer you to sales.&quot;  ); transfer( &quot;14075551111&quot;); } if (result.value==&quot;support&quot;)  {  say( &quot;Sure, let me get support.  Please hold.&quot; ); transfer( &quot;14085552222&quot;); } }
T.10: Bad Choices - Ruby answer options = { :choices  => 'sales( 1, sales), support( 2, support)', :repeat  => 3, :onBadChoice => lambda { say ‘I did not understand what you said.' }, :onTimeout  => lambda { say 'Hm.  I did not hear anything.' } } result = ask 'For sales, just say sales or press 1. For support, say support or press 2.', options if result.name == 'choice' case result.value when 'sales' say 'Ok, let me transfer you to sales.' transfer '14075551212' when 'support' say 'Sure, let me get support.  Please hold.' transfer '14085551212' end end hangup
T.11: Right choices - Groovy // ----------- // handling good choices with event handlers too // ----------- answer(); ask( &quot;Hi. For sales, just say sales or press 1. For support, say support or press 2.&quot;,  [  choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3, onBadChoice: { say(&quot;I'm sorry, I didn't understand what you said.&quot;) }, onTimeout: { say(&quot;Hm.  I didn't hear anything.&quot;) }, onChoice: {event-> if (event.value=='sales') { say( &quot;Ok, let me transfer you to sales.&quot; ); transfer( &quot;14075551212&quot;); } if (event.value=='support') { say( &quot;Sure, let me get support. Please hold.&quot; ); transfer( &quot;14085551212&quot;); }  }  ] );
T.12: onEvent - JavaScript answer(); ask( &quot;Hi. For sales, just say sales or press 1. For support, say support or press 2.&quot;,  {  choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3, onEvent: function( event )  { if (event.name=='badChoice') { say( ”I didn't understand what you said.&quot;) } if (event.name=='timeout')  { say( &quot;Hm. I didn't hear anything.&quot;) } if (event.name=='choice') { if (event.value=='sales') { say( &quot;Ok, let me transfer you to sales.&quot; ); transfer( &quot;14075551111&quot;); } if (event.value=='support') { say( &quot;Sure, let me get support.  Please hold.&quot; ); transfer( &quot;14085551111&quot;); } } transfer( &quot;14075552222&quot;);  } } );
T.13: conditional accept - Ruby # ----------- # reject based on callerid # ----------- answer log &quot;*&quot;*100 + currentCall.inspect if currentCall.callerID == ’4078675309' answer say 'Hello there and goodbye' hangup else reject end
T.14: Bounce the Call - JavaScript // ----------- // redirect // ----------- answer(); if (currentCall.callerID == '4075551111')  answer() else redirect( &quot;14075552222&quot;);
T.15: Branching - Groovy // ----------- // Changing behavior based on number called // ----------- answer(); if (currentCall.calledID == '4075551111') say( &quot;Hello Andrew.&quot;); if (currentCall.calledID == '4075552222') say( &quot;Hello Brian. &quot;); hangup();
T.16 Recording - JavaScript answer(); event=record(&quot;Leave your message at the beep.  Thanks!&quot;, { beep:true, silenceTimeout: 5, maxTime:60, timeout:10, onRecord:function(event ) { say(&quot;you said &quot; + event.recordURI )  } } ); log( &quot;event.recordURI = &quot; + event.recordURI ); hangup();
Using Language Libraries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],from random import * number = randint(1,1000) answer() say(&quot;Hello. Your magic number today is %s. Goodbye.&quot; % number) hangup()
Mashing Up With Web Services # python app to retrieve and say a text file import urllib number= urllib.urlopen(&quot;http://blog-files.voxeo.com/media/test.txt&quot;).read() answer() say(&quot;Welcome to Tropo. Your magic number is %s. Goodbye.&quot; % number) hangup() // Groovy app to retrieve and say top ten hits from Yahoo music def musicbase = &quot;http://us.music.yahooapis.com/track/v1&quot; def appid = &quot;KgtDvNrV34Eavq_dUF81vBlVLKAOq7o1tj7Tzvu_kYbKsCtBW190VmrvVHK_0w--” say( &quot;, Top 10 Chart Toppers!&quot; ) def toptracksxml = new XmlSlurper().parseText( &quot;${musicbase}/list/published/popular?count=10&appid=${appid}&quot;.toURL().text ) toptracksxml.Track.each { track ->   say( &quot;, Number &quot; + track.ItemInfo.ChartPosition[&quot;@this&quot;] + &quot;, &quot; + track[&quot;@title&quot;] + &quot;, by &quot; + track.Artist[0][&quot;@name&quot;] ) } say( &quot;, Goodbye!&quot; ) hangup()
Getting Started with Tropo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
So How about some Cash?
[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
So start writing some code!

More Related Content

Similar to Tropo eComm 2009 Tutorial

Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
mussawir20
 
Voicecon - Mashups with Tropo.com
Voicecon - Mashups with Tropo.comVoicecon - Mashups with Tropo.com
Voicecon - Mashups with Tropo.com
Voxeo Corp
 
Pseudocode used in IMP-35 course
Pseudocode used in IMP-35 coursePseudocode used in IMP-35 course
Pseudocode used in IMP-35 course
Jussi Pohjolainen
 
Php Loop
Php LoopPhp Loop
Php Loop
lotlot
 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
mussawir20
 
PHP Basics for Designers
PHP Basics for DesignersPHP Basics for Designers
PHP Basics for Designers
Matthew Turland
 
LocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputsLocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputs
Suite Solutions
 
Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2
alish sha
 

Similar to Tropo eComm 2009 Tutorial (20)

Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
 
What Is Php
What Is PhpWhat Is Php
What Is Php
 
Voicecon - Mashups with Tropo.com
Voicecon - Mashups with Tropo.comVoicecon - Mashups with Tropo.com
Voicecon - Mashups with Tropo.com
 
Php Training
Php TrainingPhp Training
Php Training
 
Pseudocode used in IMP-35 course
Pseudocode used in IMP-35 coursePseudocode used in IMP-35 course
Pseudocode used in IMP-35 course
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Php Loop
Php LoopPhp Loop
Php Loop
 
XML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARXML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEAR
 
REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)
 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
 
PHP Basics for Designers
PHP Basics for DesignersPHP Basics for Designers
PHP Basics for Designers
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
 
Phone calls and sms from php
Phone calls and sms from phpPhone calls and sms from php
Phone calls and sms from php
 
Web development
Web developmentWeb development
Web development
 
LocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputsLocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputs
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion Applications
 
Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2
 
Testing Merb
Testing MerbTesting Merb
Testing Merb
 

More from Voxeo Corp

Voxeo Summit Day 2 - Voxeo CXP - IVR on Steroids
Voxeo Summit Day 2 - Voxeo CXP - IVR on SteroidsVoxeo Summit Day 2 - Voxeo CXP - IVR on Steroids
Voxeo Summit Day 2 - Voxeo CXP - IVR on Steroids
Voxeo Corp
 
Voxeo Summit Day 2 - Using CXP hotspot analytics
Voxeo Summit Day 2 - Using CXP hotspot analyticsVoxeo Summit Day 2 - Using CXP hotspot analytics
Voxeo Summit Day 2 - Using CXP hotspot analytics
Voxeo Corp
 
Voxeo Summit Day 2 - Securing customer interactions
Voxeo Summit Day 2 - Securing customer interactionsVoxeo Summit Day 2 - Securing customer interactions
Voxeo Summit Day 2 - Securing customer interactions
Voxeo Corp
 
Voxeo Summit Day 2 - Real-time communications with WebRTC
Voxeo Summit Day 2 - Real-time communications with WebRTCVoxeo Summit Day 2 - Real-time communications with WebRTC
Voxeo Summit Day 2 - Real-time communications with WebRTC
Voxeo Corp
 
Voxeo Summit Day 2 - Voxeo CXP for business users
Voxeo Summit Day 2 - Voxeo CXP for business usersVoxeo Summit Day 2 - Voxeo CXP for business users
Voxeo Summit Day 2 - Voxeo CXP for business users
Voxeo Corp
 
Voxeo Summit Day 2 - Creating raving fans
Voxeo Summit Day 2 - Creating raving fansVoxeo Summit Day 2 - Creating raving fans
Voxeo Summit Day 2 - Creating raving fans
Voxeo Corp
 
Voxeo Summit Day 2 - Advanced CCXML topics
Voxeo Summit Day 2 - Advanced CCXML topicsVoxeo Summit Day 2 - Advanced CCXML topics
Voxeo Summit Day 2 - Advanced CCXML topics
Voxeo Corp
 
Voxeo Summit Day 2 - The science of customer obsession
Voxeo Summit Day 2 - The science of customer obsessionVoxeo Summit Day 2 - The science of customer obsession
Voxeo Summit Day 2 - The science of customer obsession
Voxeo Corp
 

More from Voxeo Corp (20)

Voxeo Summit Day 2 -What's new in CXP 14
Voxeo Summit Day 2 -What's new in CXP 14Voxeo Summit Day 2 -What's new in CXP 14
Voxeo Summit Day 2 -What's new in CXP 14
 
Voxeo Summit Day 2 -Voxeo APIs and SDKs
Voxeo Summit Day 2 -Voxeo APIs and SDKsVoxeo Summit Day 2 -Voxeo APIs and SDKs
Voxeo Summit Day 2 -Voxeo APIs and SDKs
 
Voxeo Summit Day 2 - Voxeo CXP - IVR on Steroids
Voxeo Summit Day 2 - Voxeo CXP - IVR on SteroidsVoxeo Summit Day 2 - Voxeo CXP - IVR on Steroids
Voxeo Summit Day 2 - Voxeo CXP - IVR on Steroids
 
Voxeo Summit Day 2 - Using CXP hotspot analytics
Voxeo Summit Day 2 - Using CXP hotspot analyticsVoxeo Summit Day 2 - Using CXP hotspot analytics
Voxeo Summit Day 2 - Using CXP hotspot analytics
 
Voxeo Summit Day 2 - Securing customer interactions
Voxeo Summit Day 2 - Securing customer interactionsVoxeo Summit Day 2 - Securing customer interactions
Voxeo Summit Day 2 - Securing customer interactions
 
Voxeo Summit Day 2 - Real-time communications with WebRTC
Voxeo Summit Day 2 - Real-time communications with WebRTCVoxeo Summit Day 2 - Real-time communications with WebRTC
Voxeo Summit Day 2 - Real-time communications with WebRTC
 
Voxeo Summit Day 2 - Voxeo CXP for business users
Voxeo Summit Day 2 - Voxeo CXP for business usersVoxeo Summit Day 2 - Voxeo CXP for business users
Voxeo Summit Day 2 - Voxeo CXP for business users
 
Voxeo Summit Day 2 - Creating raving fans
Voxeo Summit Day 2 - Creating raving fansVoxeo Summit Day 2 - Creating raving fans
Voxeo Summit Day 2 - Creating raving fans
 
Voxeo Summit Day 2 - Advanced CCXML topics
Voxeo Summit Day 2 - Advanced CCXML topicsVoxeo Summit Day 2 - Advanced CCXML topics
Voxeo Summit Day 2 - Advanced CCXML topics
 
Voxeo Summit Day 2 - The science of customer obsession
Voxeo Summit Day 2 - The science of customer obsessionVoxeo Summit Day 2 - The science of customer obsession
Voxeo Summit Day 2 - The science of customer obsession
 
Voxeo Summit Day 1 - Extending your IVR investment to mobile
Voxeo Summit Day 1 - Extending your IVR investment to mobileVoxeo Summit Day 1 - Extending your IVR investment to mobile
Voxeo Summit Day 1 - Extending your IVR investment to mobile
 
Voxeo Summit Day 1 - The Art of The Possible
Voxeo Summit Day 1 - The Art of The PossibleVoxeo Summit Day 1 - The Art of The Possible
Voxeo Summit Day 1 - The Art of The Possible
 
Voxeo Summit Day 1 - Prophecy log search
Voxeo Summit Day 1 - Prophecy log searchVoxeo Summit Day 1 - Prophecy log search
Voxeo Summit Day 1 - Prophecy log search
 
Voxeo Summit Day 1 - Customer experience analytics
Voxeo Summit Day 1 - Customer experience analyticsVoxeo Summit Day 1 - Customer experience analytics
Voxeo Summit Day 1 - Customer experience analytics
 
Voxeo Summit Day 1 - Communications-enabled Business Processes (CEBP)
Voxeo Summit Day 1 - Communications-enabled Business Processes (CEBP)Voxeo Summit Day 1 - Communications-enabled Business Processes (CEBP)
Voxeo Summit Day 1 - Communications-enabled Business Processes (CEBP)
 
Voxeo Summit Day 1 - A view into the Voxeo cloud
Voxeo Summit Day 1 - A view into the Voxeo cloudVoxeo Summit Day 1 - A view into the Voxeo cloud
Voxeo Summit Day 1 - A view into the Voxeo cloud
 
Voxeo Summit Day 1 - Lessons learned from large scale deployments
Voxeo Summit Day 1 - Lessons learned from large scale deploymentsVoxeo Summit Day 1 - Lessons learned from large scale deployments
Voxeo Summit Day 1 - Lessons learned from large scale deployments
 
Voxeo Jam Session: What's New in Prophecy 11 and VoiceObjects 11?
Voxeo Jam Session: What's New in Prophecy 11 and VoiceObjects 11?Voxeo Jam Session: What's New in Prophecy 11 and VoiceObjects 11?
Voxeo Jam Session: What's New in Prophecy 11 and VoiceObjects 11?
 
How Do You Hear Me Now?
How Do You Hear Me Now?How Do You Hear Me Now?
How Do You Hear Me Now?
 
CCXML For Advanced Communications Applications
CCXML For Advanced Communications ApplicationsCCXML For Advanced Communications Applications
CCXML For Advanced Communications Applications
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Tropo eComm 2009 Tutorial

  • 1. Introducing Tropo Powered by Voxeo RJ Auburn CTO
  • 2. Once upon a time…
  • 3. Now XML is in the enterprise…
  • 4. Write apps directly in leading languages Tropo.com Ruby
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Developing with Voxeo XML-based Telephony Voxeo CallXML The easiest telephony markup ever devised    Tool-based Telephony Voxeo Designer Easy web-based, Visio- like rapid app dev tool   VoiceObjects Sophisticated service creation environment, personalization, analytics VoiceXML The only 100% compliant browser CCXML The world’s most proven CCXML engine A Voxeo Company API-based Telephony Tropo Mash-up style API in multiple language    Java Media Control JSR 309 Java SIP Servlets JSR 116/289 A Voxeo Company Simpler apps, all skill levels Sophisticated apps
  • 10. So lets get to the code already…
  • 11. T.1: Hello World JavaScript and PHP answer(); say(&quot;Hello, world!&quot;); hangup(); Ruby answer say &quot;Hello, world!” hangup Groovy answer() say 'Hello, world!' hangup() Python answer() say(&quot;Hello, world !&quot;) hangup()
  • 12. T.2: Asking for Input - JavaScript // ----------- // asking for input // ----------- answer(); result=ask( &quot;Hi. For sales, press 1. For support, press 2.&quot;, {choices:&quot;1, 2&quot;} ); if (result.name=='choice') { if (result.value==&quot;1&quot;) { say( &quot;sales is not available right now.&quot;) } if (result.value==&quot;2&quot;) { say( &quot;support is currently on the other line.&quot; ) } } hangup();
  • 13. T.3: Repeating the Question - Ruby # ----------- # repeating the question # ----------- answer options = { :choices => '1, 2', :repeat => 3 } result = ask 'For sales, press 1. For support, press 2.', options if result.name == 'choice' case result.value when '1' say 'sales is not available right now.' when '2' say 'support is currently on the other line.' end end hangup
  • 14. T.4: Changing Timeouts - Groovy // ----------- // changing the default timeout // ----------- answer(); result=ask( &quot;For sales, press 1. For support, press 2.&quot;, [choices:&quot;1, 2&quot;,repeat:3, timeout:10 ] ); if (result.name=='choice') { if (result.value==&quot;1&quot;) { say( &quot;sales is not available right now.&quot;) } if (result.value==&quot;2&quot;) { say( &quot;support is currently on the other line.&quot; ) } } hangup();
  • 15. T.5: Speech - Python # Using speech input instead of touch-tone answer() result = ask(&quot;Hi. For sales, say sales. For support, say support&quot;, {'choices':&quot;sales, support&quot;, 'repeat':3}) if (result.name == 'choice'): if (result.value == &quot;sales&quot;): say(&quot;Sales is not available right now&quot;) if (result.value == &quot;support&quot;): say(&quot;Support is currently on the other line.&quot;) hangup()
  • 16. T.6: Speech & DTMF - PHP <?php // ----------- // using both speech and touch-tone input // ----------- answer(); $result = ask( &quot;For sales, just say sales or press 1. For support, say support or press 2.&quot;, array( &quot;choices&quot; => &quot;sales( 1, sales), support( 2, support)&quot; , &quot;repeat&quot; => 3 ) ); if ($result->name==&quot;choice&quot;) { if ($result->value==&quot; sales &quot;) say( &quot;sales is not available right now.&quot; ) ; if ($result->value==&quot; support &quot;) say( &quot;support is currently on the other line.&quot; ) ; } hangup(); ?>
  • 17. T.7: Transfer Time - Ruby # ----------- # connecting the call to another number () # ----------- answer options = { :choices => 'sales( 1, sales), support( 2, support)', :repeat => 3 } result = ask 'For sales, say sales or press 1. For support, say support or press 2.', options if result.name == 'choice' case result.value when 'sales' say 'Ok, let me transfer you to sales.' transfer '14075551212' when 'support' say 'Sure, let me get support. Please hold.' transfer '14085551212' end end hangup
  • 18. T.8: Wrong Choices - Groovy answer(); result=ask( &quot;For sales, say sales or press 1. For support, say support or press 2.&quot;, [choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3] ); if (result.name=='choice') { if (result.value==&quot;sales&quot;) { say( &quot;Ok, let me transfer you to sales.&quot;); transfer( &quot;14075551212&quot;); } if (result.value==&quot;support&quot;) { say( &quot;Sure, let me get support. Please hold.&quot; ); transfer( &quot;14085551212&quot;); } } if( result.name=='badChoice') { say( &quot;I'm not sure what you wanted. Goodbye.&quot;) }
  • 19. T.9: Event Handlers - JavaScript answer(); result=ask( &quot;For sales, just say sales or press 1. For support, say support or press 2.&quot;, { choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3, onBadChoice: function() { say(&quot;I'm sorry, I didn't understand what you said.&quot;) } } ); if (result.name=='choice') { if (result.value==&quot;sales&quot;) { say( &quot;Ok, let me transfer you to sales.&quot; ); transfer( &quot;14075551111&quot;); } if (result.value==&quot;support&quot;) { say( &quot;Sure, let me get support. Please hold.&quot; ); transfer( &quot;14085552222&quot;); } }
  • 20. T.10: Bad Choices - Ruby answer options = { :choices => 'sales( 1, sales), support( 2, support)', :repeat => 3, :onBadChoice => lambda { say ‘I did not understand what you said.' }, :onTimeout => lambda { say 'Hm. I did not hear anything.' } } result = ask 'For sales, just say sales or press 1. For support, say support or press 2.', options if result.name == 'choice' case result.value when 'sales' say 'Ok, let me transfer you to sales.' transfer '14075551212' when 'support' say 'Sure, let me get support. Please hold.' transfer '14085551212' end end hangup
  • 21. T.11: Right choices - Groovy // ----------- // handling good choices with event handlers too // ----------- answer(); ask( &quot;Hi. For sales, just say sales or press 1. For support, say support or press 2.&quot;, [ choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3, onBadChoice: { say(&quot;I'm sorry, I didn't understand what you said.&quot;) }, onTimeout: { say(&quot;Hm. I didn't hear anything.&quot;) }, onChoice: {event-> if (event.value=='sales') { say( &quot;Ok, let me transfer you to sales.&quot; ); transfer( &quot;14075551212&quot;); } if (event.value=='support') { say( &quot;Sure, let me get support. Please hold.&quot; ); transfer( &quot;14085551212&quot;); } } ] );
  • 22. T.12: onEvent - JavaScript answer(); ask( &quot;Hi. For sales, just say sales or press 1. For support, say support or press 2.&quot;, { choices:&quot;sales( 1, sales), support( 2, support)&quot;, repeat:3, onEvent: function( event ) { if (event.name=='badChoice') { say( ”I didn't understand what you said.&quot;) } if (event.name=='timeout') { say( &quot;Hm. I didn't hear anything.&quot;) } if (event.name=='choice') { if (event.value=='sales') { say( &quot;Ok, let me transfer you to sales.&quot; ); transfer( &quot;14075551111&quot;); } if (event.value=='support') { say( &quot;Sure, let me get support. Please hold.&quot; ); transfer( &quot;14085551111&quot;); } } transfer( &quot;14075552222&quot;); } } );
  • 23. T.13: conditional accept - Ruby # ----------- # reject based on callerid # ----------- answer log &quot;*&quot;*100 + currentCall.inspect if currentCall.callerID == ’4078675309' answer say 'Hello there and goodbye' hangup else reject end
  • 24. T.14: Bounce the Call - JavaScript // ----------- // redirect // ----------- answer(); if (currentCall.callerID == '4075551111') answer() else redirect( &quot;14075552222&quot;);
  • 25. T.15: Branching - Groovy // ----------- // Changing behavior based on number called // ----------- answer(); if (currentCall.calledID == '4075551111') say( &quot;Hello Andrew.&quot;); if (currentCall.calledID == '4075552222') say( &quot;Hello Brian. &quot;); hangup();
  • 26. T.16 Recording - JavaScript answer(); event=record(&quot;Leave your message at the beep. Thanks!&quot;, { beep:true, silenceTimeout: 5, maxTime:60, timeout:10, onRecord:function(event ) { say(&quot;you said &quot; + event.recordURI ) } } ); log( &quot;event.recordURI = &quot; + event.recordURI ); hangup();
  • 27.
  • 28. Mashing Up With Web Services # python app to retrieve and say a text file import urllib number= urllib.urlopen(&quot;http://blog-files.voxeo.com/media/test.txt&quot;).read() answer() say(&quot;Welcome to Tropo. Your magic number is %s. Goodbye.&quot; % number) hangup() // Groovy app to retrieve and say top ten hits from Yahoo music def musicbase = &quot;http://us.music.yahooapis.com/track/v1&quot; def appid = &quot;KgtDvNrV34Eavq_dUF81vBlVLKAOq7o1tj7Tzvu_kYbKsCtBW190VmrvVHK_0w--” say( &quot;, Top 10 Chart Toppers!&quot; ) def toptracksxml = new XmlSlurper().parseText( &quot;${musicbase}/list/published/popular?count=10&appid=${appid}&quot;.toURL().text ) toptracksxml.Track.each { track ->   say( &quot;, Number &quot; + track.ItemInfo.ChartPosition[&quot;@this&quot;] + &quot;, &quot; + track[&quot;@title&quot;] + &quot;, by &quot; + track.Artist[0][&quot;@name&quot;] ) } say( &quot;, Goodbye!&quot; ) hangup()
  • 29.
  • 30. So How about some Cash?
  • 31.
  • 32.
  • 33. So start writing some code!