I try to call my phone number by Twilio. I manage to do that by call action method:
public ActionResult Call(string toNumber) {
client = new TwilioRestClient(Settings.AccountSid, Settings.AuthToken);
var result = client.InitiateOutboundCall(Settings.TwilioNumber, toNumber, "http://twimlets.com/message?Message%5B0%5D=http://demo.kevinwhinnery.com/audio/zelda.mp3");
if (result.RestException != null) {
return new System.Web.Mvc.HttpStatusCodeResult(500, result.RestException.Message);
}
return Content("Call enroute!");
}
When I answer the phone the mp3 specified in the url is played. I want live 2-way audio. In some examples from Twilio like : https://www.twilio.com/docs/quickstart/csharp/client/outgoing-calls I see usage of capability token:
var capability = new TwilioCapability(accountSid, authToken);
capability.AllowClientOutgoing(appSid);
capability.AllowClientIncoming("jenny");
string token = capability.GenerateToken();
and Twilio Device: Twilio.Device.setup('@token');
.
Why am I even able to make phone call without generating capability token in my example? Can I somehow create Twilio.Device
in C# not javascript? Should I pass capability token as model from controller?