KEMBAR78
Getting Started: Developing Tropo Applications | PPTX
Getting Started
Developing Tropo Applications
Phil Bellanti - Technical Marketing Engineer
DEVNET-1023
• Introductions
• Tropo Overview
• Incoming Calls
• Outgoing Calls
• Advanced Features
• Text Messaging (SMS)
• Advanced Speech Concepts
• REST APIs
• What is WebAPI?
• Questions?
Agenda
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Cloud APIs enabling developers to quickly
and easily embed communication
capabilities into their applications and
business processes.
DEVNET-1023 3
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Old-style
Communication
Development
4DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
+
• Ask
• Call
• Conference
• Hangup
• Record
• Reject
• Say
• Transfer
DEVNET-1023 5
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
PHP
<?php
answer();
say("Hello World");
hangup();
?>
Javascript
answer();
say("Hello World");
hangup();
Ruby
answer
say "Hello World"
hangup
Python
answer()
say("Hello World")
hangup()
Groovy
answer()
say("Hello World")
hangup()
DEVNET-1023 6
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
<?php
$options = array('choices' => '1 (1, sales),
2 (2, support)');
$result = ask('Hi. For sales, say Sales or press 1.
For support, say Support or press 2.',
$options);
if ($result->name == 'choice') {
switch ($result->value) {
case 1:
say('Your money is important to us.');
break;
case 2:
say('Your call will be ignored in the order
received.');
break;
}
}
?>
DEVNET-1023 7
Incoming Calls
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 10DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Inbound Capabilities:
User Calls or Texts App
• Surveys / Voting
• Voice Search
• Seasonal Spikes
• Audio Conferencing
• Information Lookup
• Basic Auto Attendant
DEVNET-1023 11
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Incoming Calls
answer();
say("Welcome to Tropo!");
hangup();
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
Incoming Calls
say("Welcome to Tropo!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
Playing Audio
say("http://www.phono.com/audio/troporocks.mp3")
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
Asking Questions
var result = ask("What's your favorite color?
Choose from red, blue or green.", {
choices:"red, blue, green"
});
say("You said " + result.value);
log("They said " + result.value);
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
Asking Questions
var result=ask("Pick a number from 0 to 9", {
choices:"0,1,2,3,4,5,6,7,8,9"
});
say("You said " + result.value);
log("They said " + result.value);
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
Grammar Builtins
result=ask("Pick a number from 0 to 9", {
choices:"[1 DIGIT]"
});
say("You said " + result.value);
log("They said " + result.value);
choices:"[4 DIGITS]"
OR
choices:"[4-16 DIGITS]"
DEVNET-1023
Outgoing Calls
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 19DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
Outbound Capabilities:
App Calls or Texts User
• Voice Broadcast
• Conditional Alerts
• Click-to-Call
• Appointment Reminders
• Two Factor Authentication
• Confirmation SMS
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
Outgoing Calls
call("+14155550100");
say("Tag, you’re it!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 22
Outgoing Calls
call("sip:alice@example.com");
say("Tag, you’re it!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
Outgoing Calls
call("+14155550100");
call("14155550100");
call("4155550100");
call("+1 415 555-0100");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
Outgoing Calls
call(
[
"+14075550100",
"sip:alice@example.com"
]
);
say("Tag, you're it!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + numberToDial);
say("Hey, "+ customerName +": "+ msg);
POST /rest/1/Sessions
{
"token": "abcdef123456",
"customerName": "John Dyer",
"numberToDial": "14075551212",
"msg": "the sky is falling."
}
25DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + numberToDial);
say("Hey, "+ customerName +": "+ msg);
POST /rest/1/Sessions
{
"token": "abcdef123456",
"customerName": "John Dyer",
"numberToDial": "14075551212",
"msg": "the sky is falling."
}
26DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + numberToDial);
say("Hey, "+ customerName +": "+ msg);
POST /rest/1/Sessions
{
"token": "abcdef123456",
"customerName": "John Dyer",
"numberToDial": "14075551212",
"msg": "the sky is falling."
}
27DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + numberToDial);
POST /rest/1/Sessions
{
"whatever": "14075551212"
}
28DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + numberToDial);
POST /rest/1/Sessions
{
"whatever": "14075551212"
}
29DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + numberToDial);
POST /rest/1/Sessions
{
"whatever": "14075551212"
}
30DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + whatever);
POST /rest/1/Sessions
{
"whatever": "14075551212"
}
31DEVNET-1023
Transfers
& Call Control
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
Controlling a Call
transfer("+14075550100");
transfer([
"+14075550100",
"+16505559876"
]);
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
transfer(["+14075550100","sip:12345678912
@221.122.54.86"], {
playvalue:
"http://example.com/holdmusic.mp3",
terminator: "*",
onTimeout: function(event) {
say("nobody answered");
}
});
34DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
Rejecting calls
reject();
var callerID = currentCall.callerID;
if (callerID == "4155550100") {
reject();
}
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
Redirect
redirect("sip:alice@example.com");
DEVNET-1023
Recording
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
record("Leave your message at the beep.
Press pound when finished.", {
beep:true,
timeout:10,
silenceTimeout:7,
maxTime:60,
terminator:'#',
recordFormat:"audio/mp3",
recordURI:"ftp://example.com/1.mp3",
recordUser:"tropocloud",
recordPassword:"password"
}
);
38DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
var rec = record("Leave a message.");
say(rec.value);
39DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
var rec = record("Leave a message.");
say(rec.value);
40DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
var rec = record("Leave a message.");
say(rec.value);
41DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
startCallRecording("http://example.com/recording.js");
ask("What's your favorite color? Choose from red,
blue or green.", {
choices:"red, blue, green"
});
stopCallRecording();
42DEVNET-1023
Caller ID
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
Reading Caller ID
if (currentCall.callerID == "4075550100") {
say("Sending you to Adam.");
transfer("+19166002497");
}
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 45
Setting Caller ID
call("+19165550101", {
callerID:"+14075550100"
});
transfer("+19165550100", {
callerID: "14075550100"
});
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
Rejecting calls
reject();
var callerID = currentCall.callerID;
if (callerID == "4155550100") {
reject();
}
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Hanging up
• Explicitly, through hangup();
• When a script ends
• When execution fails
47DEVNET-1023
Conferencing
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 49
Conferencing
conference("1138");
conference("2600hz");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
result=ask("What is your conference ID?",
{choices:"[4 DIGITS]"}
);
conference(result.value);
50DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
conference("12345", {
joinPrompt: "Someone joined",
leavePrompt: "Someone left",
});
51DEVNET-1023
Text Messaging
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 53
Text Messages
call("+14155550100",
{network:"SMS"}
);
say("Tag, you’re it!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 54
Text Messages
call("+14155550100",
{network:"SMS"}
);
say("Tag, you’re it!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
call('+' + to, {network:"SMS"});
say(msg);
POST /rest/1/Sessions
{
"token": "abcd12345",
"to": "14075551212",
"msg": "the sky is falling."
}
55DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 56
Incoming SMS
say("Welcome to Tropo!");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 57
First SMS Message
currentCall.initialText;
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 58
Multichannel
say("Thanks for your call. We'll text you
the information.");
hangup();
call(currentCall.callerID, {
network:"SMS"});
say("Here's what you asked for.");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 59
Message Shortcut
say("Thanks for your call. We'll text you
the information.");
message("Here's what you asked for.",
{
to: currentCall.callerID,
network: "SMS"}
);
say("This goes to the voice call.");
DEVNET-1023
Advanced Speech Concepts
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 61
Speech Control
say("1234");
“One thousand two hundred thirty four”
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
Speech Control
say("1 2 3 4");
“One Two Three Four”
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 63
SSML
say("<speak>
<say-as interpret-as='vxml:digits'>
1234
</say-as>
</speak>");
“One Two Three Four”
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 64
say-as
• currency
• number
• phone
• date
• time
interpret-as='vxml:digits'
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 65
Prosody
say("<speak>One potato, two potato, three potato,
four. <prosody rate='-50%'>One potato, two potato,
three potato, four.</prosody></speak>");
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 66
TTS Fallback
say('<speak>
<audio src="http://example.com/welcome.wav">
This text will be spoken if
the audio file can not be
played.
</audio>
</speak>');
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Grammars
• SimpleGrammar
• hamburger(burger, cheeseburger, hamburger)
• GrXML
• ABNF
• SRGS
67DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 68
SimpleGrammar
var foo = ask("Who?", {
choices: "department(support, engineering,
sales), person(jose, jason, adam)",
});
say("You said " + foo.choice.interpretation + ",
which is a " +
foo.value);
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 69
External Grammars
var result = ask("What's your destination?", {
choices:"http://example.com/tropo/destinations.grxml"
});
DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" root="main">
<rule id="main" scope="public">
<item repeat="1-16">
<ruleref uri="#digit">
<tag>out.concept = out.concept + rules.digit;</tag>
</ruleref>
</item>
</rule>
<rule id="digit">
<one-of>
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
</one-of>
</rule>
</grammar>
70DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Audio Playback
• 8kHz, 8bit u-law (wav or raw) (*.wav or *.ulaw)
• 8kHz, 8bit a-law (wav or raw) (*.wav or *.alaw)
• 8kHz, 8bit pcm (wav) (*.wav)
• 8khz, 16bit pcm (wav or raw) (*.wav or *.pcm)
• MS-GSM (wav) (*.wav)
• GSM 6.10 (raw) (*.gsm)
• MP3
71DEVNET-1023
Rest APIs
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Session
• Start a new session
• Send a signal to an existing session
73DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Conference
• Mute and unmute participants
• Play an audio file to all members of a conference
74DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Provisioning
• Manage applications, users, and phone numbers
• Full role-based access control
• Tropo Commander and UI both built on this
75DEVNET-1023
WebAPI
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
What is it?
• Uses JSON over http to communicate with Tropo
• Most large-scale customers stick with Scripting
• Web Scale issues
77DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Complete Your Online Session Evaluation
Don’t forget: Cisco Live sessions will be available
for viewing on-demand after the event at
CiscoLive.com/Online
• Give us your feedback to be
entered into a Daily Survey
Drawing. A daily winner will
receive a $750 Amazon gift card.
• Complete your session surveys
through the Cisco Live mobile
app or from the Session Catalog
on CiscoLive.com/us.
78DEVNET-1023
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public
Continue Your Education
• Tropo.com ScriptingAPI Quickstart Guide:
https://www.tropo.com/docs/scripting/quickstarts
• More Learning Labs Available:
https://developer.cisco.com/site/devnet/overview/index.gsp
• Follow @Tropo and @PBellanti on Twitter
• Stay Up to Date on All Things Tropo:
https://www.tropo.com/category/blog/
79DEVNET-1023
Please join us for the Service Provider Innovation Talk featuring:
Yvette Kanouff | Senior Vice President and General Manager, SP Business
Joe Cozzolino | Senior Vice President, Cisco Services
Thursday, July 14th, 2016
11:30 am - 12:30 pm, In the Oceanside A room
What to expect from this innovation talk
• Insights on market trends and forecasts
• Preview of key technologies and capabilities
• Innovative demonstrations of the latest and greatest products
• Better understanding of how Cisco can help you succeed
Register to attend the session live now or
watch the broadcast on cisco.com
Thank you
Getting Started: Developing Tropo Applications

Getting Started: Developing Tropo Applications

  • 1.
    Getting Started Developing TropoApplications Phil Bellanti - Technical Marketing Engineer DEVNET-1023
  • 2.
    • Introductions • TropoOverview • Incoming Calls • Outgoing Calls • Advanced Features • Text Messaging (SMS) • Advanced Speech Concepts • REST APIs • What is WebAPI? • Questions? Agenda
  • 3.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Cloud APIs enabling developers to quickly and easily embed communication capabilities into their applications and business processes. DEVNET-1023 3
  • 4.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Old-style Communication Development 4DEVNET-1023
  • 5.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public + • Ask • Call • Conference • Hangup • Record • Reject • Say • Transfer DEVNET-1023 5
  • 6.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public PHP <?php answer(); say("Hello World"); hangup(); ?> Javascript answer(); say("Hello World"); hangup(); Ruby answer say "Hello World" hangup Python answer() say("Hello World") hangup() Groovy answer() say("Hello World") hangup() DEVNET-1023 6
  • 7.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public <?php $options = array('choices' => '1 (1, sales), 2 (2, support)'); $result = ask('Hi. For sales, say Sales or press 1. For support, say Support or press 2.', $options); if ($result->name == 'choice') { switch ($result->value) { case 1: say('Your money is important to us.'); break; case 2: say('Your call will be ignored in the order received.'); break; } } ?> DEVNET-1023 7
  • 8.
  • 9.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 10DEVNET-1023
  • 10.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Inbound Capabilities: User Calls or Texts App • Surveys / Voting • Voice Search • Seasonal Spikes • Audio Conferencing • Information Lookup • Basic Auto Attendant DEVNET-1023 11
  • 11.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 12 Incoming Calls answer(); say("Welcome to Tropo!"); hangup(); DEVNET-1023
  • 12.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 13 Incoming Calls say("Welcome to Tropo!"); DEVNET-1023
  • 13.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 14 Playing Audio say("http://www.phono.com/audio/troporocks.mp3") DEVNET-1023
  • 14.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 15 Asking Questions var result = ask("What's your favorite color? Choose from red, blue or green.", { choices:"red, blue, green" }); say("You said " + result.value); log("They said " + result.value); DEVNET-1023
  • 15.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 16 Asking Questions var result=ask("Pick a number from 0 to 9", { choices:"0,1,2,3,4,5,6,7,8,9" }); say("You said " + result.value); log("They said " + result.value); DEVNET-1023
  • 16.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 17 Grammar Builtins result=ask("Pick a number from 0 to 9", { choices:"[1 DIGIT]" }); say("You said " + result.value); log("They said " + result.value); choices:"[4 DIGITS]" OR choices:"[4-16 DIGITS]" DEVNET-1023
  • 17.
  • 18.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 19DEVNET-1023
  • 19.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 20 Outbound Capabilities: App Calls or Texts User • Voice Broadcast • Conditional Alerts • Click-to-Call • Appointment Reminders • Two Factor Authentication • Confirmation SMS DEVNET-1023
  • 20.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 21 Outgoing Calls call("+14155550100"); say("Tag, you’re it!"); DEVNET-1023
  • 21.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 22 Outgoing Calls call("sip:alice@example.com"); say("Tag, you’re it!"); DEVNET-1023
  • 22.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 23 Outgoing Calls call("+14155550100"); call("14155550100"); call("4155550100"); call("+1 415 555-0100"); DEVNET-1023
  • 23.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 24 Outgoing Calls call( [ "+14075550100", "sip:alice@example.com" ] ); say("Tag, you're it!"); DEVNET-1023
  • 24.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + numberToDial); say("Hey, "+ customerName +": "+ msg); POST /rest/1/Sessions { "token": "abcdef123456", "customerName": "John Dyer", "numberToDial": "14075551212", "msg": "the sky is falling." } 25DEVNET-1023
  • 25.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + numberToDial); say("Hey, "+ customerName +": "+ msg); POST /rest/1/Sessions { "token": "abcdef123456", "customerName": "John Dyer", "numberToDial": "14075551212", "msg": "the sky is falling." } 26DEVNET-1023
  • 26.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + numberToDial); say("Hey, "+ customerName +": "+ msg); POST /rest/1/Sessions { "token": "abcdef123456", "customerName": "John Dyer", "numberToDial": "14075551212", "msg": "the sky is falling." } 27DEVNET-1023
  • 27.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + numberToDial); POST /rest/1/Sessions { "whatever": "14075551212" } 28DEVNET-1023
  • 28.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + numberToDial); POST /rest/1/Sessions { "whatever": "14075551212" } 29DEVNET-1023
  • 29.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + numberToDial); POST /rest/1/Sessions { "whatever": "14075551212" } 30DEVNET-1023
  • 30.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + whatever); POST /rest/1/Sessions { "whatever": "14075551212" } 31DEVNET-1023
  • 31.
  • 32.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 33 Controlling a Call transfer("+14075550100"); transfer([ "+14075550100", "+16505559876" ]); DEVNET-1023
  • 33.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public transfer(["+14075550100","sip:12345678912 @221.122.54.86"], { playvalue: "http://example.com/holdmusic.mp3", terminator: "*", onTimeout: function(event) { say("nobody answered"); } }); 34DEVNET-1023
  • 34.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 35 Rejecting calls reject(); var callerID = currentCall.callerID; if (callerID == "4155550100") { reject(); } DEVNET-1023
  • 35.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 36 Redirect redirect("sip:alice@example.com"); DEVNET-1023
  • 36.
  • 37.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public record("Leave your message at the beep. Press pound when finished.", { beep:true, timeout:10, silenceTimeout:7, maxTime:60, terminator:'#', recordFormat:"audio/mp3", recordURI:"ftp://example.com/1.mp3", recordUser:"tropocloud", recordPassword:"password" } ); 38DEVNET-1023
  • 38.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public var rec = record("Leave a message."); say(rec.value); 39DEVNET-1023
  • 39.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public var rec = record("Leave a message."); say(rec.value); 40DEVNET-1023
  • 40.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public var rec = record("Leave a message."); say(rec.value); 41DEVNET-1023
  • 41.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public startCallRecording("http://example.com/recording.js"); ask("What's your favorite color? Choose from red, blue or green.", { choices:"red, blue, green" }); stopCallRecording(); 42DEVNET-1023
  • 42.
  • 43.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 44 Reading Caller ID if (currentCall.callerID == "4075550100") { say("Sending you to Adam."); transfer("+19166002497"); } DEVNET-1023
  • 44.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 45 Setting Caller ID call("+19165550101", { callerID:"+14075550100" }); transfer("+19165550100", { callerID: "14075550100" }); DEVNET-1023
  • 45.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 46 Rejecting calls reject(); var callerID = currentCall.callerID; if (callerID == "4155550100") { reject(); } DEVNET-1023
  • 46.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Hanging up • Explicitly, through hangup(); • When a script ends • When execution fails 47DEVNET-1023
  • 47.
  • 48.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 49 Conferencing conference("1138"); conference("2600hz"); DEVNET-1023
  • 49.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public result=ask("What is your conference ID?", {choices:"[4 DIGITS]"} ); conference(result.value); 50DEVNET-1023
  • 50.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public conference("12345", { joinPrompt: "Someone joined", leavePrompt: "Someone left", }); 51DEVNET-1023
  • 51.
  • 52.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 53 Text Messages call("+14155550100", {network:"SMS"} ); say("Tag, you’re it!"); DEVNET-1023
  • 53.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 54 Text Messages call("+14155550100", {network:"SMS"} ); say("Tag, you’re it!"); DEVNET-1023
  • 54.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public call('+' + to, {network:"SMS"}); say(msg); POST /rest/1/Sessions { "token": "abcd12345", "to": "14075551212", "msg": "the sky is falling." } 55DEVNET-1023
  • 55.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 56 Incoming SMS say("Welcome to Tropo!"); DEVNET-1023
  • 56.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 57 First SMS Message currentCall.initialText; DEVNET-1023
  • 57.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 58 Multichannel say("Thanks for your call. We'll text you the information."); hangup(); call(currentCall.callerID, { network:"SMS"}); say("Here's what you asked for."); DEVNET-1023
  • 58.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 59 Message Shortcut say("Thanks for your call. We'll text you the information."); message("Here's what you asked for.", { to: currentCall.callerID, network: "SMS"} ); say("This goes to the voice call."); DEVNET-1023
  • 59.
  • 60.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 61 Speech Control say("1234"); “One thousand two hundred thirty four” DEVNET-1023
  • 61.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 62 Speech Control say("1 2 3 4"); “One Two Three Four” DEVNET-1023
  • 62.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 63 SSML say("<speak> <say-as interpret-as='vxml:digits'> 1234 </say-as> </speak>"); “One Two Three Four” DEVNET-1023
  • 63.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 64 say-as • currency • number • phone • date • time interpret-as='vxml:digits' DEVNET-1023
  • 64.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 65 Prosody say("<speak>One potato, two potato, three potato, four. <prosody rate='-50%'>One potato, two potato, three potato, four.</prosody></speak>"); DEVNET-1023
  • 65.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 66 TTS Fallback say('<speak> <audio src="http://example.com/welcome.wav"> This text will be spoken if the audio file can not be played. </audio> </speak>'); DEVNET-1023
  • 66.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Grammars • SimpleGrammar • hamburger(burger, cheeseburger, hamburger) • GrXML • ABNF • SRGS 67DEVNET-1023
  • 67.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 68 SimpleGrammar var foo = ask("Who?", { choices: "department(support, engineering, sales), person(jose, jason, adam)", }); say("You said " + foo.choice.interpretation + ", which is a " + foo.value); DEVNET-1023
  • 68.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public 69 External Grammars var result = ask("What's your destination?", { choices:"http://example.com/tropo/destinations.grxml" }); DEVNET-1023
  • 69.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public <?xml version="1.0"?> <grammar xmlns="http://www.w3.org/2001/06/grammar" root="main"> <rule id="main" scope="public"> <item repeat="1-16"> <ruleref uri="#digit"> <tag>out.concept = out.concept + rules.digit;</tag> </ruleref> </item> </rule> <rule id="digit"> <one-of> <item>0</item> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> </one-of> </rule> </grammar> 70DEVNET-1023
  • 70.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Audio Playback • 8kHz, 8bit u-law (wav or raw) (*.wav or *.ulaw) • 8kHz, 8bit a-law (wav or raw) (*.wav or *.alaw) • 8kHz, 8bit pcm (wav) (*.wav) • 8khz, 16bit pcm (wav or raw) (*.wav or *.pcm) • MS-GSM (wav) (*.wav) • GSM 6.10 (raw) (*.gsm) • MP3 71DEVNET-1023
  • 71.
  • 72.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Session • Start a new session • Send a signal to an existing session 73DEVNET-1023
  • 73.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Conference • Mute and unmute participants • Play an audio file to all members of a conference 74DEVNET-1023
  • 74.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Provisioning • Manage applications, users, and phone numbers • Full role-based access control • Tropo Commander and UI both built on this 75DEVNET-1023
  • 75.
  • 76.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public What is it? • Uses JSON over http to communicate with Tropo • Most large-scale customers stick with Scripting • Web Scale issues 77DEVNET-1023
  • 77.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Complete Your Online Session Evaluation Don’t forget: Cisco Live sessions will be available for viewing on-demand after the event at CiscoLive.com/Online • Give us your feedback to be entered into a Daily Survey Drawing. A daily winner will receive a $750 Amazon gift card. • Complete your session surveys through the Cisco Live mobile app or from the Session Catalog on CiscoLive.com/us. 78DEVNET-1023
  • 78.
    © 2016 Ciscoand/or its affiliates. All rights reserved. Cisco Public Continue Your Education • Tropo.com ScriptingAPI Quickstart Guide: https://www.tropo.com/docs/scripting/quickstarts • More Learning Labs Available: https://developer.cisco.com/site/devnet/overview/index.gsp • Follow @Tropo and @PBellanti on Twitter • Stay Up to Date on All Things Tropo: https://www.tropo.com/category/blog/ 79DEVNET-1023
  • 79.
    Please join usfor the Service Provider Innovation Talk featuring: Yvette Kanouff | Senior Vice President and General Manager, SP Business Joe Cozzolino | Senior Vice President, Cisco Services Thursday, July 14th, 2016 11:30 am - 12:30 pm, In the Oceanside A room What to expect from this innovation talk • Insights on market trends and forecasts • Preview of key technologies and capabilities • Innovative demonstrations of the latest and greatest products • Better understanding of how Cisco can help you succeed Register to attend the session live now or watch the broadcast on cisco.com
  • 80.

Editor's Notes

  • #5 Early days - copper wires analog protocols telephony hardware proprietary programming languages
  • #9 BART demo
  • #17 numbers grammar
  • #21 One of our partners saved over $2M by migrating all of their outbound text messaging to Tropo. Formerly they were using a 3rd party SMS notification service. “Out of the box” notification services are generally expensive and offer limited customization.
  • #46 Text messages must have a callerID/senderID attached, so we can't send "unknown" Avoid setting the callerID to the same number you are calling. Use a real phone number when setting callerID. no 555 number as your callerID - unpredictable results.
  • #48 explicit hangup: script execution continues
  • #50 conference IDs unique to account/environment
  • #62 speech synthesis markup language
  • #63 speech synthesis markup language
  • #64 speech synthesis markup language
  • #66 speech synthesis markup language
  • #72 mp3 downsampled to PSTN - 8bit, 8khz