Adding PddInterval in CdrStats

This commit is contained in:
DanB
2015-06-08 16:16:22 +02:00
parent 05a522a64c
commit aa4cd62a7f
12 changed files with 92 additions and 58 deletions

View File

@@ -320,6 +320,7 @@ CREATE TABLE tp_cdrstats (
`accounts` varchar(24) NOT NULL,
`subjects` varchar(64) NOT NULL,
`destination_prefixes` varchar(64) NOT NULL,
`pdd_interval` varchar(64) NOT NULL,
`usage_interval` varchar(64) NOT NULL,
`suppliers` varchar(64) NOT NULL,
`disconnect_causes` varchar(64) NOT NULL,

View File

@@ -315,6 +315,7 @@ CREATE TABLE tp_cdrstats (
accounts VARCHAR(24) NOT NULL,
subjects VARCHAR(64) NOT NULL,
destination_prefixes VARCHAR(64) NOT NULL,
pdd_interval VARCHAR(64) NOT NULL,
usage_interval VARCHAR(64) NOT NULL,
suppliers VARCHAR(64) NOT NULL,
disconnect_causes VARCHAR(64) NOT NULL,

View File

@@ -1,6 +1,6 @@
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],UsageInterval[15],Supplier[16],DisconnectCause[17],MediationRunIds[18],RatedAccount[19],RatedSubject[20],CostInterval[21],Triggers[22]
CDRST3,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,rated,*out,cgrates.org,call,dan,dan,+49,5m;10m,,,default,rif,rif,0;2,CDRST3_WARN_ASR
CDRST3,,,ACD,,,,,,,,,,,,,,,,,,,CDRST3_WARN_ACD
CDRST3,,,ACC,,,,,,,,,,,,,,,,,,,CDRST3_WARN_ACC
CDRST4,10,0,ASR,,,,,,,cgrates.org,call,,,,,,,,,,,CDRST4_WARN_ASR
CDRST4,,,ACD,,,,,,,,,,,,,,,,,,,CDRST4_WARN_ACD
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],PddInterval[15],UsageInterval[16],Supplier[17],DisconnectCause[18],MediationRunIds[19],RatedAccount[20],RatedSubject[21],CostInterval[22],Triggers[23]
CDRST3,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,rated,*out,cgrates.org,call,dan,dan,+49,,5m;10m,,,default,rif,rif,0;2,CDRST3_WARN_ASR
CDRST3,,,ACD,,,,,,,,,,,,,,,,,,,,CDRST3_WARN_ACD
CDRST3,,,ACC,,,,,,,,,,,,,,,,,,,,CDRST3_WARN_ACC
CDRST4,10,0,ASR,,,,,,,cgrates.org,call,,,,,,,,,,,,CDRST4_WARN_ASR
CDRST4,,,ACD,,,,,,,,,,,,,,,,,,,,CDRST4_WARN_ACD
1 #Id[0] QueueLength[1] TimeWindow[2] Metric[3] SetupInterval[4] TOR[5] CdrHost[6] CdrSource[7] ReqType[8] Direction[9] Tenant[10] Category[11] Account[12] Subject[13] DestinationPrefix[14] UsageInterval[15] PddInterval[15] Supplier[16] UsageInterval[16] DisconnectCause[17] Supplier[17] MediationRunIds[18] DisconnectCause[18] RatedAccount[19] MediationRunIds[19] RatedSubject[20] RatedAccount[20] CostInterval[21] RatedSubject[21] Triggers[22] CostInterval[22] Triggers[23]
2 CDRST3 5 60m ASR 2014-07-29T15:00:00Z;2014-07-29T16:00:00Z *voice 87.139.12.167 FS_JSON rated *out cgrates.org call dan dan +49 5m;10m 5m;10m default rif default rif rif 0;2 rif CDRST3_WARN_ASR 0;2 CDRST3_WARN_ASR
3 CDRST3 ACD CDRST3_WARN_ACD CDRST3_WARN_ACD
4 CDRST3 ACC CDRST3_WARN_ACC CDRST3_WARN_ACC
5 CDRST4 10 0 ASR cgrates.org call CDRST4_WARN_ASR CDRST4_WARN_ASR
6 CDRST4 ACD CDRST4_WARN_ACD CDRST4_WARN_ACD

