CDRcombine Module

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
Line 33: Line 33:
  
 
===How to use===
 
===How to use===
 +
====Writing call logs to a file====
 
* Make sure the cdrcombine, [[CDR Build Module|cdrbuild]], and [[CDR File Module|cdrfile]] modules are loaded.
 
* Make sure the cdrcombine, [[CDR Build Module|cdrbuild]], and [[CDR File Module|cdrfile]] modules are loaded.
  
Line 52: Line 53:
 
  1370509560.562, "1370508584-5", "sip/8", "192.168.168.226:58434", "124", "123", 9.520, 4.998, 14.589, "answered", "", "sip/9", "192.168.168.11:5061", 9.518,4.998,14.582, ""
 
  1370509560.562, "1370508584-5", "sip/8", "192.168.168.226:58434", "124", "123", 9.520, 4.998, 14.589, "answered", "", "sip/9", "192.168.168.11:5061", 9.518,4.998,14.582, ""
 
  1370509605.743, "1370508584-6", "sip/10", "192.168.168.11:5061", "123", "124", 96.289, 6.796, 103.190, "answered", "", "sip/12", "192.168.168.11:5061", 6.988, 3.224, 10.281, ""
 
  1370509605.743, "1370508584-6", "sip/10", "192.168.168.11:5061", "123", "124", 96.289, 6.796, 103.190, "answered", "", "sip/12", "192.168.168.11:5061", 6.988, 3.224, 10.281, ""
 +
 +
====Writing call logs to the database====
 +
* Make sure the cdrcombine, [[CDR Build Module|cdrbuild]], and [[register]] modules are loaded.
 +
* In register.conf '''[call.cdr]''' section uncomment '''cdr_combined''' or set your own query:
 +
 +
cdr_combined=INSERT INTO cdr VALUES(TIMESTAMP 'EPOCH' + INTERVAL '${time} s','${chan}',\
 +
  '${address}','${caller}','${called}',INTERVAL '${duration} s',INTERVAL '${billtime} s',\
 +
  INTERVAL '${ringtime} s','${status}','${reason}','${out_leg.chan}','${out_leg.address}',\
 +
  INTERVAL '${out_leg.billtime} s',INTERVAL '${out_leg.ringtime} s',\
 +
  INTERVAL '${out_leg.duration} s','${out_leg.reason}'
  
 
'''See also''':
 
'''See also''':
 
* [[CDR File Module]]
 
* [[CDR File Module]]

Revision as of 15:37, 18 September 2013

The cdrcombine module enables the writing of a single CDR entry per call instead of multiple entries, one for each call leg (one for the incoming leg and one or more for outgoing leg(s)).
This module was added in SVN revision 5394.

By default yate writes a CDR entry for each leg of a call. You usually have two call legs: one between the caller party and yate server and the other one between yate server and the called party. Cdrcombine module unifies the information about the call and the 2 call legs and writes a single entry in the CDR log file/database.

Using this module makes it easier to follow the call logs, but it's only recommended for simple setups.

Contents

Operation on CDR

This modules catches the call.cdr messages for operations "initialize", "update" and "finalize" and emits call.cdr message with operation "combine" at the end of the call.

Format for information

Unified information for call

Fields identifying a call:

  • time
  • billid
  • caller
  • called
  • status

Call leg specific information

The following fields are call leg specific:

  • chan
  • address
  • billtime
  • ringtime
  • duration
  • reason

Configuration

There is no configuration file for cdrcombine module. In order to use set "combine" option to true in cdrfile.conf.

How to use

Writing call logs to a file

  • In cdrfile.conf set:
[general]
; file: string: Name of the file to write the CDR to
; You should check that this file is log rotated - see /etc/logrotate.d/yate
file=/var/log/yate-cdr.csv

; combined: bool: Use combined CDR for all legs of a call
combined=true

; comma-separated (.csv), combined=true
format=${time}, "${billid}", "${chan}", "${address}", "${caller}", "${called}", ${billtime}, ${ringtime}, ${duration}, "${status}", "${reason}", "${out_leg.chan}", "${out_leg.address}", ${out_leg.billtime}, ${out_leg.ringtime}, ${out_leg.duration}, "${out_leg.reason}"
  • Example of output in configured yate-cdr.csv
1370509475.567, "1370508584-4", "sip/6", "192.168.168.11:5061", "123", "124", 0.000, 4.375, 4.453, "ringing", "Request Terminated", "sip/7", "192.168.168.226:58434", 0.000,4.379,4.446, "Cancelled"
1370509560.562, "1370508584-5", "sip/8", "192.168.168.226:58434", "124", "123", 9.520, 4.998, 14.589, "answered", "", "sip/9", "192.168.168.11:5061", 9.518,4.998,14.582, ""
1370509605.743, "1370508584-6", "sip/10", "192.168.168.11:5061", "123", "124", 96.289, 6.796, 103.190, "answered", "", "sip/12", "192.168.168.11:5061", 6.988, 3.224, 10.281, ""

Writing call logs to the database

  • Make sure the cdrcombine, cdrbuild, and register modules are loaded.
  • In register.conf [call.cdr] section uncomment cdr_combined or set your own query:
cdr_combined=INSERT INTO cdr VALUES(TIMESTAMP 'EPOCH' + INTERVAL '${time} s','${chan}',\
 '${address}','${caller}','${called}',INTERVAL '${duration} s',INTERVAL '${billtime} s',\
 INTERVAL '${ringtime} s','${status}','${reason}','${out_leg.chan}','${out_leg.address}',\
 INTERVAL '${out_leg.billtime} s',INTERVAL '${out_leg.ringtime} s',\
 INTERVAL '${out_leg.duration} s','${out_leg.reason}'

See also:

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers