0
votes

I've been trying to redirect incoming phone calls from Twilio via webhook to execute TwiML hosted on a website.

For testing, I've been using 'raw' GitHub to host my XML as a 'GET' request webhook.

My code is in the format below:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
        <Number>
            +447xxxxxxxxx
        </Number>
    </Dial>
</Response>

When I run this code from a TwiML bin, it redirects as I want, however when I send it through a webhook, it just says the phone number out loud.

Any help on why this is would be greatly appreciated,

Thank you.

1

1 Answers

1
votes

This has to do with the MIME type the web server is returning.

You can find more details here.

Twilio understands MIME types

The webserver is returning text/plain instead of text/xml.

You can host your static TwiML in a TwiMl Bin.