Twilio 通话中的呼叫转移 [英] Twilio call transfer from in-call

查看:35
本文介绍了Twilio 通话中的呼叫转移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有从 Twilio 文档中找到明确的答案.我正在尝试构建一个电话系统,该系统可以在通话中且仅通过电话将另一方置于保持状态.例子:有两个特工和我一起在外地工作.我在手机上(远离计算机)接到一个电话,发现另一个座席需要与我通话的人通话.我希望能够在电话中按下一些东西,直接将另一个人转接到座席,或者将他们放入队列中.然后我可以打电话给另一个代理,他可以从队列中检索这个人.所有这些都需要通过我们的手机实现.

I'm not finding a definite answer from the Twilio docs on this. I'm trying to build a phone system that can place the other party on hold while in-call and only from the phone. Example: There are two agents working with me out in the field. I get a call on my mobile (away from a computer) and find that the other agent would need to speak to the person I'm on the phone with. I would like to be able to press something into the phone that would either directly transfer the other person to the agent, or place them in a queue. I could then call the other agent and he could retrieve the person from the queue. All of which would need to happen just from our phones.

我找到了一些关于此的文档,但似乎都需要我在电脑前,这不可能.

I've found some documentation on this, but it seems to all require me to be at a computer, which wont be possible.

这甚至可以用 Twilio 实现吗?

Is this even possible with Twilio?

推荐答案

Twilio 布道者在这里.

Twilio evangelist here.

这听起来可能是使用一些的好地方;s.

This sounds like it might be a good place to use some <Conference>s.

让我们定义场景中的角色:Agent1、Agent2、Field.

Lets define the actors in your scenario: Agent1, Agent2, Field.

假设 Field 调用 Agent1.您可以将 字段转换为 (让我们称之为ConferenceA),然后使用 REST API 向 Agent1 发起出站呼叫.当他们回答时,他们进入同一个.系统需要获取 Agent1 和 Field 的 CallSid 以及 的 Sid,将它们保存在某种类型的存储中以备后用.

Lets say that Field calls Agent1. Instead of connecting the two directly with a <Dial> you could <Dial> Field into a <Conference> (lets call it ConferenceA), then use the REST API to initiate an outbound call to Agent1. When they answer <Dial> them into the same <Conference>. The system will need to grab the CallSid's of both Agent1 and Field, as well as the Sid of the <Conference>, persist them in some type of storage to use later.

在这种情况下使用 比使用 为您提供了更大的灵活性来独立于其他呼叫的每个部分操作> 连接 Field 和 Agent1.

Using <Conference> in this scenario gives you more flexibility to manipulate each leg of the call independent of the other than you would have if you use <Dial> to connect Field and Agent1.

现在 Agent2 调用 Field.Agent2 将经历相同的过程,只是相反.Agent2 将被拨入 (我们称之为 ConferenceB),您的系统将使用 REST API 来调用 Field.当 Field 回答时,他们将 输入到与 Agent2 相同的会议中.同样,系统将需要获取 Agent2 和 Field 的 CallSid,以及 的 Sid,将它们保存在某种类型的存储中以备后用.

So now Agent2 calls Field. Agent2 would go through the same process, just in reverse. Agent2 would get dialed into a <Conference> (lets call it ConferenceB) and your system would use the REST API to call Field. When Field answers they get <Dial>ed into the same conference as Agent2. Again, the system will need to grab the CallSid's of both Agent2 and Field, as well as the Sid of the <Conference>, persist them in some type of storage to use later.

现在,Field 需要一种方法来告诉系统将 Agent2 与 Agent1 连接起来.为此,您可以在将 Field 拨入 ConferenceB 时使用 TwiML 中的 <Dial>s hangupOnStar 属性. 动词看起来像:

Now, Field needs a way to tell the system to connect Agent2 with Agent1. To do that you can utilize the <Dial>s hangupOnStar attribute in the TwiML you hand Twilio when you dial Field into the ConferenceB. The <Dial> verb would look something like:

<Dial hangupOnStar="true" action="[process_hangup_url]">
    <Conference>ConferenceB</Conference>
</Dial>

hangupOnStar 告诉 Twilio 断开呼叫者 (Field) 与他们ed(会议)的连接,但仍向 中定义的 URL 发出请求; 动词动作属性.这很重要,因为当 Field 需要告诉系统将 Agent2 重定向到带有 Agent1 的 ConferenceA 时,并且对 s action 属性中的 URL 的请求使系统有机会提示 Field 看看他是否想要这样做.所以你可能让 Twilio 像这样执行一些 TwiML:

hangupOnStar tells Twilio to disconnect the caller (Field) from whoever they <Dial>ed (the conference), but still makes a request to the URL defined in the <Dial> verbs action attribute. That is important because when Field needs to tell the system to redirect Agent2 into the ConferenceA with Agent1, and the request to the URL in s action attribute gives the system the opportunity to prompt Field to see if thats what he wants to do. So you might have Twilio execute some TwiML like this:

<Response>
    <Gather action=[gather_handler]>
        <Say>Press 1 to connect this caller to another<Say>
    </Gather>
</Response>

如果 Field 按 1,系统(知道此处涉及的所有各方的所有 CallSid 和会议 sid)可以使用 REST API 将 Agent2 重定向到 ConferenceB 之外并进入 ConferenceA.

If Field presses one, the system (who knows all of the CallSids for all of the parties involved here, and the conference sids), can use the REST API to redirect Agent2 out of the ConferenceB and into ConferenceA.

它使系统变得有点复杂,但它应该适合你.

It makes for a bit more complicated of a system, but it should work for you.

希望有帮助

这篇关于Twilio 通话中的呼叫转移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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