The document discusses a presentation given at Cluecon 2009 about simplifying communication application development. It promotes using Tropo.com's script-based approach to build applications that integrate voice and telephony capabilities using common programming languages like JavaScript, Ruby, Python, and Groovy. Examples are provided demonstrating how to perform tasks like answering calls, speaking prompts, handling input, and transferring calls using just a few lines of code in different languages. The presentation argues this type of simplified development model is needed as phone usage changes and more "communication applications" that bring together voice, text, and other channels are created.
28. SIP Servlets
- Standard Java based API for
writing SIP applications.
- 1.0 standardized as JSR-116.
- 1.1 just released as JSR-289
- Extends the HTTP Servlet model
to support SIP and telephony
applications
- http://www.sipservlet.com/
- Supported by a large number of
application servers including
Oracle (BEA), IBM, Sun, Voxeo.
29. JSR-309
- Java Media Server API
- Based on the CCXML
media model
- Still in draft stage
- Provides dialog
resources,
conferencing, media
routing to Java
applications
38. •! answer
•! redirect •! ask
•! reject •! say •! log
•! record •! wait •! call
•! default •! transfer
•! hangup
Simple to Learn
39. Simple to Deploy
•Hosted service or OPEN SOURCE
•Accessible via Phone, SIP, Skype etc
•Inbound and Outbound calling
•Free for developers
•No setup costs
•Five minutes from sign-up to live deployment
+ = GO
49. T.1: Hello World
JavaScript and PHP Ruby
answer(); answer
say("Hello, world!"); say "Hello, world!”
hangup(); hangup
Python Groovy
answer() answer()
say("Hello, world !") say 'Hello, world!'
hangup() hangup()
50. 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();
51. Using ASR - 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()
52. Using ASR and DTMF - JavaScript
answer();
result=ask( "For sales, just say sales or press 1. For support, say support or press 2.",
{ choices:"sales( 1, sales), support( 2, support)", repeat:3,
onBadChoice: function() { say("I'm sorry, I didn't understand what you said.") }
} );
if (result.name=='choice')
{
if (result.value=="sales")
{
say( "Ok, let me transfer you to sales." );
transfer( "14075551111");
}
if (result.value=="support")
{
say( "Sure, let me get support. Please hold." );
transfer( "14085552222");
}
}
53. Twitter Example - Groovy
answer()
if (currentCall.callerID == "8315551234") {
def event = ask("Welcome RJ. Please enter the phone number you wish",
[choices:"[10 DIGITS]",timeout:10])
if (event.name=="choice") {
transfer(event.value)
} else {
say ("too slow bro.")
hangup();
}
} else {
say("Thank you for calling RJ. We will connect you now.")
say("His twitter status is")
String xml =
"http://twitter.com/statuses/user_timeline.xml?screen_name=zscgeek".toURL().text
def strXML = new XmlParser().parseText(xml)
say(strXML.statuses.status[0].text.text())
transfer("tel:+18315551234")
}