背景

公司为提高客服部门沟通效率对接电话呼叫中心,调研后选择了亚马逊的Amazon Connect服务,因为是国外业务没有选择用阿里云,怕有坑。

Amazon Connect后台

需要在后台创建“联系流”,也就是用户接通电话后我们提供的一系列功能选项,比如开始放一段欢迎语音,然后提示用户选择1,2,4,*,#等,每一个选项可能又对应了一条“联系流”,整体的功能就是围绕着“联系流”来进行的,用户输入的一些值可以通过 contact.getAttributes() 拿到。

前端对接

需要引入 amazon-connect-1.3.js, 这是一个开源项目(https://github.com/aws/amazon-connect-streams)所有前端接打电话的界面功能都是基于这个库来完成的。

connect.contact(): 主要获取联系人信息(姓名,电话等)还有联系人输入的一些值。
connect.agent(): 主要获取电话设备的一些状态信息。

HTML:

 <!-- 电话图标,用来唤出电话界面 -->
<div id="amazonConnectContainer">
<img src="/Public/img/amazon_tel.jpg" alt="">
</div>
<!-- 生成iframe的地方,可以放在网页任意位置 -->
<div id="containerDiv" title="Amazon Connect">
<!--Amazon CCP is hiding in here-->
</div>

CSS:

 <style>
.containerDiv iframe {
display: none;
}
</style>

JS:

 <script type="text/javascript" src="/Public/lib/connect-streams.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#amazonConnectContainer").click(function(event) {
event.preventDefault();
$("#containerDiv iframe").remove();
if(typeof connect != "undefined" && !connect.core.initialized){
window.myCPP = window.myCPP || {};
//replace with the CCP URL for your Amazon Connect instance
var ccpUrl = "https://xxxxxx.awsapps.com/connect/ccp#/";
connect.core.initCCP(containerDiv, {
ccpUrl: ccpUrl,
loginPopup: false,
softphone: {
allowFramedSoftphone: true,
disableRingtone: true,
ringtoneUrl: true
}
});
connect.contact(subscribeToContactEvents);
connect.agent(subscribeToAgentEvents);
}
var awidth = 320; //窗口宽度
var aheight = 465; //窗口高度
var atop = (screen.availHeight - aheight) / 2; //窗口顶部位置
var aleft = (screen.availWidth - awidth) / 2; //窗口放中央 window.open (ccpUrl, 'newwindow', 'height=465, width=320, top='+atop+', left='+aleft+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
}); function subscribeToContactEvents(contact){
window.myCPP.contact = contact;
logInfoMsg("Subscribing to events for contact");
if (contact.getActiveInitialConnection()
&& contact.getActiveInitialConnection().getEndpoint()) {
logInfoMsg("New contact is from " + contact.getActiveInitialConnection().getEndpoint().phoneNumber); // 用户电话
} else {
logInfoMsg("This is an existing contact for this agent");
}
logInfoMsg("Contact is from queue " + contact.getQueue().name);
logInfoMsg("Contact attributes are " + JSON.stringify(contact.getAttributes())); // 用户属性
}
function subscribeToAgentEvents(agent) {
window.myCPP.agent = agent;
agentGreetingDiv.innerHTML = '<h3>Hi ' + agent.getName() + '!</h3>';
logInfoMsg("Subscribing to events for agent " + agent.getName());
logInfoMsg("Agent is currently in status of " + agent.getStatus().name);
// 获取电话状态名称
displayAgentStatus(agent.getStatus().name);
// agent.onRefresh(handleAgentRefresh);
// agent.onRoutable(handleAgentRoutable);
// agent.onNotRoutable(handleAgentNotRoutable);
// agent.onOffline(handleAgentOffline);
}
function logInfoMsg(msg) {
connect.getLog().info(msg);
}
});
</script>

