| 1 |
; |
| 2 |
; Asterisk Call Detail Record Logging (CDR) - Custom Sqlite3 Backend |
| 3 |
; |
| 4 |
|
| 5 |
; This is the configuration file for the customizable Sqlite3 backend for CDR |
| 6 |
; logging. |
| 7 |
; |
| 8 |
; Legacy vs Advanced Mappings |
| 9 |
; |
| 10 |
; Legacy mappings are those that are defined using dialplan functions like CDR |
| 11 |
; and CSV_QUOTE and require a VERY expensive function replacement process at |
| 12 |
; runtime for every record output. |
| 13 |
; |
| 14 |
; Advanced mappings are those that are defined by a simple list of field names |
| 15 |
; which uses significantly less resources at runtime. |
| 16 |
; |
| 17 |
; |
| 18 |
; Each category in this file represents a separate Sqlite3 database file. |
| 19 |
; A filename that starts with a forward-slash '/' will be treated as an absolute |
| 20 |
; path name. If it doesn't, it must be a file name with no directory separators |
| 21 |
; which will be placed in the /var/log/asterisk directory. If the database |
| 22 |
; file doesn't already exist, it will be created. |
| 23 |
; |
| 24 |
; Previous versions of Asterisk limited the output to a single database file |
| 25 |
; named "master" which was shared with CDR Sqlite3 logging. That is no longer |
| 26 |
; the case. |
| 27 |
; |
| 28 |
; Legacy Mappings |
| 29 |
; |
| 30 |
; Within a legacy mapping, use the CDR() and CSV_QUOTE() functions to retrieve |
| 31 |
; values from the CDR. |
| 32 |
; |
| 33 |
; NOTE: If your legacy mapping uses only the CDR dialplan function, the module |
| 34 |
; will attempt to strip the functions and create a much faster advanced mapping |
| 35 |
; for it. However, we urge you to create a real advanced mapping and not rely |
| 36 |
; on this process. If the mapping contains something not recognized it will go |
| 37 |
; the slower legacy route. |
| 38 |
; |
| 39 |
; |
| 40 |
;[cdr_master] |
| 41 |
;table = cdr ; The name of the table in the database into which records |
| 42 |
; are to be written. If the table doesn't already exist, |
| 43 |
; it will be created. |
| 44 |
|
| 45 |
;columns = calldate, literal, clid, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, ds_store |
| 46 |
; The column names to receive the fields. If the table doesn't already exist, |
| 47 |
; it will be created with these columns. If the table does exist, this list |
| 48 |
; MUST match the existing columns or the config will fail to load. |
| 49 |
; The column names do NOT have to match the field names however. |
| 50 |
|
| 51 |
;values = '${CDR(start)}','some literal','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration)}','${CDR(billsec)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(ds_store)}' |
| 52 |
; The list of fields to write into the columns. |
| 53 |
; Each field MUST be enclosed in single-quotes and the fields separated |
| 54 |
; by commas. Additionally, the number of fields specified MUST match the |
| 55 |
; number of columns or the config will fail to load. |
| 56 |
|
| 57 |
;busy_timeout = 1000 ; The number of milliseconds to wait for a database operation |
| 58 |
; to complete before an error is returned. |
| 59 |
|
| 60 |
; |
| 61 |
; Advanced Mappings |
| 62 |
; |
| 63 |
;[cdr_advanced] |
| 64 |
;table = cdr ; The name of the table in the database into which records |
| 65 |
; are to be written. If the table doesn't already exist, |
| 66 |
; it will be created. |
| 67 |
|
| 68 |
;columns = calldate, literal, clid, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, ds_storetest ; The column names to receive the fields. If the table doesn't already exist, |
| 69 |
; it will be created with these columns. If the table does exist, this list |
| 70 |
; MUST match the existing columns or the config will fail to load. |
| 71 |
|
| 72 |
;fields = start,"some literal",clid,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield,ds_store(uservar) |
| 73 |
; The "fields" parameter differentiates this mapping as an Advanced one |
| 74 |
; as opposed to "values" used above. |
| 75 |
; |
| 76 |
; This is the list of fields to include in the record. The field names are the |
| 77 |
; same as in the legacy mapping but without any enclosing dialplan functions. |
| 78 |
; You can specify literals to be placed in the output record by double-quoting |
| 79 |
; them. There is also some special notation available in the form of "qualifiers". |
| 80 |
; A qualifier is a list of tags, separated by the '^' character and placed |
| 81 |
; directly after the field name and enclosed in parentheses. |
| 82 |
; |
| 83 |
; If you've added user variables to the CDR using the CDR() dialplan function in |
| 84 |
; extensions.conf, you'll need to retrieve the field using the "uservar" qualifier. |
| 85 |
; For example, if you've added the "ds_type" variable, you'll need to retrieve |
| 86 |
; it with `ds_type(uservar)`. |
| 87 |
; |
| 88 |
; The default output format for the "start", "answer" and "end" timestamp fields |
| 89 |
; is the "%Y-%m-%d %T" strftime string format however you can also format those |
| 90 |
; fields as an int64 or a float: `start(int64),answer(float),end`. |
| 91 |
; |
| 92 |
; The "disposition" and "amaflags" are formatted as their string names like |
| 93 |
; "ANSWERED" and "DOCUMENTATION" by default but if you just want the numbers and |
| 94 |
; not the names... `amaflags(int64),disposition(int64)`. |
| 95 |
; |
| 96 |
; If you need to combine flags, use the caret '^' symbol: `start(int64^noquote)` |
| 97 |
; |
| 98 |
; Final notes about "fields": |
| 99 |
; Field names and qualifiers aren't case sensitive. |
| 100 |
; You MUST use commas to separate the fields. |
| 101 |
; You MUST use double-quotes to indicate literal fields. |
| 102 |
; Whitespace in "fields" is ignored except in literals. |
| 103 |
|
| 104 |
;busy_timeout = 1000 ; The number of milliseconds to wait for a database operation |
| 105 |
; to complete before an error is returned. |