I created a TwiML application and set the voice request URL in the web deployment of the ASP.NET-MVC action method: http://voiceapp-001-site1.myasp.net/voice
This action method is called when someone navigates to the URL above:
public ActionResult Voice() { Response.ContentType = "text/xml"; // put a phone number you've verified with Twilio to use as a caller ID number string callerId = Settings.TwilioNumber; // put your default Twilio Client name here, for when a phone number isn't given string number = "jenny"; // get the phone number from the page request parameters, if given if (Request["PhoneNumber"] != null) { number = Request["PhoneNumber"]; } // wrap the phone number or client name in the appropriate TwiML verb // by checking if the number given has only digits and format symbols string numberOrClient; var m = Regex.Match(number, @"^[\d\+\-\(\) ]+$"); if (m.Success) { numberOrClient = string.Format("<Number>{0}</Number>", number); } else { numberOrClient = string.Format("<Client>{0}</Client>", number); } ViewBag.CallerId = callerId; ViewBag.NumberOfClient = numberOrClient; return View(); }
Voice view looks like this:
<?xml version="1.0" encoding="UTF-8" ?> <response> <dial callerid="@ViewBag.CallerId"> @Html.Raw(ViewBag.NumberOfClient) </dial> </response>
Then I try to make a test call:

but after 13 seconds the call ends automatically and in the error log I get:
Notification SID NOe85ffe80dfc52e81f942a7414c9f7c9c Warning 12200 Schema validation warning Description Cannot find the declaration of element 'response'.
But below in the Body section, I see a response element:

source share