Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio not communicating with my xml file stored on amazon S3

I have a twilio account and am able to make calls. I am also able to use twiML Bins to do some text-to-voice. I however would like to call people hand play the recording stored on my amazon server, my java code is as follows:

callParams.put("To", "#number"); 
callParams.put("From", "#number");
callParams.put("Url", "https://myserveraddress/play.xml");

The xml code is as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
  <Play>https://myserveraddress/jazz.mp3</Play>
</Response>

My mp3 is stored in the same location as my xml. But when I try make a call the twilio debugger tells me:

Error - 11200. HTTP retrieval failure.

Any Help will be appreciated.

like image 460
Chognificent Avatar asked Feb 02 '26 18:02

Chognificent


1 Answers

Twilio evangelist here.

By default Twilio is going to make a POST request to the Url, and I'm guessing your web server can't serve a .xml from a POST request. You can send the Method param to tell Twilio to make a GET request instead:

callParams.put("To", "#number"); 
callParams.put("From", "#number");
callParams.put("Url", "https://myserveraddress/play.xml");
callParams.put("Method", "GET");

Here is a longer sample: http://twilio.com/docs/api/rest/making-calls#example-5

Hope that helps.

like image 128
Devin Rader Avatar answered Feb 04 '26 10:02

Devin Rader



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!