OpenNetwork.xyz   Placeholder for our stuff related to Telecom, IT, Internet of things (IOT), ESP8266, Raspberry Pi

Call Detail Record Analysis using awk and sed

This page consistes of my collection of call detail records (cdr) analysis one-liner scripts. I have used these for the dialogic control switch (formarly veraz) icdr files over the years.

Dialogic control switch gives a single line CDR for a call. Various fields are seperated by delimiter semicolon (;). Although these one-liners were written specifically for dialogic control switch, yet these can be adopted to various other switch cdr formats by changing field numbers and delimiter. These can be run on Linux/Solaris or Cygwin. You will find then handy in reconciling the CDR or find a particular value quickly.

Here is an example of a cdr file.

Note: In solaris servers use "nawk" instead of "awk"

Call Status, Total Count and Total MOU (Minuts of Usage)

You can use this script repeatedly to check out number of succesful calls and MOU are increasing. Increasing stats indicate that switch is churning out succesful calls and working in good condition..

# awk ' BEGIN {FS=";"} {a[$7]++;b[$7]=b[$7]+$137}END{for (i in a) print i,a[i],b[i]/60}' OFS=',' icdr*
S,2,3.41742
U,2,0

Find CDR with call duration greater then 300 seconds

# awk 'BEGIN {FS=";"} ($137 > 300) {print $0}' OFS=';' icdr*

 

INPUT : ITG, ETG, Status, Date, FileRange
OUTPUT : Status, Count of Given Status, Total MOU

# awk 'BEGIN {FS=";"} ($58 == "InTGname") && ($59 == "OutTGname") && ($7 == "S") && (substr($35 $5,1,10)== "2009-07-17") {a[$7]++;b[$7]=b[$7]+$137}END{for (i in a) print i,a[i],b[i]/60}' OFS=',' icdr*

 

INPUT : ITG, Status, Date, FileRange
OUTPUT : ETG, Status, Count of Given Status, Total MOU

# awk 'BEGIN {FS=";"} ($58 == "InTGname") && ($7 == "S") && (substr($35 $5,1,10)== "2009-07-17") {a[$59","$7]++;b[$59","$7]=b[$59","$7]+$137}END{for (i in a) print i,a[i],b[i]/60}' OFS=',' icdr*

 

INPUT : ITG, Date, FileRange
OUTPUT : ETG, Status (S,E,U,I,R), Count of Status, Total MOU

# awk 'BEGIN {FS=";"} ($58 == "InTGname") && (substr($35 $5,1,10)== "2009-07-17") {a[$59","$7]++;b[$59","$7]=b[$59","$7]+$137}END{for (i in a) print i,a[i],b[i]/60}' OFS=',' icdr*

 

INPUT : Date, FileRange
OUTPUT : ITG, ETG, Status (S,E,U,I,R), Count of Status, Total MOU

# awk 'BEGIN {FS=";"} (substr($35 $5,1,10)== "2009-07-17") {a[$58","$59","$7]++;b[$58","$59","$7]=b[$58","$59","$7]+$137}END{for (i in a) print i,a[i],b[i]/60}' OFS=',' icdr*

 

© 2019 Suresh Hariramani