Initiating Outbound Calls with TWILIO

二次信任 提交于 2020-01-17 04:49:05

问题


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);            
        }

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?

Thank you


回答1:


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.

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>

Where /complete_call.xml might look like:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Connecting</Say>
</Response>

You can read more about using this method for Call Screening and see some C# examples there.

Hope you find this to be helpful.



来源:https://stackoverflow.com/questions/33768186/initiating-outbound-calls-with-twilio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!