public void Can_Generate_Dial_Multiple_Clients() { var response = new TwilioResponse(); response.DialClients("Jenny", "Tommy", "Olive"); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }
public async Task <ActionResult> RouteIncoming(string From) { var response = new TwilioResponse(); //look up the from and if we recognize it dial the associated client IMobileServiceTable <PhoneNumber> phoneNumberTable = MobileService.GetTable <PhoneNumber>(); var phoneNumbers = await phoneNumberTable.ReadAsync <PhoneNumber>(phoneNumberTable.Where(p => p.Value == From)); PhoneNumber phoneNumber = phoneNumbers.FirstOrDefault(); if (phoneNumber == null) { response.Say("Could not find your phone number. Please register first"); } else { response.Say("Connecting you now"); response.DialClients(phoneNumber.Key.ToString("N")); } return(TwiML(response)); }
public void Can_Generate_Dial_Multiple_Clients() { var response = new TwilioResponse(); response.DialClients("Jenny", "Tommy", "Olive"); Assert.IsTrue(IsValidTwiML(response.ToXDocument())); }