text
stringlengths
0
152
|
Chapter 21: System Monitoring and Logging
This is the command used to execute this extension and generate a sample manager
event:
*CLI> console dial 110@testing
Finally, this is an example manager event produced as a result of this test call:
Event: Cdr
Privilege: cdr,all
AccountCode:
Source:
Destination: 110
DestinationContext: testing
CallerID:
Channel: Console/dsp
DestinationChannel:
LastApplication: Hangup
LastData:
StartTime: 2010-08-23 08:27:21
AnswerTime: 2010-08-23 08:27:21
EndTime: 2010-08-23 08:27:21
Duration: 0
BillableSeconds: 0
Disposition: ANSWERED
AMAFlags: DOCUMENTATION
UniqueID: 1282570041.3
UserField:
Rate: 0.02
Carrier: BS&S
cdr_odbc
This module enables the legacy ODBC interface for CDR logging. New installations
should use cdr_adaptive_odbc instead.
cdr_sqlite
This module allows posting of CDRs to an SQLite database using SQLite version 2.
Unless you have a specific need for SQLite version 2 as opposed to version 3, we rec‐
ommend that all new installations use cdr_sqlite3_custom.
This module requires no configuration to work. If the module has been compiled and
loaded into Asterisk, it will insert CDRs into a table called cdr in a database located
at /var/log/asterisk/cdr.db.
cdr_sqlite3_custom
This CDR backend inserts CDRs into an SQLite database using SQLite version 3. The
database created by this module lives at /var/log/asterisk/master.db. This module
requires a configuration file, /etc/asterisk/cdr_sqlite3_custom.conf. The configuration
file identifies the table name, as well as customizes which CDR variables will be inser‐
ted into the database.
Call Detail Records
|
363
cdr_syslog
This module allows logging of CDRs using syslog. To enable this, first add an entry
to the system’s syslog configuration file, /etc/syslog.conf. For example:
local4.* /var/log/asterisk/asterisk-cdr.log
The Asterisk module has a configuration file as well. Add the following section
to /etc/asterisk/cdr_syslog.conf:
[cdr]
facility = local4
priority = info
template = "We received a call from ${CDR(src)}"
Here is an example syslog entry using this configuration:
$ cat /var/log/asterisk/asterisk-cdr.log
Aug 12 19:17:36 pbx cdr: "We received a call from 2565551212"
Example Call Detail Records
We will use the cdr_custom module to illustrate some example CDR records for dif‐
ferent call scenarios. The configuration used for /etc/asterisk/cdr_custom.conf is
shown in “cdr_custom” on page 361.
Single-party call
In this example, we’ll show what a CDR looks like for a simple one-party call:
exten => 227,1,VoiceMailMain(@${GLOBAL(VOICEMAIL_CONTEXT)})
This is the CDR from /var/log/asterisk/cdr-custom/Master.csv that was created as a
result of calling this extension:
"","SOFTPHONE_A","227","sets","""101"" <SOFTPHONE_A>","PJSIP/SOFTPHONE_A-00000002",