Correction getCost in tutorial - getCost does not consider balances, adding TCC and TCD in CDRST1 instance

This commit is contained in:
DanB
2015-04-28 18:20:56 +02:00
parent 42cd26972f
commit bc73d7b5f1
3 changed files with 6 additions and 4 deletions

View File

@@ -2,6 +2,8 @@
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,,,,,,,,,,,,,,,,,,
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] Supplier[16] MediationRunIds[17] RatedAccount[18] RatedSubject[19] CostInterval[20] Triggers[21]
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

View File

@@ -256,7 +256,7 @@ func TestTutFsCallsGetCosts(t *testing.T) {
var cc engine.CallCost
if err := tutFsCallsRpc.Call("Responder.GetCost", cd, &cc); err != nil {
t.Error("Got error on Responder.GetCost: ", err.Error())
} else if cc.Cost != 0.01 {
} else if cc.Cost != 0.6 {
t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost)
}
tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z")
@@ -274,7 +274,7 @@ func TestTutFsCallsGetCosts(t *testing.T) {
}
if err := tutFsCallsRpc.Call("Responder.GetCost", cd, &cc); err != nil {
t.Error("Got error on Responder.GetCost: ", err.Error())
} else if cc.Cost != 0.05 { // 0.01 first minute, 0.04 25 seconds with RT_20CNT
} else if cc.Cost != 0.6417 { // 0.01 first minute, 0.04 25 seconds with RT_20CNT
t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost)
}
tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z")

View File

@@ -254,7 +254,7 @@ func TestTutKamCallsGetCosts(t *testing.T) {
var cc engine.CallCost
if err := tutKamCallsRpc.Call("Responder.GetCost", cd, &cc); err != nil {
t.Error("Got error on Responder.GetCost: ", err.Error())
} else if cc.Cost != 0.01 {
} else if cc.Cost != 0.6 {
t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost)
}
tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z")
@@ -272,7 +272,7 @@ func TestTutKamCallsGetCosts(t *testing.T) {
}
if err := tutKamCallsRpc.Call("Responder.GetCost", cd, &cc); err != nil {
t.Error("Got error on Responder.GetCost: ", err.Error())
} else if cc.Cost != 0.05 {
} else if cc.Cost != 0.6417 {
t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost)
}
tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z")