Reputation: 296
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
Upvotes: 0
Views: 770
Reputation: 3811
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.
Upvotes: 1