Reputation: 1034
I have got a Python Django app and I would like to make calls from my Django app by using Twilio. E.g. call a friend and have a conversation with him. I have registered with a Twilio account, however when I am calling a number I can only setup a code to be executed and no "normal call".
However, I do not understand completely the setup and I did some research.
import os
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)
call = client.calls.create(
url='http://demo.twilio.com/docs/voice.xml',
to='+14155551212',
from_='+15017122661'
)
print(call.sid)
Could someone please point me in the right direction?
Cheers, Andi
Upvotes: 0
Views: 113
Reputation: 10771
You can reference the document, Setting Up Call Forwarding, which shows you many different way to accomplish that task.
Upvotes: 1