//[Authorize(Roles ="SAdmin")] public HttpResponseMessage Welcome() { var response = new Twilio.TwiML.VoiceResponse(); var gather = new Gather(action: new Uri(string.Format("http://tchapi.thecloudhealth.com/API/Voice/Show?digits=")) , numDigits: 1 ); gather.Say("Hi sameer, you have appointment tomorrow at oak surgery center " + //"DoctorName will be doing the surgery. " + "Press 1 to confirm the appointment, press 2 to cancelled the appointment."); response.Append(gather); var res = Request.CreateResponse(HttpStatusCode.OK); res.Content = new StringContent(response.ToString(), Encoding.UTF8, "text/xml"); return(res); }
//[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); }