Exemplo n.º 1
0
        public void Can_Generate_Enqueue_With_Task()
        {
            var response = new TwilioResponse();
            var task = new Task("{'task':'attributes'}", new {priority = "10", timeout = "30"});
            response.EnqueueTask(new { workflowSid = "WFXXXXX" }, task);

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add a Call to a TaskQueue
        /// </summary>
        /// <param name="attributes"></param>
        /// <param name="task"></param>
        /// <returns></returns>
        public TwilioResponse EnqueueTask(object attributes, Task task)
        {
            var enqueue = new Enqueue(String.Empty, attributes);
            Current.Push(enqueue);
            Add(task);
            Add(Current.Pop());

            return this;
        }