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


C# TwilioResponse.DialQueue方法代码示例

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


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

示例1: Dial

        /// <summary>
        /// Action Method that returns the TwiML needed to connect an 'Agent' to the first call in the Queue
        /// </summary>
        /// <remarks>This method also includes the 'url' parameter in the generated TwiML.  This allows you to provide a URL that can return TwiML that will be executed to the dequeued caller as a Whisper</remarks>
        /// <returns></returns>
        public ActionResult Dial()
        {
            var response = new TwilioResponse();
            response.DialQueue("Demo Queue", new { url = Url.Action("Connect") }, new { });

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

示例2: DialQueueOrNumber

        public HttpResponseMessage DialQueueOrNumber(DialQueueParameters clientParameters)
        {
            var response = new TwilioResponse();

            if (string.IsNullOrEmpty(clientParameters.PhoneNumber))
            {
                _logger.Debug($"Dialling queue {clientParameters.QueueName} for client {clientParameters.ClientName}");

                var queue = _queueService.ResolveByName(clientParameters.QueueName);
                var call = _queueProvider.GetFirstCallFromQueue(queue);

                response.DialQueue(clientParameters.QueueName, new { record = "record-from-answer" });
                _queueStateHandler.DecreaseQueueByName(clientParameters.QueueName);
                _callService.FlagCallConnected(call.Sid, clientParameters.ClientName);
            }
            else
            {
                var agentName = "";
                var agent = new Agent();
                string number;
                if (!string.IsNullOrEmpty(clientParameters.From))
                {
                    agentName = clientParameters.From.Split(':')[1];
                    var agentNamePeriod = agentName.Replace("_", ".");
                    agent = _agentService.GetAgentByAgentEmail(agentNamePeriod + "@letme.com");
                }

                if (agent.TeamId == "10") //Lead gen
                {
                    number = WebConfigurationManager.AppSettings["TwilioNumberLeadGen"];
                }
                else if (agent.TeamId == "12")
                {
                    number = WebConfigurationManager.AppSettings["TwilioNumberPM"];
                }
                else
                {
                    number = WebConfigurationManager.AppSettings["TwilioNumber"];
                }

                var callId = _callService.LogOutboundCall(new Call
                {
                    Dialled = clientParameters.PhoneNumber,
                    CallStatus = CallStatus.Initiated,
                    DateReceived = DateTime.Now,
                    ClientName = agentName

                }).CallId;

                var attributes = new { callerId = number, record = "record-from-answer", action = $"/api/CallStatus/Update?callId={callId}" };
                response.Dial(clientParameters.PhoneNumber, attributes);
            }
            return Request.CreateResponse(HttpStatusCode.OK, response.Element, new XmlMediaTypeFormatter());
        }
开发者ID:letmeproperty,项目名称:callcentre,代码行数:54,代码来源:TwilioVoiceController.cs

示例3: Agent

 public HttpResponseMessage Agent(string companyId, string departmentId, string teamId, string id)
 {
     var twilioResponse = new TwilioResponse();
     twilioResponse.DialQueue(id, null);
     return Request.CreateResponse(HttpStatusCode.OK, twilioResponse.Element, new XmlMediaTypeFormatter());
 }
开发者ID:letmeproperty,项目名称:callcentre,代码行数:6,代码来源:DirectoryController.cs


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