View File

@@ -1,6 +1,6 @@
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],UsageInterval[15],Supplier[16],DisconnectCause[17],MediationRunIds[18],RatedAccount[19],RatedSubject[20],CostInterval[21],Triggers[22]
CDRST1,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,rated,*out,cgrates.org,call,dan,dan,+49,5m;10m,,,default,rif,rif,0;2,CDRST1_WARN_ASR
CDRST1,,,ACD,,,,,,,,,,,,,,,,,,,CDRST1_WARN_ACD
CDRST1,,,ACC,,,,,,,,,,,,,,,,,,,CDRST1_WARN_ACC
CDRST2,10,10m,ASR,,,,,,,cgrates.org,call,,,,,,,,,,,CDRST2_WARN_ASR
CDRST2,,,ACD,,,,,,,,,,,,,,,,,,,CDRST2_WARN_ACD
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],PddInterval[15],UsageInterval[16],Supplier[17],DisconnectCause[18],MediationRunIds[19],RatedAccount[20],RatedSubject[21],CostInterval[22],Triggers[23]
CDRST1,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,rated,*out,cgrates.org,call,dan,dan,+49,,5m;10m,,,default,rif,rif,0;2,CDRST1_WARN_ASR
CDRST1,,,ACD,,,,,,,,,,,,,,,,,,,,CDRST1_WARN_ACD
CDRST1,,,ACC,,,,,,,,,,,,,,,,,,,,CDRST1_WARN_ACC
CDRST2,10,10m,ASR,,,,,,,cgrates.org,call,,,,,,,,,,,,CDRST2_WARN_ASR
CDRST2,,,ACD,,,,,,,,,,,,,,,,,,,,CDRST2_WARN_ACD
1 #Id[0] QueueLength[1] TimeWindow[2] Metric[3] SetupInterval[4] TOR[5] CdrHost[6] CdrSource[7] ReqType[8] Direction[9] Tenant[10] Category[11] Account[12] Subject[13] DestinationPrefix[14] UsageInterval[15] PddInterval[15] Supplier[16] UsageInterval[16] DisconnectCause[17] Supplier[17] MediationRunIds[18] DisconnectCause[18] RatedAccount[19] MediationRunIds[19] RatedSubject[20] RatedAccount[20] CostInterval[21] RatedSubject[21] Triggers[22] CostInterval[22] Triggers[23]
2 CDRST1 5 60m ASR 2014-07-29T15:00:00Z;2014-07-29T16:00:00Z *voice 87.139.12.167 FS_JSON rated *out cgrates.org call dan dan +49 5m;10m 5m;10m default rif default rif rif 0;2 rif CDRST1_WARN_ASR 0;2 CDRST1_WARN_ASR
3 CDRST1 ACD CDRST1_WARN_ACD CDRST1_WARN_ACD
4 CDRST1 ACC CDRST1_WARN_ACC CDRST1_WARN_ACC
5 CDRST2 10 10m ASR cgrates.org call CDRST2_WARN_ASR CDRST2_WARN_ASR
6 CDRST2 ACD CDRST2_WARN_ACD CDRST2_WARN_ACD

View File

