I'm setting up masked calling. When I get the following TwiML response after calling the masked number, it isn't dialing the number that I'm specifying. It's just saying the number instead after saying the content of the say
Here is the TwiML
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Say>Your call will be charged blah blah.</Say>
<Dial action="http://mywebsite.com/Call/CallComplete" callerId="+441XXXXX">
<Number>+44795XXXXX</Number>
</Dial>
</Response>
And here is the c#
public static string TwiMLDial(string maskedNumber, string to, string actionURL)
{
var response = new Twilio.TwiML.VoiceResponse();
response.Say("Your call will be charged blah blah.");
var dial = new Twilio.TwiML.Dial(action: actionURL, callerId: maskedNumber);
dial.Number(to);
response.Dial(dial);
return response.ToString();
}
I'm using c# .Net core. And have the following in my startup.cs which may be relevant:
services.AddMvc(config =>
{
// Add XML Content Negotiation
config.RespectBrowserAcceptHeader = true;
config.InputFormatters.Add(new XmlSerializerInputFormatter());
config.OutputFormatters.Add(new XmlSerializerOutputFormatter());
})
.AddJsonOptions(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
});