diff --git a/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json b/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json index 0f4059de0..8aac09bb9 100644 --- a/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json @@ -85,17 +85,6 @@ // "cdr_replication":[], // replicate the raw CDR to a number of servers }, - -"cdrs": { - "enabled": true, // start the CDR Server service: -// "extra_fields": [], // extra fields to store in CDRs for non-generic CDRs -// "store_cdrs": true, // store cdrs in storDb - "rater": "internal", // address where to reach the Rater for cost calculation, empty to disable functionality: <""|internal|x.y.z.y:1234> - "cdrstats": "internal", // address where to reach the cdrstats service, empty to disable stats functionality<""|internal|x.y.z.y:1234> -// "reconnects": 5, // number of reconnect attempts to rater or cdrs -// "cdr_replication":[], // replicate the raw CDR to a number of servers -}, - "cdr_stats": { "enabled": true, // starts the cdrstats service: // "queue_length": 50, // number of items in the stats buffer diff --git a/engine/responder_test.go b/engine/responder_test.go index 8998baf69..5060ae543 100644 --- a/engine/responder_test.go +++ b/engine/responder_test.go @@ -392,4 +392,31 @@ func TestGetLCR(t *testing.T) { } else if !reflect.DeepEqual(eLcLcr.SupplierCosts, lcrLc.SupplierCosts) { t.Errorf("Expecting: %+v, received: %+v", eLcLcr.SupplierCosts[1], lcrLc.SupplierCosts[1]) } + /* + bRif12 := &Balance{Value: 40, Weight: 10, DestinationId: dstDe.Id} + bIvo12 := &Balance{Value: 60, Weight: 10, DestinationId: dstDe.Id} + rif12sAccount := &Account{Id: utils.ConcatenatedKey(utils.OUT, "tenant12", "rif12"), BalanceMap: map[string]BalanceChain{MINUTES + OUTBOUND: BalanceChain{bRif12}}} + ivo12sAccount := &Account{Id: utils.ConcatenatedKey(utils.OUT, "tenant12", "ivo12"), BalanceMap: map[string]BalanceChain{MINUTES + OUTBOUND: BalanceChain{bIvo12}}} + for _, acnt := range []*Account{rif12sAccount, ivo12sAccount} { + if err := accountingStorage.SetAccount(acnt); err != nil { + t.Error(err) + } + } + eLcLcr = &LCRCost{ + Entry: &LCREntry{DestinationId: utils.ANY, RPCategory: "call", Strategy: LCR_STRATEGY_LOWEST, Weight: 10.0}, + SupplierCosts: []*LCRSupplierCost{ + &LCRSupplierCost{Supplier: "*out:tenant12:call:ivo12", Cost: 0, Duration: 60 * time.Second}, + &LCRSupplierCost{Supplier: "*out:tenant12:call:rif12", Cost: 0.4, Duration: 60 * time.Second}, + &LCRSupplierCost{Supplier: "*out:tenant12:call:dan12", Cost: 0.6, Duration: 60 * time.Second}, + }, + } + if err := rsponder.GetLCR(cdLowestCost, &lcrLc); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(eLcLcr.Entry, lcrLc.Entry) { + t.Errorf("Expecting: %+v, received: %+v", eLcLcr.Entry, lcrLc.Entry) + + } else if !reflect.DeepEqual(eLcLcr.SupplierCosts, lcrLc.SupplierCosts) { + t.Errorf("Expecting: %+v, received: %+v", eLcLcr.SupplierCosts[1], lcrLc.SupplierCosts[1]) + } + */ }