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


C# TwilioResponse.Gather方法代码示例

本文整理汇总了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);
        }
开发者ID:jonasrafael,项目名称:Samples,代码行数:8,代码来源:WelcomeController.cs

示例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());
        }
开发者ID:jonasrafael,项目名称:Samples,代码行数:9,代码来源:WelcomeController.cs

示例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;
     }
 }
开发者ID:TwilioDevEd,项目名称:automated-survey-csharp,代码行数:14,代码来源:Response.cs

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

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


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