我怎么twilio调用代理将它们连接到呼叫者在队列中? [英] How do I get twilio to call the agent to connect them to callers in the queue?

查看:339
本文介绍了我怎么twilio调用代理将它们连接到呼叫者在队列中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从twilio文档和教程代理根本不知道有人在队列中,所以这个如果总是有人在排队和代理只是坐在那里,现场呼吁整天才有效。

目标:

当有人呼叫我想呼叫连接到代理。如果试剂是不可用,则呼叫方添加到队列。如果第二个或第三人的电话,让他​​们加入到队列中。当代理完成他们的第一个电话,挂断电话,让电话线在下,实际上环座席的电话与代理说话。

我是真正的新twilio所以这twiml不好,我已经知道这个是不行的,但这里是我试图至今:

 <?XML版本=1.0编码=UTF-8&GT?;
<应变及GT;
     <排队waitUrl =contactagent.php>&myQueue中LT; /排队>
< /响应>

contactagent.php:

 < PHP
//从twilio.com/docs/php/install的PHP帮助库
require_once('../ callapp /服务/ Twilio.php'); //加载库$ SID =(MYID);
$令牌=(即为MyToken);
$客户端=新Services_Twilio($ SID,$令牌);
$调用= $客户 - >问责> calls->创建($ _ REQUEST ['那是在队列调用者'],(代理商的电话号码),connectagent.xml,阵列()) ;
回声< XML版本= \\1.0 \\编码= \\UTF-8 \\&GT?;
<应变及GT;
   <&说GT;您正在号码。$ _ REQUEST ['QueuePosition'。在网上进行了重新presentative< /&说GT;
   <Play>http://com.twilio.sounds.music.s3.amazonaws.com/MARKOVICHAMP-Borghestral.mp3</Play>
&LT; /响应&gt;中
?&GT;

connectAgent.xml

 &LT; XML版本='1.0'编码='UTF-8'&GT?;
&LT;应变及GT;
   &LT;表盘&GT;&myQueue中LT; /拨号&GT;
&LT; /响应&GT;


解决方案

我觉得你应该把所有的客户端调用到队列(无论第一个客户端或没有)。使用排队做。这是个好即可。

接下来,需要发起对代理人的电话。
您可以指示Twilio呼叫座席的电话号码。在该指令定义一个回调URLdial_agent_callback和一个状态回调URLdial_agent_status_callback。
一旦发生(这表明代理已回升)中的dial_agent_callback回调,您指示Twilio拨打您的队列:

 &LT;应变及GT;
   &LT;表盘&GT;
      &LT;队列URL =dial_queue_callback&GT;
         myQueue中
      &LT; /队列&GT;
   &LT; /拨号&GT;
&LT;应变及GT;

您可以在一个代理已经完成了dial_queue_status_callback跟一个客户知道(或者,如果代理没有回升,或出现任何问题)。回调状态将指明发生了什么。

最后,你需要弄清楚何时触发到座席的呼叫。
当客户来电时,我建议触发事件。打电话给你的下一个可用的代理,如果有一个。如果有更多的客户比代理可以检查使用Twilio API队列的大小。然后,当一个新的代理连接,或者当一个忙碌的代理完成处理客户呼叫时,可以触发一个代理一个新的呼叫。

我希望帮助。

From the twilio documentation and tutorial an agent would have no idea that someone was in the queue, so this only works if there is always someone in the queue and agents just sit there and field calls all day.

Objective:

When someone calls I would like to connect the call to the agent. If the agent isn't available, add the caller to a queue. If a second or third person calls, keep adding them to the queue. When the agent finishes their first call and hangs up, let the next in line call and actually ring the agent's phone to speak with the agent.

I'm really new to twilio so this twiml is bad and I already know this doesn't work, but here's what I'm trying so far:

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
     <Enqueue waitUrl="contactagent.php">myqueue</Enqueue>
</Response> 

contactagent.php:

<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('../callapp/Services/Twilio.php'); // Loads the library

$sid = "(MYID)";
$token = "(MyToken)";
$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create($_REQUEST['the caller that's in the queue'], "(the agent's phone number)", "connectagent.xml", array());
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<Response>
   <Say>Your are number ".$_REQUEST['QueuePosition']." in line for a representative.</Say>
   <Play>http://com.twilio.sounds.music.s3.amazonaws.com/MARKOVICHAMP-Borghestral.mp3</Play>
</Response>"
?>

connectAgent.xml

<?xml version='1.0' encoding='utf-8' ?>
<Response>
   <Dial>myqueue</Dial>
</Response>

解决方案

I think you should put all of your client calls to the queue (no matter first client or not). Do it using Enqueue. That is good then.

Next, you need to initiate a call to an agent. You can instruct Twilio to call agent's phone number. In that instruction define a callback url "dial_agent_callback" and a status callback url "dial_agent_status_callback". Once the "dial_agent_callback" callback occurs (indicating that agent has picked up), you instruct Twilio to dial your queue:

<Response>
   <Dial>
      <Queue url="dial_queue_callback">
         myqueue
      </Queue>
   </Dial>
<Response>

You can know when an agent has finished talking to a client in a dial_queue_status_callback (or if agent has not picked up, or if any problems occurred). The callback Status will indicate what has happened.

Finally, you need to figure out when to trigger calls to the agent. I suggest triggering an event when a client call occurs. Call your next available agent, if there is one. In case there are more clients than agents you can check the Queue Size using Twilio API. Then you can trigger a new call to an agent when a new agent joins, or when a busy agent finishes handling client call.

I hope that helps.

这篇关于我怎么twilio调用代理将它们连接到呼叫者在队列中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