Calling members of the US Congress is the best way for a constituent's voice to be heard. But it's often a nuisance of overloaded switchboards and endless busy signals. This application aims to reduce that hassle by automatically redialing until the call is connected.
You'll need a Twilio account and inbound number, and a server to respond to HTTP requests from Twilio.
The application needs access to a Redis instance and depends on the Python packages listed in requirements.txt (pip install -r requirements.txt
).
Copy config.example.py to config.py
and set all necessary values.
Generate the ZIP code data cache by running python geo_data.py > zip_codes.json
.
To run the application for development:
$ python redialer.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
or:
$ export FLASK_APP=redialer.py
$ flask run
* Serving Flask app "redialer"
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
When developing locally behind NAT, ngrok makes things a lot easier.
Use something like Gunicorn for production deployment.
When setting up your inbound Twilio number or TwiML app, use the following settings:
- Request URL:
http://example.com/
(e.g. the/
route of the application) - Status Callback URL:
http://example.com/inbound/ping
(the/inbound/ping
route of the application)