本文整理汇总了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());
}
示例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;
}
示例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;
}
示例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;
}
示例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("");
}
示例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");
}
示例7: GetHttpResponse
private static HttpResponseMessage GetHttpResponse(TwilioResponse response)
{
Log.Info(response);
return new HttpResponseMessage { Content = new StringContent(response.ToString(), Encoding.UTF8, "application/xml") };
}
示例8: ReceiveCall
public IActionResult ReceiveCall()
{
var twiml = new TwilioResponse();
twiml.Say("You are calling Marcos Placona").Dial(_twilioSettings.Options.MyOwnNumber);
return Content(twiml.ToString());
}
示例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");
}
示例10: SendTwilioResult
private static ActionResult SendTwilioResult(TwilioResponse response)
{
Stream result = new MemoryStream(Encoding.Default.GetBytes(response.ToString()));
return new FileStreamResult(result, "application/xml");
}