Skip to content

Instantly share code, notes, and snippets.

@Brodan
Last active November 11, 2016 22:59
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 Brodan/1c42684a7fab4216c51d to your computer and use it in GitHub Desktop.
Save Brodan/1c42684a7fab4216c51d to your computer and use it in GitHub Desktop.
Python script to hangup all in-progress Twilio calls.
from twilio.rest import TwilioRestClient
from twilio.rest.resources import Call
ACCOUNT_SID = "YOUR_ACCOUNT_SID"
AUTH_TOKEN = "YOUR_AUTH_TOKEN"
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
calls = client.calls.list(status=Call.IN_PROGRESS) # May need to use Call.QUEUED or Call.RINGING
for c in calls:
c.hangup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment