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.5.tar.gz (11.7 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.5-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dialer-0.2.5.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.5.0

File hashes

Hashes for dialer-0.2.5.tar.gz
Algorithm Hash digest
SHA256 791c5b15d8dbfe4ed5805a1cec9a188179befd290c256697b921e6bcda34a803
MD5 1398fd0ffbe9f16c4f4bb4a9831c916a
BLAKE2b-256 734d3918ed3e1a067e98c0a40b1c46d769bd41446657168d9a0b9e11f4a8fcd3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dialer-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.5.0

File hashes

Hashes for dialer-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 745e215794ae23a1887f4b776a204bca1ea46016b7eddb8adbbfb4d9021f5061
MD5 422130d5c5ca6cae7c53780a4a0b90b3
BLAKE2b-256 092e0530b9f056807900c9007fc836add7dc74e0d8503b0b9f486ef1a34c140b

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