@@ -1,24 +1,24 @@
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],UsageInterval[15],Supplier[16],DisconnectCause[17],MediationRunIds[18],RatedAccount[19],RatedSubject[20],CostInterval[21],Triggers[22]
CDRST1,10,0,ASR,,,,,,,cgrates.org,,,,,,,,*default,,,,CDRST1_WARN
CDRST1,,,ACD,,,,,,,,,,,,,,,,,,,
CDRST1,,,ACC,,,,,,,,,,,,,,,,,,,
CDRST1,,,TCD,,,,,,,,,,,,,,,,,,,
CDRST1,,,TCC,,,,,,,,,,,,,,,,,,,
CDRST_1001,10,10m,ASR,,,,,,,cgrates.org,,,1001,,,,,*default,,,,CDRST1001_WARN
CDRST_1001,,,ACD,,,,,,,,,,,,,,,,,,,
CDRST_1001,,,ACC,,,,,,,,,,,,,,,,,,,
CDRST_1002,10,10m,ASR,,,,,,,cgrates.org,,,1002,,,,,*default,,,,CDRST1001_WARN
CDRST_1002,,,ACD,,,,,,,,,,,,,,,,,,,
CDRST_1002,,,ACC,,,,,,,,,,,,,,,,,,,
CDRST_1003,,,ASR,,,,,,,cgrates.org,,,,1003,,,,*default,,,,CDRST3_WARN
CDRST_1003,,,ACD,,,,,,,,,,,,,,,,,,,
STATS_SUPPL1,,,ACD,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,ASR,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,ACC,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,TCD,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,TCC,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL2,,,ACD,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,ASR,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,ACC,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,TCD,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,TCC,,,,,,,,,,,,,suppl2,,,,,,
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],PddInterval[15],UsageInterval[16],Supplier[17],DisconnectCause[18],MediationRunIds[19],RatedAccount[20],RatedSubject[21],CostInterval[22],Triggers[23]
CDRST1,10,0,ASR,,,,,,,cgrates.org,,,,,,,,,*default,,,,CDRST1_WARN
CDRST1,,,ACD,,,,,,,,,,,,,,,,,,,,
CDRST1,,,ACC,,,,,,,,,,,,,,,,,,,,
CDRST1,,,TCD,,,,,,,,,,,,,,,,,,,,
CDRST1,,,TCC,,,,,,,,,,,,,,,,,,,,
CDRST_1001,10,10m,ASR,,,,,,,cgrates.org,,,1001,,,,,,*default,,,,CDRST1001_WARN
CDRST_1001,,,ACD,,,,,,,,,,,,,,,,,,,,
CDRST_1001,,,ACC,,,,,,,,,,,,,,,,,,,,
CDRST_1002,10,10m,ASR,,,,,,,cgrates.org,,,1002,,,,,,*default,,,,CDRST1001_WARN
CDRST_1002,,,ACD,,,,,,,,,,,,,,,,,,,,
CDRST_1002,,,ACC,,,,,,,,,,,,,,,,,,,,
CDRST_1003,,,ASR,,,,,,,cgrates.org,,,,1003,,,,,*default,,,,CDRST3_WARN
CDRST_1003,,,ACD,,,,,,,,,,,,,,,,,,,,
STATS_SUPPL1,,,ACD,,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,ASR,,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,ACC,,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,TCD,,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL1,,,TCC,,,,,,,,,,,,,,suppl1,,,,,,
STATS_SUPPL2,,,ACD,,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,ASR,,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,ACC,,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,TCD,,,,,,,,,,,,,,suppl2,,,,,,
STATS_SUPPL2,,,TCC,,,,,,,,,,,,,,suppl2,,,,,,
1 #Id[0] QueueLength[1] TimeWindow[2] Metric[3] SetupInterval[4] TOR[5] CdrHost[6] CdrSource[7] ReqType[8] Direction[9] Tenant[10] Category[11] Account[12] Subject[13] DestinationPrefix[14] UsageInterval[15] PddInterval[15] Supplier[16] UsageInterval[16] DisconnectCause[17] Supplier[17] RatedAccount[19] DisconnectCause[18] MediationRunIds[18] MediationRunIds[19] RatedSubject[20] RatedAccount[20] CostInterval[21] RatedSubject[21] CostInterval[22] Triggers[22] Triggers[23]
2 CDRST1 10 0 ASR cgrates.org *default CDRST1_WARN
3 CDRST1 ACD
4 CDRST1 ACC
5 CDRST1 TCD
6 CDRST1 TCC
7 CDRST_1001 10 10m ASR cgrates.org 1001 *default CDRST1001_WARN
8 CDRST_1001 ACD
9 CDRST_1001 ACC
10 CDRST_1002 10 10m ASR cgrates.org 1002 *default CDRST1001_WARN
11 CDRST_1002 ACD
12 CDRST_1002 ACC
13 CDRST_1003 ASR cgrates.org 1003 *default CDRST3_WARN
14 CDRST_1003 ACD
15 STATS_SUPPL1 ACD suppl1 suppl1
16 STATS_SUPPL1 ASR suppl1 suppl1
17 STATS_SUPPL1 ACC suppl1 suppl1
18 STATS_SUPPL1 TCD suppl1 suppl1
19 STATS_SUPPL1 TCC suppl1 suppl1
20 STATS_SUPPL2 ACD suppl2 suppl2
21 STATS_SUPPL2 ASR suppl2 suppl2
22 STATS_SUPPL2 ACC suppl2 suppl2
23 STATS_SUPPL2 TCD suppl2 suppl2
24 STATS_SUPPL2 TCC suppl2 suppl2

