public HttpResponseMessage LeaveQueue(TwilioQueueRequest twilioRequest)
        {
            var twilioResponse = new TwilioResponse();

            twilioResponse.Say("We're sorry but there is no agent available at the moment.", _voicesettings);
            twilioResponse.Redirect(Url.Link("ExtendedApi", new { controller = "Phone", action = "GoodByeMessage" }));

            return Request.CreateResponse(HttpStatusCode.OK, twilioResponse.Element);
        }
        public HttpResponseMessage WaitInQueue(TwilioQueueRequest twilioRequest)
        {
            var twilioResponse = new TwilioResponse();

            twilioResponse.Say(string.Format("You are number {0} out of {1} in the queue, please stay on your line.",
                                             twilioRequest.CurrentQueueSize, twilioRequest.QueuePosition), _voicesettings);
            twilioResponse.Redirect("http://twimlets.com/holdmusic?Bucket=com.twilio.music.rock");

            return Request.CreateResponse(HttpStatusCode.OK, twilioResponse.Element);
        }
 public HttpResponseMessage JoinQueue(TwilioQueueRequest twilioRequest)
 {
     var twilioResponse = new TwilioResponse();
     twilioResponse.Say("You're now joining the Priority Queue", _voicesettings);
     twilioResponse.Enqueue("PriorityQueue",
                            new
                                {
                                    action = Url.Link("ExtendedApi", new {controller = "Phone", action = "LeaveQueue"}),
                                    waitUrl = Url.Link("ExtendedApi", new {controller = "Phone", action = "WaitInQueue"})
                                });
     return Request.CreateResponse(HttpStatusCode.OK, twilioResponse.Element);
 }