I have the following installed before using this script:
1) Centos 7
2) MySQL 5.7
3) Python 3.4
4) Watchdog module installed using pip (for watching changes in the file system)
5) Shutil module installed using pip (to od file operations, copy, move, rename, etc..)
6) MySQL Connector Module installed using pip (to connect to and work with MySQL)
7) Chrooted SFTP in CentOS.
I have already created a Database (say Cisco) in MySQL which contains a table (initially) to load all entries in the CDR file. I will use another table(s) as required to update the information.
Important: I have created the systemctl scrip to start the script as a service.
Due to time limitations, I have just given you the major things. If you need the detailed step, please reply.