From f94b32a42f4b543348b7ff014651d3e22f404af2 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 25 Jul 2013 11:35:57 -0400 Subject: [PATCH] Add a CDR log file It may be useful to have a consumable log of every call the system has processed. This enables a simple CSV based file for CDRs (Call Detail Records). Change-Id: I2086594a127e1377056fdb10af763ade3af4ad56 --- .../files/pbx/asterisk/cdr.conf | 3 +++ .../files/pbx/asterisk/cdr_custom.conf | 3 +++ modules/openstack_project/manifests/pbx.pp | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 modules/openstack_project/files/pbx/asterisk/cdr.conf create mode 100644 modules/openstack_project/files/pbx/asterisk/cdr_custom.conf diff --git a/modules/openstack_project/files/pbx/asterisk/cdr.conf b/modules/openstack_project/files/pbx/asterisk/cdr.conf new file mode 100644 index 0000000000..cc3fa0fd28 --- /dev/null +++ b/modules/openstack_project/files/pbx/asterisk/cdr.conf @@ -0,0 +1,3 @@ +[general](+) + +enable=yes diff --git a/modules/openstack_project/files/pbx/asterisk/cdr_custom.conf b/modules/openstack_project/files/pbx/asterisk/cdr_custom.conf new file mode 100644 index 0000000000..d4234613bc --- /dev/null +++ b/modules/openstack_project/files/pbx/asterisk/cdr_custom.conf @@ -0,0 +1,3 @@ +[mappings](+) + +Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)} diff --git a/modules/openstack_project/manifests/pbx.pp b/modules/openstack_project/manifests/pbx.pp index cd046d6b43..d25829aa91 100644 --- a/modules/openstack_project/manifests/pbx.pp +++ b/modules/openstack_project/manifests/pbx.pp @@ -59,4 +59,22 @@ class openstack_project::pbx ( source => 'puppet:///modules/openstack_project/pbx/asterisk/extensions.conf', require => File['/etc/asterisk/'], } + + file {'/etc/asterisk/cdr.conf.d/cdr.conf': + ensure => present, + owner => 'asterisk', + group => 'asterisk', + mode => '0660', + source => 'puppet:///modules/openstack_project/pbx/asterisk/cdr.conf', + require => File['/etc/asterisk/'], + } + + file {'/etc/asterisk/cdr_custom.conf.d/cdr_custom.conf': + ensure => present, + owner => 'asterisk', + group => 'asterisk', + mode => '0660', + source => 'puppet:///modules/openstack_project/pbx/asterisk/cdr_custom.conf', + require => File['/etc/asterisk/'], + } }