lito
lito

Reputation: 1

how to set myself URL when make call by Twilio?

As you know, use Twilio to make a call, needs pass a URL tell Twilio to fetch instructions.

And I deploy my URL on http://1xx.16.102.129:8080/voice/voice.xml

Here is my code:

List<NameValuePair> params = new ArrayList<NameValuePair>();

params.add(new BasicNameValuePair("Url","http://1xx.16.102.129:8080/voice/voice.xml")); 

params.add(new BasicNameValuePair("To", "+1xxxxxxxxxxxx"));

params.add(new BasicNameValuePair("From", "+15086895110"));

CallFactory callFactory = client.getAccount().getCallFactory();

Call call = callFactory.create(params);

After the phone call end, I got exception like "502 Bad Gateway”". Can anyone tell me what is the problem?

Upvotes: 0

Views: 322

Answers (1)

Devin Rader
Devin Rader

Reputation: 10366

Twilio evangelist here.

502 Bad Gateway is usually an indication that Twilio tried to request content from the URL you specified when initiating the outbound call but had trouble.

There are a lot of things that can cause this including things like problems resolving DNS, not including a Content-Type header in the response or network disruptions between Twilio and your server.

We have put together a number of troubleshooting tips that you can find on our website that you can use to help diagnose the problem.

Hope that helps.

Upvotes: 1

Related Questions