Skip to main content

Automate customer trainings over the phone with no human intervention.

Project description

Auto-Training Dialer

Automate customer trainings over the phone with no human intervention.

Authors

Overview

This system automates calls to customers throughout a campaign, scheduling diferent trainings per week depending on which level customer is on. Human intervention is only needed on initial upload of numbers.

It involves using peewee to manage all database interactions, sockets for connection to Asterisk via AMI port to initiate calls, and reading a log file written by Asterisk to reschedule customer for another training or same training depending on whether they listened to previous training for at least a specified number of seconds.

Features

  • Upload customer campaign details to database
  • Auto call customers
  • Redirect customer call to a custom asterisk dialplan to play training audio
  • Move customer through the training modules depending on whether they successfully listened to previous module

Installation

Requirements:

  python 3.6+

Install package:

pip install dialer

Post installation script:

Run post install setup script from a directory from which you will be running all usage commands, from now on, we shall refer to this folder as root_folder.

dialer_setup dialer_name
  • Change dialer_name to the name for the autodialer. This same name should be used on all usage commands.
  • This will create a settings.py file and database/database.ini and logs/asterisk_dialer_name in this root_folder
  • It will also add cronjobs to run calling feature at top of every hour from 7am to 9pm. Runs script to update DB using asterisk_dialer_name.log at 10pm. You may edit it in your crontab
  • The calling script doesn't call customers who have taken 4 or more consecutive weeks without picking our calls
  • You can run command again in same root_folder with different dialer_name to setup another autodialer.

Asterisk AMI & Database:

  • Add your database and AMI credentials to root_folder/database/database.ini file

Settings:

Go to root_folder/settings.py to make changes to settings like:

  • Time frame script is allowed to call customers
  • When campaign is supposed to start, this determines when customer calls are to be scheduled
  • You dialplan context & target where customer calls are supposed to be sent on pickup, which should contain the logic for playing recordings etc

Usage/Examples

Have your frontend application upload .csv file with columns in this order; phone_number, customer_language, campaign_type.

  • Training_level of 0 is auto assigned on initial upload
  • First row is ignored, assumed to be for column names even though they're optional

Have your application execute this command with full path to uploaded file and dialer_name used at setup.

  • The uploaded file is meant to be deleted by this script after reading it, make sure parent folder has (wx) permissions. Command:
cd root_folder && upload_to_dialer dialer_name full_path_csv_file.csv
  • This script will read numbers from csv and upload to database.

Asterisk Setup

  • Variables; clid (phone_number), dialer (name of autodialer), language (customer language), level (level of training whose recordings you should play, 0 is for recording about when customer wants to be called), type (type of campaign incase one dialer is used for multiple campaigns) shall be sent on the AMI Orignate request, use them in your asterisk custom dialplan

  • Set your asterisk custom dialplan to write to root_folder/logs/asterisk_dialer_name.log on call hangup, in this format;

    phone_number, duration_of_call (in seconds), day_they_prefer_to_be_called (i.e 1 for Monday, 2 for Tue etc), time_they_prefer_to_be_called (i.e 8 for 8am, 14 for 2pm)

    Example: 259790551930, 40, 3, 13

  • The last two should only be written at the beginning when customers are choose when to be called.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dialer-0.2.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dialer-0.2.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file dialer-0.2.1.tar.gz.

File metadata

  • Download URL: dialer-0.2.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.6.0

File hashes

Hashes for dialer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8edbefe139e9ba22acbbec92c587636694b3edde8e90ea41b267f90fe4bb3829
MD5 57538d3b7dcd4490457b5e8d54d4661c
BLAKE2b-256 ceb955c549097c7d2d02b1c104c96c5ee133df8f9b549e41e0f7eb16203f3737

See more details on using hashes here.

File details

Details for the file dialer-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dialer-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.6.0

File hashes

Hashes for dialer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4abf2eb402ae515133caf1e2fc21469ea61a726a7f241f4c024fa68d086ba6a
MD5 93761239551daa9429d39338e00b17ba
BLAKE2b-256 46beec736d14819f1a283b9afc5469bebc1f9a1c6da3af122da73344fd4a5db2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page