当前位置: 首页>>代码示例>>C#>>正文


C# TwilioResponse.Enqueue方法代码示例

本文整理汇总了C#中Twilio.TwiML.TwilioResponse.Enqueue方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioResponse.Enqueue方法的具体用法?C# TwilioResponse.Enqueue怎么用?C# TwilioResponse.Enqueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Twilio.TwiML.TwilioResponse的用法示例。


在下文中一共展示了TwilioResponse.Enqueue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Can_Generate_Enqueue_With_Name_And_Options

        public void Can_Generate_Enqueue_With_Name_And_Options()
        {
            var response = new TwilioResponse();
            response.Enqueue("example", new { action = "example.xml", method = "GET", waitUrl="wait.xml", waitUrlMethod="GET", workspaceSid="WSXXXXX" });

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
开发者ID:HafsaNaveed,项目名称:twilio-csharp,代码行数:7,代码来源:EnqueueTests.cs

示例2: Can_Generate_Enqueue_With_Options_And_TaskAttributes

        public void Can_Generate_Enqueue_With_Options_And_TaskAttributes()
        {
            var response = new TwilioResponse();
            response.Enqueue(new { action = "example.xml", method = "GET", waitUrl = "wait.xml", waitUrlMethod = "GET", workspaceSid = "WSXXXXX" }, "{'task':'attributes'}");

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
开发者ID:HafsaNaveed,项目名称:twilio-csharp,代码行数:7,代码来源:EnqueueTests.cs

示例3: Can_Generate_Enqueue_With_Only_Options

        public void Can_Generate_Enqueue_With_Only_Options()
        {
            var response = new TwilioResponse();
            response.Enqueue(new { action = "example.xml", method = "GET", waitUrl = "wait.xml", waitUrlMethod = "GET"});

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
开发者ID:nkerkin,项目名称:twilio-csharp,代码行数:7,代码来源:EnqueueTests.cs

示例4: Can_Generate_Enqueue_With_Name

        public void Can_Generate_Enqueue_With_Name()
        {
            var response = new TwilioResponse();
            response.Enqueue("example");

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
开发者ID:HafsaNaveed,项目名称:twilio-csharp,代码行数:7,代码来源:EnqueueTests.cs

示例5: Can_Generate_Enqueue_With_Options_And_TaskAttributes_And_Priority_And_Timeout

        public void Can_Generate_Enqueue_With_Options_And_TaskAttributes_And_Priority_And_Timeout()
        {
            var response = new TwilioResponse();
            response.Enqueue(new { action = "example.xml", method = "GET", waitUrl = "wait.xml", waitUrlMethod = "GET", workflowSid = "WFXXXXX" }, "{'task':'attributes'}", new {priority="10", timeout="30"});

            Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
        }
开发者ID:nkerkin,项目名称:twilio-csharp,代码行数:7,代码来源:EnqueueTests.cs

示例6: QueueCall

        public ActionResult QueueCall()
        {
            var response = new TwilioResponse();

            response.Enqueue("Demo Queue", new {
                action= Url.Action("LeaveQueue"),       //url to call when the call is dequeued
                waitUrl = Url.Action("WaitInQueue")    //url to call while the call waits
            });

            return TwiML(response);
        }
开发者ID:devinrader,项目名称:Queue-Demo,代码行数:11,代码来源:CallController.cs

示例7: SendResponse

    public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "application/xml";

        var twiml = new Twilio.TwiML.TwilioResponse();
        twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef", waitUrl = "/hold_music.php", action = "/post_bridge_survey.php"}, "{\"account_number\":\"12345abcdef\"}");
        response.StatusDescription = twiml.ToString();
        return response;
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:13,代码来源:example.4.x.cs

示例8: SendResponse

    public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "application/xml";

        var twiml = new Twilio.TwiML.TwilioResponse();
        twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef" });
        response.StatusDescription = twiml.ToString();
        return response;
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:13,代码来源:example.4.x.cs

示例9: Company

 public HttpResponseMessage Company(string id)
 {
     var callWaitUrl = _accountSettings.GetSetting("CallWaitUrl");
     var response = new TwilioResponse();
     response.Say("You are joining a queue");
     var attributes = new
     {
         action = "/api/CallStatus/Update?callId=null",
         method = "POST",
         waitUrl = callWaitUrl
     };
     response.Enqueue($"Company_{id}", attributes);
     return Request.CreateResponse(HttpStatusCode.OK, response.Element, new XmlMediaTypeFormatter());
 }
开发者ID:letmeproperty,项目名称:callcentre,代码行数:14,代码来源:DirectoryController.cs

示例10: SendResponse

    public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "application/xml";

        var twiml = new Twilio.TwiML.TwilioResponse();
        var task = new Task("{\"account_number\":\"12345abcdef\"}", new {priority = "5", timeout = "200"});
        twiml.EnqueueTask (new { workflowSid = "WW0123456789abcdef0123456789abcdef" }, task);

        // alternatively
        twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef" }, "{\"account_number\":\"12345abcdef\"}",  new {priority = "5", timeout = "200"});

        response.StatusDescription = twiml.ToString();
        return response;
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:18,代码来源:example.4.x.cs

示例11: Inbound

        public TwilioResponse Inbound()
        {
            var response = new TwilioResponse();

            if (settings.WorkingHours != null && settings.WorkingHours.Enabled)
            {
                if (!(settings.WorkingHours.From <= DateTime.UtcNow.TimeOfDay && settings.WorkingHours.To >= DateTime.UtcNow.TimeOfDay))
                {
                    return AddVoiceMail(response);
                }
            }

            if (settings.AvailableOperators.Any())
            {
                if (!string.IsNullOrEmpty(settings.GreetingAudio))
                {
                    response.Play(settings.GreetingAudio);
                }

                response.Enqueue(settings.Queue.Name, new { method = "GET", action = GetEcho("enqueue"), waitUrl = GetEcho("wait"), waitUrlMethod = "GET" });
            }

            return AddVoiceMail(response); 
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:24,代码来源:TwilioResponseHelper.cs

示例12: JoinQueue

 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);
 }
开发者ID:pkefal,项目名称:VoxVoiPlayground,代码行数:12,代码来源:PhoneController.cs

示例13: Department

        public HttpResponseMessage Department(string companyId, string id, string callSid)
        {
            var callWaitUrl = _accountSettings.GetSetting("CallWaitUrl");
            var queueMessageUrl = _accountSettings.GetSetting("JoiningQueueMessageUrl");
            var endPoint = _endpointResolverService.Get(int.Parse(id));
            var response = new TwilioResponse();

            response.Play(queueMessageUrl);
            var attributes = new
            {
                action = "api/CallStatus/Update?callId=null",
                method = "POST",
                waitUrl = callWaitUrl
            };
            response.Enqueue($"Department_{endPoint.EndpointId}", attributes);
            _callService.UpdateCallBySid(new Call
            {
                Sid = callSid,
                CallStatus = CallStatus.Queued,
                DateReceived = DateTime.Now,
                QueueId = int.Parse(id)
            });

            _logger.Debug($"Twiml generated for call {callSid}. {response.Element}");
            return Request.CreateResponse(HttpStatusCode.OK, response.Element, new XmlMediaTypeFormatter());
        }
开发者ID:letmeproperty,项目名称:callcentre,代码行数:26,代码来源:DirectoryController.cs


注:本文中的Twilio.TwiML.TwilioResponse.Enqueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。