亚马逊 amazon connect(呼叫中心)的更多相关文章

  1. 在亚马逊amazon的AWS上安装Node和MongoDB服务器

    在亚马逊amazon的AWS上安装Node和MongoDB服务器 在建立AWS上账号.创建EC2 ,用putty链接上之后,就可以用下面的方法开始安装. !!! 如果不是是自己建立的EC2, 而是由B ...

  2. 通过SecureCRT访问亚马逊Amazon EC2主机

    亚马逊推出了免费的云主机服务器 Amazon EC2,它是通过安全密钥来访问主机的. 问题是下载的密钥在SecureCRT 上无法直接使用,需要转换. 下面的方法可以在自己的linux主机上生成sec ...

  3. [2014亚马逊amazon] 在线笔试题 大于非负整数N的第一个回文数 Symmetric Number

    1.题目 如标题,求大于整数N(N>=0)的第一个回文数的字符串表示形式. 这个题目也是当时笔试第一次见到,花了一个小时才做出了.慢慢总结还是挺简单的. 2.分析 分析如下: (1)一位数N(9 ...

  4. U盘版Windows 10已经在亚马逊Amazon開始接受预订啦

    Windows 10定于下周7月29日正式公布. Windows 10家庭版119美元.专业版199美元,这个价格包含 Windows 10 授权.

  5. 亚马逊AWS业务副总裁:如何在基础设施上降成本

    腾讯科技 林靖东 11月17日编译 亚马逊Amazon Web Services业务的副总裁.著名工程师詹姆斯汉密尔顿(James Hamilton)在AWS re:Invent大会上解释了公司是如何 ...

  6. 亚马逊与Twitter携手电子商务

    亚马逊(Amazon)与Twitter开展了合作,允许用户以Twitter消息的形式将喜欢的商品发送到购物篮中.这些高科技企业正在想办法把社交媒体和电子商务融为一体. 这一功能旨在将Twitter转变 ...

  7. 亚马逊拟斥资15亿美元建航空货运中心 - Amazon to spend $1.49 bln on air cargo hub, fans talk of bigger ambitions - ReutersFebruary 1, 2017

    2月1日消息,亚马逊本周二宣布将在肯塔基州开建其第一个航空货运中心,以应对高速增长的航空货运需求.亚马逊预计,该项目将带来2000个工作岗位. 据悉,该项计划总投入约为15亿美元,亚马逊或可从当地政府 ...

  8. Amazon EMR(Elastic MapReduce):亚马逊Hadoop托管服务运行架构&Hadoop云服务之战:微软vs.亚马逊

    http://s3tools.org/s3cmd Amazon Elastic MapReduce (Amazon EMR)简介 Amazon Elastic MapReduce (Amazon EM ...

  9. [转]Amazon AWS亚马逊云服务免费一年VPS主机成功申请和使用方法

    今天部落将再次为大家介绍如何成功申请到来自亚马逊的Amazon AWS免费一年的VPS主机服务.亚马逊公司这个就不用介绍了,是美国最大的一家网络电子商务公司,亚马逊弹性计算云Amazon EC2更是鼎 ...

随机推荐

  1. win10常用快捷键

    记住Win10一些常用的快捷键,在使用电脑的过程中,可以快速的切换不同的功能窗口,减少鼠标的操作.大大提高工作效率.来看看下面这些常用的. Win键+Tab:激活任务视图 Win键+A:激活操作中心 ...

  2. android 2018 面试题

    四大组件:activity.service.content provider.broadcast receiver [一]Activity 1.生命周期 onCreate:表示activity正在被创 ...

  3. HttpClient 调用WebAPI时,传参的三种方式

    public void Post() { //方法一,传json参数 var d = new { username = " ", password = " ", ...

  4. PHP 点阵5*7字体

    效果: 源码: <?php // standard ascii 5x7 font 纵向取模 // defines ascii characters 0x20-0x7f (32-127) $fon ...

  5. [Swift]LeetCode74. 搜索二维矩阵 | Search a 2D Matrix

    Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo ...

  6. [Swift]LeetCode466. 统计重复个数 | Count The Repetitions

    Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc&qu ...

  7. [Swift]LeetCode926. 将字符串翻转到单调递增 | Flip String to Monotone Increasing

    A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), ...

  8. [Swift]LeetCode991. 坏了的计算器 | Broken Calculator

    On a broken calculator that has a number showing on its display, we can perform two operations: Doub ...

  9. springmvc 请求参数解析细节

    springmvc 的请求流程,相信大家已经很熟悉了,不熟悉的同学可以参考下资料! 有了整体流程的概念,是否对其中的实现细节就很清楚呢?我觉得不一定,比如:单是参数解析这块,就是个大学问呢? 首先,我 ...

  10. 机器学习基石笔记:Homework #1 PLA&PA相关习题

    原文地址:http://www.jianshu.com/p/5b4a64874650 问题描述 程序实现 # coding: utf-8 import numpy as np import matpl ...