本文整理汇总了C#中Twilio.TwiML.TwilioResponse.Gather方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioResponse.Gather方法的具体用法?C# TwilioResponse.Gather怎么用?C# TwilioResponse.Gather使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Twilio.TwiML.TwilioResponse
的用法示例。
在下文中一共展示了TwilioResponse.Gather方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Post
public HttpResponseMessage Post(VoiceRequest request)
{
var response = new TwilioResponse();
response.Say("Welcome to this Twilio demo app. Please enter your 3 digit pin code.");
response.Gather(new { numDigits = 3, action = string.Format("/api/Authenticate") });
return this.TwiMLResponse(response);
}
示例2: Post
public HttpResponseMessage Post(VoiceRequest request)
{
var response = new TwilioResponse();
response.Say("Welcome to this Twilio demo app. Please enter your 5 digit ID.");
response.Gather(new { numDigits = 5, action = string.Format("/api/Authenticate") });
return this.Request.CreateResponse(HttpStatusCode.OK, response.Element, new XmlMediaTypeFormatter());
}
示例3: AddRecordOrGatherCommands
private void AddRecordOrGatherCommands(TwilioResponse response)
{
var questionType = _question.Type;
switch (questionType)
{
case QuestionType.Voice:
response.Record(new { action = GenerateUrl(_question) });
break;
case QuestionType.Numeric:
case QuestionType.YesNo:
response.Gather(new { action = GenerateUrl(_question) });
break;
}
}
示例4: IncomingCall
//
// GET: /Phone/
public ActionResult IncomingCall(string CallSid, string FromCity, string FromState, string FromZip, string FromCountry)
{
LocationalCall call = (LocationalCall) GetCall(CallSid);
StateManager.AddNewCall(call);
StateManager.AddToLog(CallSid, "Incoming call...");
call.City = FromCity;
call.Country = FromCountry;
call.ZipCode = FromZip;
call.State = FromState;
TwilioResponse response = new TwilioResponse();
response.Say("Welcome to the Bank of Griff.");
response.Pause();
response.Say("Press 1 to manage your account.");
response.Say("Press 2 to take out a loan.");
response.Say("Press 3 to talk to a representative.");
response.Pause();
response.Gather(new { action = Url.Action("ServiceRequest"),
timeout = 120, method = "POST", numDigits = 1 });
return SendTwilioResult(response);
}
示例5: ServiceRequest
public ActionResult ServiceRequest(string CallSid, string Digits)
{
var call = GetCall(CallSid);
TwilioResponse response = new TwilioResponse();
switch (Digits)
{
case "0":
{
StateManager.AddToLog(CallSid, string.Format("User selected option {0} from service selection.", "Return to Menu"));
response.Say("Returning to the main menu.");
response.Redirect(Url.Action("IncomingCall"));
}
break;
case "1":
{
StateManager.AddToLog(CallSid, string.Format("User selected option {0} from service selection.", "Manage Account"));
response.Say("Please enter your 8 digit account number");
response.Gather(
new { action = Url.Action("ManageAccount"), timeout = 120, method = "POST", numDigits = 8 });
}
break;
case "2":
{
StateManager.AddToLog(CallSid, string.Format("User selected option {0} from service selection.", "Take a Loan"));
response.Say(
"All of our loan officers are currently giving money away to people less deserving than you.");
}
break;
case "3":
{
StateManager.AddToLog(CallSid, string.Format("User selected option {0} from service selection.", "Talk to a Representative"));
}
break;
default:
{
response.Say("Oy vey.");
response.Redirect(Url.Action("IncomingCall"));
} break;
}
return SendTwilioResult(response);
}