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()); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "application/xml"; var response = new TwilioResponse(); response.Say("Hello there! You have successfully configured a web hook."); response.Say("Have fun with your Twilio development!", new { Voice = "woman" }); context.Response.Write(response.ToString()); }
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; }
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; }
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" }, "{\"account_number\":\"12345abcdef\"}"); response.StatusDescription = twiml.ToString(); return(response); }
public void ProcessRequest(HttpContext context) { var twiml = new TwilioResponse(); if (context.Request["message"] != null) { var message = HttpContext.Current.Server.UrlDecode(context.Request["message"].ToString()); twiml.Say(message); } else twiml.Say("Good Morning, I am ready"); context.Response.Clear(); context.Response.ContentType = "text/xml"; context.Response.Write(twiml.ToString()); context.Response.End(); }
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; }
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); }
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(""); }
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"); }
private static HttpResponseMessage GetHttpResponse(TwilioResponse response) { Log.Info(response); return new HttpResponseMessage { Content = new StringContent(response.ToString(), Encoding.UTF8, "application/xml") }; }
public IActionResult ReceiveCall() { var twiml = new TwilioResponse(); twiml.Say("You are calling Marcos Placona").Dial(_twilioSettings.Options.MyOwnNumber); return Content(twiml.ToString()); }
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"); }
private static ActionResult SendTwilioResult(TwilioResponse response) { Stream result = new MemoryStream(Encoding.Default.GetBytes(response.ToString())); return new FileStreamResult(result, "application/xml"); }