5.12. Call Data Records (CDRs)

The ABC SBC generates Call Data Records (CDRs) for every call processed by the SBC.

5.12.1. CDRs Location

CDRs are generated into the directory:

/var/log/frafos/cdr/

They are generated on Source Realm basis, so every CDR is filtered to a specific file with the name „cdr-source_realm_name.log“. All CDRs also go into one combined file called „cdr.log“.

CDR output files are rotated once a day at midnight and exported to the archive directory: :

/var/log/frafos/cdr/export

The exported files are renamed to include the date – e.g. ” cdr.log-20120701“. The files are stored for 93 days by default and then are deleted from the disk.

The number of daily rotated files to keep and also the directory for exported files can be changed using Config / Global config, using settings under “CDRs” tab. The lowest possible number of days to keep the exported CDR files is one day.

5.12.2. CDR Format

CDRs are stored in CSV format and contain following items in given order:

  • Source Realm
  • Source Call Agent
  • Destination Realm
  • Destination Call Agent
  • From user part
  • From host part
  • From display name
  • To user part
  • To host part
  • To display name
  • Local tag (ID for call)
  • Timestamp when the call was initiated (format - 2012-05-04 02:22:01)
  • Timestamp when the call was connected (format as above)
  • End Timestamp of the call (format as above)
  • Duration from start to end (sec.ms)
  • Duration from start to connect/end (for established/failed call; sec.ms)
  • Duration from connect to end (for established call; sec.ms)
  • SIP R-URI
  • SIP From URI
  • SIP To URI

CDR example:

pstnprovider.com,gw1,mobile.com,uas,"alice","example.com","","bob","192.168.1.4","", "6D47CCAA-4FF10747000824C5-80299700","2012-07-02 04:28:23","2012-07-02 04:28:28", "2012-07-02 04:28:33","10.139","4.895","5.244","bob@192.168.1.4:6000","alice@example.com", "bob@192.168.1.4"

5.12.3. Access to CDRs

CDRs can be accessed remotely using SFTP protocol. There is a default user configured with privileges to the particular location.

username: cdr
password: cdrfrafos

Using SFTP you can log in from your local machine to the FRAFOS ABC SBC and download the CDR output files:

% sftp cdr@<SBC IP address> % sftp> get -r *

To get only exported files (i.e. files that are not updated any more and are ready for post-processing):

% sftp> get export/*

5.12.4. Customised CDR Records

The content of CDR records can be changed using configuration file :

/etc/sems/cc_syslog_cdr.conf

Only the value of „cdr_format“ option (the CDR structure) can be changed. Changing any other options may cause CDR subsystem malfunction and should be done by authorised person only.

After changing the CDR configuration file, the SEMS process of the ABC SBC needs to be restarted manually:

% pcs resource disable sems % pcs resource enable sems

Following items can be used in cdr_format option:

  • $srcrlm.name - Source Realm
  • $srcca.name - Source Call Agent
  • $dstrlm.name - Destination Realm
  • $dstca.name - Destination Call Agent
  • caller_id_user - From user part
  • caller_id_host - From host part
  • caller_id_name - From display name
  • callee_id_user - To user part
  • callee_id_host - To host part
  • callee_id_name - To display name
  • $ltag - Local tag (internal call identifier)
  • $start_tm - Timestamp when the call was initiated (format - 2012-05-04 02:22:01)
  • $connect_tm - Timestamp when the call was connected
  • $end_tm - End Timestamp of the call
  • $duration - Duration from start to end (sec.ms)
  • $setup_duration - Duration from start to connect/end (for established/failed call; sec.ms)
  • $bill_duration - Duration from connect to end (for established call; sec.ms)
  • sip_req_uri - SIP R-URI
  • sip_from_uri - SIP From URI
  • sip_to_uri - SIP To URI
  • disposition - Result of call establishment. Possible values: answered, failed, canceled.
  • invite_code - Result code of final reply to initial INVITE (not set for canceled calls).
  • invite_reason - Reason phrase of final reply to initial INVITE (not set for canceled calls).
  • hangup_cause - Reason for the call termination, set for established calls only. Possible values: BYE, reply, no ACK, RTP timeout, session timeout, error, other.
  • hangup_initiator - Reason for the call termination.  It is set for answered calls only where hangup was caused by request (BYE) or in case of call was terminated because of local error. Possible values: caller, callee, local - Example: $gui.<call variable name> - Allows to write user specified call variable into CDR. For example $gui.experimental_variable will write the value of experimental_variable into CDR. The call variable can be set using “Set Call Variable” action, see Binding Rules together with Call Variables for more details on using call variables.

Important: CDRs are written using syslog and split into per-realm files according to first item that is expected to be the source Realm. If you change the CDR format the way the first item is not a “realm” name, the files will be named according to the values in this column and won’t represent per-realm data any more.