I have tried most of the solutions here but couldn't figure out why my call isn't reaching the other side. Though Twilio says that both incoming and outgoing was successfully completed.
Here's the necessary part of my code
from flask import Flask
from flask import request, Response
@app.route('/makeACall', methods=['POST'])
def exchange_voice():
account_sid = "XXXX"
auth_token = "XXXX"
client = TwilioRestClient(account_sid, auth_token)
call = client.calls.create(
to="+1857XXX",
from_="+1510XXX",
url="cloudserver.com/answerWithXML",
method='POST'
)
print(call.sid)
@app.route("/answerWithXML", methods=['GET', 'POST'])
def sendBackXML():
resp = twilio.twiml.Response();
resp.say("Welcome!");
//Was originally sending str(resp) as in docs
return Response(resp, content_type="application/xml")
The debugger gives
- "11200 - HTTP retrieval failure" for the returned response
- "12100 - Document parse failure" when str(resp) was returned