882f48735b84a59d49545115217ff9d8d668facd
[asterisk/asterisk.git] / configs / cdr.conf.sample
1 ;
2 ; Asterisk Call Detail Record engine configuration
3 ;
4 ; CDR is Call Detail Record, which provides logging services via a variety of
5 ; pluggable backend modules.  Detailed call information can be recorded to
6 ; databases, files, etc.  Useful for billing, fraud prevention, compliance with
7 ; Sarbanes-Oxley aka The Enron Act, QOS evaluations, and more.
8 ;
9
10 [general]
11
12 ; Define whether or not to use CDR logging.  Setting this to "no" will override
13 ; any loading of backend CDR modules.  Default is "yes".
14 ;enable=yes
15
16 ; Define whether or not to log unanswered calls. Setting this to "yes" will
17 ; report every attempt to ring a phone in dialing attempts, when it was not
18 ; answered. For example, if you try to dial 3 extensions, and this option is "yes",
19 ; you will get 3 CDR's, one for each phone that was rung. Default is "no". Some
20 ; find this information horribly useless. Others find it very valuable. Note, in "yes"
21 ; mode, you will see one CDR, with one of the call targets on one side, and the originating
22 ; channel on the other, and then one CDR for each channel attempted. This may seem
23 ; redundant, but cannot be helped.
24 ;
25 ; In brief, this option controls the reporting of unanswered calls which only have an A 
26 ; party. Calls which get offered to an outgoing line, but are unanswered, are still 
27 ; logged, and that is the intended behaviour. (It also results in some B side CDRs being
28 ; output, as they have the B side channel as their source channel, and no destination 
29 ; channel.)
30 ;unanswered = no
31
32 ; Define whether or not to log congested calls. Setting this to "yes" will
33 ; report each call that fails to complete due to congestion conditions. Default
34 ; is "no".
35 ;congestion = no
36
37 ; Normally, CDR's are not closed out until after all extensions are finished
38 ; executing.  By enabling this option, the CDR will be ended before executing
39 ; the "h" extension so that CDR values such as "end" and "billsec" may be
40 ; retrieved inside of of this extension.  The default value is "no".
41 ;endbeforehexten=no
42
43 ; Normally, the 'billsec' field logged to the backends (text files or databases)
44 ; is simply the end time (hangup time) minus the answer time in seconds. Internally,
45 ; asterisk stores the time in terms of microseconds and seconds. By setting
46 ; initiatedseconds to 'yes', you can force asterisk to report any seconds
47 ; that were initiated (a sort of round up method). Technically, this is
48 ; when the microsecond part of the end time is greater than the microsecond
49 ; part of the answer time, then the billsec time is incremented one second.
50 ; The default value is "no".
51 ;initiatedseconds=no
52
53 ; Define the CDR batch mode, where instead of posting the CDR at the end of
54 ; every call, the data will be stored in a buffer to help alleviate load on the
55 ; asterisk server.  Default is "no".
56 ;
57 ; WARNING WARNING WARNING
58 ; Use of batch mode may result in data loss after unsafe asterisk termination
59 ; ie. software crash, power failure, kill -9, etc.
60 ; WARNING WARNING WARNING
61 ;
62 ;batch=no
63
64 ; Define the maximum number of CDRs to accumulate in the buffer before posting
65 ; them to the backend engines.  'batch' must be set to 'yes'.  Default is 100.
66 ;size=100
67
68 ; Define the maximum time to accumulate CDRs in the buffer before posting them
69 ; to the backend engines.  If this time limit is reached, then it will post the
70 ; records, regardless of the value defined for 'size'.  'batch' must be set to
71 ; 'yes'.  Note that time is in seconds.  Default is 300 (5 minutes).
72 ;time=300
73
74 ; The CDR engine uses the internal asterisk scheduler to determine when to post
75 ; records.  Posting can either occur inside the scheduler thread, or a new
76 ; thread can be spawned for the submission of every batch.  For small batches,
77 ; it might be acceptable to just use the scheduler thread, so set this to "yes".
78 ; For large batches, say anything over size=10, a new thread is recommended, so
79 ; set this to "no".  Default is "no".
80 ;scheduleronly=no
81
82 ; When shutting down asterisk, you can block until the CDRs are submitted.  If
83 ; you don't, then data will likely be lost.  You can always check the size of
84 ; the CDR batch buffer with the CLI "cdr status" command.  To enable blocking on
85 ; submission of CDR data during asterisk shutdown, set this to "yes".  Default
86 ; is "yes".
87 ;safeshutdown=yes
88
89 ;
90 ;
91 ; CHOOSING A CDR "BACKEND"  (what kind of output to generate)
92 ;
93 ; To choose a backend, you have to make sure either the right category is
94 ; defined in this file, or that the appropriate config file exists, and has the
95 ; proper definitions in it. If there are any problems, usually, the entry will
96 ; silently ignored, and you get no output.
97 ;
98 ; Also, please note that you can generate CDR records in as many formats as you
99 ; wish. If you configure 5 different CDR formats, then each event will be logged
100 ; in 5 different places! In the example config files, all formats are commented
101 ; out except for the cdr-csv format.
102 ;
103 ; Here are all the possible back ends:
104 ;
105 ;   csv, custom, manager, odbc, pgsql, radius, sqlite, tds
106 ;    (also, mysql is available via the asterisk-addons, due to licensing
107 ;     requirements)
108 ;   (please note, also, that other backends can be created, by creating
109 ;    a new backend module in the source cdr/ directory!)
110 ;
111 ; Some of the modules required to provide these backends will not build or install
112 ; unless some dependency requirements are met. Examples of this are pgsql, odbc,
113 ; etc. If you are not getting output as you would expect, the first thing to do
114 ; is to run the command "make menuselect", and check what modules are available,
115 ; by looking in the "2. Call Detail Recording" option in the main menu. If your
116 ; backend is marked with XXX, you know that the "configure" command could not find
117 ; the required libraries for that option.
118 ;
119 ; To get CDRs to be logged to the plain-jane /var/log/asterisk/cdr-csv/Master.csv
120 ; file, define the [csv] category in this file. No database necessary. The example
121 ; config files are set up to provide this kind of output by default.
122 ;
123 ; To get custom csv CDR records, make sure the cdr_custom.conf file
124 ; is present, and contains the proper [mappings] section. The advantage to
125 ; using this backend, is that you can define which fields to output, and in
126 ; what order. By default, the example configs are set up to mimic the cdr-csv
127 ; output. If you don't make any changes to the mappings, you are basically generating
128 ; the same thing as cdr-csv, but expending more CPU cycles to do so!
129 ;
130 ; To get manager events generated, make sure the cdr_manager.conf file exists,
131 ; and the [general] section is defined, with the single variable 'enabled = yes'.
132 ;
133 ; For odbc, make sure all the proper libs are installed, that "make menuselect"
134 ; shows that the modules are available, and the cdr_odbc.conf file exists, and
135 ; has a [global] section with the proper variables defined.
136 ;
137 ; For pgsql, make sure all the proper libs are installed, that "make menuselect"
138 ; shows that the modules are available, and the cdr_pgsql.conf file exists, and
139 ; has a [global] section with the proper variables defined.
140 ;
141 ; For logging to radius databases, make sure all the proper libs are installed, that
142 ; "make menuselect" shows that the modules are available, and the [radius]
143 ; category is defined in this file, and in that section, make sure the 'radiuscfg'
144 ; variable is properly pointing to an existing radiusclient.conf file.
145 ;
146 ; For logging to sqlite databases, make sure the 'cdr.db' file exists in the log directory,
147 ; which is usually /var/log/asterisk. Of course, the proper libraries should be available
148 ; during the 'configure' operation.
149 ;
150 ; For tds logging, make sure the proper libraries are available during the 'configure'
151 ; phase, and that cdr_tds.conf exists and is properly set up with a [global] category.
152 ;
153 ; Also, remember, that if you wish to log CDR info to a database, you will have to define
154 ; a specific table in that databse to make things work! See the doc directory for more details
155 ; on how to create this table in each database.
156 ;
157
158 [csv]
159 usegmtime=yes    ; log date/time in GMT.  Default is "no"
160 loguniqueid=yes  ; log uniqueid.  Default is "no"
161 loguserfield=yes ; log user field.  Default is "no"
162 accountlogs=yes  ; create separate log file for each account code. Default is "yes"
163
164 ;[radius]
165 ;usegmtime=yes    ; log date/time in GMT
166 ;loguniqueid=yes  ; log uniqueid
167 ;loguserfield=yes ; log user field
168 ; Set this to the location of the radiusclient-ng configuration file
169 ; The default is /etc/radiusclient-ng/radiusclient.conf
170 ;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf