Call Detail Record Service

Introduction

The Call Detail Record (CDR) Service is an internal component of all Evolve ® applications that manages and organizes CDRs in an application database. This service, called xpressworkx_cdr_services, is run on each Application Server (AS), can be restarted using normal OS service management, and is partially managed by a series of cron jobs.

Call Detail Records

CDRs compile data of exchanges and include every received and generated event that is processed by an application. For more information on accessing CDRs from the web UI or API, see the application specific User’s Guide.

The CDRs generated by each application are stored in application-specific SQLite databases on each AS with the following format:

/var/opt/xpressworkx/cdr/<appshortname>.cdr.db

CDRs are collected on each AS individually and then pulled into the main database to view in the web interface or access in the JSON API. This process occurs by default every night at midnight and is done by two separate cron jobs.

CDR Partition

This cron job (xpressworkx-cdr-partition <appshortname>) is run for each application on each AS individually and prepares the CDRs collected on the AS for transfer to the NIU.

This process moves the currently active SQLite database to a timestamped file with the following format:

/var/opt/xpressworkx/cdr/<appshortname>.cdr-<timestamp>.db

Important

Each time this cron job runs, a new timestamped database file is made. This should be monitored for disk space consumption.

By default, the partitioning process runs every day at midnight server time. However, the frequency can be changed to meet your specific requirements. Make sure that the partitioning process on each AS runs at least as frequently as the synchronize process on each NIU.

CDR Synchronize

This cron job (xpressworkx-cdr-synchronize <appshortname>) is run for each application on the primary NIU and pulls the partitioned CDRs from each AS into the main database.

This job runs an rsync of every timestamped file, copying these files from each AS and moving them to a backup directory on the AS. This only occurs when xpressworkx-cdr-partition has been run.

On the NIU, xpressworkx-cdr-synchronize writes records from the SQLite databases to the main Postgres database. Once the records are written, the SQLite database on the NIU is deleted.

Important

CDR access through the web UI and API is not available until after this has occurred.

Important

This job must be monitored for errors and expected volume of data.

By default, the synchronization process runs every day at midnight server time. However, the frequency can be changed to meet your specific requirements.

CDR Cleanup

The cleanup process xpressworkx-cdr-cleanup <appshortname> runs on each AS and deletes all timestamped files in the database that are older than the specified retention period.

By default, the cleanup process runs every day at midnight server time and deletes all files in the backup directory that are older than 7 days. However, both the frequency and retention period can be changed to meet your specific requirements.

This retention period can be found and modified in the /var/opt/xpressworkx/cdr/cdr-service-config.yml file.

Tip

The retention period must be set to at least once a day.


The cleanup process does not remove CDR database partitions that have not yet been synchronized. Only files found in the /var/opt/xpressworkx/cdr/backup directory can be removed, and a delay in or cancellation of synchronization from the NIU will not result in lost records.

The frequency of this job can be changed to meet your specific requirements and prevent unwanted consumption of disk space.

CDR Database Cleanup

The database cleanup process xpressworkx-cdr-cleanup-database <appshortname> runs on the NIU and deletes all files in the main Postgres database that are older than the specified retention date.

This retention period can be found and modified in the /var/opt/xpressworkx/app-manager/cdr/<app>/cdr-synchronization-config.yml file.

CDR Materialized View

For the applications that install this cron job, the application event records into a single record view within the web UI. This materialized view condenses the events into a human-readable format with the option of expanding the view to show all the details of the events.

This process creates a lock file in /var/run/, before checking if the NIU running this cron job is the active or standby NIU. If the NIU is the standby, the process will exit, and the lock file is removed.

On the active NIU, the process <appshortname>-refresh-cdrs is run, which will create the materialized view and update the CDRs displayed in the application’s web UI. Once the job is complete, the lock file is removed.

By default, this job is run every hour. However, the frequency can be changed to meet your specific requirements.