Its a python script that collects caller ID, call time, call source and destination, disposition and duration from CDR database of all outbound and inbound calls from and to PSTN network. After arranging the data it sends a report of the calls and sends a tabulated email to a user defined email address.
The script uses
MySQLdb to extract data from the CDR database and uses
HTML.py to tabualte the data in an HTML table.
smtplib is used to send email.
Apart from standard python installation, the script requires
HTML.py which is already included and
MySQLdb library. You can install
MySQLdb as follows:
apt-get install python-mysqldb
yum install MySQL-python
cd /usr/ports/databases/py-MySQLdb make install clean
This script is intended to be used as a cron that runs at 23:59 everyday.
At the moment the script is hard-coded to do things such as:
- Connecting to database.
- Counting length of numbers to distinguish PSTN from SIP extensions.
ifconditions under for loop under
- Sending authenticated email (
Saad Ali - Linux/BSD Admin
Philippe Lagadec - Author of HTML.py
- The script
AsteriskCDReporter.pyis licensed under MIT License.
HTML.pyis licensed under CeCILL license.