public void Example_3() { var response = new TwilioResponse(); response.Record(new { transcribe = true, transcribeCallback = "/handle_transcribe.php" }); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public void Example_1() { var response = new TwilioResponse(); response.Record(); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public void Can_Generate_Record_With_All_Attributes() { var response = new TwilioResponse(); response.Record(new { action = "record.php", method = "GET", timeout = 10, finishOnKey = "#", maxLength = 90, transcribe = true, transcribeCallback = "transcribe.php", playBeep = false }); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public void Can_Generate_Single_Record() { var response = new TwilioResponse(); response.Record(); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public HttpResponseMessage Post(VoiceRequest request) { var response = new TwilioResponse(); var option = (request != null) ? request.Digits : string.Empty; switch (option) { case "1": response.Say("Please say your name and provide your feedback. Press the pound key when you are finished."); response.Record(new { playBeep = "true", transcribe = "true", finishOnKey = "#", action = CallCreateController.URL }); break; case "2": response.Say("Enter the feedback id number followed by pound."); response.Gather(new { finishOnKey = "#", action = CallLookupController.URL }); break; default: response.Say("You've entered an invalid option."); response.Redirect(CallHomeController.URL); break; } return(this.Request.CreateResponse( HttpStatusCode.OK, response.Element, new XmlMediaTypeFormatter())); }
public void Can_Generate_Record_And_Attributes() { var response = new TwilioResponse(); response.Record(new { action = "record.php" }); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public void Example_2() { var response = new TwilioResponse(); response.Say("Please leave a message at the beep. Press the star key when finished."); response.Record(new { action = "http://foo.edu/handleRecording.php", method = "GET", maxLength = 20, finishOnKey = "*" }); response.Say("I did not receive a recording"); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public void Can_Generate_Single_Record() { var response = new TwilioResponse(); response.Record(); Assert.True(IsValidTwiML(response.ToXDocument())); }
public void Can_Generate_Record_And_Attributes() { var response = new TwilioResponse(); response.Record(new { action = "record.php" }); Assert.True(IsValidTwiML(response.ToXDocument())); }
public void Can_Generate_Record_With_All_Attributes() { var response = new TwilioResponse(); response.Record(new { action = "record.php", method = "GET", timeout = 10, finishOnKey = "#", maxLength = 90, transcribe = true, transcribeCallback = "transcribe.php", playBeep = false }); Assert.True(IsValidTwiML(response.ToXDocument())); }
public async Task <TwilioResponse> DoMenu(TwilioRequest request) { var response = new TwilioResponse(); if (request.Digits == "1") { var now = TimeUtils.GetLocalDateTime(this.config); var newEvent = new SarEvent { Name = "New Event at " + TimeUtils.GetMiltaryTimeVoiceText(now), Opened = now }; await this.eventService.Create(newEvent); LoadActiveEvents(); this.session.EventId = newEvent.Id; BeginMenu(response); response.SayVoice("Created " + newEvent.Name); await EndMenu(response); } else if (request.Digits == "2") { using (var db = dbFactory()) { BuildSetEventMenu(response, string.Empty, Url.Content("~/api/VoiceAdmin/Menu")); } } else if (request.Digits == "3") { response.SayVoice("Record a short description of this event at the tone"); response.Record(new { maxLength = 120, action = GetAction("SetDescription", controller: "VoiceAdmin") }); BeginMenu(response); await EndMenu(response); } else if (request.Digits == "9") { Dictionary <string, string> args = new Dictionary <string, string>(); args.Add("targetId", this.session.EventId.ToString()); response.BeginGather(new { numDigits = 1, action = GetAction("ConfirmClose", args, controller: "VoiceAdmin"), timeout = 10 }); response.SayVoice("Press 9 to confirm close of {0}. Press any other key to return to menu.", GetEventName()); response.EndGather(); } else if (request.Digits == "0") { response.Redirect(GetAction("Menu")); } else { response.SayVoice("I didn't understand."); BeginMenu(response); await EndMenu(response); } return(response); }
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)); }
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)); }
public TwiMLResult Index(VoiceRequest request) { var response = new TwilioResponse(); // Use <Say> to give the caller some instructions response.Say("Hello. Please leave a message and I will transcribe it."); // Use <Record> to record and transcribe the caller's message response.Record(new { transcribe = true, maxLength = 30 }); // End the call with <Hangup> response.Hangup(); return TwiML(response); }
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; } }
public async Task <TwilioResponse> DoMenu(TwilioRequest request) { var response = new TwilioResponse(); if (request.Digits == "1") { if (this.session.MemberId == null) { await AddLoginPrompt(response, Url.Content("~/api/Voice/DoSignInOut")); } else { response = await DoSignInOut(request); } } else if (request.Digits == "2") { BuildSetEventMenu(response, string.Empty, Url.Content("~/api/voice/Menu")); } else if (request.Digits == "3") { response.SayVoice(Speeches.StartRecording); response.Record(new { maxLength = 120, action = GetAction("StopRecording") }); BeginMenu(response); await EndMenu(response); } else if (request.Digits == "8") { await AddLoginPrompt(response, Url.Content("~/api/voice/Menu")); } else if (request.Digits == "9") { response.Redirect(GetAction("Menu", controller: "VoiceAdmin")); } else { response.SayVoice(Speeches.InvalidSelection); BeginMenu(response); await EndMenu(response); } return(LogResponse(response)); }
public void _1_4b() { var digits = 1; var response = new TwilioResponse(); if (digits == 1) { response.Dial("+13105551212"); response.Say("The call failed or the remote party hung up. Goodbye."); } else if (digits == 2) { response.Say("Record your monkey howl after the tone."); response.Record(new { maxLength = 30, action = "hello-monkey-handle-recording.php" }); } Assert.True(IsValidTwiML(response.ToXDocument())); }
// /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); }
public HttpResponseMessage Record(VoiceRequest request, CallType type) { var response = new TwilioResponse(); if (request.Digits == "2") { response.Dial(MyCell); return(TWiML(response)); } // "Please leave your message after the beep. Press pound when you are done recording. " response.Play("/audio/record.mp3"); response.Record(new { playBeep = "true", action = "/ivr/record_callback/" + type }); return(TWiML(response)); }
//create a TwiML response to notify the caller that the call is being recorded; appends the response to an existing response public static TwilioResponse GetResponseRecord(TwilioResponse resp, TwilioRequestVoice request, Entity.Client client, Entity.Call call) { if (log.IsDebugEnabled) { log.Debug("GetResponseRecord.request." + (request == null ? "null" : request.ToJsonString())); } resp.Say("This call may be recorded for quality assurance."); resp.Record(); //log the current call state if (call != null) { call.CallRecord = true; call.Save(); } return resp; }
public void _1_4b() { var digits = 1; var response = new TwilioResponse(); if (digits == 1) { response.Dial("+13105551212"); response.Say("The call failed or the remote party hung up. Goodbye."); } else if (digits == 2) { response.Say("Record your monkey howl after the tone."); response.Record(new { maxLength = 30, action = "hello-monkey-handle-recording.php" }); } Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }