Esempio n. 1
0
        public TwilioResponse Wait(string queueId, string queueTime, string queueSize)
        {
            var response = new TwilioResponse();

            response.AllowedChildren.Add("Leave");

            var queue = settings.Queue;

            if (Convert.ToInt32(queueTime) > queue.WaitTime || Convert.ToInt32(queueSize) > queue.Size)
            {
                return(response.Leave());
            }

            if (!string.IsNullOrEmpty(queue.WaitUrl))
            {
                response.BeginGather(new { method = "GET", action = GetEcho("gatherQueue") })
                .Play(queue.WaitUrl)
                .EndGather();
            }

            return(response);
        }