简体   繁体   English

Twilio无法与存储在亚马逊S3上的xml文件通信

[英]Twilio not communicating with my xml file stored on amazon S3

I have a twilio account and am able to make calls. 我有一个twilio帐户,可以打电话。 I am also able to use twiML Bins to do some text-to-voice. 我还可以使用twiML Bins进行文本到语音的转换。 I however would like to call people hand play the recording stored on my amazon server, my java code is as follows: 但是我想打电话给人们手工播放存储在我的亚马逊服务器上的录音,我的java代码如下:

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

The xml code is as follows: xml代码如下:

<?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. 我的mp3储存在与xml相同的位置。 But when I try make a call the twilio debugger tells me: 但是当我尝试拨打电话时,twilio调试器告诉我:

Error - 11200. HTTP retrieval failure. 错误-11200。HTTP检索失败。

Any Help will be appreciated. 任何帮助将不胜感激。

Twilio evangelist here. Twilio的传播者在这里。

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. 默认情况下,Twilio将向Url发出POST请求,而我猜测您的Web服务器无法通过POST请求提供.xml。 You can send the Method param to tell Twilio to make a GET request instead: 您可以发送Method参数来告诉Twilio发出GET请求:

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 这是一个更长的示例: http : //twilio.com/docs/api/rest/making-calls#example-5

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM