Skip to content

Instantly share code, notes, and snippets.

@priyankvex
Created June 3, 2018 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priyankvex/91831d714b4d8bb6e9c06344462aeaf2 to your computer and use it in GitHub Desktop.
Save priyankvex/91831d714b4d8bb6e9c06344462aeaf2 to your computer and use it in GitHub Desktop.
class TwiMLDialSecondLegView(APIView):
"""
Read more here: https://www.twilio.com/docs/voice/twiml
"""
def post(self, request, *args, **kwargs):
response = VoiceResponse()
action_url = urlparse.urljoin(settings.SITE_URL, reverse('first_leg_disconnected_url'))
dial = Dial(action=action_url, caller_id=request.GET.get("caller_id", TwilioClient.get_caller_id()))
customer_number = request.GET["customer_number"]
dial.number(contact_number)
response.append(dial)
return HttpResponse(response, content_type="application/xml")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment