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


C# TwilioResponse.Record方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:TwilioDevEd,项目名称:automated-survey-csharp,代码行数:14,代码来源:Response.cs

示例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);
  }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:example.4.x.cs

示例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);
 }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:20,代码来源:twiml-gather-input.4.x.cs

示例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);
        }
开发者ID:TwilioDevEd,项目名称:conference-broadcast-csharp,代码行数:13,代码来源:RecordingsController.cs

示例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);
        }
开发者ID:nguyenminhthu,项目名称:TeleConsult,代码行数:27,代码来源:ConferenceController.cs

示例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;
 }
开发者ID:kzhen,项目名称:RefUnited-IVR-Platform,代码行数:7,代码来源:IVRBroadcastLogic.cs

示例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;
        }
开发者ID:kzhen,项目名称:RefUnited-IVR-Platform,代码行数:9,代码来源:IVRBroadcastLogic.cs

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

示例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;
        }
开发者ID:kzhen,项目名称:RefUnited-IVR-Platform,代码行数:27,代码来源:IVRMainLogic.cs

示例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;
        }
开发者ID:kzhen,项目名称:RefUnited-IVR-Platform,代码行数:26,代码来源:IVRMainLogic.cs


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