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 qArns = [ | |
"arn:aws:connect:...", | |
"arn:aws:connect:..." | |
]; | |
const metricsList = [ | |
{ | |
Name: "AGENTS_AVAILABLE", | |
Unit: "COUNT" | |
}, |
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
app.post("/submit-updateAttributes", async (req, res) => { | |
const contactId = req.body.contactId; | |
const flagForFollowUpRaw = req.body.flagForFollowUp; // will equal "on" if checked, undefined if false | |
const flagForFollowUp = flagForFollowUpRaw && flagForFollowUpRaw === "on"; | |
var updateContactAttributesParams = { | |
InstanceId: connectInstanceId, | |
InitialContactId: contactId, | |
Attributes: { | |
FlaggedForFollowUp: flagForFollowUp.toString() |
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
html | |
head | |
title= title | |
link(rel="stylesheet" href="../css/base.css") | |
body | |
h2= "Details for " + user.Username | |
ul | |
li= "ARN: " + user.Arn | |
li= "First Name: " + user.IdentityInfo.FirstName | |
li= "Last Name: " + user.IdentityInfo.LastName |
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
html | |
head | |
title= title | |
link(rel="stylesheet" href="css/base.css") | |
body | |
h2= "Users in my Connect Instance (" + dataList.length + ")" | |
ul | |
each val in dataList | |
li | |
a(href="user/" + val.Id) #{val.Username} |
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 app = express(); | |
const AWS = require("aws-sdk"); | |
require("express-async-errors"); | |
const connectInstanceId = "7f03..."; | |
var connectClient = new AWS.Connect({ | |
apiVersion: "2017-08-08", | |
region: "us-east-1" |
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
/**------------------------------------------------------------------------- | |
* Uninitialize Connect. | |
*/ | |
connect.core.terminate = function() { | |
connect.core.client = new connect.NullClient(); | |
connect.core.masterClient = new connect.NullClient(); | |
var bus = connect.core.getEventBus(); | |
if(bus) bus.unsubscribeAll(); | |
connect.core.bus = new connect.EventBus(); | |
connect.core.agentDataProvider = null; |
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
var agent = new lily.Agent(); | |
agent.getEndpoints(agent.getAllQueueARNs(), { | |
success: function(data){ | |
console.log("valid_queue_phone_agent_endpoints", data.endpoints, "You can transfer the call to any of these endpoints"); | |
}, | |
failure:function(){ | |
console.log("failed") | |
} | |
}); |
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
// api.js | |
Contact.prototype.onSession = function(f) { | |
var bus = connect.core.getEventBus(); | |
bus.subscribe(this.getEventName(connect.ContactEvents.SESSION), f); | |
}; | |
... | |
// application code | |
function subscribeToContactEvents(contact) { | |
... |
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
connect.contact(function(contact) { | |
... | |
contact.onRefresh(function() { | |
... | |
session.remoteAudioElement = document.getElementById('remote-audio'); | |
session.connect(); | |
// new code | |
var bus = connect.core.getEventBus(); | |
bus.trigger(contact.getEventName(connect.ContactEvents.SESSION), session); | |
} |
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
// SoftphoneManager code | |
connect.contact(function(contact) { | |
... | |
contact.onRefresh(function() { | |
... | |
session.remoteAudioElement = document.getElementById('remote-audio'); | |
session.connect(); | |
// new code | |
contact.session = session; | |
} |
NewerOlder