No commit activity in last 3 years
No release in over 3 years
Outputs a mini statement of recent telephone calls from the Asterisk Call Detail Records (cdr-csv/Master.csv) file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.1, ~> 1.1
>= 0.2.4, ~> 0.2
 Project Readme

Introducing the Asterisk_mini_statement gem

require 'asterisk_mini_statement'


h = {
  telno: '0131 357 5xxx',
  startdate: '8-May-2016', 
  enddate: '14-May-2016',
  outgoing_regex: /SIP\/(\d+)@voipfone/
}

ams = AsteriskMiniStatement.new('/home/james/Master.csv', h)
puts ams.to_s

The above script will read the Asterisk Call Detail Records (CDR) file and output a listing of inbound and outbound calls over the past week. A sample of the output is show below:

Telephone mini-statement
========================

telno: 0131 357 5xxx
Period: 08/05/2016 - 14/05/2016

Breakdown:

Date/time  Telephone    duration
=========  ===========  ========

Sunday 8th May 2016

>  5:29pm: 0751960xxxx     8m 5s

--------------------------------

Monday 9th May 2016

>  8:54am: 013122xxxxx       55s
>  3:09pm: 013151xxxxx    1m 22s

--------------------------------

Tuesday 10th May 2016

>  4:55pm: 075900xxxxx       57s
<  4:58pm: 013177xxxxx    1m 11s

--------------------------------

Wednesday 11th May 2016

>  4:02pm: 013166xxxxx       26s

--------------------------------

Thursday 12th May 2016

>  3:40pm: 077863xxxxx       35s
>  3:41pm: 013166xxxxx       37s

--------------------------------

Friday 13th May 2016

>  2:08pm: 013155xxxxx       50s
<  3:49pm: 013151xxxxx       47s
>  3:57pm: 013151xxxxx    1m 37s
<  3:59pm: 013155xxxxx     2m 9s

--------------------------------

Notes:

  • The outgoing_regex parameter is necessary to identify from the lastdata field if the call was an outgoing call or not
  • The output is designed for printing to a mini-thermal printer (32 characters wide).

Resources

asterisk cdr csv statement ministatement