Package: callattendant
Call Attendantpip install callattendantThe Call Attendant (callattendant) is an auto attendant with an integrated call blocker and
voice messaging system running on a Raspberry Pi. It stops annoying robocalls and spammers from
interrupting your life. Let the Call Attendant intercept and block robocallers and telemarketers
before the first ring on your landline.Thecallattendantprovides international support with configurable phone number formats, with
flexible and editable blocked-number and permitted-number lists.If you're at all interested in this project, please provide some feedback by giving it astar, or even better, get involved
by filingissues, joining theforumand/or submittingpull requests.
Thanks!Support LinksWeb PageWikiForumTable of ContentsOverviewQuick StartOverviewThe Call Attendant (callattendant) is a python-based, automated call attendant that runs on a
lightweight Raspberry Pi, or other Linux-based system, coupled with a US Robotics 5637 USB modem.How it worksThe Raspberry Pi and modem are connected to your home phone system in parallel with your phone
handset(s). When an incoming call is received, the call goes to both your phone and thecallattendant. During the period of the first ring thecallattendantanalyzes the caller ID,
and based on your configuration, determines if the call should be blocked or allowed. Blocked calls
can be simply hung up on, or routed to the voice message system. Calls that are allowed will simply
ring your home phone like normal. Calls can be sent to the integrated voice mail system if you choose.
Thecallattendant's filtering mechanisms include an online lookup service, a permitted number list,
a blocked number list and pattern matching on the caller's number and/or name.Features include:A call blocker that intercepts robocallers and blocked numbers at or before the first ringPermitted numbers pass straight through to the local phone system for normal call ringing and answeringVisual indicators to show whether the incoming call is from a permitted, blocked, or unknown numberCall details, permitted numbers, and blocked numbers are available in a web-based user interfaceCalls can be handled by a voice messaging system that optioanlly requires human interaction,
e.g, "Press 1 to leave a message"You can review call history, voice messages, permitted and blocked numbers, and performing caller
management through the Call Attendant's web interface. Here is an example of the home page with metrics
and a convienient list of recent calls. For a complete description see theUser Guide.Screenshots of the home page as seen on an IPad Pro and a Pixel 2 phoneDocumentationThe project wiki on GitHub contains the documentation for the Call Attendant:See theWiki Homefor complete
installation, configuration, and operation instructions.See theUser Guidesection for the
web interface instructions.TheDeveloper Guidesection
describes the software architecture and software development plan, and shows you how to setup
your software development environment.TheAdvancedsection addresses more
complex setups and situations. For instance,Running as a Service.Hardware RequirementsThecallattendantuses the following hardware:Raspberry Pi 3B+or betterUS Robotics 5637 Modemor theZoom 3095 Modem. Other Conexant-based
modems may work.Photo of the required hardware: a Raspberry Pi 3B+ and USR5637 modemQuick StartHardwareYou will need a Raspberry Pi running Raspbian or better with access to the Internet for the software
installation, and ultimately for the the online robocaller lookups. For the project, you will need a
modem of some sort to do the telephony communications. TheU.S. Robotics USR5637 56K USB Modemhas
been proven effective. For some installs, it just works, no config needed. It showed up as /dev/ttyACM0.SoftwareThe installation calls for Python3.X.Setup a Virtual EnvironmentOptionalThe following instructions create and activate a virtual environment namedvenvwithin the
current folder:# Install virtualenv - if not installedsudoaptinstallvirtualenv# Create the virtual environmentvirtualenvvenv--python=python3# Activate itsourcevenv/bin/activateNow you're operating with a virtual Python. To check, issue thewhichcommand and ensure the
output points to your virtual environment; and also check the Python version:$whichpython
/home/pi/venv/bin/python

