Ejemplo n.º 1
0
        public HttpResponseMessage GetAll(int?numberOfResult = null)
        {
            if (!_requestValidationService.IsValidRequest(HttpContext.Current))
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized));
            }
            var customers = _customersService.GetAll(numberOfResult).ToList();

            return(Request.CreateResponse(HttpStatusCode.OK, customers));
        }
Ejemplo n.º 2
0
        public IHttpActionResult Connect([FromUri] string salesNumber)
        {
            var twilioAuthToken = ConfigurationManager.AppSettings["TwilioAuthToken"];

            if (!_requestValidationService.IsValidRequest(HttpContext.Current, twilioAuthToken))
            {
                return(Unauthorized());
            }

            var response = new TwilioResponse();

            response
            .Say("Thanks for contacting Homesite's Customer Service department. Our " +
                 "next available representative will take your call.")
            .Dial(salesNumber)
            .Hangup();
            return(TwiML(response));
        }
        public ActionResult Connect(string salesNumber)
        {
            var twilioAuthToken = ConfigurationManager.AppSettings["TwilioAuthToken"];

            if (!_requestValidationService.IsValidRequest(System.Web.HttpContext.Current, twilioAuthToken))
            {
                return(new HttpUnauthorizedResult());
            }

            var response = new VoiceResponse();

            response
            .Say("Thanks for contacting our sales department. Our " +
                 "next available representative will take your call.")
            .Dial(salesNumber)
            .Hangup();

            return(TwiML(response));
        }