本文整理汇总了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);
}
示例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());
}
示例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());
}