$python--version
Python3.7.3Later, when you install thecallattendantsoftware, it will be placed within the virtual environment
folder (underlib/python3.x/site-packagesto be exact). The virtual environment, when activated, alters
yourPATHso that the system looks for python and its packages within this folder hierarchy.Install the SoftwareThe software is available onPyPI. Install and update usingpip:# Using the virtual environment you use "pip" to install the softwarepipinstallcallattendant# You must use "pip3" on the Pi if your not using a virtual environmentpip3installcallattendantIf your not using the virtual environment, you may need to reboot or logoff/login to update the$PATHfor your profile in order to find and use thecallattendantcommand.OperationThecallattendantpackage includes acallattendantcommand to start the system. Run this command
the first time with the--create-folderoption to create the initial data and files in the default
data folder:~/.callattendant. This is a hidden folder off the root of your home directory. You
can override this location with the--data-pathoption.Usage: callattendant --config [FILE] --data-path [FOLDER]
Options:
-c, --config [FILE]       load a python configuration file
-d, --data-path [FOLDER]  path to data and configuration files
-f, --create-folder       create the data-path folder if it does not exist
-h, --help                displays this help text# Creating the default data folder with the default configurationcallattendant--create-folder# Using the default configurationcallattendant# Using a customized config file in an alternate, existing locationcallattendant--configmyapp.cfg--data-path/var/lib/callattendantYou should see output of the form:Command line options:
  --config=app.cfg
  --data-path=None
  --create-folder=False
[Configuration]
  BLOCKED_ACTIONS = ('greeting', 'voice_mail')
  BLOCKED_GREETING_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/blocked_greeting.wav
  BLOCKED_RINGS_BEFORE_ANSWER = 0
  BLOCK_ENABLED = True
  BLOCK_NAME_PATTERNS = {'V[0-9]{15}': 'Telemarketer Caller ID'}
  BLOCK_NUMBER_PATTERNS = {}
  BLOCK_SERVICE = NOMOROBO
  CONFIG_FILE = app.cfg
  DATABASE = callattendant.db
  DATA_PATH = /home/pi/.callattendant
  DB_FILE = /home/pi/.callattendant/callattendant.db
  DEBUG = False
  ENV = production
  PERMITTED_ACTIONS = ('greeting', 'record_message')
  PERMITTED_GREETING_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/general_greeting.wav
  PERMITTED_RINGS_BEFORE_ANSWER = 6
  PERMIT_NAME_PATTERNS = {}
  PERMIT_NUMBER_PATTERNS = {}
  PHONE_DISPLAY_FORMAT = ###-###-####
  PHONE_DISPLAY_SEPARATOR = -
  ROOT_PATH = /home/pi/.local/lib/python3.7/site-packages/callattendant
  SCREENED_ACTIONS = ('greeting', 'record_message')
  SCREENED_GREETING_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/general_greeting.wav
  SCREENED_RINGS_BEFORE_ANSWER = 0
  SCREENING_MODE = ('whitelist', 'blacklist')
  TESTING = False
  VERSION = 1.1.0
  VOICE_MAIL_GOODBYE_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/goodbye.wav
  VOICE_MAIL_GREETING_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/general_greeting.wav
  VOICE_MAIL_INVALID_RESPONSE_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/invalid_response.wav
  VOICE_MAIL_LEAVE_MESSAGE_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/please_leave_message.wav
  VOICE_MAIL_MENU_FILE = /home/pi/.local/lib/python3.7/site-packages/callattendant/resources/voice_mail_menu.wav
  VOICE_MAIL_MESSAGE_FOLDER = /home/pi/.callattendant/messages
Initializing Modem
Opening serial port
Looking for modem on /dev/ttyACM0
******* Conextant-based modem detected **********
Serial port opened on /dev/ttyACM0
Modem initialized
{MSG LED OFF}
Starting the Flask webapp
Running the Flask server
Waiting for call...
 * Serving Flask app "userinterface.webapp" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: offMake a few calls to yourself to test the service. The standard output will show the
progress of the calls. Then navigate tohttp://<pi-address>|<pi-hostname>:5000in a
web browser to checkout the web interface.Pressctrl-cto shutdown the systemWeb InterfaceURL:http://<pi-address>|<pi-hostname>:5000To view the web interface, simply point your web browser to port5000on your Raspberry Pi.
For example, in your Raspberry Pi's browser, you can use:http://localhost:5000/See theUser Guidefor more information.ConfigurationThe Call Attendant's behavior can be controlled by a configuration file. To override the default
configuration, open the  the~/.callattenant/app.cfgand edit its contents.nano~/.callattendant/app.cfgThen specify the configuration file and path on the command line, e.g.:callattendant --config app.cfgSee theConfigurationsection in the project's wiki for more information.