View File

@@ -198,12 +198,12 @@ vdf,emptyY,*out,TOPUP_EMPTY_AT,
*out,cgrates.org,call,dan,*any,extra1,,,,,,rif2,rif2,,,,,,
`
cdrStats = `
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],UsageInterval[15],Supplier[16],DisconnectCause[17],MediationRunIds[18],RatedAccount[19],RatedSubject[20],CostInterval[21],Triggers[22]
CDRST1,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,*rated,*out,cgrates.org,call,dan,dan,49,5m;10m,suppl1,NORMAL_CLEARING,default,rif,rif,0;2,STANDARD_TRIGGERS
CDRST1,,,ACD,,,,,,,,,,,,,,,,,,,STANDARD_TRIGGER
CDRST1,,,ACC,,,,,,,,,,,,,,,,,,,
CDRST2,10,10m,ASR,,,,,,,cgrates.org,call,,,,,,,,,,,
CDRST2,,,ACD,,,,,,,,,,,,,,,,,,,
#Id[0],QueueLength[1],TimeWindow[2],Metric[3],SetupInterval[4],TOR[5],CdrHost[6],CdrSource[7],ReqType[8],Direction[9],Tenant[10],Category[11],Account[12],Subject[13],DestinationPrefix[14],PddInterval[15],UsageInterval[16],Supplier[17],DisconnectCause[18],MediationRunIds[19],RatedAccount[20],RatedSubject[21],CostInterval[22],Triggers[23]CDRST1,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,*rated,*out,cgrates.org,call,dan,dan,49,5m;10m,suppl1,NORMAL_CLEARING,default,rif,rif,0;2,STANDARD_TRIGGERS
CDRST1,5,60m,ASR,2014-07-29T15:00:00Z;2014-07-29T16:00:00Z,*voice,87.139.12.167,FS_JSON,*rated,*out,cgrates.org,call,dan,dan,49,3m;7m,5m;10m,suppl1,NORMAL_CLEARING,default,rif,rif,0;2,STANDARD_TRIGGERS
CDRST1,,,ACD,,,,,,,,,,,,,,,,,,,,STANDARD_TRIGGER
CDRST1,,,ACC,,,,,,,,,,,,,,,,,,,,
CDRST2,10,10m,ASR,,,,,,,cgrates.org,call,,,,,,,,,,,,
CDRST2,,,ACD,,,,,,,,,,,,,,,,,,,,
`
)
@@ -1063,6 +1063,7 @@ func TestLoadCdrStats(t *testing.T) {
Account: []string{"dan"},
Subject: []string{"dan"},
DestinationPrefix: []string{"49"},
PddInterval: []time.Duration{3 * time.Minute, 7 * time.Minute},
UsageInterval: []time.Duration{5 * time.Minute, 10 * time.Minute},
Supplier: []string{"suppl1"},
DisconnectCause: []string{"NORMAL_CLEARING"},

View File

@@ -336,6 +336,7 @@ func APItoModelCdrStat(stats *utils.TPCdrStats) (result []TpCdrstat) {
Accounts: st.Accounts,
Subjects: st.Subjects,
DestinationPrefixes: st.DestinationPrefixes,
PddInterval: st.PddInterval,
UsageInterval: st.UsageInterval,
Suppliers: st.Suppliers,
DisconnectCauses: st.DisconnectCauses,

View File

@@ -516,6 +516,7 @@ func (tps TpCdrStats) GetCdrStats() (map[string][]*utils.TPCdrStat, error) {
Accounts: tpCs.Accounts,
Subjects: tpCs.Subjects,
DestinationPrefixes: tpCs.DestinationPrefixes,
PddInterval: tpCs.PddInterval,
UsageInterval: tpCs.UsageInterval,
Suppliers: tpCs.Suppliers,
DisconnectCauses: tpCs.DisconnectCauses,
@@ -602,6 +603,31 @@ func UpdateCdrStats(cs *CdrStats, triggers ActionTriggerPriotityList, tpCs *util
if tpCs.DestinationPrefixes != "" {
cs.DestinationPrefix = append(cs.DestinationPrefix, tpCs.DestinationPrefixes)
}
if tpCs.PddInterval != "" {
pdds := strings.Split(tpCs.PddInterval, utils.INFIELD_SEP)
if len(pdds) > 0 {
if sPdd, err := time.ParseDuration(pdds[0]); err == nil {
if len(cs.PddInterval) < 1 {
cs.PddInterval = append(cs.PddInterval, sPdd)
} else {
cs.PddInterval[0] = sPdd
}
} else {
log.Printf("Error parsing PddInterval %v for cdrs stats %v", tpCs.PddInterval, cs.Id)
}
}
if len(pdds) > 1 {
if ePdd, err := time.ParseDuration(pdds[1]); err == nil {
if len(cs.PddInterval) < 2 {
cs.PddInterval = append(cs.PddInterval, ePdd)
} else {
cs.PddInterval[1] = ePdd
}
} else {
log.Printf("Error parsing UsageInterval %v for cdrs stats %v", tpCs.PddInterval, cs.Id)
}
}
}
if tpCs.UsageInterval != "" {
durations := strings.Split(tpCs.UsageInterval, utils.INFIELD_SEP)
if len(durations) > 0 {

View File

@@ -9,16 +9,16 @@ import (
func TestModelHelperCsvLoad(t *testing.T) {
l, err := csvLoad(TpDestination{}, []string{"TEST_DEST", "+492"})
tpd := l.(TpDestination)
if err != nil || tpd.Tag != "TEST_DEST" || tpd.Prefix != "+492" {
tpd, ok := l.(TpDestination)
if err != nil || !ok || tpd.Tag != "TEST_DEST" || tpd.Prefix != "+492" {
t.Errorf("model load failed: %+v", tpd)
}
}
func TestModelHelperCsvLoadInt(t *testing.T) {
l, err := csvLoad(TpCdrstat{}, []string{"CDRST1", "5", "60m", "ASR", "2014-07-29T15:00:00Z;2014-07-29T16:00:00Z", "*voice", "87.139.12.167", "FS_JSON", "*rated", "*out", "cgrates.org", "call", "dan", "dan", "49", "5m;10m", "suppl1", "NORMAL_CLEARING", "default", "rif", "rif", "0;2", "STANDARD_TRIGGERS"})
tpd := l.(TpCdrstat)
if err != nil || tpd.QueueLength != 5 {
l, err := csvLoad(TpCdrstat{}, []string{"CDRST1", "5", "60m", "ASR", "2014-07-29T15:00:00Z;2014-07-29T16:00:00Z", "*voice", "87.139.12.167", "FS_JSON", "*rated", "*out", "cgrates.org", "call", "dan", "dan", "49", "3m;7m", "5m;10m", "suppl1", "NORMAL_CLEARING", "default", "rif", "rif", "0;2", "STANDARD_TRIGGERS"})
tpd, ok := l.(TpCdrstat)
if err != nil || !ok || tpd.QueueLength != 5 {
t.Errorf("model load failed: %+v", tpd)
}
}
@@ -389,6 +389,7 @@ func TestTPCdrStatsAsExportSlice(t *testing.T) {
Accounts: "dan",
Subjects: "dan",
DestinationPrefixes: "49",
PddInterval: "3m;7m",
UsageInterval: "5m;10m",
Suppliers: "supplier1",
DisconnectCauses: "NORMAL_CLEARNING",
@@ -412,6 +413,7 @@ func TestTPCdrStatsAsExportSlice(t *testing.T) {
Accounts: "dan",
Subjects: "dan",
DestinationPrefixes: "49",
PddInterval: "3m;7m",
UsageInterval: "5m;10m",
Suppliers: "supplier1",
DisconnectCauses: "NORMAL_CLEARNING",
@@ -424,9 +426,9 @@ func TestTPCdrStatsAsExportSlice(t *testing.T) {
}
expectedSlc := [][]string{
[]string{"CDRST1", "5", "60m", "ASR;ACD", "2014-07-29T15:00:00Z;2014-07-29T16:00:00Z", "*voice", "87.139.12.167", "FS_JSON", utils.META_RATED, "*out", "cgrates.org", "call",
"dan", "dan", "49", "5m;10m", "supplier1", "NORMAL_CLEARNING", "default", "rif", "rif", "0;2", "STANDARD_TRIGGERS"},
"dan", "dan", "49", "3m;7m", "5m;10m", "supplier1", "NORMAL_CLEARNING", "default", "rif", "rif", "0;2", "STANDARD_TRIGGERS"},
[]string{"CDRST1", "5", "60m", "ASR", "2014-07-29T15:00:00Z;2014-07-29T16:00:00Z", "*voice", "87.139.12.167", "FS_JSON", utils.META_RATED, "*out", "cgrates.org", "call",
"dan", "dan", "49", "5m;10m", "supplier1", "NORMAL_CLEARNING", "default", "dan", "dan", "0;2", "STANDARD_TRIGGERS"},
"dan", "dan", "49", "3m;7m", "5m;10m", "supplier1", "NORMAL_CLEARNING", "default", "dan", "dan", "0;2", "STANDARD_TRIGGERS"},
}
ms := APItoModelCdrStat(cdrStats)
var slc [][]string

View File

@@ -306,14 +306,15 @@ type TpCdrstat struct {
Accounts string `index:"12" re:""`
Subjects string `index:"13" re:""`
DestinationPrefixes string `index:"14" re:""`
UsageInterval string `index:"15" re:""`
Suppliers string `index:"16" re:""`
DisconnectCauses string `index:"17" re:""`
MediationRunids string `index:"18" re:""`
RatedAccounts string `index:"19" re:""`
RatedSubjects string `index:"20" re:""`
CostInterval string `index:"21" re:""`
ActionTriggers string `index:"22" re:""`
PddInterval string `index:"15" re:""`
UsageInterval string `index:"16" re:""`
Suppliers string `index:"17" re:""`
DisconnectCauses string `index:"18" re:""`
MediationRunids string `index:"19" re:""`
RatedAccounts string `index:"20" re:""`
RatedSubjects string `index:"21" re:""`
CostInterval string `index:"22" re:""`
ActionTriggers string `index:"23" re:""`
CreatedAt time.Time
}

View File

@@ -73,9 +73,9 @@ type StoredCdr struct {
Subject string // rating subject (rating subsystem) this record should be attached to
Destination string // destination to be charged
SetupTime time.Time // set-up time of the event. Supported formats: datetime RFC3339 compatible, SQL datetime (eg: MySQL), unix timestamp.
Pdd time.Duration // PDD value
AnswerTime time.Time // answer time of the event. Supported formats: datetime RFC3339 compatible, SQL datetime (eg: MySQL), unix timestamp.
Usage time.Duration // event usage information (eg: in case of tor=*voice this will represent the total duration of a call)
Pdd time.Duration // PDD value
Supplier string // Supplier information when available
DisconnectCause string // Disconnect cause of the event
ExtraFields map[string]string // Extra fields to be stored in CDR

View File

@@ -336,6 +336,7 @@ type TPCdrStat struct {
Accounts string
Subjects string
DestinationPrefixes string
PddInterval string
UsageInterval string
Suppliers string
DisconnectCauses string