本文整理汇总了C#中Twilio.TwiML.TwilioResponse.Record方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioResponse.Record方法的具体用法?C# TwilioResponse.Record怎么用?C# TwilioResponse.Record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Twilio.TwiML.TwilioResponse
的用法示例。
在下文中一共展示了TwilioResponse.Record方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: Index
public TwiMLResult Index(VoiceRequest request)
{
var response = new TwilioResponse();
// Use <Say> to give the caller some instructions
response.Say("Hello. Please leave a message after the beep.");
// Use <Record> to record the caller's message
response.Record();
// End the call with <Hangup>
response.Hangup();
return TwiML(response);
}
示例3: HandleGather
// /Voice/HandleGather
public TwiMLResult HandleGather(VoiceRequest request)
{
var response = new TwilioResponse();
switch (request.Digits)
{
case "1":
response.Dial("+13105551212");
response.Say("The call failed or the remote party hung up. Goodbye.");
break;
case "2":
response.Say("Record your message after the tone.");
response.Record(new {maxLength = "30", action = "/Voice/HandleRecord"});
break;
default:
response.Redirect("/Voice");
break;
}
return TwiML(response);
}
示例4: Record
public ActionResult Record()
{
var response = new TwilioResponse();
response.Say(
"Please record your message after the beep. Press star to end your recording");
response.Record(new
{
finishOnKey = "*",
action = Url.Action("Hangup")
});
return TwiML(response);
}
示例5: VoiceMail
public TwiMLResult VoiceMail(CallContextModel model)
{
var response = new TwilioResponse();
try
{
response.Say(ConferenceConst.DictateFollowUpAction,
new { voice = VoiceInConference, language = LanguageInConference });
var callBackUrl = Utilities.FormatLink(Url.Action("VoiceMailStatusCallBack", "Conference", model));
response.Record(new
{
action = callBackUrl,
trim = "trim-silence",
finishOnKey = "#",
playBeep = true
});
}
catch (Exception e)
{
// Log
Log.Error("Voice email. Error: ", e);
// Error
response.Say(ConferenceConst.ErrorMessage, new { voice = VoiceInConference, language = LanguageInConference });
response.Hangup();
}
return new TwiMLResult(response);
}
示例6: RecordPublicReply
public TwilioResponse RecordPublicReply(VoiceRequest request, int profileId, int lastBroadcastIdx, int? subBroadcastIdx)
{
var response = new TwilioResponse();
response.Say("At the tone please record your reply.");
response.Record(new { action = ivrRouteProvider.GetUrlMethod(IVRRoutes.BROADCAST_SAVE_PUBLIC_REPLY, profileId, lastBroadcastIdx, subBroadcastIdx), playBeep = true });
return response;
}
示例7: RecordBroadcast
public TwilioResponse RecordBroadcast(VoiceRequest request, int profileId)
{
var response = new TwilioResponse();
response.Say("At the tone record your message, to finish press any key. Please note that this will be public to all people on the Refugees United platform.");
response.Record(new { action = ivrRouteProvider.GetUrlMethod(IVRRoutes.BROADCAST_SAVE_PUBLIC_BROADCAST, profileId), playBeep = true });
return response;
}
示例8: RecordMessage
public HttpResponseMessage RecordMessage(TwilioRecordRequest twilioRequest)
{
var twilioResponse = new TwilioResponse();
twilioResponse.Say("Please leave your message after the beep and finish with the pound key.", _voicesettings);
twilioResponse.Say("You have 6 seconds.", _voicesettings);
twilioResponse.Record(
new
{
action = Url.Link("ExtendedApi", new {controller = "Phone", action = "HandleRecordedMessage"}),
finishOnkey = "#",
maxLength = "6",
method = "POST",
transcribe = "true"
});
twilioResponse.Say("We did not receive a recording. You're returning to the previous menu.", _voicesettings);
twilioResponse.Redirect(Url.Link("ExtendedApi", new { controller = "Phone", action = "HandleMenuCall" }));
return Request.CreateResponse(HttpStatusCode.OK, twilioResponse.Element);
}
示例9: RecordMessageForFavourite
public TwilioResponse RecordMessageForFavourite(VoiceRequest request, int profileId, string favs, int pageIdx)
{
var response = new TwilioResponse();
var favsArray = favs.Split(',');
if (request.Digits.Equals("#"))
{
response.Redirect(string.Format("/IVRMain/SendFavMessage_ListFavs?profileId={0}&pageIdx={1}", profileId, ++pageIdx));
return response;
}
else if (request.Digits.Equals("*"))
{
response.Redirect(routeProvider.GetUrlMethod(IVRRoutes.PLAY_MAIN_MENU));
return response;
}
var selection = int.Parse(request.Digits);
string targetProfileId = favsArray[selection - 1];
response.Say("Record your message after the tone, press any key when you are done.");
response.Record(new { action = string.Format("/IVRMain/SendFavMessage_SaveRecording?profileId={0}&targetProfileId={1}", profileId, targetProfileId) });
return response;
}
示例10: PlayRecordedMessage_Response
public TwilioResponse PlayRecordedMessage_Response(VoiceRequest request, int profileId, int recordingIdx, int fromProfileId)
{
var response = new TwilioResponse();
var digits = int.Parse(request.Digits);
switch (digits)
{
case 1:
response.Redirect(string.Format("/IVRMain/PlayRecordedMessage?profileId={0}&recordingIdx={1}", profileId, recordingIdx));
break;
case 2:
profileManager.DeleteRecording(profileId, recordingIdx);
response.Redirect(string.Format("/IVRMain/PlayRecordedMessage?profileId={0}&recordingIdx={1}", profileId, recordingIdx));
break;
case 3:
response.Say("At the tone please record your response. Press any key when you are done.");
response.Record(new { action = string.Format("/IVRMain/PlayRecordedMessage_SaveResponse?profileId={0}&recordingIdx={1}&fromProfileId={2}", profileId, recordingIdx, fromProfileId) });
break;
case 4:
response.Redirect(string.Format("/IVRMain/PlayRecordedMessage?profileId={0}&recordingIdx={1}", profileId, ++recordingIdx));
break;
}
return response;
}