Twilio 呼叫保持未按预期工作 [英] Twilio call hold is not working as expected

查看:23
本文介绍了Twilio 呼叫保持未按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Twilio 从我的 Twilio 客户端呼叫我的客户,并希望在需要时让用户暂停.为此,每当用户单击保持"按钮时,我都会调用 RESTAPI.按钮.但是在调用方法调用后,我的 Twilio 客户端断开连接并为我的客户播放保持声音.你能否为此提出一些建议.以下两种方法都不起作用

I am using Twilio to call my customers from my Twilio client and want to put the user on hold whenever is needed. For that i am calling RESTAPI whenever user clicks on the "Hold" Button. But after calling the method call is getting disconnected for My Twilio client and playing Hold sound for my customer. Can you please suggest something for this. Both the below approaches are not working

   var response = new VoiceResponse();
        var dial = new Dial();
        dial.Conference("Customer Waiting Room", beep: Conference.BeepEnum.False);
        response.Append(dial);
        var call = Twilio.Rest.Api.V2010.Account.CallResource.Read(parentCallSid: callSid).ToList();
        Twilio.Rest.Api.V2010.Account.CallResource.Update(new Twilio.Rest.Api.V2010.Account.UpdateCallOptions(call[0].Sid) { Twiml = response.ToString() });
        return Content(response.ToString(), "application/xml");

替代方案:

 var response = new VoiceResponse();
                response.Say("You have a caller on hold.");
                var call = Twilio.Rest.Api.V2010.Account.CallResource.Read(parentCallSid: callSid).ToList();
                response.Enqueue("admin");
                Twilio.Rest.Api.V2010.Account.CallResource.Update(new Twilio.Rest.Api.V2010.Account.UpdateCallOptions(call[0].ParentCallSid) { Twiml = response.ToString() });

推荐答案

Twilio 开发人员布道者在这里.

Twilio developer evangelist here.

您在代理和客户之间建立了直接呼叫.当您将客户呼叫移开时,您的代理呼叫将转移到下一个 TwiML 指令.如果您的代理没有进一步的 TwiML 说明,则他们将断开连接.

You have a direct call setup between your agent and you customer. When you move your customer call away from that, then your agent call will move on to the next TwiML instruction. If there are no further TwiML instructions available for your agent, then they will get disconnected.

要克服这个问题,您需要考虑在客户被搁置时您希望代理做什么.例如,最好在会议中进行呼叫.这样,当您暂停客户时,座席可以留在会议中.

To overcome this, you need to consider what you want your agent to do while your customer is on hold. It might be better, for example, to have your call take place in a conference. That way, when you put your customer on hold, the agent can remain in the conference.

否则,您应该在座席的 之后提供进一步的 TwiML 说明,以便他们在客户支线离开后继续呼叫.

Otherwise, you should provide further TwiML instructions after your agent's <Dial> so that they continue the call after the customer leg goes away.

这篇关于Twilio 呼叫保持未按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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