使用 TWILIO 发起出站呼叫 [英] Initiating Outbound Calls with TWILIO
问题描述
我有一个使用 TWILIO API 的 C# 服务,目前我在尝试使用 InitiateOutboundCalls 函数时遇到了问题.
I have a C# Service using TWILIO API and I am having issues at the moment trying to use the InitiateOutboundCalls function.
private void SendCall(string cellNumber, string message) {
Call callResult;
callResult = _client.InitiateOutboundCall(twilioNumber, employeeNumber, message);
TwilioRestExceptionCheck(callResult);
}
这是 C# 服务中的小函数,它应该用这个 twimlbin 代码(如上的消息变量)调用员工:
This is the little function in the C# Service which is supposed to call the employee with this twimlbin code (the message variable as above):
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Cams Support. See text for Recording</Say>
<Sms>Sending Recording... </Sms>
<Hangup/>
</Response>
问题是,即使员工没有接听电话,即:没有接听他/她的电话,呼叫状态仍然设置为完成".呼叫不应该设置为无应答"吗?如何判断员工是接听电话还是未接电话?
The issue is that even if the employee misses the call, ie: doesn't answer his/her phone, the call status is still set as "complete". Shouldn't the call be set as "no-answer"? How can I tell if the employee picks up or misses the call?
谢谢
推荐答案
来自 Twilio 的 Megan 在这里.
Megan from Twilio here.
当员工未接电话时,可能会发生的情况是电话转到应答机,应答机实际上会返回您所看到的完成"状态.
What is likely happening when an employee misses a call is that the call goes to an answering machine which will actually return the "complete" status that you are seeing.
您可能会处理此问题的一种方法是使用 <Gather>
动词确保实际接听电话的是员工,而不是他们的语音邮件.
One way that you might deal with this is to make sure that a call is actually answered by the human employee and not their voicemail using the <Gather>
verb.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather action="/complete_call.xml" method="get">
<Say>Press any key to accept the call.</Say>
</Gather>
</Response>
其中 /complete_call.xml
可能如下所示:
Where /complete_call.xml
might look like:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Connecting</Say>
</Response>
您可以阅读有关将这种方法用于 Call Screening 的更多信息,并查看一些 C# 示例那里.
You can read more about using this method for Call Screening and see some C# examples there.
希望这对您有所帮助.
这篇关于使用 TWILIO 发起出站呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!