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


C# TwilioResponse.ToString方法代码示例

本文整理汇总了C#中Twilio.TwiML.TwilioResponse.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioResponse.ToString方法的具体用法?C# TwilioResponse.ToString怎么用?C# TwilioResponse.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Twilio.TwiML.TwilioResponse的用法示例。


在下文中一共展示了TwilioResponse.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/xml";

            var response = new TwilioResponse();
            response.Say("Hello there! Your Twilio environment has been configured.");
            response.Say("Good luck during the workshop!", new { Voice = "woman" });

            context.Response.Write(response.ToString());
        }
开发者ID:kwhinnery,项目名称:jumpstart,代码行数:10,代码来源:Hello.ashx.cs

示例2: SendResponse

    public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "application/xml";

        var twiml = new Twilio.TwiML.TwilioResponse();
        twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef", waitUrl = "/hold_music.php", action = "/post_bridge_survey.php"}, "{\"account_number\":\"12345abcdef\"}");
        response.StatusDescription = twiml.ToString();
        return response;
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:13,代码来源:example.4.x.cs

示例3: SendResponse

    public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "application/xml";

        var twiml = new Twilio.TwiML.TwilioResponse();
        twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef" });
        response.StatusDescription = twiml.ToString();
        return response;
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:13,代码来源:example.4.x.cs

示例4: SendResponse

    public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "application/xml";

        var twiml = new Twilio.TwiML.TwilioResponse();
        var task = new Task("{\"account_number\":\"12345abcdef\"}", new {priority = "5", timeout = "200"});
        twiml.EnqueueTask (new { workflowSid = "WW0123456789abcdef0123456789abcdef" }, task);

        // alternatively
        twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef" }, "{\"account_number\":\"12345abcdef\"}",  new {priority = "5", timeout = "200"});

        response.StatusDescription = twiml.ToString();
        return response;
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:18,代码来源:example.4.x.cs

示例5: VoiceTwiML

        public virtual ActionResult VoiceTwiML(string PhoneNumber)
        {
            var twiml = new TwilioResponse();
            try
            {
                var number = new Number(PhoneNumber);
                twiml.Dial(number, new { callerId = MY_TWILIO_PHONENUMBER });
            }
            catch (Exception)
            {
                //e.printStackTrace();
            }

            Response.ContentType = "text/xml";
            Response.Write(twiml.ToString());
            Response.End();

            return Content("");
        }
开发者ID:patelpriyank,项目名称:Android,代码行数:19,代码来源:TwilioController.cs

示例6: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            string customerPhone = context.Request.QueryString.Get("customerPhone");

            context.Response.Clear();
            context.Response.ContentType = "text/xml";
            context.Response.ContentEncoding = System.Text.Encoding.UTF8;
            var twiml = new Twilio.TwiML.TwilioResponse();

            //twiml.Say("Hello Seba");
            //twiml.Enqueue("QueueDemo");

            DialCallProperties cp = new DialCallProperties(customerPhone);

            twiml.Dial("+17202822740", cp);

            context.Response.Write(twiml.ToString());
            context.Response.End();
            //string accountSid = "AC910947335f85f6b222394231ac5f064d";
            //string authToken = "44e9b67a8f82209656db45e7575759c5";
            //var twilio = new TwilioRestClient(accountSid, authToken);
            //var call = twilio.InitiateOutboundCall("+17209615246", "+17202822742", "http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient");
        }
开发者ID:sgnagnarella,项目名称:twiliotest,代码行数:23,代码来源:Call.ashx.cs

示例7: GetHttpResponse

 private static HttpResponseMessage GetHttpResponse(TwilioResponse response)
 {
     Log.Info(response);
     return new HttpResponseMessage { Content = new StringContent(response.ToString(), Encoding.UTF8, "application/xml") };
 }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:5,代码来源:TwilioController.cs

示例8: ReceiveCall

 public IActionResult ReceiveCall()
 {
     var twiml = new TwilioResponse();
     twiml.Say("You are calling Marcos Placona").Dial(_twilioSettings.Options.MyOwnNumber);
     return Content(twiml.ToString());
 }
开发者ID:ZhangYueqiu,项目名称:asp5-mvc6-examples,代码行数:6,代码来源:HomeController.cs

示例9: Index

        public IActionResult Index(string From)
        {
            // Identify caller if possible
            // Otherwise, request PIN            
            //return View("Login");

            //var x = new Twilio.TwiML.TwilioResponse();
            //x.Say("Hello test 123");
            //return Content(x.ToString(), "text/xml");

            
            Guid g = Guid.NewGuid();
            var st = new State
            {                
                ID = g
            };
            
            var cont = seq(st);
            st.Continuation = cont.GetEnumerator();            
            states.Add(g, st);
            var x = new TwilioResponse();
            x.Redirect("/Voice/Continue/" + g.ToString());
            return Content(x.ToString(), "text/xml");

        }
开发者ID:steven777400,项目名称:FlyingClubReservation,代码行数:25,代码来源:VoiceController.cs

示例10: SendTwilioResult

        private static ActionResult SendTwilioResult(TwilioResponse response)
        {
            Stream result = new MemoryStream(Encoding.Default.GetBytes(response.ToString()));

            return new FileStreamResult(result, "application/xml");
        }
开发者ID:1kevgriff,项目名称:CallCenter,代码行数:6,代码来源:PhoneController.cs


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