This is an enhanced version of the PyCascades Code of Conduct Hotline.
This hotline uses Nexmo Voice API + Zapier integration.
When a caller calls the hotline, it will dial each of the PyCascades Code of Conduct committee members, and the caller will be connected to the first person who answered.
Calls to the hotline can be (optionally) automatically recorded. By default, calls are not recorded.
To autorecord, set both the AUTO_RECORD
and ZAPIER_CATCH_HOOK_RECORDING_URL
environment variables.
For additional details of how to set up the hotline, please read my Nexmo Developer Spotlight tutorial, posted November 15, 2018.
Python 3.6.5+ because of f-strings. In reality, Python 3.7 is used (as specified in runtime.txt).
- aiohttp
- nexmo
- click
In Heroku, set the environment variables:
NEXMO_API_KEY
: The Nexmo API KeyNEXMO_API_SECRET
: The Nexmo API Key SecretNEXMO_APP_ID
: The Nexmo App IDNEXMO_PRIVATE_KEY_VOICE_APP
: The path to the Nexmo App's private key (private.key file).It looks like the following:
----- BEGIN PRIVATE KEY ---- blablahblah ---- END PRIVATE KEY ----
PHONE_NUMBERS
: A list of staff name and phone number dictionaries.Example:
[{"name": "Mariatta", "phone": "16040000000"}, {"name": "Miss Islington", "phone": "1778111111"}]
AUTO_RECORD
: set toTrue
if you want to autorecord incoming calls. This is optional, and will default toFalse
if not set.ZAPIER_CATCH_HOOK_RECORDING_URL
: The Webhooks By Zapier url. This is only needed ifAUTO_RECORD
isTrue
.HOTLINE_DESC
: the description of this Hotline. For example:PyCascades Code of Conduct Hotline
orPyCascades Head Office
.
Requires click 7.0+
Set the environment variables:
NEXMO_APP_ID
: The Nexmo App IDNEXMO_PRIVATE_KEY_VOICE_APP
: The content of the private key (from private.key file). It looks like the following:`----- BEGIN PRIVATE KEY ---- blablahblah ---- END PRIVATE KEY ----`
In the enhanced-coc-hotline directory, run:
$ python3 -m download_recording url1 url2 url3 ...
GNU General Public License v3.0.