This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wait(1000); | |
say("Welcome to DevNet: Cisco Developer Program"); | |
wait(1000); | |
say("bye bye"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Constructor for the Cisco Spark Logging Library | |
// - token: we recommend to leverage a Cisco Spark Bot Account | |
// - roomId: add your bot to the room you want to chat to | |
function SparkLog(token, roomId) { | |
this.token = token; | |
this.roomId = roomId; | |
} | |
SparkLog.prototype.log = function(newLogEntry) { | |
var result; | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
say("Hello world") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
say("Thank you for calling the random message hotline"); | |
function pickRandomQuote() { | |
var quotes = [ | |
"Speech was given to man to disguise his thoughts.", | |
"The adjective is the banana peel of the parts of speech." | |
]; | |
return quotes[Math.floor(Math.random() * quotes.length)]; | |
} | |
ask("Please enter your phone number followed by the pound sign", { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New incoming call | |
if (currentCall) { | |
answer(); | |
say("Welcome to Tropo SIP demo"); | |
wait(500); | |
say("Let's guess your username !"); | |
wait(500); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (currentCall) { | |
say("Welcome to the caching service"); | |
} | |
else { | |
call(phonenumber, { network:"SMS"}); | |
say(msg); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var csvFile = loadFile("http://hosting.tropo.com/5075556/www/data/numbers.csv"); | |
var numbersToDial = csvJSON(csvFile); | |
for (var i = 0; i<numbersToDial.length-1; i++){ | |
var callee = numbersToDial[i]; | |
call(callee.number, { network: "SMS" }); | |
say("Hi, " + callee.name); | |
hangup(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// QUICK START GUIDE | |
// | |
// 1. Create a Cisco Spark bot account dedicated to 'ChatOps', and store its token in a safe place | |
// 2. Create a Group room named "Tropo ChatOps", store its identifier in a safe place | |
// 3. Add your ChatOps bot as a member of the "Tropo ChatOps room" | |
// 4. Clone this gists, make it secret, and edit it | |
// 5. Replace the ChatOps bot token and ChatOps room identifier | |
// 6. Save your gists (keep it secret as it contains your bot's token), and click Raw | |
// 7. Create a Tropo application, with 'Scripting' type, pointing to your gist raw URL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function requestJSONviaGET(url) { | |
try { | |
var connection = new java.net.URL(url).openConnection(); | |
connection.setRequestMethod("GET"); | |
connection.setDoOutput(false); | |
connection.setDoInput(true); | |
connection.connect(); | |
if (connection.getResponseCode() != 200) return undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST https://api.recast.ai/v2/request?Authorization=Token XXXXX | |
// { | |
// "text": "I need somone speaks swedish", | |
// "language" : "en" | |
// | |
function invoke(phonenumber, text) { | |
try { | |
// Open Connection | |
var url = "https://vertkawaa.localtunnel.me/tropo"; | |
var connection = new java.net.URL(url).openConnection(); |
NewerOlder