Posts

Showing posts with the label twilio

Python Twilio making a call with Client

Python Twilio making a call with Client I am trying to make a call using twilio and python with the code below: account_sid = "***" auth_token = "***" client = Client(account_sid, auth_token) call = client.calls.create(to=phone_number, from_="+***", record=True, url="https://handler.twilio.com/twiml/***") print call.sid Here is my xml on that url: <Response> <Say>Hi, Thanks for accepting our call!</Say> </Response> The call connects, but after the xml triggers, the call ends. Can someone point me out what I am doing wrong? I can successfully make a call by doing the approach below, but I need the callsid right after dial for storing the callsid in the database to retrieve the recording later: resp = VoiceResponse() dial = Dial(caller_id='+1***', record="record-from-ringing") dial.number(phone_number, url="https://handler.twilio.com/twiml/***") resp.append(dial) return HttpResponse(resp, mimetype...