Question

I have the following XML (Twiml) example which works fine:

<Response>
<Play loop="1">https://api.twilio.com/cowbell.mp3</Play>
<Dial method="POST" timeout="30" hangupOnStar="false" timeLimit="14400" callerId="+1234567890" record="false">+0987654321</Dial>
</Response>

This works perfectly as it should. However, when I use a public dropbox share link for the mp3 file:

https://www.dropbox.com/s/bhowc21p2bzug70/NorthAustinNmeNEW.mp3

The script breaks altogether, throwing this error:

Twilio is unable to process the Content-Type of the provided URL

I have tried loading the file to several sites outside of dropbox with no luck. Does anyone have a recommendation for how I can get the above file to play correctly?

Était-ce utile?

La solution

This is because dropbox is sending HTTP/1.1 302 redirect with header Content-Type: text/html; charset=utf-8 instead of HTTP/1.1 200 OK with Content-Type: audio/mpeg header.

Host your mp3 file on a http server so it is downloaded directly.

Or you can use following link. But this url pattern is not guaranteed.

https://dl.dropboxusercontent.com/s/bhowc21p2bzug70/NorthAustinNmeNEW.mp3
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top