This file contains 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
exports.handler = function (context, event, callback) { | |
const sgMail = require("@sendgrid/mail"); | |
sgMail.setApiKey(context.SG_API_KEY); | |
let client = context.getTwilioClient(); | |
client | |
.transcriptions(event.TranscriptionSid) | |
.fetch() |
This file contains 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
const express = require("express"); | |
const router = express.Router(); | |
const twilio = require("twilio"); | |
const axios = require("axios"); | |
require("dotenv").config(); | |
const client = new twilio(process.env.ACCOUNT_SID, process.env.AUTH_TOKEN); | |
router.post("/calls", (req, res, next) => { | |
console.log("inbound call: ", req.body); |
This file contains 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
const express = require("express"); | |
const bodyParser = require("body-parser"); | |
const multer = require("multer"); | |
const upload = multer(); | |
const app = express(); | |
require("dotenv").config(); | |
const client = require("twilio")( | |
process.env.ACCOUNT_SID, | |
process.env.AUTH_TOKEN |
This file contains 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
const WebSocket = require("ws"); | |
const express = require("express"); | |
const app = express(); | |
const uuid = require("uuid"); | |
const server = require("http").createServer(app); | |
const wss = new WebSocket.Server({ server }); | |
const bodyParser = require("body-parser"); | |
require("dotenv").config(); | |
const client = require("twilio")( |
This file contains 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
manager.strings.incomingCall = "Incoming call from: {{from}}"; | |
flex.Notifications.registerNotification({ | |
id: "incomingCall", | |
content: "incomingCall", | |
timeout: 0, | |
backgroundColor: "#1a76d2", | |
icon: "IncomingCallBold", | |
actions: [ |
This file contains 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
exports.handler = function(context, event, callback) { | |
let twiml = new Twilio.twiml.VoiceResponse(); | |
let numberList = [ | |
{ trackingNumber: "+1XXXXXXXXXX", destination: "+1XXXXXXXXXX" }, | |
{ trackingNumber: "+1XXXXXXXXXX", destination: "+1XXXXXXXXXX" } | |
]; | |
let match = numberList.find(numbers => numbers.trackingNumber == event.To); |
This file contains 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
exports.handler = function(context, event, callback) { | |
let client = context.getTwilioClient(); | |
let promises = []; | |
client.monitor.alerts | |
.list({ limit: 20 }) | |
.then(alerts => { | |
let matchedAlerts = []; | |
alerts.forEach(a => { | |
This file contains 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
exports.handler = function(context, event, callback) { | |
// With timezone: | |
// In Functions/Configure, add NPM name: moment-timezone, version: 0.5.14 | |
// Timezone function reference: https://momentjs.com/timezone/ | |
let moment = require("moment-timezone"); | |
// timezone needed for Daylight Saving Time adjustment | |
let timezone = event.timezone || "America/Chicago"; | |
console.log("+ timezone: " + timezone); |
This file contains 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
const sgMail = require("@sendgrid/mail"); | |
const AWS = require("aws-sdk"); | |
require("dotenv").config(); | |
// AWS Config | |
AWS.config.update({ | |
accessKeyId: process.env.aws_access_key_id, | |
secretAccessKey: process.env.aws_secret_access_key | |
}); |
This file contains 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
exports.handler = function(context, event, callback) { | |
const sgMail = require('@sendgrid/mail'); | |
sgMail.setApiKey(context.SG_API_KEY); | |
let spam = 0; | |
if(event.AddOns){ | |
const addOns = JSON.parse(event.AddOns); | |
if (('nomorobo_spamscore' in addOns.results)) { | |
spam = addOns.results.nomorobo_spamscore.result.score; | |
} |
NewerOlder