1
votes

Trying out something very basic in Twilio & C#. I am new to Twilio & I am not very strong with MVC

public class IncomingCallController : TwilioController
    {
        // GET: IncomingCall
        [HttpGet]
        public ActionResult Index()
        {
            var response = new VoiceResponse();
            var dial = new Dial();
            Response.ContentType = "text/xml";
            response.Say("Please wait...transferring your call");
            dial.Number("+919812345678");
            return TwiML(response);    
        }
    }

I need the above code snippet to return the static Twiml equivalent that I would have put in a Twiml bin.

I have configured the phone number to with a webhook url as http://someaddress.azurewebsites.net/IncomingCall

Why am i getting an

11210-HTTP bad host name

error

I understand that I am doing something wrong here. I have tried using both a POST and GET request.

Can anyone who has knowledge of this point me in the right direction?

Where am I going wrong?

Any help would be appreciated.

1
Are you able to GET your TwiML URL yourself in a web browser? - philnash
If i am not mistaken, this will need to be hosted to ensure visibility...right? I mean its not as if I am trying to make an outbound call using the API... - Romi24
It needs to be available publicly, yes. That's why I asked whether you can bring it up in a browser. Check out more information on error 11210 to see what you need to do. - philnash
is there anything wrong with my approach? - Romi24
Your code looks fine, I don't believe Twilio can reach it. That's why I'm asking if you can load it in a browser. - philnash

1 Answers

0
votes

Some issues are created by programmers who are in a tearing hurry....This was an issue created by yours truly..

Thanks to Phil's interaction I was able to find out...