/ivr-recording-django

Example App and Tutorial content for IVR Call Recording and Agent Call screening

Primary LanguagePythonMIT LicenseMIT

Twilio

IVR Call Recording and Agent Conference.

IVRs (interactive voice response) are automated phone systems that can facilitate communication between callers and businesses. In this tutorial you will learn how to screen and send callers to voicemail if an agent is busy.

Read the full tutorial here!

Build and test

Local Development

  1. Clone this repository and cd into its directory:

    git clone git@github.com:TwilioDevEd/ivr-recording-django.git
    cd ivr-recording-django
  2. The file ivr/fixtures/agents.json contains the agents phone numbers. Replace any of these phone numbers with yours.

    When the application asks you to select an agent, choose the one you just modified and it will then call your phone.

  3. Create a local virtual environment and activate it:

    python -m venv venv && source venv/bin/activate
  4. Install dependencies:

    pip install -r requirements.txt
  5. Set environment variables:

    cp .env.example .env

    Then add a value to SECRET_KEY.

    Note: DEBUG variable is False by default. Feel free to update it to True if needed.

  6. Set up database and run migrations:

    python manage.py migrate
  7. Load initial agents' data:

    python manage.py loaddata ivr/fixtures/agents.json
  8. Make sure the tests succeed:

    python manage.py test
  9. Run the application:

    python manage.py runserver
  10. Check it out at http://localhost:8000/ivr. You can go to the agents page to see and listen the saved recordings.

  11. Expose the application to the wider Internet using ngrok To let our Twilio Phone number use the callback endpoint we exposed, our development server will need to be publicly accessible. We recommend using ngrok to solve this problem.

    ngrok http 8000
  12. Provision a number under the Manage Numbers page on your account. Set the voice URL for the number to http://<your-ngrok-subdomain>.ngrok.io/ivr/welcome.

That's it!

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.