I have started to use Twilio Voice call recently for sending OTP to users using Django. I am referring to the given link to customise the Twilio response. https://www.twilio.com/docs/tutorials/walkthrough/click-to-call/python/flask
views.py
def voice_call(otp, mobile_no):
client = TwilioRestClient(settings.ACCOUNT_SID, settings.AUTH_TOKEN)
client.calls.create(from_=settings.OTP_FROM_NUMBER,
to=mobile_no,
url='http://localhost:8000/outbound/',
method='POST')
def outbound(self):
response = twiml.Response()
response.say("Thank you for contacting our department",
voice='alice')
return HttpResponse(response, content_type="application/xml")
In urls.py, I have /outbound/ that points to my django view module.
If I hit '/outbound/' in browser it renders the correct xml response but in the voice call, it gives an error message saying 'Sorry application error'
Not sure where i am going wrong in rendering the xml. Thanks in advance.