//[Authorize(Roles ="SAdmin")] public HttpResponseMessage Show(string digits) { var response = new Twilio.TwiML.VoiceResponse(); var selectedOption = digits; switch (selectedOption) { case "1": response.Say("Appointment confirmed, Thank you for calling"); break; case "2": response.Say("Appointment cancelled, Thank you for calling"); break; } var res = Request.CreateResponse(HttpStatusCode.OK); res.Content = new StringContent(response.ToString(), Encoding.UTF8, "text/xml"); return(res); }
public Twilio.TwiML.VoiceResponse ResponseVoiceCall() { try { ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; TwilioClient.Init(accountSid, authToken); var response = new Twilio.TwiML.VoiceResponse(); response.Say("Thank you for calling, we will call you soon", voice: "alice", language: "en-US"); return(response); } catch (Exception ex) { throw; } }