예제 #1
0
        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;
            }
        }
예제 #2
0
        //[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);
        }
예제 #3
0
        //[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);
        }