Skip to content

A simple Node.js script to take CDR files generated by a PBX (3CX is the target) and

License

Notifications You must be signed in to change notification settings

jmwebslave/CDR2MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CDR2MySQL

A simple Node.js script to take CDR files generated by a PBX (3CX is the target) and pump them into MySQL.

This script will watch a folder on your file system, and upon a file appearing will attempt to parse it as a CSV/CDR file. Upon successful completion of the parse and SQL insert it will then delete the CDR file.

Configuration

Open the config.js file and fill in the parameters with ones that match your own environment. Note that file system paths in Windows need to be appropriately escaped (\ becomes \).

In the fields area you need to ensure that you have added one line per field you export in your CDR. You don't have to store them all in MySQL, but you do need to make provision them them to exist in the config.

Startup

npm run main.js

TODO:

Have the system run a query beforehand to check if the CDR record to be inserted already exists. In the meantime you may as well just make a MySQL constraint to stop this from happening.

Contributing

This is my first Node.js application, and to be honest I don't really know what I'm doing. Tips, advice, bug reports, etc are all very welcome.

About

A simple Node.js script to take CDR files generated by a PBX (3CX is the target) and

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published