【发布时间】:2021-04-27 17:59:51
【问题描述】:
我正在使用 Twilio 从我的 Twilio 客户端呼叫我的客户,并希望在需要时让用户保持等待状态。为此,每当用户单击“保留”按钮时,我都会调用 RESTAPI。 但是在调用方法调用后,我的 Twilio 客户端断开连接并为我的客户播放保持声音。你能为此提出一些建议吗?以下两种方法都不起作用
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-api twilio-twiml twilio-programmable-chat twilio-click-to-call