背景

公司为提高客服部门沟通效率对接电话呼叫中心,调研后选择了亚马逊的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. 在ASP.NET Core中使用brotli压缩

    Brotli是一种全新的数据格式,可以提供比Zopfli高20-26%的压缩比.据谷歌研究,Brotli压缩速度同zlib的Deflate实现大致相同,而在Canterbury语料库上的压缩密度比LZ ...

  2. MQTT在react-native中的运行

    mqtt 1.什么是mqtt? MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式 ...

  3. Websocket实现即时通讯

    前言 关于我和WebSocket的缘:我从大二在计算机网络课上听老师讲过之后,第一次使用就到了毕业之后的第一份工作.直到最近换了工作,到了一家是含有IM社交聊天功能的app的时候,我觉得我现在可以谈谈 ...

  4. 手把手教你在CSDN博客中插入图片之剑走偏锋系列

    1.在博客园注册账号.你没有看错,就是博客园,在图像上传方面博客园比CSDN这个垃圾强太多了. 2.在博客园进入随笔撰写编辑模块,点击上传图像按钮(点最黄的那个,别点错了). 3.弹出如下窗口 ,点击 ...

  5. [Swift]LeetCode106. 从中序与后序遍历序列构造二叉树 | Construct Binary Tree from Inorder and Postorder Traversal

    Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that ...

  6. [SQL]LeetCode178. 分数排名 | Rank Scores

    Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ra ...

  7. [Swift]LeetCode281. 之字形迭代器 $ Zigzag Iterator

    Given two 1d vectors, implement an iterator to return their elements alternately. For example, given ...

  8. ubuntu16.04安装lnmp环境

     1.安装mysql sudo apt install mysql-server 2.安装nginx和php #添加nginx和php的ppa源 sudo apt-add-repository ppa ...

  9. 页面的div中有滚动条,js实现刷新页面后回到记录时滚动条的位置

    当div中绑定数据,给它一个属性overflow-y: scroll,添加长度大小,使其能够出现滚动条:每次刷新的时候滚动条总是会出现在最上方,这使我很头疼,经过查阅网上资料,返现两种方法可行.如下: ...

  10. Python档案袋(函数与函数装饰器 )

    特点:代码复用.可扩展.保持一致性 函数简单的实现,返回值的不同: #定义方法 def funx1(): pass def funx2(): return 0 def funx3(): return ...