Outgoing call from twilio number to mobile phone using ASP.NET Core Web API and Angular app

100 Views Asked by At

I have requirement where admin user can directly call on user's mobile phone. Frontend is developed in Angular app and I have to make backend API which helps to Angular to call Twilio API for Outbound call.

I have created all credentials in Twilio console, but I do not have any idea what APIs need to implement in .NET Core. I have used sample code from Twilio site, and able to make call from users mobile, but do not know what to do once user picked up the call.

By using this code, I'm able to receive call, but do not what APIs need Angular side which can established two way communication

string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

TwilioClient.Init(accountSid, authToken);

var call = CallResource.Create(
        url: new Uri("http://demo.twilio.com/docs/voice.xml"),
        to: new Twilio.Types.PhoneNumber("+14155551212"),
        from: new Twilio.Types.PhoneNumber("+15017122661")
);

Console.WriteLine(call.Sid);
0

There are 0 best solutions below