From 66e2b4cd01e99a9587f19ca49ffca38c740b26cb Mon Sep 17 00:00:00 2001 From: TeoV Date: Tue, 12 Jan 2021 17:43:26 +0200 Subject: [PATCH] Remove RoundingMethod and RoundingDecimals from RateProfile --- apier/v1/rateprofiles_it_test.go | 116 +++++------ apier/v1/remote_it_test.go | 24 +-- apier/v1/replicate_it_test.go | 24 +-- config/config_defaults.go | 28 ++- config/config_json_test.go | 34 ++-- config/config_test.go | 43 ++-- .../mysql/create_tariffplan_tables.sql | 2 - .../postgres/create_tariffplan_tables.sql | 2 - .../routes_with_rates/RateProfiles.csv | 14 +- data/tariffplans/testit/RateProfiles.csv | 8 +- data/tariffplans/tutrates/RateProfiles.csv | 10 +- engine/libtest.go | 10 +- engine/loader_csv_test.go | 18 +- engine/model_helpers.go | 32 +-- engine/model_helpers_test.go | 158 ++++++--------- engine/models.go | 28 ++- engine/rateprofile.go | 6 - engine/rateprofile_test.go | 3 - engine/z_filterindexer_it_test.go | 34 ++-- engine/z_onstor_it_test.go | 12 +- engine/z_stordb_it_test.go | 18 +- general_tests/export_it_test.go | 2 - loaders/loader_test.go | 185 +++++++----------- rates/rates.go | 4 +- utils/apitpdata.go | 2 - 25 files changed, 323 insertions(+), 494 deletions(-) diff --git a/apier/v1/rateprofiles_it_test.go b/apier/v1/rateprofiles_it_test.go index 0a84b9016..ecfd71df6 100644 --- a/apier/v1/rateprofiles_it_test.go +++ b/apier/v1/rateprofiles_it_test.go @@ -157,15 +157,13 @@ func testV1RatePrfVerifyRateProfile(t *testing.T) { t.Error(err) } rPrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -232,13 +230,11 @@ func testV1RatePrfRemoveRateProfile(t *testing.T) { func testV1RatePrfSetRateProfileRates(t *testing.T) { rPrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*wrong:inline"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*wrong:inline"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -256,13 +252,11 @@ func testV1RatePrfSetRateProfileRates(t *testing.T) { t.Fatal(err) } apiRPrf := &engine.APIRateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*wrong:inline"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*wrong:inline"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.APIRate{ "RT_WEEK": { ID: "RT_WEEK", @@ -358,12 +352,10 @@ func testV1RatePrfSetRateProfileRates(t *testing.T) { } rPrfUpdated := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ @@ -414,12 +406,10 @@ func testV1RatePrfSetRateProfileRates(t *testing.T) { func testV1RatePrfRemoveRateProfileRates(t *testing.T) { apiRPrf := &engine.APIRateProfile{ - Tenant: "cgrates.org", - ID: "SpecialRate", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, + Tenant: "cgrates.org", + ID: "SpecialRate", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.APIRate{ @@ -481,12 +471,10 @@ func testV1RatePrfRemoveRateProfileRates(t *testing.T) { } rPrfUpdated := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "SpecialRate", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, + Tenant: "cgrates.org", + ID: "SpecialRate", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ @@ -535,12 +523,10 @@ func testV1RatePrfRemoveRateProfileRates(t *testing.T) { } rPrfUpdated2 := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "SpecialRate", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, + Tenant: "cgrates.org", + ID: "SpecialRate", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{}, @@ -572,11 +558,9 @@ func testV1RatePrfStopEngine(t *testing.T) { func testV1RateGetRemoveRateProfileWithoutTenant(t *testing.T) { rateProfile := &engine.RateProfile{ - ID: "RPWithoutTenant", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, + ID: "RPWithoutTenant", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ @@ -598,12 +582,9 @@ func testV1RateGetRemoveRateProfileWithoutTenant(t *testing.T) { apiRPrf := &APIRateProfileWithCache{ APIRateProfileWithOpts: &engine.APIRateProfileWithOpts{ APIRateProfile: &engine.APIRateProfile{ - ID: "RPWithoutTenant", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - + ID: "RPWithoutTenant", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.APIRate{ "RT_WEEK": { @@ -693,12 +674,10 @@ func testV1RatePrfGetRateProfileIDsCount(t *testing.T) { func testV1RatePrfGetRateProfileRatesWithoutTenant(t *testing.T) { rPrf := &engine.RateProfile{ - ID: "SpecialRate", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + ID: "SpecialRate", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -720,12 +699,9 @@ func testV1RatePrfGetRateProfileRatesWithoutTenant(t *testing.T) { apiRPrf := &APIRateProfileWithCache{ APIRateProfileWithOpts: &engine.APIRateProfileWithOpts{ APIRateProfile: &engine.APIRateProfile{ - ID: "SpecialRate", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - + ID: "SpecialRate", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.APIRate{ "RT_WEEK": { diff --git a/apier/v1/remote_it_test.go b/apier/v1/remote_it_test.go index 4c00b6c4e..65d6838b8 100644 --- a/apier/v1/remote_it_test.go +++ b/apier/v1/remote_it_test.go @@ -682,13 +682,11 @@ func testInternalRemoteITGetRouteProfile(t *testing.T) { } rPrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -710,13 +708,11 @@ func testInternalRemoteITGetRouteProfile(t *testing.T) { apiRPrf := &APIRateProfileWithCache{ APIRateProfileWithOpts: &engine.APIRateProfileWithOpts{ APIRateProfile: &engine.APIRateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.APIRate{ "RT_WEEK": { ID: "RT_WEEK", diff --git a/apier/v1/replicate_it_test.go b/apier/v1/replicate_it_test.go index 0d5357c5f..4127b0515 100644 --- a/apier/v1/replicate_it_test.go +++ b/apier/v1/replicate_it_test.go @@ -1340,13 +1340,11 @@ func testInternalReplicateITThreshold(t *testing.T) { func testInternalReplicateITRateProfile(t *testing.T) { //set rPrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -1367,13 +1365,11 @@ func testInternalReplicateITRateProfile(t *testing.T) { } apiRPrf := &engine.APIRateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.APIRate{ "RT_WEEK": { ID: "RT_WEEK", diff --git a/config/config_defaults.go b/config/config_defaults.go index 8cf6e64e8..84378ffd2 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -803,21 +803,19 @@ const CGRATES_CFG_JSON = ` {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"}, {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"}, {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.4"}, - {"tag": "RoundingMethod", "path": "RoundingMethod", "type": "*variable", "value": "~*req.5"}, - {"tag": "RoundingDecimals", "path": "RoundingDecimals", "type": "*variable", "value": "~*req.6"}, - {"tag": "MinCost", "path": "MinCost", "type": "*variable", "value": "~*req.7"}, - {"tag": "MaxCost", "path": "MaxCost", "type": "*variable", "value": "~*req.8"}, - {"tag": "MaxCostStrategy", "path": "MaxCostStrategy", "type": "*variable", "value": "~*req.9"}, - {"tag": "RateID", "path": "RateID", "type": "*variable", "value": "~*req.10"}, - {"tag": "RateFilterIDs", "path": "RateFilterIDs", "type": "*variable", "value": "~*req.11"}, - {"tag": "RateActivationTimes", "path": "RateActivationTimes", "type": "*variable", "value": "~*req.12"}, - {"tag": "RateWeight", "path": "RateWeight", "type": "*variable", "value": "~*req.13"}, - {"tag": "RateBlocker", "path": "RateBlocker", "type": "*variable", "value": "~*req.14"}, - {"tag": "RateIntervalStart", "path": "RateIntervalStart", "type": "*variable", "value": "~*req.15"}, - {"tag": "RateFixedFee", "path": "RateFixedFee", "type": "*variable", "value": "~*req.16"}, - {"tag": "RateRecurrentFee", "path": "RateRecurrentFee", "type": "*variable", "value": "~*req.17"}, - {"tag": "RateUnit", "path": "RateUnit", "type": "*variable", "value": "~*req.18"}, - {"tag": "RateIncrement", "path": "RateIncrement", "type": "*variable", "value": "~*req.19"}, + {"tag": "MinCost", "path": "MinCost", "type": "*variable", "value": "~*req.5"}, + {"tag": "MaxCost", "path": "MaxCost", "type": "*variable", "value": "~*req.6"}, + {"tag": "MaxCostStrategy", "path": "MaxCostStrategy", "type": "*variable", "value": "~*req.7"}, + {"tag": "RateID", "path": "RateID", "type": "*variable", "value": "~*req.8"}, + {"tag": "RateFilterIDs", "path": "RateFilterIDs", "type": "*variable", "value": "~*req.9"}, + {"tag": "RateActivationTimes", "path": "RateActivationTimes", "type": "*variable", "value": "~*req.10"}, + {"tag": "RateWeight", "path": "RateWeight", "type": "*variable", "value": "~*req.11"}, + {"tag": "RateBlocker", "path": "RateBlocker", "type": "*variable", "value": "~*req.12"}, + {"tag": "RateIntervalStart", "path": "RateIntervalStart", "type": "*variable", "value": "~*req.13"}, + {"tag": "RateFixedFee", "path": "RateFixedFee", "type": "*variable", "value": "~*req.14"}, + {"tag": "RateRecurrentFee", "path": "RateRecurrentFee", "type": "*variable", "value": "~*req.15"}, + {"tag": "RateUnit", "path": "RateUnit", "type": "*variable", "value": "~*req.16"}, + {"tag": "RateIncrement", "path": "RateIncrement", "type": "*variable", "value": "~*req.17"}, ], }, { diff --git a/config/config_json_test.go b/config/config_json_test.go index db77393b3..4bd55a942 100644 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -1571,66 +1571,58 @@ func TestDfLoaderJsonCfg(t *testing.T) { Path: utils.StringPointer("Weight"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.4")}, - {Tag: utils.StringPointer("RoundingMethod"), - Path: utils.StringPointer("RoundingMethod"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.5")}, - {Tag: utils.StringPointer("RoundingDecimals"), - Path: utils.StringPointer("RoundingDecimals"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.6")}, {Tag: utils.StringPointer("MinCost"), Path: utils.StringPointer("MinCost"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.7")}, + Value: utils.StringPointer("~*req.5")}, {Tag: utils.StringPointer("MaxCost"), Path: utils.StringPointer("MaxCost"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.8")}, + Value: utils.StringPointer("~*req.6")}, {Tag: utils.StringPointer("MaxCostStrategy"), Path: utils.StringPointer("MaxCostStrategy"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.9")}, + Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("RateID"), Path: utils.StringPointer("RateID"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.10")}, + Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("RateFilterIDs"), Path: utils.StringPointer("RateFilterIDs"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.11")}, + Value: utils.StringPointer("~*req.9")}, {Tag: utils.StringPointer("RateActivationTimes"), Path: utils.StringPointer("RateActivationTimes"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.12")}, + Value: utils.StringPointer("~*req.10")}, {Tag: utils.StringPointer("RateWeight"), Path: utils.StringPointer("RateWeight"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.13")}, + Value: utils.StringPointer("~*req.11")}, {Tag: utils.StringPointer("RateBlocker"), Path: utils.StringPointer("RateBlocker"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.14")}, + Value: utils.StringPointer("~*req.12")}, {Tag: utils.StringPointer("RateIntervalStart"), Path: utils.StringPointer("RateIntervalStart"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.15")}, + Value: utils.StringPointer("~*req.13")}, {Tag: utils.StringPointer("RateFixedFee"), Path: utils.StringPointer("RateFixedFee"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.16")}, + Value: utils.StringPointer("~*req.14")}, {Tag: utils.StringPointer("RateRecurrentFee"), Path: utils.StringPointer("RateRecurrentFee"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.17")}, + Value: utils.StringPointer("~*req.15")}, {Tag: utils.StringPointer("RateUnit"), Path: utils.StringPointer("RateUnit"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.18")}, + Value: utils.StringPointer("~*req.16")}, {Tag: utils.StringPointer("RateIncrement"), Path: utils.StringPointer("RateIncrement"), Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.19")}, + Value: utils.StringPointer("~*req.17")}, }, }, { diff --git a/config/config_test.go b/config/config_test.go index 57479ab3e..28a584a25 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -3276,94 +3276,82 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), Layout: time.RFC3339, }, - {Tag: "RoundingMethod", - Path: "RoundingMethod", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Layout: time.RFC3339, - }, - {Tag: "RoundingDecimals", - Path: "RoundingDecimals", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Layout: time.RFC3339, - }, {Tag: "MinCost", Path: "MinCost", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "MaxCost", Path: "MaxCost", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "MaxCostStrategy", Path: "MaxCostStrategy", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateID", Path: "RateID", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateFilterIDs", Path: "RateFilterIDs", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateActivationTimes", Path: "RateActivationTimes", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateWeight", Path: "RateWeight", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateBlocker", Path: "RateBlocker", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateIntervalStart", Path: "RateIntervalStart", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateFixedFee", Path: "RateFixedFee", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateRecurrentFee", Path: "RateRecurrentFee", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.17", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateUnit", Path: "RateUnit", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.18", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "RateIncrement", Path: "RateIncrement", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.19", utils.InfieldSep), + Value: NewRSRParsersMustCompile("~*req.17", utils.InfieldSep), Layout: time.RFC3339, }, }, @@ -5361,7 +5349,7 @@ func TestV1GetConfigAsJSONDispatcherH(t *testing.T) { func TestV1GetConfigAsJSONLoaders(t *testing.T) { var reply string - expected := `{"loaders":[{"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.6"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.7"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.10"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Values","tag":"Values","type":"*variable","value":"~*req.4"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.5"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.9"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.10"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.6"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"MetricFilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.11"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.8"},{"path":"ActionIDs","tag":"ActionIDs","type":"*variable","value":"~*req.9"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"path":"RouteID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"RouteFilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"RouteAccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"RouteRatingPlanIDs","tag":"RouteRatingPlanIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeight","tag":"RouteWeight","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.5"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.6"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.7"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.9"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.10"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.11"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.12"}],"file_name":"DispatcherProfiles.csv","flags":null,"type":"*dispatchers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Address","tag":"Address","type":"*variable","value":"~*req.2"},{"path":"Transport","tag":"Transport","type":"*variable","value":"~*req.3"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.4"}],"file_name":"DispatcherHosts.csv","flags":null,"type":"*dispatcher_hosts"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"RoundingMethod","tag":"RoundingMethod","type":"*variable","value":"~*req.5"},{"path":"RoundingDecimals","tag":"RoundingDecimals","type":"*variable","value":"~*req.6"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.7"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.8"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.9"},{"path":"RateID","tag":"RateID","type":"*variable","value":"~*req.10"},{"path":"RateFilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.11"},{"path":"RateActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.12"},{"path":"RateWeight","tag":"RateWeight","type":"*variable","value":"~*req.13"},{"path":"RateBlocker","tag":"RateBlocker","type":"*variable","value":"~*req.14"},{"path":"RateIntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.15"},{"path":"RateFixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.16"},{"path":"RateRecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.17"},{"path":"RateUnit","tag":"RateUnit","type":"*variable","value":"~*req.18"},{"path":"RateIncrement","tag":"RateIncrement","type":"*variable","value":"~*req.19"}],"file_name":"RateProfiles.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"TargetType","tag":"TargetType","type":"*variable","value":"~*req.6"},{"path":"TargetIDs","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"path":"ActionID","tag":"ActionID","type":"*variable","value":"~*req.8"},{"path":"ActionFilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"path":"ActionBlocker","tag":"ActionBlocker","type":"*variable","value":"~*req.10"},{"path":"ActionTTL","tag":"ActionTTL","type":"*variable","value":"~*req.11"},{"path":"ActionType","tag":"ActionType","type":"*variable","value":"~*req.12"},{"path":"ActionOpts","tag":"ActionOpts","type":"*variable","value":"~*req.13"},{"path":"ActionPath","tag":"ActionPath","type":"*variable","value":"~*req.14"},{"path":"ActionValue","tag":"ActionValue","type":"*variable","value":"~*req.15"}],"file_name":"ActionProfiles.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"BalanceID","tag":"BalanceID","type":"*variable","value":"~*req.5"},{"path":"BalanceFilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"path":"BalanceWeight","tag":"BalanceWeight","type":"*variable","value":"~*req.7"},{"path":"BalanceBlocker","tag":"BalanceBlocker","type":"*variable","value":"~*req.8"},{"path":"BalanceType","tag":"BalanceType","type":"*variable","value":"~*req.9"},{"path":"BalanceOpts","tag":"BalanceOpts","type":"*variable","value":"~*req.10"},{"path":"BalanceCostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.11"},{"path":"BalanceCostAttributes","tag":"BalanceCostAttributes","type":"*variable","value":"~*req.12"},{"path":"BalanceUnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.13"},{"path":"BalanceUnits","tag":"BalanceUnits","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"AccountProfiles.csv","flags":null,"type":"*account_profiles"}],"dry_run":false,"enabled":false,"field_separator":",","id":"*default","lock_filename":".cgr.lck","run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` + expected := `{"loaders":[{"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.6"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.7"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.10"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Values","tag":"Values","type":"*variable","value":"~*req.4"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.5"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.9"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.10"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.6"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"MetricFilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.11"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.8"},{"path":"ActionIDs","tag":"ActionIDs","type":"*variable","value":"~*req.9"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"path":"RouteID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"RouteFilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"RouteAccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"RouteRatingPlanIDs","tag":"RouteRatingPlanIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeight","tag":"RouteWeight","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.5"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.6"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.7"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.9"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.10"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.11"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.12"}],"file_name":"DispatcherProfiles.csv","flags":null,"type":"*dispatchers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Address","tag":"Address","type":"*variable","value":"~*req.2"},{"path":"Transport","tag":"Transport","type":"*variable","value":"~*req.3"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.4"}],"file_name":"DispatcherHosts.csv","flags":null,"type":"*dispatcher_hosts"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.5"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.6"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.7"},{"path":"RateID","tag":"RateID","type":"*variable","value":"~*req.8"},{"path":"RateFilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.9"},{"path":"RateActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.10"},{"path":"RateWeight","tag":"RateWeight","type":"*variable","value":"~*req.11"},{"path":"RateBlocker","tag":"RateBlocker","type":"*variable","value":"~*req.12"},{"path":"RateIntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.13"},{"path":"RateFixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.14"},{"path":"RateRecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.15"},{"path":"RateUnit","tag":"RateUnit","type":"*variable","value":"~*req.16"},{"path":"RateIncrement","tag":"RateIncrement","type":"*variable","value":"~*req.17"}],"file_name":"RateProfiles.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"TargetType","tag":"TargetType","type":"*variable","value":"~*req.6"},{"path":"TargetIDs","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"path":"ActionID","tag":"ActionID","type":"*variable","value":"~*req.8"},{"path":"ActionFilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"path":"ActionBlocker","tag":"ActionBlocker","type":"*variable","value":"~*req.10"},{"path":"ActionTTL","tag":"ActionTTL","type":"*variable","value":"~*req.11"},{"path":"ActionType","tag":"ActionType","type":"*variable","value":"~*req.12"},{"path":"ActionOpts","tag":"ActionOpts","type":"*variable","value":"~*req.13"},{"path":"ActionPath","tag":"ActionPath","type":"*variable","value":"~*req.14"},{"path":"ActionValue","tag":"ActionValue","type":"*variable","value":"~*req.15"}],"file_name":"ActionProfiles.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"BalanceID","tag":"BalanceID","type":"*variable","value":"~*req.5"},{"path":"BalanceFilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"path":"BalanceWeight","tag":"BalanceWeight","type":"*variable","value":"~*req.7"},{"path":"BalanceBlocker","tag":"BalanceBlocker","type":"*variable","value":"~*req.8"},{"path":"BalanceType","tag":"BalanceType","type":"*variable","value":"~*req.9"},{"path":"BalanceOpts","tag":"BalanceOpts","type":"*variable","value":"~*req.10"},{"path":"BalanceCostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.11"},{"path":"BalanceCostAttributes","tag":"BalanceCostAttributes","type":"*variable","value":"~*req.12"},{"path":"BalanceUnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.13"},{"path":"BalanceUnits","tag":"BalanceUnits","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"AccountProfiles.csv","flags":null,"type":"*account_profiles"}],"dry_run":false,"enabled":false,"field_separator":",","id":"*default","lock_filename":".cgr.lck","run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(&SectionWithOpts{Section: LoaderJson}, &reply); err != nil { t.Error(err) @@ -5586,8 +5574,7 @@ func TestV1GetConfigAsJSONAllConfig(t *testing.T) { } }` var reply string - - expected := `{"accounts":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rates_conns":[],"suffix_indexed_fields":[],"thresholds_conns":[]},"actions":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[],"tenants":[]},"analyzers":{"cleanup_interval":"1h0m0s","db_path":"/var/spool/cgrates/analyzers","enabled":false,"index_type":"*scorch","ttl":"24h0m0s"},"apiban":{"enabled":false,"keys":[]},"apiers":{"attributes_conns":[],"caches_conns":["*internal"],"ees_conns":[],"enabled":false,"scheduler_conns":[]},"asterisk_agent":{"asterisk_conns":[{"address":"127.0.0.1:8088","alias":"","connect_attempts":3,"password":"CGRateS.org","reconnects":5,"user":"cgrates"}],"create_cdr":false,"enabled":false,"sessions_conns":["*internal"]},"attributes":{"apiers_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"process_runs":1,"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"caches":{"partitions":{"*account_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*account_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*account_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*apiban":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2m0s"},"*attribute_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*attribute_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*caps_events":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*cdr_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10m0s"},"*cdrs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*closed_sessions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*diameter_messages":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*dispatcher_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_loads":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*event_charges":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*event_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*load_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rate_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rate_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_connections":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_responses":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2s"},"*session_costs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stat_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueue_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueues":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stir":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*threshold_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*threshold_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_account_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_account_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destination_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*uch":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*versions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""}},"replication_conns":[]},"cdrs":{"attributes_conns":[],"chargers_conns":[],"ees_conns":[],"enabled":false,"extra_fields":[],"online_cdr_exports":[],"rals_conns":[],"scheduler_conns":[],"session_cost_retries":5,"stats_conns":[],"store_cdrs":true,"thresholds_conns":[]},"chargers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"configs":{"enabled":false,"root_dir":"/var/spool/cgrates/configs","url":"/configs/"},"cores":{"caps":0,"caps_stats_interval":"0","caps_strategy":"*busy","shutdown_timeout":"1s"},"data_db":{"db_host":"127.0.0.1","db_name":"10","db_password":"","db_port":6379,"db_type":"*redis","db_user":"cgrates","items":{"*account_action_plans":{"remote":false,"replicate":false},"*account_profiles":{"remote":false,"replicate":false},"*accounts":{"remote":false,"replicate":false},"*action_plans":{"remote":false,"replicate":false},"*action_profiles":{"remote":false,"replicate":false},"*action_triggers":{"remote":false,"replicate":false},"*actions":{"remote":false,"replicate":false},"*attribute_profiles":{"remote":false,"replicate":false},"*charger_profiles":{"remote":false,"replicate":false},"*destinations":{"remote":false,"replicate":false},"*dispatcher_hosts":{"remote":false,"replicate":false},"*dispatcher_profiles":{"remote":false,"replicate":false},"*filters":{"remote":false,"replicate":false},"*indexes":{"remote":false,"replicate":false},"*load_ids":{"remote":false,"replicate":false},"*rate_profiles":{"remote":false,"replicate":false},"*rating_plans":{"remote":false,"replicate":false},"*rating_profiles":{"remote":false,"replicate":false},"*resource_profiles":{"remote":false,"replicate":false},"*resources":{"remote":false,"replicate":false},"*reverse_destinations":{"remote":false,"replicate":false},"*route_profiles":{"remote":false,"replicate":false},"*shared_groups":{"remote":false,"replicate":false},"*statqueue_profiles":{"remote":false,"replicate":false},"*statqueues":{"remote":false,"replicate":false},"*threshold_profiles":{"remote":false,"replicate":false},"*thresholds":{"remote":false,"replicate":false},"*timings":{"remote":false,"replicate":false}},"opts":{"query_timeout":"10s","redis_ca_certificate":"","redis_client_certificate":"","redis_client_key":"","redis_cluster":false,"redis_cluster_ondown_delay":"0","redis_cluster_sync":"5s","redis_sentinel":"","redis_tls":false},"remote_conns":[],"replication_conns":[]},"diameter_agent":{"asr_template":"","concurrent_requests":-1,"dictionaries_path":"/usr/share/cgrates/diameter/dict/","enabled":false,"forced_disconnect":"*none","listen":"127.0.0.1:3868","listen_net":"tcp","origin_host":"CGR-DA","origin_realm":"cgrates.org","product_name":"CGRateS","rar_template":"","request_processors":[],"sessions_conns":["*internal"],"synced_conn_requests":false,"vendor_id":0},"dispatcherh":{"dispatchers_conns":[],"enabled":false,"hosts":{},"register_interval":"5m0s"},"dispatchers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"dns_agent":{"enabled":false,"listen":"127.0.0.1:2053","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"],"timezone":""},"ees":{"attributes_conns":[],"cache":{"*file_csv":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"export_path":"/var/spool/cgrates/ees","field_separator":",","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"tenant":"","timezone":"","type":"*none"}]},"ers":{"enabled":false,"readers":[{"cache_dump_fields":[],"concurrent_requests":1024,"failed_calls_prefix":"","field_separator":",","fields":[{"mandatory":true,"path":"*cgreq.ToR","tag":"ToR","type":"*variable","value":"~*req.2"},{"mandatory":true,"path":"*cgreq.OriginID","tag":"OriginID","type":"*variable","value":"~*req.3"},{"mandatory":true,"path":"*cgreq.RequestType","tag":"RequestType","type":"*variable","value":"~*req.4"},{"mandatory":true,"path":"*cgreq.Tenant","tag":"Tenant","type":"*variable","value":"~*req.6"},{"mandatory":true,"path":"*cgreq.Category","tag":"Category","type":"*variable","value":"~*req.7"},{"mandatory":true,"path":"*cgreq.Account","tag":"Account","type":"*variable","value":"~*req.8"},{"mandatory":true,"path":"*cgreq.Subject","tag":"Subject","type":"*variable","value":"~*req.9"},{"mandatory":true,"path":"*cgreq.Destination","tag":"Destination","type":"*variable","value":"~*req.10"},{"mandatory":true,"path":"*cgreq.SetupTime","tag":"SetupTime","type":"*variable","value":"~*req.11"},{"mandatory":true,"path":"*cgreq.AnswerTime","tag":"AnswerTime","type":"*variable","value":"~*req.12"},{"mandatory":true,"path":"*cgreq.Usage","tag":"Usage","type":"*variable","value":"~*req.13"}],"filters":[],"flags":[],"header_define_character":":","id":"*default","opts":{},"partial_cache_expiry_action":"","partial_record_cache":"0","processed_path":"/var/spool/cgrates/ers/out","row_length":0,"run_delay":"0","source_path":"/var/spool/cgrates/ers/in","tenant":"","timezone":"","type":"*none","xml_root_path":[""]}],"sessions_conns":["*internal"]},"filters":{"apiers_conns":[],"resources_conns":[],"stats_conns":[]},"freeswitch_agent":{"create_cdr":false,"empty_balance_ann_file":"","empty_balance_context":"","enabled":false,"event_socket_conns":[{"address":"127.0.0.1:8021","alias":"127.0.0.1:8021","password":"ClueCon","reconnects":5}],"extra_fields":"","low_balance_ann_file":"","max_wait_connection":"2s","sessions_conns":["*internal"],"subscribe_park":true},"general":{"connect_attempts":5,"connect_timeout":"1s","dbdata_encoding":"*msgpack","default_caching":"*reload","default_category":"call","default_request_type":"*rated","default_tenant":"cgrates.org","default_timezone":"Local","digest_equal":":","digest_separator":",","failed_posts_dir":"/var/spool/cgrates/failed_posts","failed_posts_ttl":"5s","locking_timeout":"0","log_level":6,"logger":"*syslog","max_call_duration":"3h0m0s","max_parallel_conns":100,"min_call_duration":"0","node_id":"ENGINE1","poster_attempts":3,"reconnects":-1,"reply_timeout":"2s","rounding_decimals":5,"rsr_separator":";","tpexport_dir":"/var/spool/cgrates/tpe"},"http":{"auth_users":{},"client_opts":{"dialFallbackDelay":"300ms","dialKeepAlive":"30s","dialTimeout":"30s","disableCompression":false,"disableKeepAlives":false,"expectContinueTimeout":"0","forceAttemptHttp2":true,"idleConnTimeout":"90s","maxConnsPerHost":0,"maxIdleConns":100,"maxIdleConnsPerHost":2,"responseHeaderTimeout":"0","skipTlsVerify":false,"tlsHandshakeTimeout":"10s"},"dispatchers_registrar_url":"/dispatchers_registrar","freeswitch_cdrs_url":"/freeswitch_json","http_cdrs":"/cdr_http","json_rpc_url":"/jsonrpc","use_basic_auth":false,"ws_url":"/ws"},"http_agent":[],"kamailio_agent":{"create_cdr":false,"enabled":false,"evapi_conns":[{"address":"127.0.0.1:8448","alias":"","reconnects":5}],"sessions_conns":["*internal"],"timezone":""},"listen":{"http":"127.0.0.1:2080","http_tls":"127.0.0.1:2280","rpc_gob":"127.0.0.1:2013","rpc_gob_tls":"127.0.0.1:2023","rpc_json":"127.0.0.1:2012","rpc_json_tls":"127.0.0.1:2022"},"loader":{"caches_conns":["*localhost"],"data_path":"./","disable_reverse":false,"field_separator":",","gapi_credentials":".gapi/credentials.json","gapi_token":".gapi/token.json","scheduler_conns":["*localhost"],"tpid":""},"loaders":[{"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.6"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.7"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.10"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Values","tag":"Values","type":"*variable","value":"~*req.4"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.5"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.9"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.10"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.6"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"MetricFilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.11"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.8"},{"path":"ActionIDs","tag":"ActionIDs","type":"*variable","value":"~*req.9"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"path":"RouteID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"RouteFilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"RouteAccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"RouteRatingPlanIDs","tag":"RouteRatingPlanIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeight","tag":"RouteWeight","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.5"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.6"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.7"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.9"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.10"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.11"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.12"}],"file_name":"DispatcherProfiles.csv","flags":null,"type":"*dispatchers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Address","tag":"Address","type":"*variable","value":"~*req.2"},{"path":"Transport","tag":"Transport","type":"*variable","value":"~*req.3"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.4"}],"file_name":"DispatcherHosts.csv","flags":null,"type":"*dispatcher_hosts"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"RoundingMethod","tag":"RoundingMethod","type":"*variable","value":"~*req.5"},{"path":"RoundingDecimals","tag":"RoundingDecimals","type":"*variable","value":"~*req.6"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.7"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.8"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.9"},{"path":"RateID","tag":"RateID","type":"*variable","value":"~*req.10"},{"path":"RateFilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.11"},{"path":"RateActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.12"},{"path":"RateWeight","tag":"RateWeight","type":"*variable","value":"~*req.13"},{"path":"RateBlocker","tag":"RateBlocker","type":"*variable","value":"~*req.14"},{"path":"RateIntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.15"},{"path":"RateFixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.16"},{"path":"RateRecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.17"},{"path":"RateUnit","tag":"RateUnit","type":"*variable","value":"~*req.18"},{"path":"RateIncrement","tag":"RateIncrement","type":"*variable","value":"~*req.19"}],"file_name":"RateProfiles.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"TargetType","tag":"TargetType","type":"*variable","value":"~*req.6"},{"path":"TargetIDs","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"path":"ActionID","tag":"ActionID","type":"*variable","value":"~*req.8"},{"path":"ActionFilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"path":"ActionBlocker","tag":"ActionBlocker","type":"*variable","value":"~*req.10"},{"path":"ActionTTL","tag":"ActionTTL","type":"*variable","value":"~*req.11"},{"path":"ActionType","tag":"ActionType","type":"*variable","value":"~*req.12"},{"path":"ActionOpts","tag":"ActionOpts","type":"*variable","value":"~*req.13"},{"path":"ActionPath","tag":"ActionPath","type":"*variable","value":"~*req.14"},{"path":"ActionValue","tag":"ActionValue","type":"*variable","value":"~*req.15"}],"file_name":"ActionProfiles.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"BalanceID","tag":"BalanceID","type":"*variable","value":"~*req.5"},{"path":"BalanceFilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"path":"BalanceWeight","tag":"BalanceWeight","type":"*variable","value":"~*req.7"},{"path":"BalanceBlocker","tag":"BalanceBlocker","type":"*variable","value":"~*req.8"},{"path":"BalanceType","tag":"BalanceType","type":"*variable","value":"~*req.9"},{"path":"BalanceOpts","tag":"BalanceOpts","type":"*variable","value":"~*req.10"},{"path":"BalanceCostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.11"},{"path":"BalanceCostAttributes","tag":"BalanceCostAttributes","type":"*variable","value":"~*req.12"},{"path":"BalanceUnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.13"},{"path":"BalanceUnits","tag":"BalanceUnits","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"AccountProfiles.csv","flags":null,"type":"*account_profiles"}],"dry_run":false,"enabled":false,"field_separator":",","id":"*default","lock_filename":".cgr.lck","run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}],"mailer":{"auth_password":"CGRateS.org","auth_user":"cgrates","from_address":"cgr-mailer@localhost.localdomain","server":"localhost"},"migrator":{"out_datadb_encoding":"msgpack","out_datadb_host":"127.0.0.1","out_datadb_name":"10","out_datadb_opts":{"redis_ca_certificate":"","redis_client_certificate":"","redis_client_key":"","redis_cluster":false,"redis_cluster_ondown_delay":"0","redis_cluster_sync":"5s","redis_sentinel":"","redis_tls":false},"out_datadb_password":"","out_datadb_port":"6379","out_datadb_type":"redis","out_datadb_user":"cgrates","out_stordb_host":"127.0.0.1","out_stordb_name":"cgrates","out_stordb_opts":{},"out_stordb_password":"","out_stordb_port":"3306","out_stordb_type":"mysql","out_stordb_user":"cgrates","users_filters":[]},"radius_agent":{"client_dictionaries":{"*default":"/usr/share/cgrates/radius/dict/"},"client_secrets":{"*default":"CGRateS.org"},"enabled":false,"listen_acct":"127.0.0.1:1813","listen_auth":"127.0.0.1:1812","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"]},"rals":{"balance_rating_subject":{"*any":"*zero1ns","*voice":"*zero1s"},"caches_conns":["*internal"],"dynaprepaid_actionplans":[],"enabled":false,"max_computed_usage":{"*any":"189h0m0s","*data":"107374182400","*mms":"10000","*sms":"10000","*voice":"72h0m0s"},"max_increments":1000000,"remove_expired":true,"rp_subject_prefix_matching":false,"stats_conns":[],"thresholds_conns":[]},"rates":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rate_indexed_selects":true,"rate_nested_fields":false,"rate_prefix_indexed_fields":[],"rate_suffix_indexed_fields":[],"suffix_indexed_fields":[],"verbosity":1000},"resources":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"attributes_conns":[],"default_ratio":1,"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rals_conns":[],"rates_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"rpc_conns":{"*internal":{"conns":[{"TLS":false,"address":"*internal","synchronous":false,"transport":""}],"poolSize":0,"strategy":"*first"},"*localhost":{"conns":[{"TLS":false,"address":"127.0.0.1:2012","synchronous":false,"transport":"*json"}],"poolSize":0,"strategy":"*first"}},"schedulers":{"cdrs_conns":[],"enabled":false,"filters":[],"stats_conns":[],"thresholds_conns":[]},"sessions":{"alterable_fields":[],"attributes_conns":[],"cdrs_conns":[],"channel_sync_interval":"0","chargers_conns":[],"client_protocol":1,"debit_interval":"0","enabled":false,"listen_bijson":"127.0.0.1:2014","min_dur_low_balance":"0","rals_conns":[],"replication_conns":[],"resources_conns":[],"routes_conns":[],"scheduler_conns":[],"session_indexes":[],"session_ttl":"0","stats_conns":[],"stir":{"allowed_attest":["*any"],"default_attest":"A","payload_maxduration":"-1","privatekey_path":"","publickey_path":""},"store_session_costs":false,"terminate_attempts":5,"thresholds_conns":[]},"sip_agent":{"enabled":false,"listen":"127.0.0.1:5060","listen_net":"udp","request_processors":[],"retransmission_timer":1000000000,"sessions_conns":["*internal"],"timezone":""},"stats":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","store_uncompressed_limit":0,"suffix_indexed_fields":[],"thresholds_conns":[]},"stor_db":{"db_host":"127.0.0.1","db_name":"cgrates","db_password":"","db_port":3306,"db_type":"*mysql","db_user":"cgrates","items":{"*cdrs":{"remote":false,"replicate":false},"*session_costs":{"remote":false,"replicate":false},"*tp_account_actions":{"remote":false,"replicate":false},"*tp_account_profiles":{"remote":false,"replicate":false},"*tp_action_plans":{"remote":false,"replicate":false},"*tp_action_profiles":{"remote":false,"replicate":false},"*tp_action_triggers":{"remote":false,"replicate":false},"*tp_actions":{"remote":false,"replicate":false},"*tp_attributes":{"remote":false,"replicate":false},"*tp_chargers":{"remote":false,"replicate":false},"*tp_destination_rates":{"remote":false,"replicate":false},"*tp_destinations":{"remote":false,"replicate":false},"*tp_dispatcher_hosts":{"remote":false,"replicate":false},"*tp_dispatcher_profiles":{"remote":false,"replicate":false},"*tp_filters":{"remote":false,"replicate":false},"*tp_rate_profiles":{"remote":false,"replicate":false},"*tp_rates":{"remote":false,"replicate":false},"*tp_rating_plans":{"remote":false,"replicate":false},"*tp_rating_profiles":{"remote":false,"replicate":false},"*tp_resources":{"remote":false,"replicate":false},"*tp_routes":{"remote":false,"replicate":false},"*tp_shared_groups":{"remote":false,"replicate":false},"*tp_stats":{"remote":false,"replicate":false},"*tp_thresholds":{"remote":false,"replicate":false},"*tp_timings":{"remote":false,"replicate":false},"*versions":{"remote":false,"replicate":false}},"opts":{"conn_max_lifetime":0,"max_idle_conns":10,"max_open_conns":100,"query_timeout":"10s","sslmode":"disable"},"prefix_indexed_fields":[],"remote_conns":null,"replication_conns":null,"string_indexed_fields":[]},"suretax":{"bill_to_number":"","business_unit":"","client_number":"","client_tracking":"~*req.CGRID","customer_number":"~*req.Subject","include_local_cost":false,"orig_number":"~*req.Subject","p2pplus4":"","p2pzipcode":"","plus4":"","regulatory_code":"03","response_group":"03","response_type":"D4","return_file_code":"0","sales_type_code":"R","tax_exemption_code_list":"","tax_included":"0","tax_situs_rule":"04","term_number":"~*req.Destination","timezone":"UTC","trans_type_code":"010101","unit_type":"00","units":"1","url":"","validation_key":"","zipcode":""},"templates":{"*asr":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"}],"*cca":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"path":"*rep.Result-Code","tag":"ResultCode","type":"*constant","value":"2001"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"},{"mandatory":true,"path":"*rep.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"mandatory":true,"path":"*rep.CC-Request-Type","tag":"CCRequestType","type":"*variable","value":"~*req.CC-Request-Type"},{"mandatory":true,"path":"*rep.CC-Request-Number","tag":"CCRequestNumber","type":"*variable","value":"~*req.CC-Request-Number"}],"*err":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"}],"*errSip":[{"mandatory":true,"path":"*rep.Request","tag":"Request","type":"*constant","value":"SIP/2.0 500 Internal Server Error"}],"*rar":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"path":"*diamreq.Re-Auth-Request-Type","tag":"ReAuthRequestType","type":"*constant","value":"0"}]},"thresholds":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[]},"tls":{"ca_certificate":"","client_certificate":"","client_key":"","server_certificate":"","server_key":"","server_name":"","server_policy":4}}` + expected := `{"accounts":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rates_conns":[],"suffix_indexed_fields":[],"thresholds_conns":[]},"actions":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[],"tenants":[]},"analyzers":{"cleanup_interval":"1h0m0s","db_path":"/var/spool/cgrates/analyzers","enabled":false,"index_type":"*scorch","ttl":"24h0m0s"},"apiban":{"enabled":false,"keys":[]},"apiers":{"attributes_conns":[],"caches_conns":["*internal"],"ees_conns":[],"enabled":false,"scheduler_conns":[]},"asterisk_agent":{"asterisk_conns":[{"address":"127.0.0.1:8088","alias":"","connect_attempts":3,"password":"CGRateS.org","reconnects":5,"user":"cgrates"}],"create_cdr":false,"enabled":false,"sessions_conns":["*internal"]},"attributes":{"apiers_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"process_runs":1,"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"caches":{"partitions":{"*account_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*account_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*account_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*apiban":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2m0s"},"*attribute_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*attribute_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*caps_events":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*cdr_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10m0s"},"*cdrs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*closed_sessions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*diameter_messages":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*dispatcher_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_loads":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*event_charges":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*event_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*load_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rate_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rate_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_connections":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_responses":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2s"},"*session_costs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stat_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueue_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueues":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stir":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*threshold_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*threshold_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_account_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_account_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destination_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*uch":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*versions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""}},"replication_conns":[]},"cdrs":{"attributes_conns":[],"chargers_conns":[],"ees_conns":[],"enabled":false,"extra_fields":[],"online_cdr_exports":[],"rals_conns":[],"scheduler_conns":[],"session_cost_retries":5,"stats_conns":[],"store_cdrs":true,"thresholds_conns":[]},"chargers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"configs":{"enabled":false,"root_dir":"/var/spool/cgrates/configs","url":"/configs/"},"cores":{"caps":0,"caps_stats_interval":"0","caps_strategy":"*busy","shutdown_timeout":"1s"},"data_db":{"db_host":"127.0.0.1","db_name":"10","db_password":"","db_port":6379,"db_type":"*redis","db_user":"cgrates","items":{"*account_action_plans":{"remote":false,"replicate":false},"*account_profiles":{"remote":false,"replicate":false},"*accounts":{"remote":false,"replicate":false},"*action_plans":{"remote":false,"replicate":false},"*action_profiles":{"remote":false,"replicate":false},"*action_triggers":{"remote":false,"replicate":false},"*actions":{"remote":false,"replicate":false},"*attribute_profiles":{"remote":false,"replicate":false},"*charger_profiles":{"remote":false,"replicate":false},"*destinations":{"remote":false,"replicate":false},"*dispatcher_hosts":{"remote":false,"replicate":false},"*dispatcher_profiles":{"remote":false,"replicate":false},"*filters":{"remote":false,"replicate":false},"*indexes":{"remote":false,"replicate":false},"*load_ids":{"remote":false,"replicate":false},"*rate_profiles":{"remote":false,"replicate":false},"*rating_plans":{"remote":false,"replicate":false},"*rating_profiles":{"remote":false,"replicate":false},"*resource_profiles":{"remote":false,"replicate":false},"*resources":{"remote":false,"replicate":false},"*reverse_destinations":{"remote":false,"replicate":false},"*route_profiles":{"remote":false,"replicate":false},"*shared_groups":{"remote":false,"replicate":false},"*statqueue_profiles":{"remote":false,"replicate":false},"*statqueues":{"remote":false,"replicate":false},"*threshold_profiles":{"remote":false,"replicate":false},"*thresholds":{"remote":false,"replicate":false},"*timings":{"remote":false,"replicate":false}},"opts":{"query_timeout":"10s","redis_ca_certificate":"","redis_client_certificate":"","redis_client_key":"","redis_cluster":false,"redis_cluster_ondown_delay":"0","redis_cluster_sync":"5s","redis_sentinel":"","redis_tls":false},"remote_conns":[],"replication_conns":[]},"diameter_agent":{"asr_template":"","concurrent_requests":-1,"dictionaries_path":"/usr/share/cgrates/diameter/dict/","enabled":false,"forced_disconnect":"*none","listen":"127.0.0.1:3868","listen_net":"tcp","origin_host":"CGR-DA","origin_realm":"cgrates.org","product_name":"CGRateS","rar_template":"","request_processors":[],"sessions_conns":["*internal"],"synced_conn_requests":false,"vendor_id":0},"dispatcherh":{"dispatchers_conns":[],"enabled":false,"hosts":{},"register_interval":"5m0s"},"dispatchers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"dns_agent":{"enabled":false,"listen":"127.0.0.1:2053","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"],"timezone":""},"ees":{"attributes_conns":[],"cache":{"*file_csv":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"export_path":"/var/spool/cgrates/ees","field_separator":",","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"tenant":"","timezone":"","type":"*none"}]},"ers":{"enabled":false,"readers":[{"cache_dump_fields":[],"concurrent_requests":1024,"failed_calls_prefix":"","field_separator":",","fields":[{"mandatory":true,"path":"*cgreq.ToR","tag":"ToR","type":"*variable","value":"~*req.2"},{"mandatory":true,"path":"*cgreq.OriginID","tag":"OriginID","type":"*variable","value":"~*req.3"},{"mandatory":true,"path":"*cgreq.RequestType","tag":"RequestType","type":"*variable","value":"~*req.4"},{"mandatory":true,"path":"*cgreq.Tenant","tag":"Tenant","type":"*variable","value":"~*req.6"},{"mandatory":true,"path":"*cgreq.Category","tag":"Category","type":"*variable","value":"~*req.7"},{"mandatory":true,"path":"*cgreq.Account","tag":"Account","type":"*variable","value":"~*req.8"},{"mandatory":true,"path":"*cgreq.Subject","tag":"Subject","type":"*variable","value":"~*req.9"},{"mandatory":true,"path":"*cgreq.Destination","tag":"Destination","type":"*variable","value":"~*req.10"},{"mandatory":true,"path":"*cgreq.SetupTime","tag":"SetupTime","type":"*variable","value":"~*req.11"},{"mandatory":true,"path":"*cgreq.AnswerTime","tag":"AnswerTime","type":"*variable","value":"~*req.12"},{"mandatory":true,"path":"*cgreq.Usage","tag":"Usage","type":"*variable","value":"~*req.13"}],"filters":[],"flags":[],"header_define_character":":","id":"*default","opts":{},"partial_cache_expiry_action":"","partial_record_cache":"0","processed_path":"/var/spool/cgrates/ers/out","row_length":0,"run_delay":"0","source_path":"/var/spool/cgrates/ers/in","tenant":"","timezone":"","type":"*none","xml_root_path":[""]}],"sessions_conns":["*internal"]},"filters":{"apiers_conns":[],"resources_conns":[],"stats_conns":[]},"freeswitch_agent":{"create_cdr":false,"empty_balance_ann_file":"","empty_balance_context":"","enabled":false,"event_socket_conns":[{"address":"127.0.0.1:8021","alias":"127.0.0.1:8021","password":"ClueCon","reconnects":5}],"extra_fields":"","low_balance_ann_file":"","max_wait_connection":"2s","sessions_conns":["*internal"],"subscribe_park":true},"general":{"connect_attempts":5,"connect_timeout":"1s","dbdata_encoding":"*msgpack","default_caching":"*reload","default_category":"call","default_request_type":"*rated","default_tenant":"cgrates.org","default_timezone":"Local","digest_equal":":","digest_separator":",","failed_posts_dir":"/var/spool/cgrates/failed_posts","failed_posts_ttl":"5s","locking_timeout":"0","log_level":6,"logger":"*syslog","max_call_duration":"3h0m0s","max_parallel_conns":100,"min_call_duration":"0","node_id":"ENGINE1","poster_attempts":3,"reconnects":-1,"reply_timeout":"2s","rounding_decimals":5,"rsr_separator":";","tpexport_dir":"/var/spool/cgrates/tpe"},"http":{"auth_users":{},"client_opts":{"dialFallbackDelay":"300ms","dialKeepAlive":"30s","dialTimeout":"30s","disableCompression":false,"disableKeepAlives":false,"expectContinueTimeout":"0","forceAttemptHttp2":true,"idleConnTimeout":"90s","maxConnsPerHost":0,"maxIdleConns":100,"maxIdleConnsPerHost":2,"responseHeaderTimeout":"0","skipTlsVerify":false,"tlsHandshakeTimeout":"10s"},"dispatchers_registrar_url":"/dispatchers_registrar","freeswitch_cdrs_url":"/freeswitch_json","http_cdrs":"/cdr_http","json_rpc_url":"/jsonrpc","use_basic_auth":false,"ws_url":"/ws"},"http_agent":[],"kamailio_agent":{"create_cdr":false,"enabled":false,"evapi_conns":[{"address":"127.0.0.1:8448","alias":"","reconnects":5}],"sessions_conns":["*internal"],"timezone":""},"listen":{"http":"127.0.0.1:2080","http_tls":"127.0.0.1:2280","rpc_gob":"127.0.0.1:2013","rpc_gob_tls":"127.0.0.1:2023","rpc_json":"127.0.0.1:2012","rpc_json_tls":"127.0.0.1:2022"},"loader":{"caches_conns":["*localhost"],"data_path":"./","disable_reverse":false,"field_separator":",","gapi_credentials":".gapi/credentials.json","gapi_token":".gapi/token.json","scheduler_conns":["*localhost"],"tpid":""},"loaders":[{"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.6"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.7"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.10"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Values","tag":"Values","type":"*variable","value":"~*req.4"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.5"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.9"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.10"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.6"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"MetricFilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.11"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.8"},{"path":"ActionIDs","tag":"ActionIDs","type":"*variable","value":"~*req.9"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"path":"RouteID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"RouteFilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"RouteAccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"RouteRatingPlanIDs","tag":"RouteRatingPlanIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeight","tag":"RouteWeight","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.5"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.6"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.7"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.9"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.10"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.11"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.12"}],"file_name":"DispatcherProfiles.csv","flags":null,"type":"*dispatchers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Address","tag":"Address","type":"*variable","value":"~*req.2"},{"path":"Transport","tag":"Transport","type":"*variable","value":"~*req.3"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.4"}],"file_name":"DispatcherHosts.csv","flags":null,"type":"*dispatcher_hosts"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.5"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.6"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.7"},{"path":"RateID","tag":"RateID","type":"*variable","value":"~*req.8"},{"path":"RateFilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.9"},{"path":"RateActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.10"},{"path":"RateWeight","tag":"RateWeight","type":"*variable","value":"~*req.11"},{"path":"RateBlocker","tag":"RateBlocker","type":"*variable","value":"~*req.12"},{"path":"RateIntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.13"},{"path":"RateFixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.14"},{"path":"RateRecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.15"},{"path":"RateUnit","tag":"RateUnit","type":"*variable","value":"~*req.16"},{"path":"RateIncrement","tag":"RateIncrement","type":"*variable","value":"~*req.17"}],"file_name":"RateProfiles.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"TargetType","tag":"TargetType","type":"*variable","value":"~*req.6"},{"path":"TargetIDs","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"path":"ActionID","tag":"ActionID","type":"*variable","value":"~*req.8"},{"path":"ActionFilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"path":"ActionBlocker","tag":"ActionBlocker","type":"*variable","value":"~*req.10"},{"path":"ActionTTL","tag":"ActionTTL","type":"*variable","value":"~*req.11"},{"path":"ActionType","tag":"ActionType","type":"*variable","value":"~*req.12"},{"path":"ActionOpts","tag":"ActionOpts","type":"*variable","value":"~*req.13"},{"path":"ActionPath","tag":"ActionPath","type":"*variable","value":"~*req.14"},{"path":"ActionValue","tag":"ActionValue","type":"*variable","value":"~*req.15"}],"file_name":"ActionProfiles.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.4"},{"path":"BalanceID","tag":"BalanceID","type":"*variable","value":"~*req.5"},{"path":"BalanceFilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"path":"BalanceWeight","tag":"BalanceWeight","type":"*variable","value":"~*req.7"},{"path":"BalanceBlocker","tag":"BalanceBlocker","type":"*variable","value":"~*req.8"},{"path":"BalanceType","tag":"BalanceType","type":"*variable","value":"~*req.9"},{"path":"BalanceOpts","tag":"BalanceOpts","type":"*variable","value":"~*req.10"},{"path":"BalanceCostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.11"},{"path":"BalanceCostAttributes","tag":"BalanceCostAttributes","type":"*variable","value":"~*req.12"},{"path":"BalanceUnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.13"},{"path":"BalanceUnits","tag":"BalanceUnits","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"AccountProfiles.csv","flags":null,"type":"*account_profiles"}],"dry_run":false,"enabled":false,"field_separator":",","id":"*default","lock_filename":".cgr.lck","run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}],"mailer":{"auth_password":"CGRateS.org","auth_user":"cgrates","from_address":"cgr-mailer@localhost.localdomain","server":"localhost"},"migrator":{"out_datadb_encoding":"msgpack","out_datadb_host":"127.0.0.1","out_datadb_name":"10","out_datadb_opts":{"redis_ca_certificate":"","redis_client_certificate":"","redis_client_key":"","redis_cluster":false,"redis_cluster_ondown_delay":"0","redis_cluster_sync":"5s","redis_sentinel":"","redis_tls":false},"out_datadb_password":"","out_datadb_port":"6379","out_datadb_type":"redis","out_datadb_user":"cgrates","out_stordb_host":"127.0.0.1","out_stordb_name":"cgrates","out_stordb_opts":{},"out_stordb_password":"","out_stordb_port":"3306","out_stordb_type":"mysql","out_stordb_user":"cgrates","users_filters":[]},"radius_agent":{"client_dictionaries":{"*default":"/usr/share/cgrates/radius/dict/"},"client_secrets":{"*default":"CGRateS.org"},"enabled":false,"listen_acct":"127.0.0.1:1813","listen_auth":"127.0.0.1:1812","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"]},"rals":{"balance_rating_subject":{"*any":"*zero1ns","*voice":"*zero1s"},"caches_conns":["*internal"],"dynaprepaid_actionplans":[],"enabled":false,"max_computed_usage":{"*any":"189h0m0s","*data":"107374182400","*mms":"10000","*sms":"10000","*voice":"72h0m0s"},"max_increments":1000000,"remove_expired":true,"rp_subject_prefix_matching":false,"stats_conns":[],"thresholds_conns":[]},"rates":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rate_indexed_selects":true,"rate_nested_fields":false,"rate_prefix_indexed_fields":[],"rate_suffix_indexed_fields":[],"suffix_indexed_fields":[],"verbosity":1000},"resources":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"attributes_conns":[],"default_ratio":1,"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rals_conns":[],"rates_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"rpc_conns":{"*internal":{"conns":[{"TLS":false,"address":"*internal","synchronous":false,"transport":""}],"poolSize":0,"strategy":"*first"},"*localhost":{"conns":[{"TLS":false,"address":"127.0.0.1:2012","synchronous":false,"transport":"*json"}],"poolSize":0,"strategy":"*first"}},"schedulers":{"cdrs_conns":[],"enabled":false,"filters":[],"stats_conns":[],"thresholds_conns":[]},"sessions":{"alterable_fields":[],"attributes_conns":[],"cdrs_conns":[],"channel_sync_interval":"0","chargers_conns":[],"client_protocol":1,"debit_interval":"0","enabled":false,"listen_bijson":"127.0.0.1:2014","min_dur_low_balance":"0","rals_conns":[],"replication_conns":[],"resources_conns":[],"routes_conns":[],"scheduler_conns":[],"session_indexes":[],"session_ttl":"0","stats_conns":[],"stir":{"allowed_attest":["*any"],"default_attest":"A","payload_maxduration":"-1","privatekey_path":"","publickey_path":""},"store_session_costs":false,"terminate_attempts":5,"thresholds_conns":[]},"sip_agent":{"enabled":false,"listen":"127.0.0.1:5060","listen_net":"udp","request_processors":[],"retransmission_timer":1000000000,"sessions_conns":["*internal"],"timezone":""},"stats":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","store_uncompressed_limit":0,"suffix_indexed_fields":[],"thresholds_conns":[]},"stor_db":{"db_host":"127.0.0.1","db_name":"cgrates","db_password":"","db_port":3306,"db_type":"*mysql","db_user":"cgrates","items":{"*cdrs":{"remote":false,"replicate":false},"*session_costs":{"remote":false,"replicate":false},"*tp_account_actions":{"remote":false,"replicate":false},"*tp_account_profiles":{"remote":false,"replicate":false},"*tp_action_plans":{"remote":false,"replicate":false},"*tp_action_profiles":{"remote":false,"replicate":false},"*tp_action_triggers":{"remote":false,"replicate":false},"*tp_actions":{"remote":false,"replicate":false},"*tp_attributes":{"remote":false,"replicate":false},"*tp_chargers":{"remote":false,"replicate":false},"*tp_destination_rates":{"remote":false,"replicate":false},"*tp_destinations":{"remote":false,"replicate":false},"*tp_dispatcher_hosts":{"remote":false,"replicate":false},"*tp_dispatcher_profiles":{"remote":false,"replicate":false},"*tp_filters":{"remote":false,"replicate":false},"*tp_rate_profiles":{"remote":false,"replicate":false},"*tp_rates":{"remote":false,"replicate":false},"*tp_rating_plans":{"remote":false,"replicate":false},"*tp_rating_profiles":{"remote":false,"replicate":false},"*tp_resources":{"remote":false,"replicate":false},"*tp_routes":{"remote":false,"replicate":false},"*tp_shared_groups":{"remote":false,"replicate":false},"*tp_stats":{"remote":false,"replicate":false},"*tp_thresholds":{"remote":false,"replicate":false},"*tp_timings":{"remote":false,"replicate":false},"*versions":{"remote":false,"replicate":false}},"opts":{"conn_max_lifetime":0,"max_idle_conns":10,"max_open_conns":100,"query_timeout":"10s","sslmode":"disable"},"prefix_indexed_fields":[],"remote_conns":null,"replication_conns":null,"string_indexed_fields":[]},"suretax":{"bill_to_number":"","business_unit":"","client_number":"","client_tracking":"~*req.CGRID","customer_number":"~*req.Subject","include_local_cost":false,"orig_number":"~*req.Subject","p2pplus4":"","p2pzipcode":"","plus4":"","regulatory_code":"03","response_group":"03","response_type":"D4","return_file_code":"0","sales_type_code":"R","tax_exemption_code_list":"","tax_included":"0","tax_situs_rule":"04","term_number":"~*req.Destination","timezone":"UTC","trans_type_code":"010101","unit_type":"00","units":"1","url":"","validation_key":"","zipcode":""},"templates":{"*asr":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"}],"*cca":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"path":"*rep.Result-Code","tag":"ResultCode","type":"*constant","value":"2001"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"},{"mandatory":true,"path":"*rep.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"mandatory":true,"path":"*rep.CC-Request-Type","tag":"CCRequestType","type":"*variable","value":"~*req.CC-Request-Type"},{"mandatory":true,"path":"*rep.CC-Request-Number","tag":"CCRequestNumber","type":"*variable","value":"~*req.CC-Request-Number"}],"*err":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"}],"*errSip":[{"mandatory":true,"path":"*rep.Request","tag":"Request","type":"*constant","value":"SIP/2.0 500 Internal Server Error"}],"*rar":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"path":"*diamreq.Re-Auth-Request-Type","tag":"ReAuthRequestType","type":"*constant","value":"0"}]},"thresholds":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[]},"tls":{"ca_certificate":"","client_certificate":"","client_key":"","server_certificate":"","server_key":"","server_name":"","server_policy":4}}` cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSON) if err != nil { t.Fatal(err) diff --git a/data/storage/mysql/create_tariffplan_tables.sql b/data/storage/mysql/create_tariffplan_tables.sql index 7b2622fa1..d0dfe6d15 100644 --- a/data/storage/mysql/create_tariffplan_tables.sql +++ b/data/storage/mysql/create_tariffplan_tables.sql @@ -483,8 +483,6 @@ CREATE TABLE tp_rate_profiles ( `filter_ids` varchar(64) NOT NULL, `activation_interval` varchar(64) NOT NULL, `weight` decimal(8,2) NOT NULL, - `rounding_method` varchar(64) NOT NULL, - `rounding_decimals` tinyint(4) NOT NULL, `min_cost` decimal(8,4) NOT NULL, `max_cost` decimal(8,4) NOT NULL, `max_cost_strategy` varchar(64) NOT NULL, diff --git a/data/storage/postgres/create_tariffplan_tables.sql b/data/storage/postgres/create_tariffplan_tables.sql index c344e9a63..1d8e1ade0 100644 --- a/data/storage/postgres/create_tariffplan_tables.sql +++ b/data/storage/postgres/create_tariffplan_tables.sql @@ -469,8 +469,6 @@ CREATE INDEX tp_routes_unique ON tp_routes ("tpid", "tenant", "id", "filter_ids" varchar(64) NOT NULL, "activation_interval" varchar(64) NOT NULL, "weight" decimal(8,2) NOT NULL, - "rounding_method" varchar(64) NOT NULL, - "rounding_decimals" SMALLINT NOT NULL, "min_cost" decimal(8,4) NOT NULL, "max_cost" decimal(8,4) NOT NULL, "max_cost_strategy" VARCHAR(64) NOT NULL, diff --git a/data/tariffplans/routes_with_rates/RateProfiles.csv b/data/tariffplans/routes_with_rates/RateProfiles.csv index bceddb684..fe4288ea3 100644 --- a/data/tariffplans/routes_with_rates/RateProfiles.csv +++ b/data/tariffplans/routes_with_rates/RateProfiles.csv @@ -1,8 +1,8 @@ -#Tenant,ID,FilterIDs,ActivationInterval,Weight,RoundingMethod,RoundingDecimals,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement -cgrates.org,RT_SPECIAL_1002,,,0,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.01,1m,1s -cgrates.org,RT_RETAIL1,,,0,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.4,1m,30s -cgrates.org,RT_RETAIL1,,,,,,,,,RT_ALWAYS,,"* * * * *",0,false,1m,,0.2,1m,10s -cgrates.org,RT_ANY2CNT_SEC,,,0,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.02,1s,1s -cgrates.org,RT_ANY1CNT_SEC,,,0,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.01,1s,1s -cgrates.org,RT_DEFAULT,,,20,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.10,1m,10s +#Tenant,ID,FilterIDs,ActivationInterval,Weight,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement +cgrates.org,RT_SPECIAL_1002,,,0,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.01,1m,1s +cgrates.org,RT_RETAIL1,,,0,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.4,1m,30s +cgrates.org,RT_RETAIL1,,,,,,,RT_ALWAYS,,"* * * * *",0,false,1m,,0.2,1m,10s +cgrates.org,RT_ANY2CNT_SEC,,,0,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.02,1s,1s +cgrates.org,RT_ANY1CNT_SEC,,,0,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.01,1s,1s +cgrates.org,RT_DEFAULT,,,20,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.10,1m,10s diff --git a/data/tariffplans/testit/RateProfiles.csv b/data/tariffplans/testit/RateProfiles.csv index c1e20b2e0..01d02e0d7 100644 --- a/data/tariffplans/testit/RateProfiles.csv +++ b/data/tariffplans/testit/RateProfiles.csv @@ -1,5 +1,5 @@ -#Tenant,ID,FilterIDs,ActivationInterval,Weight,RoundingMethod,RoundingDecimals,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement -cgrates.org,RT_SPECIAL_1002,*string:~*req.Account:1002,,10,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.01,1m,1s -cgrates.org,RT_RETAIL1,,,0,*up,4,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.4,1m,30s -cgrates.org,RT_RETAIL1,,,,,,,,,RT_ALWAYS,,"* * * * *",0,false,1m,,0.2,1m,10s +#Tenant,ID,FilterIDs,ActivationInterval,Weight,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement +cgrates.org,RT_SPECIAL_1002,*string:~*req.Account:1002,,10,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.01,1m,1s +cgrates.org,RT_RETAIL1,,,0,0,0,*free,RT_ALWAYS,,"* * * * *",0,false,0s,,0.4,1m,30s +cgrates.org,RT_RETAIL1,,,,,,,RT_ALWAYS,,"* * * * *",0,false,1m,,0.2,1m,10s diff --git a/data/tariffplans/tutrates/RateProfiles.csv b/data/tariffplans/tutrates/RateProfiles.csv index 5ca21df88..67eb4bbaa 100644 --- a/data/tariffplans/tutrates/RateProfiles.csv +++ b/data/tariffplans/tutrates/RateProfiles.csv @@ -1,5 +1,5 @@ -#Tenant,ID,FilterIDs,ActivationInterval,Weight,RoundingMethod,RoundingDecimals,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement -cgrates.org,RP1,*string:~*req.Subject:1001,,0,*up,4,0.1,0.6,*free,RT_WEEK,,"* * * * 1-5",0,false,0s,,0.12,1m,1m -cgrates.org,RP1,,,,,,,,,RT_WEEK,,,,,1m,,0.6,1m,1s -cgrates.org,RP1,,,,,,,,,RT_WEEKEND,,"* * * * 0,6",10,false,0s,,0.06,1m,1s -cgrates.org,RP1,,,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,,0.06,1m,1s \ No newline at end of file +#Tenant,ID,FilterIDs,ActivationInterval,Weight,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement +cgrates.org,RP1,*string:~*req.Subject:1001,,0,0.1,0.6,*free,RT_WEEK,,"* * * * 1-5",0,false,0s,,0.12,1m,1m +cgrates.org,RP1,,,,,,,RT_WEEK,,,,,1m,,0.6,1m,1s +cgrates.org,RP1,,,,,,,RT_WEEKEND,,"* * * * 0,6",10,false,0s,,0.06,1m,1s +cgrates.org,RP1,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,,0.06,1m,1s \ No newline at end of file diff --git a/engine/libtest.go b/engine/libtest.go index 95d41be61..9b05dc51f 100644 --- a/engine/libtest.go +++ b/engine/libtest.go @@ -282,11 +282,11 @@ cgrates.org,D1,,,,*first,,C2,*lt:~*req.Usage:10,10,false,192.168.56.204, cgrates.org,ALL1,127.0.0.1:2012,*json,true ` RateProfileCSVContent = ` -#Tenant,ID,FilterIDs,ActivationInterval,Weight,RoundingMethod,RoundingDecimals,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement -cgrates.org,RP1,*string:~*req.Subject:1001,,0,*up,4,0.1,0.6,*free,RT_WEEK,,"* * * * 1-5",0,false,0s,0,0.12,1m,1m -cgrates.org,RP1,,,,,,,,,RT_WEEK,,,,,1m,1.234,0.06,1m,1s -cgrates.org,RP1,,,,,,,,,RT_WEEKEND,,"* * * * 0,6",10,false,0s,0.089,0.06,1m,1s -cgrates.org,RP1,,,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,0.0564,0.06,1m,1s +#Tenant,ID,FilterIDs,ActivationInterval,Weight,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationStart,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement +cgrates.org,RP1,*string:~*req.Subject:1001,,0,0.1,0.6,*free,RT_WEEK,,"* * * * 1-5",0,false,0s,0,0.12,1m,1m +cgrates.org,RP1,,,,,,,RT_WEEK,,,,,1m,1.234,0.06,1m,1s +cgrates.org,RP1,,,,,,,RT_WEEKEND,,"* * * * 0,6",10,false,0s,0.089,0.06,1m,1s +cgrates.org,RP1,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,0.0564,0.06,1m,1s ` ActionProfileCSVContent = ` #Tenant,ID,FilterIDs,ActivationInterval,Weight,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionBlocker,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue diff --git a/engine/loader_csv_test.go b/engine/loader_csv_test.go index cbcea1a6b..6a4f26260 100644 --- a/engine/loader_csv_test.go +++ b/engine/loader_csv_test.go @@ -1407,16 +1407,14 @@ func TestLoadDispatcherProfiles(t *testing.T) { func TestLoadRateProfiles(t *testing.T) { eRatePrf := &utils.TPRateProfile{ - TPid: testTPID, - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + TPid: testTPID, + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "RT_WEEK": { ID: "RT_WEEK", diff --git a/engine/model_helpers.go b/engine/model_helpers.go index d5c0e9137..94199ad97 100644 --- a/engine/model_helpers.go +++ b/engine/model_helpers.go @@ -2902,8 +2902,8 @@ type RateProfileMdls []*RateProfileMdl // CSVHeader return the header for csv fields as a slice of string func (tps RateProfileMdls) CSVHeader() (result []string) { return []string{"#" + utils.Tenant, utils.ID, utils.FilterIDs, - utils.ActivationIntervalString, utils.Weight, utils.ConnectFee, utils.RoundingMethod, - utils.RoundingDecimals, utils.MinCost, utils.MaxCost, utils.MaxCostStrategy, utils.RateID, + utils.ActivationIntervalString, utils.Weight, utils.ConnectFee, utils.MinCost, + utils.MaxCost, utils.MaxCostStrategy, utils.RateID, utils.RateFilterIDs, utils.RateActivationStart, utils.RateWeight, utils.RateBlocker, utils.RateIntervalStart, utils.RateFixedFee, utils.RateRecurrentFee, utils.RateUnit, utils.RateIncrement, } @@ -2969,12 +2969,6 @@ func (tps RateProfileMdls) AsTPRateProfile() (result []*utils.TPRateProfile) { if tp.Weight != 0 { rPrf.Weight = tp.Weight } - if tp.RoundingMethod != utils.EmptyString { - rPrf.RoundingMethod = tp.RoundingMethod - } - if tp.RoundingDecimals != 0 { - rPrf.RoundingDecimals = tp.RoundingDecimals - } if tp.MinCost != 0 { rPrf.MinCost = tp.MinCost } @@ -3042,8 +3036,6 @@ func APItoModelTPRateProfile(tPrf *utils.TPRateProfile) (mdls RateProfileMdls) { } } mdl.Weight = tPrf.Weight - mdl.RoundingMethod = tPrf.RoundingMethod - mdl.RoundingDecimals = tPrf.RoundingDecimals mdl.MinCost = tPrf.MinCost mdl.MaxCost = tPrf.MaxCost mdl.MaxCostStrategy = tPrf.MaxCostStrategy @@ -3076,16 +3068,14 @@ func APItoModelTPRateProfile(tPrf *utils.TPRateProfile) (mdls RateProfileMdls) { func APItoRateProfile(tpRp *utils.TPRateProfile, timezone string) (rp *RateProfile, err error) { rp = &RateProfile{ - Tenant: tpRp.Tenant, - ID: tpRp.ID, - FilterIDs: make([]string, len(tpRp.FilterIDs)), - Weight: tpRp.Weight, - RoundingMethod: tpRp.RoundingMethod, - RoundingDecimals: tpRp.RoundingDecimals, - MaxCostStrategy: tpRp.MaxCostStrategy, - Rates: make(map[string]*Rate), - MinCost: utils.NewDecimalFromFloat64(tpRp.MinCost), - MaxCost: utils.NewDecimalFromFloat64(tpRp.MaxCost), + Tenant: tpRp.Tenant, + ID: tpRp.ID, + FilterIDs: make([]string, len(tpRp.FilterIDs)), + Weight: tpRp.Weight, + MaxCostStrategy: tpRp.MaxCostStrategy, + Rates: make(map[string]*Rate), + MinCost: utils.NewDecimalFromFloat64(tpRp.MinCost), + MaxCost: utils.NewDecimalFromFloat64(tpRp.MaxCost), } for i, stp := range tpRp.FilterIDs { rp.FilterIDs[i] = stp @@ -3129,8 +3119,6 @@ func RateProfileToAPI(rp *RateProfile) (tpRp *utils.TPRateProfile, err error) { FilterIDs: make([]string, len(rp.FilterIDs)), ActivationInterval: new(utils.TPActivationInterval), Weight: rp.Weight, - RoundingMethod: rp.RoundingMethod, - RoundingDecimals: rp.RoundingDecimals, MaxCostStrategy: rp.MaxCostStrategy, Rates: make(map[string]*utils.TPRate), } diff --git a/engine/model_helpers_test.go b/engine/model_helpers_test.go index 787368fa9..f2205d5e5 100644 --- a/engine/model_helpers_test.go +++ b/engine/model_helpers_test.go @@ -4301,15 +4301,13 @@ func TestRateProfileToAPI(t *testing.T) { t.Error(err) } rPrf := &RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", Rates: map[string]*Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -4368,11 +4366,9 @@ func TestRateProfileToAPI(t *testing.T) { ActivationTime: "", ExpiryTime: "", }, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "RT_WEEK": { ID: "RT_WEEK", @@ -4439,15 +4435,13 @@ func TestAPIToRateProfile(t *testing.T) { t.Error(err) } eRprf := &RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", Rates: map[string]*Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -4501,16 +4495,14 @@ func TestAPIToRateProfile(t *testing.T) { }, } tpRprf := &utils.TPRateProfile{ - TPid: "", - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + TPid: "", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "RT_WEEK": { ID: "RT_WEEK", @@ -4569,16 +4561,14 @@ func TestAPIToRateProfile(t *testing.T) { func TestAPItoModelTPRateProfile(t *testing.T) { tpRprf := &utils.TPRateProfile{ - TPid: "", - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + TPid: "", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "RT_WEEK": { ID: "RT_WEEK", @@ -4611,8 +4601,6 @@ func TestAPItoModelTPRateProfile(t *testing.T) { FilterIDs: "*string:~*req.Subject:1001", ActivationInterval: "", Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, MinCost: 0.1, MaxCost: 0.6, MaxCostStrategy: "*free", @@ -4635,8 +4623,6 @@ func TestAPItoModelTPRateProfile(t *testing.T) { FilterIDs: "", ActivationInterval: "", Weight: 0, - RoundingMethod: "", - RoundingDecimals: 0, MinCost: 0, MaxCost: 0, MaxCostStrategy: "", @@ -4661,8 +4647,6 @@ func TestAPItoModelTPRateProfile(t *testing.T) { FilterIDs: "*string:~*req.Subject:1001", ActivationInterval: "", Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, MinCost: 0.1, MaxCost: 0.6, MaxCostStrategy: "*free", @@ -4685,8 +4669,6 @@ func TestAPItoModelTPRateProfile(t *testing.T) { FilterIDs: "", ActivationInterval: "", Weight: 0, - RoundingMethod: "", - RoundingDecimals: 0, MinCost: 0, MaxCost: 0, MaxCostStrategy: "", @@ -4718,8 +4700,6 @@ func TestAsTPRateProfile(t *testing.T) { FilterIDs: "*string:~*req.Subject:1001", ActivationInterval: "", Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, MinCost: 0.1, MaxCost: 0.6, MaxCostStrategy: "*free", @@ -4742,8 +4722,6 @@ func TestAsTPRateProfile(t *testing.T) { FilterIDs: "", ActivationInterval: "", Weight: 0, - RoundingMethod: "", - RoundingDecimals: 0, MinCost: 0, MaxCost: 0, MaxCostStrategy: "", @@ -4761,16 +4739,14 @@ func TestAsTPRateProfile(t *testing.T) { } eRprf := &utils.TPRateProfile{ - TPid: utils.EmptyString, - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + TPid: utils.EmptyString, + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "RT_WEEK": { ID: "RT_WEEK", @@ -5060,13 +5036,11 @@ func TestRateProfileToAPIWithActInterval(t *testing.T) { ExpiryTime: time.Date(2020, time.April, 12, 21, 34, 01, 0, time.UTC), }, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", - Rates: map[string]*Rate{}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", + Rates: map[string]*Rate{}, } expStruct := &utils.TPRateProfile{ @@ -5077,13 +5051,11 @@ func TestRateProfileToAPIWithActInterval(t *testing.T) { ActivationTime: "2020-04-11T21:34:01Z", ExpiryTime: "2020-04-12T21:34:01Z", }, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", - Rates: map[string]*utils.TPRate{}, + Weight: 0, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", + Rates: map[string]*utils.TPRate{}, } if result, err := RateProfileToAPI(testProfile); err != nil { t.Error(err) @@ -5147,8 +5119,8 @@ func TestRateProfileMdlsCSVHeader(t *testing.T) { testRPMdls := RateProfileMdls{} result := testRPMdls.CSVHeader() expected := []string{"#" + utils.Tenant, utils.ID, utils.FilterIDs, - utils.ActivationIntervalString, utils.Weight, utils.ConnectFee, utils.RoundingMethod, - utils.RoundingDecimals, utils.MinCost, utils.MaxCost, utils.MaxCostStrategy, utils.RateID, + utils.ActivationIntervalString, utils.Weight, utils.ConnectFee, utils.MinCost, + utils.MaxCost, utils.MaxCostStrategy, utils.RateID, utils.RateFilterIDs, utils.RateActivationStart, utils.RateWeight, utils.RateBlocker, utils.RateIntervalStart, utils.RateFixedFee, utils.RateRecurrentFee, utils.RateUnit, utils.RateIncrement} if !reflect.DeepEqual(result, expected) { @@ -5375,8 +5347,6 @@ func TestRateProfileMdlsAsTPRateProfileCase2(t *testing.T) { FilterIDs: "*string:~*req.Subject:1001", ActivationInterval: "2014-07-29T15:00:00Z;2014-08-29T15:00:00Z", Weight: 1.2, - RoundingMethod: "*up", - RoundingDecimals: 4, MinCost: 0.1, MaxCost: 0.6, MaxCostStrategy: "*free", @@ -5394,12 +5364,10 @@ func TestRateProfileMdlsAsTPRateProfileCase2(t *testing.T) { ActivationTime: "2014-07-29T15:00:00Z", ExpiryTime: "2014-08-29T15:00:00Z", }, - Weight: 1.2, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + Weight: 1.2, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "0": { ID: "0", @@ -5433,8 +5401,6 @@ func TestRateProfileMdlsAsTPRateProfileCase3(t *testing.T) { FilterIDs: "*string:~*req.Subject:1001", ActivationInterval: "2014-07-29T15:00:00Z", Weight: 1.2, - RoundingMethod: "*up", - RoundingDecimals: 4, MinCost: 0.1, MaxCost: 0.6, MaxCostStrategy: "*free", @@ -5451,12 +5417,10 @@ func TestRateProfileMdlsAsTPRateProfileCase3(t *testing.T) { ActivationInterval: &utils.TPActivationInterval{ ActivationTime: "2014-07-29T15:00:00Z", }, - Weight: 1.2, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + Weight: 1.2, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "0": { ID: "0", diff --git a/engine/models.go b/engine/models.go index ed9bfd206..835fbeff9 100644 --- a/engine/models.go +++ b/engine/models.go @@ -519,21 +519,19 @@ type RateProfileMdl struct { FilterIDs string `index:"2" re:""` ActivationInterval string `index:"3" re:""` Weight float64 `index:"4" re:"\d+\.?\d*"` - RoundingMethod string `index:"5" re:""` - RoundingDecimals int `index:"6" re:""` - MinCost float64 `index:"7" re:"\d+\.?\d*""` - MaxCost float64 `index:"8" re:"\d+\.?\d*"` - MaxCostStrategy string `index:"9" re:""` - RateID string `index:"10" re:""` - RateFilterIDs string `index:"11" re:""` - RateActivationTimes string `index:"12" re:""` - RateWeight float64 `index:"13" re:"\d+\.?\d*"` - RateBlocker bool `index:"14" re:""` - RateIntervalStart string `index:"15" re:""` - RateFixedFee float64 `index:"16" re:"\d+\.?\d*"` - RateRecurrentFee float64 `index:"17" re:"\d+\.?\d*"` - RateUnit string `index:"18" re:""` - RateIncrement string `index:"19" re:""` + MinCost float64 `index:"5" re:"\d+\.?\d*""` + MaxCost float64 `index:"6" re:"\d+\.?\d*"` + MaxCostStrategy string `index:"7" re:""` + RateID string `index:"8" re:""` + RateFilterIDs string `index:"9" re:""` + RateActivationTimes string `index:"10" re:""` + RateWeight float64 `index:"11" re:"\d+\.?\d*"` + RateBlocker bool `index:"12" re:""` + RateIntervalStart string `index:"13" re:""` + RateFixedFee float64 `index:"14" re:"\d+\.?\d*"` + RateRecurrentFee float64 `index:"15" re:"\d+\.?\d*"` + RateUnit string `index:"16" re:""` + RateIncrement string `index:"17" re:""` CreatedAt time.Time } diff --git a/engine/rateprofile.go b/engine/rateprofile.go index eb129eda1..f57d68c12 100644 --- a/engine/rateprofile.go +++ b/engine/rateprofile.go @@ -36,8 +36,6 @@ type RateProfile struct { FilterIDs []string ActivationInterval *utils.ActivationInterval Weight float64 - RoundingDecimals int - RoundingMethod string MinCost *utils.Decimal MaxCost *utils.Decimal MaxCostStrategy string @@ -270,8 +268,6 @@ func (ext *APIRateProfile) AsRateProfile() (rp *RateProfile, err error) { FilterIDs: ext.FilterIDs, ActivationInterval: ext.ActivationInterval, Weight: ext.Weight, - RoundingDecimals: ext.RoundingDecimals, - RoundingMethod: ext.RoundingMethod, MaxCostStrategy: ext.MaxCostStrategy, } if ext.MinCost != nil { @@ -300,8 +296,6 @@ type APIRateProfile struct { FilterIDs []string ActivationInterval *utils.ActivationInterval Weight float64 - RoundingDecimals int - RoundingMethod string MinCost *float64 MaxCost *float64 MaxCostStrategy string diff --git a/engine/rateprofile_test.go b/engine/rateprofile_test.go index e6e4300b9..7612ab48f 100644 --- a/engine/rateprofile_test.go +++ b/engine/rateprofile_test.go @@ -687,9 +687,6 @@ func TestRateProfileCostCorrectCost(t *testing.T) { if rPrfCost.Cost != 0.24 { t.Errorf("Expected: %+v, received: %+v", 0.24, rPrfCost.Cost) } - if rPrfCost.RoundingDecimals != 2 { - t.Errorf("Expected: %+v, received: %+v", 2, rPrfCost.Cost) - } if !reflect.DeepEqual(rPrfCost.Altered, []string{utils.RoundingDecimals}) { t.Errorf("Expected: %+v, received: %+v", []string{utils.RoundingDecimals}, rPrfCost.Altered) } diff --git a/engine/z_filterindexer_it_test.go b/engine/z_filterindexer_it_test.go index 282df667b..4488606ff 100644 --- a/engine/z_filterindexer_it_test.go +++ b/engine/z_filterindexer_it_test.go @@ -1264,13 +1264,11 @@ func testITTestIndexingMetaNot(t *testing.T) { func testITIndexRateProfile(t *testing.T) { rPrf := &RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001", "*string:~*req.Subject:1002"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001", "*string:~*req.Subject:1002"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*Rate{ "FIRST_GI": { ID: "FIRST_GI", @@ -1308,13 +1306,11 @@ func testITIndexRateProfile(t *testing.T) { } // update the RateProfile by adding a new Rate rPrf = &RateProfile{ // recreate the profile because if we test on internal - Tenant: "cgrates.org", // each update on the original item will update the item from DB - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001", "*string:~*req.Subject:1002"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", // each update on the original item will update the item from DB + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001", "*string:~*req.Subject:1002"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*Rate{ "FIRST_GI": { ID: "FIRST_GI", @@ -1360,12 +1356,10 @@ func testITIndexRateProfile(t *testing.T) { } } rPrf2 := &RateProfile{ - Tenant: "cgrates.org", - ID: "RP2", - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP2", + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*Rate{ "CUSTOM_RATE1": { ID: "CUSTOM_RATE1", diff --git a/engine/z_onstor_it_test.go b/engine/z_onstor_it_test.go index 4d28d535c..99342d096 100644 --- a/engine/z_onstor_it_test.go +++ b/engine/z_onstor_it_test.go @@ -2159,13 +2159,11 @@ func testOnStorITDispatcherProfile(t *testing.T) { func testOnStorITRateProfile(t *testing.T) { rPrf := &RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001", "*string:~*req.Subject:1002"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001", "*string:~*req.Subject:1002"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*Rate{ "FIRST_GI": { ID: "FIRST_GI", diff --git a/engine/z_stordb_it_test.go b/engine/z_stordb_it_test.go index cddde2e26..891f6a97a 100644 --- a/engine/z_stordb_it_test.go +++ b/engine/z_stordb_it_test.go @@ -517,16 +517,14 @@ func testStorDBitCRUDTPRateProfiles(t *testing.T) { //WRITE tpr := []*utils.TPRateProfile{ { - TPid: "id_RP1", - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: 0.1, - MaxCost: 0.6, - MaxCostStrategy: "*free", + TPid: "id_RP1", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: 0.1, + MaxCost: 0.6, + MaxCostStrategy: "*free", Rates: map[string]*utils.TPRate{ "FIRST_GI": { ID: "FIRST_GI", diff --git a/general_tests/export_it_test.go b/general_tests/export_it_test.go index f15caeaa0..cc0f8a71c 100644 --- a/general_tests/export_it_test.go +++ b/general_tests/export_it_test.go @@ -380,8 +380,6 @@ func testExpVerifyRateProfiles(t *testing.T) { FilterIDs: []string{"*string:~*req.Account:1002"}, ActivationInterval: nil, Weight: 10, - RoundingDecimals: 4, - RoundingMethod: utils.MetaRoundingUp, MinCost: utils.NewDecimal(0, 0), MaxCost: utils.NewDecimal(0, 0), MaxCostStrategy: utils.MetaMaxCostFree, diff --git a/loaders/loader_test.go b/loaders/loader_test.go index 94c130adc..a75061249 100644 --- a/loaders/loader_test.go +++ b/loaders/loader_test.go @@ -1552,66 +1552,58 @@ func TestLoaderProcessRateProfile(t *testing.T) { Path: "Weight", Type: utils.MetaComposed, Value: config.NewRSRParsersMustCompile("~*req.4", utils.InfieldSep)}, - {Tag: "RoundingMethod", - Path: "RoundingMethod", - Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.5", utils.InfieldSep)}, - {Tag: "RoundingDecimals", - Path: "RoundingDecimals", - Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.6", utils.InfieldSep)}, {Tag: "MinCost", Path: "MinCost", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.7", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.5", utils.InfieldSep)}, {Tag: "MaxCost", Path: "MaxCost", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.8", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.6", utils.InfieldSep)}, {Tag: "MaxCostStrategy", Path: "MaxCostStrategy", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.9", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.7", utils.InfieldSep)}, {Tag: "RateID", Path: "RateID", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.10", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.8", utils.InfieldSep)}, {Tag: "RateFilterIDs", Path: "RateFilterIDs", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.11", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.9", utils.InfieldSep)}, {Tag: "RateActivationTimes", Path: "RateActivationTimes", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.10", utils.InfieldSep)}, {Tag: "RateWeight", Path: "RateWeight", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.11", utils.InfieldSep)}, {Tag: "RateBlocker", Path: "RateBlocker", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep)}, {Tag: "RateIntervalStart", Path: "RateIntervalStart", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.15", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep)}, {Tag: "RateFixedFee", Path: "RateFixedFee", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.16", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep)}, {Tag: "RateRecurrentFee", Path: "RateRecurrentFee", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.17", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.15", utils.InfieldSep)}, {Tag: "RateUnit", Path: "RateUnit", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.18", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.16", utils.InfieldSep)}, {Tag: "RateIncrement", Path: "RateIncrement", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.19", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.17", utils.InfieldSep)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.RateProfileCSVContent)) @@ -1637,15 +1629,13 @@ func TestLoaderProcessRateProfile(t *testing.T) { t.Error(err) } eRatePrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -1758,77 +1748,69 @@ func TestLoaderProcessRateProfileRates(t *testing.T) { Path: "Weight", Type: utils.MetaComposed, Value: config.NewRSRParsersMustCompile("~*req.4", utils.InfieldSep)}, - {Tag: "RoundingMethod", - Path: "RoundingMethod", - Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.5", utils.InfieldSep)}, - {Tag: "RoundingDecimals", - Path: "RoundingDecimals", - Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.6", utils.InfieldSep)}, {Tag: "MinCost", Path: "MinCost", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.7", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.5", utils.InfieldSep)}, {Tag: "MaxCost", Path: "MaxCost", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.8", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.6", utils.InfieldSep)}, {Tag: "MaxCostStrategy", Path: "MaxCostStrategy", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.9", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.7", utils.InfieldSep)}, {Tag: "RateID", Path: "RateID", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.10", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.8", utils.InfieldSep)}, {Tag: "RateFilterIDs", Path: "RateFilterIDs", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.11", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.9", utils.InfieldSep)}, {Tag: "RateActivationTimes", Path: "RateActivationTimes", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.10", utils.InfieldSep)}, {Tag: "RateWeight", Path: "RateWeight", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.11", utils.InfieldSep)}, {Tag: "RateBlocker", Path: "RateBlocker", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep)}, {Tag: "RateIntervalStart", Path: "RateIntervalStart", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.15", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep)}, {Tag: "RateFixedFee", Path: "RateFixedFee", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.16", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep)}, {Tag: "RateRecurrentFee", Path: "RateRecurrentFee", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.17", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.15", utils.InfieldSep)}, {Tag: "RateUnit", Path: "RateUnit", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.18", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.16", utils.InfieldSep)}, {Tag: "RateIncrement", Path: "RateIncrement", Type: utils.MetaComposed, - Value: config.NewRSRParsersMustCompile("~*req.19", utils.InfieldSep)}, + Value: config.NewRSRParsersMustCompile("~*req.17", utils.InfieldSep)}, }, } ratePrfCnt1 := ` -#Tenant,ID,FilterIDs,ActivationInterval,Weight,RoundingMethod,RoundingDecimals,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationTimes,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement -cgrates.org,RP1,*string:~*req.Subject:1001,,0,*up,4,0.1,0.6,*free,RT_WEEK,,"* * * * 1-5",0,false,0s,0.4,0.12,1m,1m -cgrates.org,RP1,,,,,,,,,RT_WEEK,,,,,1m,,0.06,1m,1s +#Tenant,ID,FilterIDs,ActivationInterval,Weight,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationTimes,RateWeight,RateBlocker,RateIntervalStart,RateFixedFee,RateRecurrentFee,RateUnit,RateIncrement +cgrates.org,RP1,*string:~*req.Subject:1001,,0,0.1,0.6,*free,RT_WEEK,,"* * * * 1-5",0,false,0s,0.4,0.12,1m,1m +cgrates.org,RP1,,,,,,,RT_WEEK,,,,,1m,,0.06,1m,1s ` ratePrfCnt2 := ` #Tenant,ID,FilterIDs,ActivationInterval,Weight,RoundingMethod,RoundingDecimals,MinCost,MaxCost,MaxCostStrategy,RateID,RateFilterIDs,RateActivationTimes,RateWeight,RateBlocker,RateIntervalStart,RateValue,RateUnit,RateIncrement -cgrates.org,RP1,,,,,,,,,RT_WEEKEND,,"* * * * 0,6",10,false,0s,,0.06,1m,1s -cgrates.org,RP1,,,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,,0.06,1m,1s +cgrates.org,RP1,,,,,,,RT_WEEKEND,,"* * * * 0,6",10,false,0s,,0.06,1m,1s +cgrates.org,RP1,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,,0.06,1m,1s ` rdr1 := ioutil.NopCloser(strings.NewReader(ratePrfCnt1)) csvRdr1 := csv.NewReader(rdr1) @@ -1853,15 +1835,13 @@ cgrates.org,RP1,,,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,,0.06,1m,1s t.Error(err) } eRatePrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -1913,15 +1893,13 @@ cgrates.org,RP1,,,,,,,,,RT_CHRISTMAS,,* * 24 12 *,30,false,0s,,0.06,1m,1s t.Errorf("wrong buffer content: %+v", ldr.bufLoaderData) } eRatePrf = &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MinCost: utils.NewDecimal(1, 1), - MaxCost: utils.NewDecimal(6, 1), - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MinCost: utils.NewDecimal(1, 1), + MaxCost: utils.NewDecimal(6, 1), + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -2016,13 +1994,11 @@ func TestLoaderRemoveRateProfileRates(t *testing.T) { } rPfr := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { ID: "RT_WEEK", @@ -2063,13 +2039,10 @@ func TestLoaderRemoveRateProfileRates(t *testing.T) { t.Error(err) } rPfr2 := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP2", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - + Tenant: "cgrates.org", + ID: "RP2", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { @@ -2137,13 +2110,10 @@ cgrates.org,RP1, } eRatePrf := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { @@ -2199,13 +2169,10 @@ cgrates.org,RP1, } eRatePrf2 := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP2", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - + Tenant: "cgrates.org", + ID: "RP2", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, MaxCostStrategy: "*free", Rates: map[string]*engine.Rate{ "RT_WEEK": { @@ -2235,14 +2202,12 @@ cgrates.org,RP1, } eRatePrf3 := &engine.RateProfile{ - Tenant: "cgrates.org", - ID: "RP1", - FilterIDs: []string{"*string:~*req.Subject:1001"}, - Weight: 0, - RoundingMethod: "*up", - RoundingDecimals: 4, - MaxCostStrategy: "*free", - Rates: map[string]*engine.Rate{}, + Tenant: "cgrates.org", + ID: "RP1", + FilterIDs: []string{"*string:~*req.Subject:1001"}, + Weight: 0, + MaxCostStrategy: "*free", + Rates: map[string]*engine.Rate{}, } rcv, err = ldr.dm.GetRateProfile("cgrates.org", "RP1", true, false, utils.NonTransactional) diff --git a/rates/rates.go b/rates/rates.go index cc6b4b014..3a13179f9 100644 --- a/rates/rates.go +++ b/rates/rates.go @@ -166,9 +166,7 @@ func (rS *RateS) rateProfileCostForEvent(rtPfl *engine.RateProfile, args *utils. return } rpCost = &engine.RateProfileCost{ - ID: rtPfl.ID, - RoundingDecimals: rtPfl.RoundingDecimals, - RoundingMethod: rtPfl.RoundingMethod, + ID: rtPfl.ID, } var ok bool if rtPfl.MinCost != nil { diff --git a/utils/apitpdata.go b/utils/apitpdata.go index 1e18abd93..f3ca4c280 100755 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -1462,8 +1462,6 @@ type TPRateProfile struct { FilterIDs []string ActivationInterval *TPActivationInterval Weight float64 - RoundingDecimals int - RoundingMethod string MinCost float64 MaxCost float64 MaxCostStrategy string