diff --git a/data/conf/cgrates.cfg b/data/conf/cgrates.cfg index af1e17c3a..d457dbe43 100644 --- a/data/conf/cgrates.cfg +++ b/data/conf/cgrates.cfg @@ -60,7 +60,7 @@ # cdr_type = csv # CDR file format . # cdr_in_dir = /var/log/cgrates/cdr/in/csv # Absolute path towards the directory where the CDRs are stored. # cdr_out_dir = /var/log/cgrates/cdr/out/csv # Absolute path towards the directory where processed CDRs will be moved. -# cdr_source_id = freeswitch_csv # Tag identifying the source of the CDRs within CGRS database. +# cdr_source_id = freeswitch_csv # Free form field, tag identifying the source of the CDRs within CGRS database. # accid_field = 0 # Accounting id field identifier. Use index number in case of .csv cdrs. # reqtype_field = 1 # Request type field identifier. Use index number in case of .csv cdrs. # direction_field = 2 # Direction field identifier. Use index numbers in case of .csv cdrs. @@ -71,7 +71,7 @@ # destination_field = 7 # Destination field identifier. Use index numbers in case of .csv cdrs. # answer_time_field = 8 # Answer time field identifier. Use index numbers in case of .csv cdrs. # duration_field = 9 # Duration field identifier. Use index numbers in case of .csv cdrs. -# extra_fields = 10:supplier,11:orig_ip # Field identifiers of the fields to add in extra fields section, special format in case of .csv "index1:field1,index2:field2" +# extra_fields = 10:supplier,11:orig_ip # Extra fields identifiers. For .csv, format: :[,:] [mediator] # enabled = false # Starts Mediator service: . diff --git a/docs/advanced.rst b/docs/advanced.rst index 9e1ee0371..d558bbfc7 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -6,6 +6,7 @@ apicalls cdrserver + cdrclient cdrexporter ratinglogic diff --git a/docs/cdrclient.rst b/docs/cdrclient.rst new file mode 100644 index 000000000..552e451b3 --- /dev/null +++ b/docs/cdrclient.rst @@ -0,0 +1,35 @@ +CDR Client (cdrc) +================= + +It's role is to gather offline CDRs and post them to CDR Server(CDRS) component. + +Controlled within *cdrc* section of the configuration file. + +Part of the *cgr-engine*, can be started on a remote server as standalone component. + +Has two modes of operation: +- Automated: CDR file processing is triggered on file creation/move. +- Manual: CDR file processing will be triggered at configured time interval (delay/sleep between processes). + +Principles behind functionality: +- Monitor/process a CDR folder (IN) as outlined above. +- Read every file in the folder, extract the information based on configuration and post it via configured mechanism to CDRS. +- The fields extracted out of each CDR row are the same ones depicted in the CDRS documentation (following primary and extra fields concept). +- Once the file processing completes, move it in it's original format in another folder (OUT) in order to avoid re-processing. Here it worths mentioning the auto-detection of duplicated CDRs at server side based on accid and host fields. + +For the moment we support processing CDRs in the following formats: + +CDR .CSV +-------- + +Most widely used format by Telecom Switches. + +Light to read and generic to process. +CDRC should be able to process in this way any .csv CDR, independent of the Telecom Switch generating them. Incompatibilities here can come out of answer time and duration formats which can vary between CDR writer implementations. +As answer time we support a number of formats already - rfc3339, SQL/MySQL, unix timestamp. As duration we support nanoseconds granularity in our code, however if time unit is not specified (eg: ms, s, m, h), we assume CDR duration will be in seconds. + +CDR fields are extracted based on configured indexes in a file row (0 represents first field). + +A particular configuration format it is represented by extra fields which need not only to be extracted by row index but also to be named since .csv format does not save field names/labels. CDRC uses the following convention for extra fields in the configuration: *:[,:]...*. + +