diff --git a/apis/loaders_it_test.go b/apis/loaders_it_test.go index 3af9355fd..6625548f3 100644 --- a/apis/loaders_it_test.go +++ b/apis/loaders_it_test.go @@ -296,9 +296,11 @@ func testLoadersGetAccount(t *testing.T) { Weight: 20, }, }, + Opts: make(map[string]interface{}), Balances: map[string]*utils.Balance{ "MonetaryBalance": { - ID: "MonetaryBalance", + ID: "MonetaryBalance", + Opts: make(map[string]interface{}), Weights: utils.DynamicWeights{ { Weight: 10, @@ -370,6 +372,7 @@ func testLoadersGetActionProfile(t *testing.T) { { ID: "TOPUP", Type: utils.MetaAddBalance, + Opts: make(map[string]interface{}), Diktats: []*engine.APDiktat{ { Path: "*balance.TestBalance.Units", @@ -482,14 +485,16 @@ func testLoadersGetDispatcherProfile(t *testing.T) { } expDspPrf := engine.DispatcherProfile{ - Tenant: "cgrates.org", - ID: "DSP1", - FilterIDs: []string{"FLTR_ACCOUNT_1001"}, - Strategy: utils.MetaWeight, + Tenant: "cgrates.org", + ID: "DSP1", + FilterIDs: []string{"FLTR_ACCOUNT_1001"}, + Strategy: utils.MetaWeight, + StrategyParams: make(map[string]interface{}), Hosts: engine.DispatcherHostProfiles{ { ID: "ALL", Weight: 20, + Params: make(map[string]interface{}), }, }, Weight: 10, diff --git a/config/config_defaults.go b/config/config_defaults.go index dec96c3e5..0f1d24120 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -1211,7 +1211,7 @@ const CGRATES_CFG_JSON = ` "fields": [ {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, {"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Type", "path": "Rules.Type", "type": "*variable", "value": "~*req.2"}, + {"tag": "Type", "path": "Rules.Type", "type": "*variable", "value": "~*req.2", "new_branch":true}, {"tag": "Element", "path": "Rules.Element", "type": "*variable", "value": "~*req.3"}, {"tag": "Values", "path": "Rules.Values", "type": "*variable", "value": "~*req.4"}, ], diff --git a/config/config_json_test.go b/config/config_json_test.go index 7bf0dbd4c..76f45bf40 100644 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -1168,15 +1168,16 @@ func TestDfLoaderJsonCfg(t *testing.T) { Value: utils.StringPointer("~*req.1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Type"), - Path: utils.StringPointer("Type"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.2")}, + Path: utils.StringPointer("Rules.Type"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~*req.2"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Element"), - Path: utils.StringPointer("Element"), + Path: utils.StringPointer("Rules.Element"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.3")}, {Tag: utils.StringPointer("Values"), - Path: utils.StringPointer("Values"), + Path: utils.StringPointer("Rules.Values"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.4")}, }, @@ -1204,19 +1205,20 @@ func TestDfLoaderJsonCfg(t *testing.T) { Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.3")}, {Tag: utils.StringPointer("AttributeFilterIDs"), - Path: utils.StringPointer("AttributeFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.4")}, + Path: utils.StringPointer("Attributes.FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~*req.4"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Path"), - Path: utils.StringPointer(utils.Path), + Path: utils.StringPointer("Attributes." + utils.Path), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.5")}, {Tag: utils.StringPointer("Type"), - Path: utils.StringPointer("Type"), + Path: utils.StringPointer("Attributes.Type"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.6")}, {Tag: utils.StringPointer("Value"), - Path: utils.StringPointer("Value"), + Path: utils.StringPointer("Attributes.Value"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("Blocker"), @@ -1308,11 +1310,12 @@ func TestDfLoaderJsonCfg(t *testing.T) { Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.6")}, {Tag: utils.StringPointer("MetricIDs"), - Path: utils.StringPointer("MetricIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.7")}, + Path: utils.StringPointer("Metrics.MetricID"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~*req.7"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("MetricFilterIDs"), - Path: utils.StringPointer("MetricFilterIDs"), + Path: utils.StringPointer("Metrics.FilterIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("Blocker"), @@ -1408,39 +1411,40 @@ func TestDfLoaderJsonCfg(t *testing.T) { Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.5")}, {Tag: utils.StringPointer("RouteID"), - Path: utils.StringPointer("RouteID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.6")}, + Path: utils.StringPointer("Routes.ID"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~*req.6"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("RouteFilterIDs"), - Path: utils.StringPointer("RouteFilterIDs"), + Path: utils.StringPointer("Routes.FilterIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("RouteAccountIDs"), - Path: utils.StringPointer("RouteAccountIDs"), + Path: utils.StringPointer("Routes.AccountIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("RouteRateProfileIDs"), - Path: utils.StringPointer("RouteRateProfileIDs"), + Path: utils.StringPointer("Routes.RateProfileIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.9")}, {Tag: utils.StringPointer("RouteResourceIDs"), - Path: utils.StringPointer("RouteResourceIDs"), + Path: utils.StringPointer("Routes.ResourceIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.10")}, {Tag: utils.StringPointer("RouteStatIDs"), - Path: utils.StringPointer("RouteStatIDs"), + Path: utils.StringPointer("Routes.StatIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.11")}, {Tag: utils.StringPointer("RouteWeights"), - Path: utils.StringPointer("RouteWeights"), + Path: utils.StringPointer("Routes.Weights"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.12")}, {Tag: utils.StringPointer("RouteBlocker"), - Path: utils.StringPointer("RouteBlocker"), + Path: utils.StringPointer("Routes.Blocker"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.13")}, {Tag: utils.StringPointer("RouteParameters"), - Path: utils.StringPointer("RouteParameters"), + Path: utils.StringPointer("Routes.RouteParameters"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.14")}, }, @@ -1504,27 +1508,28 @@ func TestDfLoaderJsonCfg(t *testing.T) { Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.4")}, {Tag: utils.StringPointer("StrategyParameters"), - Path: utils.StringPointer("StrategyParameters"), + Path: utils.StringPointer("StrategyParams"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.5")}, {Tag: utils.StringPointer("ConnID"), - Path: utils.StringPointer("ConnID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.6")}, + Path: utils.StringPointer("Hosts.ID"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~*req.6"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("ConnFilterIDs"), - Path: utils.StringPointer("ConnFilterIDs"), + Path: utils.StringPointer("Hosts.FilterIDs"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("ConnWeight"), - Path: utils.StringPointer("ConnWeight"), + Path: utils.StringPointer("Hosts.Weight"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("ConnBlocker"), - Path: utils.StringPointer("ConnBlocker"), + Path: utils.StringPointer("Hosts.Blocker"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.9")}, {Tag: utils.StringPointer("ConnParameters"), - Path: utils.StringPointer("ConnParameters"), + Path: utils.StringPointer("Hosts.Params"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.10")}, }, @@ -1627,46 +1632,52 @@ func TestDfLoaderJsonCfg(t *testing.T) { Path: utils.StringPointer("MaxCostStrategy"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.6")}, - {Tag: utils.StringPointer("RateID"), - Path: utils.StringPointer("RateID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("RateFilterIDs"), - Path: utils.StringPointer("RateFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.8")}, + Path: utils.StringPointer("Rates[<~*req.7>].FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("RateActivationTimes"), - Path: utils.StringPointer("RateActivationTimes"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.9")}, + Path: utils.StringPointer("Rates[<~*req.7>].ActivationTimes"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.9")}, {Tag: utils.StringPointer("RateWeights"), - Path: utils.StringPointer("RateWeights"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.10")}, + Path: utils.StringPointer("Rates[<~*req.7>].Weights"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.10")}, {Tag: utils.StringPointer("RateBlocker"), - Path: utils.StringPointer("RateBlocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.11")}, + Path: utils.StringPointer("Rates[<~*req.7>].Blocker"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.11")}, {Tag: utils.StringPointer("RateIntervalStart"), - Path: utils.StringPointer("RateIntervalStart"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.12")}, + Path: utils.StringPointer("Rates[<~*req.7>].IntervalRates.IntervalStart"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.12"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("RateFixedFee"), - Path: utils.StringPointer("RateFixedFee"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.13")}, + Path: utils.StringPointer("Rates[<~*req.7>].IntervalRates.FixedFee"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.13")}, {Tag: utils.StringPointer("RateRecurrentFee"), - Path: utils.StringPointer("RateRecurrentFee"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.14")}, + Path: utils.StringPointer("Rates[<~*req.7>].IntervalRates.RecurrentFee"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.14")}, {Tag: utils.StringPointer("RateUnit"), - Path: utils.StringPointer("RateUnit"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.15")}, + Path: utils.StringPointer("Rates[<~*req.7>].IntervalRates.Unit"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.15")}, {Tag: utils.StringPointer("RateIncrement"), - Path: utils.StringPointer("RateIncrement"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.16")}, + Path: utils.StringPointer("Rates[<~*req.7>].IntervalRates.Increment"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.16")}, }, }, { @@ -1695,46 +1706,46 @@ func TestDfLoaderJsonCfg(t *testing.T) { Path: utils.StringPointer("Schedule"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.4")}, - {Tag: utils.StringPointer("TargetType"), - Path: utils.StringPointer("TargetType"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.5")}, {Tag: utils.StringPointer("TargetIDs"), - Path: utils.StringPointer("TargetIDs"), + Path: utils.StringPointer("Targets[<~*req.5>]"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.6")}, - {Tag: utils.StringPointer("ActionID"), - Path: utils.StringPointer("ActionID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("ActionFilterIDs"), - Path: utils.StringPointer("ActionFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.8")}, + Path: utils.StringPointer("Actions[<~*req.7>].FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("ActionBlocker"), - Path: utils.StringPointer("ActionBlocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.9")}, + Path: utils.StringPointer("Actions[<~*req.7>].Blocker"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.9")}, {Tag: utils.StringPointer("ActionTTL"), - Path: utils.StringPointer("ActionTTL"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.10")}, + Path: utils.StringPointer("Actions[<~*req.7>].TTL"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.10")}, {Tag: utils.StringPointer("ActionType"), - Path: utils.StringPointer("ActionType"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.11")}, + Path: utils.StringPointer("Actions[<~*req.7>].Type"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.11")}, {Tag: utils.StringPointer("ActionOpts"), - Path: utils.StringPointer("ActionOpts"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.12")}, + Path: utils.StringPointer("Actions[<~*req.7>].Opts"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.12")}, {Tag: utils.StringPointer("ActionPath"), - Path: utils.StringPointer("ActionPath"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.13")}, + Path: utils.StringPointer("Actions[<~*req.7>].Diktats.Path"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.13"), + New_branch: utils.BoolPointer(true)}, {Tag: utils.StringPointer("ActionValue"), - Path: utils.StringPointer("ActionValue"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.14")}, + Path: utils.StringPointer("Actions[<~*req.7>].Diktats.Value"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.7:"}, + Value: utils.StringPointer("~*req.14")}, }, }, { @@ -1763,46 +1774,51 @@ func TestDfLoaderJsonCfg(t *testing.T) { Path: utils.StringPointer("Opts"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.4")}, - {Tag: utils.StringPointer("BalanceID"), - Path: utils.StringPointer("BalanceID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.5")}, {Tag: utils.StringPointer("BalanceFilterIDs"), - Path: utils.StringPointer("BalanceFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.6")}, + Path: utils.StringPointer("Balances[<~*req.5>].FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.6")}, {Tag: utils.StringPointer("BalanceWeights"), - Path: utils.StringPointer("BalanceWeights"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.7")}, + Path: utils.StringPointer("Balances[<~*req.5>].Weights"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.7")}, {Tag: utils.StringPointer("BalanceType"), - Path: utils.StringPointer("BalanceType"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.8")}, + Path: utils.StringPointer("Balances[<~*req.5>].Type"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.8")}, {Tag: utils.StringPointer("BalanceUnits"), - Path: utils.StringPointer("BalanceUnits"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.9")}, + Path: utils.StringPointer("Balances[<~*req.5>].Units"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.9")}, {Tag: utils.StringPointer("BalanceUnitFactors"), - Path: utils.StringPointer("BalanceUnitFactors"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.10")}, + Path: utils.StringPointer("Balances[<~*req.5>].UnitFactors"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.10")}, {Tag: utils.StringPointer("BalanceOpts"), - Path: utils.StringPointer("BalanceOpts"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.11")}, + Path: utils.StringPointer("Balances[<~*req.5>].Opts"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.11")}, {Tag: utils.StringPointer("BalanceCostIncrements"), - Path: utils.StringPointer("BalanceCostIncrements"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.12")}, + Path: utils.StringPointer("Balances[<~*req.5>].CostIncrements"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.12")}, {Tag: utils.StringPointer("BalanceAttributeIDs"), - Path: utils.StringPointer("BalanceAttributeIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.13")}, + Path: utils.StringPointer("Balances[<~*req.5>].AttributeIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.13")}, {Tag: utils.StringPointer("BalanceRateProfileIDs"), - Path: utils.StringPointer("BalanceRateProfileIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~*req.14")}, + Path: utils.StringPointer("Balances[<~*req.5>].RateProfileIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.5:"}, + Value: utils.StringPointer("~*req.14")}, {Tag: utils.StringPointer("ThresholdIDs"), Path: utils.StringPointer("ThresholdIDs"), Type: utils.StringPointer(utils.MetaVariable), diff --git a/config/config_test.go b/config/config_test.go index 795c2ca8f..68ee167c8 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -2621,17 +2621,18 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Mandatory: true, Layout: time.RFC3339}, {Tag: "Type", - Path: "Type", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Rules.Type", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, {Tag: "Element", - Path: "Element", + Path: "Rules.Element", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "Values", - Path: "Values", + Path: "Rules.Values", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), Layout: time.RFC3339}, @@ -2670,26 +2671,27 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Layout: time.RFC3339, }, { - Tag: "AttributeFilterIDs", - Path: "AttributeFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Layout: time.RFC3339}, + Tag: "AttributeFilterIDs", + Path: "Attributes.FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, { Tag: "Path", - Path: "Path", + Path: "Attributes.Path", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "Type", - Path: "Type", + Path: "Attributes.Type", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "Value", - Path: "Value", + Path: "Attributes.Value", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), Layout: time.RFC3339, @@ -2802,12 +2804,13 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "MetricIDs", - Path: "MetricIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Metrics.MetricID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, {Tag: "MetricFilterIDs", - Path: "MetricFilterIDs", + Path: "Metrics.FilterIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), Layout: time.RFC3339}, @@ -2924,47 +2927,48 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteID", - Path: "RouteID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Routes.ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, {Tag: "RouteFilterIDs", - Path: "RouteFilterIDs", + Path: "Routes.FilterIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteAccountIDs", - Path: "RouteAccountIDs", + Path: "Routes.AccountIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteRateProfileIDs", - Path: "RouteRateProfileIDs", + Path: "Routes.RateProfileIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteResourceIDs", - Path: "RouteResourceIDs", + Path: "Routes.ResourceIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteStatIDs", - Path: "RouteStatIDs", + Path: "Routes.StatIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteWeights", - Path: "RouteWeights", + Path: "Routes.Weights", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteBlocker", - Path: "RouteBlocker", + Path: "Routes.Blocker", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), Layout: time.RFC3339}, {Tag: "RouteParameters", - Path: "RouteParameters", + Path: "Routes.RouteParameters", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), Layout: time.RFC3339}, @@ -3043,37 +3047,38 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Layout: time.RFC3339, }, {Tag: "StrategyParameters", - Path: "StrategyParameters", + Path: "StrategyParams", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "ConnID", - Path: "ConnID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Hosts.ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339, + NewBranch: true, }, {Tag: "ConnFilterIDs", - Path: "ConnFilterIDs", + Path: "Hosts.FilterIDs", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "ConnWeight", - Path: "ConnWeight", + Path: "Hosts.Weight", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "ConnBlocker", - Path: "ConnBlocker", + Path: "Hosts.Blocker", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), Layout: time.RFC3339, }, {Tag: "ConnParameters", - Path: "ConnParameters", + Path: "Hosts.Params", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), Layout: time.RFC3339, @@ -3212,65 +3217,69 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), Layout: time.RFC3339, }, - {Tag: "RateID", - Path: "RateID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Layout: time.RFC3339, - }, {Tag: "RateFilterIDs", - Path: "RateFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateActivationTimes", - Path: "RateActivationTimes", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].ActivationTimes", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateWeights", - Path: "RateWeights", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateBlocker", - Path: "RateBlocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].Blocker", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateIntervalStart", - Path: "RateIntervalStart", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].IntervalRates.IntervalStart", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Layout: time.RFC3339, + NewBranch: true, }, {Tag: "RateFixedFee", - Path: "RateFixedFee", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].IntervalRates.FixedFee", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateRecurrentFee", - Path: "RateRecurrentFee", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].IntervalRates.RecurrentFee", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateUnit", - Path: "RateUnit", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].IntervalRates.Unit", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), + Layout: time.RFC3339, }, {Tag: "RateIncrement", - Path: "RateIncrement", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), - Layout: time.RFC3339, + Path: "Rates[<~*req.7>].IntervalRates.Increment", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), + Layout: time.RFC3339, }, }, }, @@ -3305,56 +3314,54 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), Layout: time.RFC3339}, - {Tag: "TargetType", - Path: "TargetType", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Layout: time.RFC3339}, {Tag: "TargetIDs", - Path: "TargetIDs", + Path: "Targets[<~*req.5>]", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), Layout: time.RFC3339}, - {Tag: "ActionID", - Path: "ActionID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Layout: time.RFC3339}, {Tag: "ActionFilterIDs", - Path: "ActionFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "ActionBlocker", - Path: "ActionBlocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].Blocker", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "ActionTTL", - Path: "ActionTTL", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].TTL", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "ActionType", - Path: "ActionType", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].Type", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "ActionOpts", - Path: "ActionOpts", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].Opts", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "ActionPath", - Path: "ActionPath", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].Diktats.Path", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, {Tag: "ActionValue", - Path: "ActionValue", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Actions[<~*req.7>].Diktats.Value", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339}, }, }, { @@ -3388,56 +3395,60 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), Layout: time.RFC3339}, - {Tag: "BalanceID", - Path: "BalanceID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Layout: time.RFC3339}, {Tag: "BalanceFilterIDs", - Path: "BalanceFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceWeights", - Path: "BalanceWeights", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceType", - Path: "BalanceType", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].Type", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceUnits", - Path: "BalanceUnits", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].Units", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceUnitFactors", - Path: "BalanceUnitFactors", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].UnitFactors", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceOpts", - Path: "BalanceOpts", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].Opts", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceCostIncrements", - Path: "BalanceCostIncrements", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].CostIncrements", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceAttributeIDs", - Path: "BalanceAttributeIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].AttributeIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "BalanceRateProfileIDs", - Path: "BalanceRateProfileIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Layout: time.RFC3339}, + Path: "Balances[<~*req.5>].RateProfileIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339}, {Tag: "ThresholdIDs", Path: "ThresholdIDs", Type: utils.MetaVariable, @@ -3456,8 +3467,8 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { } } if !reflect.DeepEqual(eCfg, cgrCfg.loaderCfg) { - t.Errorf("received: %+v, \n expecting: %+v", - utils.ToJSON(cgrCfg.loaderCfg), utils.ToJSON(eCfg)) + t.Errorf("Expecting: %+v,\n received: %+v ", + utils.ToJSON(eCfg), utils.ToJSON(cgrCfg.loaderCfg)) } } @@ -5345,7 +5356,7 @@ func TestV1GetConfigAsJSONDispatcherH(t *testing.T) { func TestV1GetConfigAsJSONLoaders(t *testing.T) { var reply string - expected := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"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"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.4"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.5"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.6"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.7"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.8"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"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":"Weight","tag":"Weight","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"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":"Weight","tag":"Weight","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":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"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":"Weights","tag":"Weights","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":"RouteRateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeights","tag":"RouteWeights","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"}],"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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.4"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.5"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.6"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.7"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.8"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.9"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.10"}],"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":"ConnectAttempts","tag":"ConnectAttempts","type":"*variable","value":"~*req.4"},{"path":"Reconnects","tag":"Reconnects","type":"*variable","value":"~*req.5"},{"path":"ConnectTimeout","tag":"ConnectTimeout","type":"*variable","value":"~*req.6"},{"path":"ReplyTimeout","tag":"ReplyTimeout","type":"*variable","value":"~*req.7"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.8"},{"path":"ClientKey","tag":"ClientKey","type":"*variable","value":"~*req.9"},{"path":"ClientCertificate","tag":"ClientCertificate","type":"*variable","value":"~*req.10"},{"path":"CaCertificate","tag":"CaCertificate","type":"*variable","value":"~*req.11"}],"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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"path":"RateID","tag":"RateID","type":"*variable","value":"~*req.7"},{"path":"RateFilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"path":"RateActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"path":"RateWeights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"path":"RateBlocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"path":"RateIntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"path":"RateFixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"path":"RateRecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"path":"RateUnit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"path":"RateIncrement","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.4"},{"path":"TargetType","tag":"TargetType","type":"*variable","value":"~*req.5"},{"path":"TargetIDs","tag":"TargetIDs","type":"*variable","value":"~*req.6"},{"path":"ActionID","tag":"ActionID","type":"*variable","value":"~*req.7"},{"path":"ActionFilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ActionBlocker","tag":"ActionBlocker","type":"*variable","value":"~*req.9"},{"path":"ActionTTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"path":"ActionType","tag":"ActionType","type":"*variable","value":"~*req.11"},{"path":"ActionOpts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"path":"ActionPath","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"path":"ActionValue","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.4"},{"path":"BalanceID","tag":"BalanceID","type":"*variable","value":"~*req.5"},{"path":"BalanceFilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"path":"BalanceWeights","tag":"BalanceWeights","type":"*variable","value":"~*req.7"},{"path":"BalanceType","tag":"BalanceType","type":"*variable","value":"~*req.8"},{"path":"BalanceUnits","tag":"BalanceUnits","type":"*variable","value":"~*req.9"},{"path":"BalanceUnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.10"},{"path":"BalanceOpts","tag":"BalanceOpts","type":"*variable","value":"~*req.11"},{"path":"BalanceCostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.12"},{"path":"BalanceAttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.13"},{"path":"BalanceRateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` + expected := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.4"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.5"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.6"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.7"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.8"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"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":"Weight","tag":"Weight","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"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"Metrics.FilterIDs","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"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":"Weight","tag":"Weight","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":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.12"},{"path":"Routes.Blocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"}],"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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.4"},{"path":"StrategyParams","tag":"StrategyParameters","type":"*variable","value":"~*req.5"},{"new_branch":true,"path":"Hosts.ID","tag":"ConnID","type":"*variable","value":"~*req.6"},{"path":"Hosts.FilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.7"},{"path":"Hosts.Weight","tag":"ConnWeight","type":"*variable","value":"~*req.8"},{"path":"Hosts.Blocker","tag":"ConnBlocker","type":"*variable","value":"~*req.9"},{"path":"Hosts.Params","tag":"ConnParameters","type":"*variable","value":"~*req.10"}],"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":"ConnectAttempts","tag":"ConnectAttempts","type":"*variable","value":"~*req.4"},{"path":"Reconnects","tag":"Reconnects","type":"*variable","value":"~*req.5"},{"path":"ConnectTimeout","tag":"ConnectTimeout","type":"*variable","value":"~*req.6"},{"path":"ReplyTimeout","tag":"ReplyTimeout","type":"*variable","value":"~*req.7"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.8"},{"path":"ClientKey","tag":"ClientKey","type":"*variable","value":"~*req.9"},{"path":"ClientCertificate","tag":"ClientCertificate","type":"*variable","value":"~*req.10"},{"path":"CaCertificate","tag":"CaCertificate","type":"*variable","value":"~*req.11"}],"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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.4"},{"path":"Targets[\u003c~*req.5\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Blocker","tag":"ActionBlocker","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Actions[\u003c~*req.7\u003e].Diktats.Path","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Diktats.Value","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.4"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"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(context.Background(), &SectionWithAPIOpts{Sections: []string{LoaderSJSON}}, &reply); err != nil { t.Error(err) @@ -5562,7 +5573,7 @@ func TestV1GetConfigAsJSONAllConfig(t *testing.T) { } }` var reply string - expected := `{"accounts":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"max_iterations":1000,"max_usage":"259200000000000","nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[],"*usage":[]},"prefix_indexed_fields":[],"rates_conns":[],"suffix_indexed_fields":[],"thresholds_conns":[]},"actions":{"accounts_conns":[],"cdrs_conns":[],"dynaprepaid_actionprofile":[],"ees_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[]},"prefix_indexed_fields":[],"stats_conns":[],"suffix_indexed_fields":[],"tenants":[],"thresholds_conns":[]},"admins":{"actions_conns":[],"attributes_conns":[],"caches_conns":["*internal"],"ees_conns":[],"enabled":false},"analyzers":{"cleanup_interval":"1h0m0s","db_path":"/var/spool/cgrates/analyzers","enabled":false,"index_type":"*scorch","ttl":"24h0m0s"},"apiban":{"enabled":false,"keys":[]},"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":["*birpc_internal"]},"attributes":{"accounts_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*processRuns":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*profileRuns":[]},"prefix_indexed_fields":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"caches":{"partitions":{"*account_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*action_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*apiban":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2m0s"},"*attribute_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*attribute_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*caps_events":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*cdr_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10m0s"},"*charger_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*charger_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*closed_sessions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*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},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatcher_loads":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatcher_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*event_charges":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*event_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*load_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rate_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rate_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*replication_hosts":{"limit":0,"precache":false,"replicate":false,"static_ttl":false},"*resource_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*resource_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*reverse_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*route_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*route_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rpc_connections":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rpc_responses":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2s"},"*stat_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*statqueue_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*statqueues":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*stir":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*threshold_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*threshold_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*uch":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"}},"replication_conns":[]},"cdrs":{"accounts_conns":[],"actions_conns":[],"attributes_conns":[],"chargers_conns":[],"ees_conns":[],"enabled":false,"extra_fields":[],"online_cdr_exports":null,"opts":{"*accountS":[],"*attributeS":[],"*chargerS":[],"*eeS":[],"*rateS":[],"*statS":[],"*thresholdS":[]},"rates_conns":[],"session_cost_retries":5,"stats_conns":[],"store_cdrs":true,"thresholds_conns":[]},"chargers":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"config_db":{"db_host":"","db_name":"","db_password":"","db_port":0,"db_type":"*internal","db_user":"","opts":{"mongoQueryTimeout":"10s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0s","redisClusterSync":"5s","redisSentinel":"","redisTLS":false}},"configs":{"enabled":false,"root_dir":"/var/spool/cgrates/configs","url":"/configs/"},"cores":{"caps":0,"caps_stats_interval":"0","caps_strategy":"*busy","ees_conns":[],"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_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*accounts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*action_profile_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*action_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*actions":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*attribute_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*attribute_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*charger_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*charger_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*dispatcher_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*dispatcher_hosts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*dispatcher_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*filters":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*load_ids":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*rate_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*rate_profile_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*rate_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*resource_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*resource_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*resources":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*reverse_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*route_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*route_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*stat_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*statqueue_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*statqueues":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*threshold_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*threshold_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*thresholds":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*versions":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false}},"opts":{"mongoQueryTimeout":"10s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0s","redisClusterSync":"5s","redisSentinel":"","redisTLS":false},"remote_conn_id":"","remote_conns":[],"replication_cache":"","replication_conns":[],"replication_filtered":false},"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":["*birpc_internal"],"synced_conn_requests":false,"vendor_id":0},"dispatchers":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"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":{"*fileCSV":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"concurrent_requests":0,"export_path":"/var/spool/cgrates/ees","failed_posts_dir":"/var/spool/cgrates/failed_posts","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"timezone":"","type":"*none"}]},"ers":{"enabled":false,"partial_cache_ttl":"1s","readers":[{"cache_dump_fields":[],"concurrent_requests":1024,"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":[],"id":"*default","opts":{"csvFieldSeparator":",","csvHeaderDefineChar":":","csvRowLength":0,"natsSubject":"cgrates_cdrs","partialCacheAction":"*none","partialOrderField":"~*req.AnswerTime","xmlRootPath":""},"partial_commit_fields":[],"processed_path":"/var/spool/cgrates/ers/out","run_delay":"0","source_path":"/var/spool/cgrates/ers/in","tenant":"","timezone":"","type":"*none"}],"sessions_conns":["*internal"]},"filters":{"accounts_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":["*birpc_internal"],"subscribe_park":true},"general":{"connect_attempts":5,"connect_timeout":"1s","dbdata_encoding":"*msgpack","decimal_max_scale":0,"decimal_min_scale":0,"decimal_precision":0,"decimal_rounding_mode":"*toNearestEven","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_parallel_conns":100,"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":"0s","forceAttemptHttp2":true,"idleConnTimeout":"1m30s","maxConnsPerHost":0,"maxIdleConns":100,"maxIdleConnsPerHost":2,"responseHeaderTimeout":"0s","skipTLSVerification":false,"tlsHandshakeTimeout":"10s"},"freeswitch_cdrs_url":"/freeswitch_json","http_cdrs":"/cdr_http","json_rpc_url":"/jsonrpc","registrars_url":"/registrar","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":["*birpc_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":{"actions_conns":["*localhost"],"caches_conns":["*localhost"],"data_path":"./","disable_reverse":false,"field_separator":",","gapi_credentials":".gapi/credentials.json","gapi_token":".gapi/token.json","tpid":""},"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"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"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.4"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.5"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.6"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.7"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.8"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"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":"Weight","tag":"Weight","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"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":"Weight","tag":"Weight","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":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"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":"Weights","tag":"Weights","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":"RouteRateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeights","tag":"RouteWeights","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"}],"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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.4"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.5"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.6"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.7"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.8"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.9"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.10"}],"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":"ConnectAttempts","tag":"ConnectAttempts","type":"*variable","value":"~*req.4"},{"path":"Reconnects","tag":"Reconnects","type":"*variable","value":"~*req.5"},{"path":"ConnectTimeout","tag":"ConnectTimeout","type":"*variable","value":"~*req.6"},{"path":"ReplyTimeout","tag":"ReplyTimeout","type":"*variable","value":"~*req.7"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.8"},{"path":"ClientKey","tag":"ClientKey","type":"*variable","value":"~*req.9"},{"path":"ClientCertificate","tag":"ClientCertificate","type":"*variable","value":"~*req.10"},{"path":"CaCertificate","tag":"CaCertificate","type":"*variable","value":"~*req.11"}],"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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"path":"RateID","tag":"RateID","type":"*variable","value":"~*req.7"},{"path":"RateFilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"path":"RateActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"path":"RateWeights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"path":"RateBlocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"path":"RateIntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"path":"RateFixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"path":"RateRecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"path":"RateUnit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"path":"RateIncrement","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.4"},{"path":"TargetType","tag":"TargetType","type":"*variable","value":"~*req.5"},{"path":"TargetIDs","tag":"TargetIDs","type":"*variable","value":"~*req.6"},{"path":"ActionID","tag":"ActionID","type":"*variable","value":"~*req.7"},{"path":"ActionFilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ActionBlocker","tag":"ActionBlocker","type":"*variable","value":"~*req.9"},{"path":"ActionTTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"path":"ActionType","tag":"ActionType","type":"*variable","value":"~*req.11"},{"path":"ActionOpts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"path":"ActionPath","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"path":"ActionValue","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.4"},{"path":"BalanceID","tag":"BalanceID","type":"*variable","value":"~*req.5"},{"path":"BalanceFilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"path":"BalanceWeights","tag":"BalanceWeights","type":"*variable","value":"~*req.7"},{"path":"BalanceType","tag":"BalanceType","type":"*variable","value":"~*req.8"},{"path":"BalanceUnits","tag":"BalanceUnits","type":"*variable","value":"~*req.9"},{"path":"BalanceUnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.10"},{"path":"BalanceOpts","tag":"BalanceOpts","type":"*variable","value":"~*req.11"},{"path":"BalanceCostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.12"},{"path":"BalanceAttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.13"},{"path":"BalanceRateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}],"migrator":{"out_datadb_encoding":"msgpack","out_datadb_host":"127.0.0.1","out_datadb_name":"10","out_datadb_opts":{"mongoQueryTimeout":"0s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0s","redisClusterSync":"5s","redisSentinel":"","redisTLS":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":{"mongoQueryTimeout":"0s","mysqlLocation":"","sqlConnMaxLifetime":"0s","sqlMaxIdleConns":0,"sqlMaxOpenConns":0,"sslMode":""},"out_stordb_password":"","out_stordb_port":"3306","out_stordb_type":"mysql","out_stordb_user":"cgrates","users_filters":null},"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"]},"rates":{"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*intervalStart":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*startTime":[],"*usage":[]},"prefix_indexed_fields":[],"rate_exists_indexed_fields":[],"rate_indexed_selects":true,"rate_nested_fields":false,"rate_notexists_indexed_fields":[],"rate_prefix_indexed_fields":[],"rate_suffix_indexed_fields":[],"suffix_indexed_fields":[],"verbosity":1000},"registrarc":{"dispatchers":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]},"rpc":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]}},"resources":{"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*units":[],"*usageID":[],"*usageTTL":[]},"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"accounts_conns":[],"attributes_conns":[],"default_ratio":1,"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*context":[],"*ignoreErrors":[],"*limit":[],"*maxCost":[],"*offset":[],"*profileCount":[],"*usage":[]},"prefix_indexed_fields":[],"rates_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"rpc_conns":{"*bijson_localhost":{"conns":[{"address":"127.0.0.1:2014","transport":"*birpc_json"}],"poolSize":0,"strategy":"*first"},"*birpc_internal":{"conns":[{"address":"*birpc_internal","transport":""}],"poolSize":0,"strategy":"*first"},"*internal":{"conns":[{"address":"*internal","transport":""}],"poolSize":0,"strategy":"*first"},"*localhost":{"conns":[{"address":"127.0.0.1:2012","transport":"*json"}],"poolSize":0,"strategy":"*first"}},"sessions":{"accounts_conns":[],"actions_conns":[],"alterable_fields":[],"attributes_conns":[],"cdrs_conns":[],"channel_sync_interval":"0","chargers_conns":[],"client_protocol":1,"default_usage":{"*any":"3h0m0s","*data":"1048576","*sms":"1","*voice":"3h0m0s"},"enabled":false,"listen_bigob":"","listen_bijson":"127.0.0.1:2014","min_dur_low_balance":"0","opts":{"*accountS":[],"*attributeS":[],"*attributesDerivedReply":[],"*blockerError":[],"*cdrS":[],"*cdrsDerivedReply":[],"*chargeable":[],"*chargerS":[],"*debitInterval":[],"*forceDuration":[],"*initiate":[],"*maxUsage":[],"*message":[],"*resourceS":[],"*resourcesAllocate":[],"*resourcesAuthorize":[],"*resourcesDerivedReply":[],"*resourcesRelease":[],"*routeS":[],"*routesDerivedReply":[],"*statS":[],"*statsDerivedReply":[],"*terminate":[],"*thresholdS":[],"*thresholdsDerivedReply":[],"*ttl":[],"*ttlLastUsage":[],"*ttlLastUsed":[],"*ttlMaxDelay":[],"*ttlUsage":[],"*update":[]},"rates_conns":[],"replication_conns":[],"resources_conns":[],"routes_conns":[],"session_indexes":[],"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":"1s","sessions_conns":["*internal"],"timezone":""},"stats":{"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[],"*roundingDecimals":[]},"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":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*session_costs":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_accounts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_action_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_attributes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_chargers":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_dispatcher_hosts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_dispatcher_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_filters":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_rate_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_resources":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_routes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_stats":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_thresholds":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*versions":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false}},"opts":{"mongoQueryTimeout":"10s","mysqlLocation":"Local","sqlConnMaxLifetime":"0s","sqlMaxIdleConns":10,"sqlMaxOpenConns":100,"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"}],"*cdrLog":[{"mandatory":true,"path":"*cdr.ToR","tag":"ToR","type":"*variable","value":"~*req.BalanceType"},{"mandatory":true,"path":"*cdr.OriginHost","tag":"OriginHost","type":"*constant","value":"127.0.0.1"},{"mandatory":true,"path":"*cdr.RequestType","tag":"RequestType","type":"*constant","value":"*none"},{"mandatory":true,"path":"*cdr.Tenant","tag":"Tenant","type":"*variable","value":"~*req.Tenant"},{"mandatory":true,"path":"*cdr.Account","tag":"Account","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Subject","tag":"Subject","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Cost","tag":"Cost","type":"*variable","value":"~*req.Cost"},{"mandatory":true,"path":"*cdr.Source","tag":"Source","type":"*constant","value":"*cdrLog"},{"mandatory":true,"path":"*cdr.Usage","tag":"Usage","type":"*constant","value":"1"},{"mandatory":true,"path":"*cdr.RunID","tag":"RunID","type":"*variable","value":"~*req.ActionType"},{"mandatory":true,"path":"*cdr.SetupTime","tag":"SetupTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.AnswerTime","tag":"AnswerTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.PreRated","tag":"PreRated","type":"*constant","value":"true"}],"*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":{"actions_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[]},"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,"exists_indexed_fields":[],"indexed_selects":true,"max_iterations":1000,"max_usage":"259200000000000","nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[],"*usage":[]},"prefix_indexed_fields":[],"rates_conns":[],"suffix_indexed_fields":[],"thresholds_conns":[]},"actions":{"accounts_conns":[],"cdrs_conns":[],"dynaprepaid_actionprofile":[],"ees_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[]},"prefix_indexed_fields":[],"stats_conns":[],"suffix_indexed_fields":[],"tenants":[],"thresholds_conns":[]},"admins":{"actions_conns":[],"attributes_conns":[],"caches_conns":["*internal"],"ees_conns":[],"enabled":false},"analyzers":{"cleanup_interval":"1h0m0s","db_path":"/var/spool/cgrates/analyzers","enabled":false,"index_type":"*scorch","ttl":"24h0m0s"},"apiban":{"enabled":false,"keys":[]},"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":["*birpc_internal"]},"attributes":{"accounts_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*processRuns":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*profileRuns":[]},"prefix_indexed_fields":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"caches":{"partitions":{"*account_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*action_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*apiban":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2m0s"},"*attribute_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*attribute_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*caps_events":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*cdr_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10m0s"},"*charger_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*charger_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*closed_sessions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*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},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatcher_loads":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatcher_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*event_charges":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*event_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*load_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rate_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rate_profile_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*replication_hosts":{"limit":0,"precache":false,"replicate":false,"static_ttl":false},"*resource_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*resource_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*reverse_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*route_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*route_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rpc_connections":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*rpc_responses":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2s"},"*stat_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*statqueue_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*statqueues":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*stir":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*threshold_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*threshold_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false},"*uch":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"}},"replication_conns":[]},"cdrs":{"accounts_conns":[],"actions_conns":[],"attributes_conns":[],"chargers_conns":[],"ees_conns":[],"enabled":false,"extra_fields":[],"online_cdr_exports":null,"opts":{"*accountS":[],"*attributeS":[],"*chargerS":[],"*eeS":[],"*rateS":[],"*statS":[],"*thresholdS":[]},"rates_conns":[],"session_cost_retries":5,"stats_conns":[],"store_cdrs":true,"thresholds_conns":[]},"chargers":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"config_db":{"db_host":"","db_name":"","db_password":"","db_port":0,"db_type":"*internal","db_user":"","opts":{"mongoQueryTimeout":"10s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0s","redisClusterSync":"5s","redisSentinel":"","redisTLS":false}},"configs":{"enabled":false,"root_dir":"/var/spool/cgrates/configs","url":"/configs/"},"cores":{"caps":0,"caps_stats_interval":"0","caps_strategy":"*busy","ees_conns":[],"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_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*accounts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*action_profile_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*action_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*actions":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*attribute_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*attribute_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*charger_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*charger_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*dispatcher_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*dispatcher_hosts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*dispatcher_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*filters":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*load_ids":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*rate_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*rate_profile_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*rate_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*resource_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*resource_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*resources":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*reverse_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*route_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*route_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*stat_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*statqueue_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*statqueues":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*threshold_filter_indexes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*threshold_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*thresholds":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*versions":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false}},"opts":{"mongoQueryTimeout":"10s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0s","redisClusterSync":"5s","redisSentinel":"","redisTLS":false},"remote_conn_id":"","remote_conns":[],"replication_cache":"","replication_conns":[],"replication_filtered":false},"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":["*birpc_internal"],"synced_conn_requests":false,"vendor_id":0},"dispatchers":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"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":{"*fileCSV":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"concurrent_requests":0,"export_path":"/var/spool/cgrates/ees","failed_posts_dir":"/var/spool/cgrates/failed_posts","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"timezone":"","type":"*none"}]},"ers":{"enabled":false,"partial_cache_ttl":"1s","readers":[{"cache_dump_fields":[],"concurrent_requests":1024,"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":[],"id":"*default","opts":{"csvFieldSeparator":",","csvHeaderDefineChar":":","csvRowLength":0,"natsSubject":"cgrates_cdrs","partialCacheAction":"*none","partialOrderField":"~*req.AnswerTime","xmlRootPath":""},"partial_commit_fields":[],"processed_path":"/var/spool/cgrates/ers/out","run_delay":"0","source_path":"/var/spool/cgrates/ers/in","tenant":"","timezone":"","type":"*none"}],"sessions_conns":["*internal"]},"filters":{"accounts_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":["*birpc_internal"],"subscribe_park":true},"general":{"connect_attempts":5,"connect_timeout":"1s","dbdata_encoding":"*msgpack","decimal_max_scale":0,"decimal_min_scale":0,"decimal_precision":0,"decimal_rounding_mode":"*toNearestEven","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_parallel_conns":100,"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":"0s","forceAttemptHttp2":true,"idleConnTimeout":"1m30s","maxConnsPerHost":0,"maxIdleConns":100,"maxIdleConnsPerHost":2,"responseHeaderTimeout":"0s","skipTLSVerification":false,"tlsHandshakeTimeout":"10s"},"freeswitch_cdrs_url":"/freeswitch_json","http_cdrs":"/cdr_http","json_rpc_url":"/jsonrpc","registrars_url":"/registrar","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":["*birpc_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":{"actions_conns":["*localhost"],"caches_conns":["*localhost"],"data_path":"./","disable_reverse":false,"field_separator":",","gapi_credentials":".gapi/credentials.json","gapi_token":".gapi/token.json","tpid":""},"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.4"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.5"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.6"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.7"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.8"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"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":"Weight","tag":"Weight","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"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"Metrics.FilterIDs","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":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"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":"Weight","tag":"Weight","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":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.12"},{"path":"Routes.Blocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"}],"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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"}],"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":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.4"},{"path":"StrategyParams","tag":"StrategyParameters","type":"*variable","value":"~*req.5"},{"new_branch":true,"path":"Hosts.ID","tag":"ConnID","type":"*variable","value":"~*req.6"},{"path":"Hosts.FilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.7"},{"path":"Hosts.Weight","tag":"ConnWeight","type":"*variable","value":"~*req.8"},{"path":"Hosts.Blocker","tag":"ConnBlocker","type":"*variable","value":"~*req.9"},{"path":"Hosts.Params","tag":"ConnParameters","type":"*variable","value":"~*req.10"}],"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":"ConnectAttempts","tag":"ConnectAttempts","type":"*variable","value":"~*req.4"},{"path":"Reconnects","tag":"Reconnects","type":"*variable","value":"~*req.5"},{"path":"ConnectTimeout","tag":"ConnectTimeout","type":"*variable","value":"~*req.6"},{"path":"ReplyTimeout","tag":"ReplyTimeout","type":"*variable","value":"~*req.7"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.8"},{"path":"ClientKey","tag":"ClientKey","type":"*variable","value":"~*req.9"},{"path":"ClientCertificate","tag":"ClientCertificate","type":"*variable","value":"~*req.10"},{"path":"CaCertificate","tag":"CaCertificate","type":"*variable","value":"~*req.11"}],"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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.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":"Weight","tag":"Weight","type":"*variable","value":"~*req.3"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.4"},{"path":"Targets[\u003c~*req.5\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Blocker","tag":"ActionBlocker","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Actions[\u003c~*req.7\u003e].Diktats.Path","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Actions[\u003c~*req.7\u003e].Diktats.Value","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.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":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.4"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.5:"],"path":"Balances[\u003c~*req.5\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.14"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.15"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}],"migrator":{"out_datadb_encoding":"msgpack","out_datadb_host":"127.0.0.1","out_datadb_name":"10","out_datadb_opts":{"mongoQueryTimeout":"0s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0s","redisClusterSync":"5s","redisSentinel":"","redisTLS":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":{"mongoQueryTimeout":"0s","mysqlLocation":"","sqlConnMaxLifetime":"0s","sqlMaxIdleConns":0,"sqlMaxOpenConns":0,"sslMode":""},"out_stordb_password":"","out_stordb_port":"3306","out_stordb_type":"mysql","out_stordb_user":"cgrates","users_filters":null},"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"]},"rates":{"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*intervalStart":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*startTime":[],"*usage":[]},"prefix_indexed_fields":[],"rate_exists_indexed_fields":[],"rate_indexed_selects":true,"rate_nested_fields":false,"rate_notexists_indexed_fields":[],"rate_prefix_indexed_fields":[],"rate_suffix_indexed_fields":[],"suffix_indexed_fields":[],"verbosity":1000},"registrarc":{"dispatchers":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]},"rpc":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]}},"resources":{"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*units":[],"*usageID":[],"*usageTTL":[]},"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"accounts_conns":[],"attributes_conns":[],"default_ratio":1,"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*context":[],"*ignoreErrors":[],"*limit":[],"*maxCost":[],"*offset":[],"*profileCount":[],"*usage":[]},"prefix_indexed_fields":[],"rates_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"rpc_conns":{"*bijson_localhost":{"conns":[{"address":"127.0.0.1:2014","transport":"*birpc_json"}],"poolSize":0,"strategy":"*first"},"*birpc_internal":{"conns":[{"address":"*birpc_internal","transport":""}],"poolSize":0,"strategy":"*first"},"*internal":{"conns":[{"address":"*internal","transport":""}],"poolSize":0,"strategy":"*first"},"*localhost":{"conns":[{"address":"127.0.0.1:2012","transport":"*json"}],"poolSize":0,"strategy":"*first"}},"sessions":{"accounts_conns":[],"actions_conns":[],"alterable_fields":[],"attributes_conns":[],"cdrs_conns":[],"channel_sync_interval":"0","chargers_conns":[],"client_protocol":1,"default_usage":{"*any":"3h0m0s","*data":"1048576","*sms":"1","*voice":"3h0m0s"},"enabled":false,"listen_bigob":"","listen_bijson":"127.0.0.1:2014","min_dur_low_balance":"0","opts":{"*accountS":[],"*attributeS":[],"*attributesDerivedReply":[],"*blockerError":[],"*cdrS":[],"*cdrsDerivedReply":[],"*chargeable":[],"*chargerS":[],"*debitInterval":[],"*forceDuration":[],"*initiate":[],"*maxUsage":[],"*message":[],"*resourceS":[],"*resourcesAllocate":[],"*resourcesAuthorize":[],"*resourcesDerivedReply":[],"*resourcesRelease":[],"*routeS":[],"*routesDerivedReply":[],"*statS":[],"*statsDerivedReply":[],"*terminate":[],"*thresholdS":[],"*thresholdsDerivedReply":[],"*ttl":[],"*ttlLastUsage":[],"*ttlLastUsed":[],"*ttlMaxDelay":[],"*ttlUsage":[],"*update":[]},"rates_conns":[],"replication_conns":[],"resources_conns":[],"routes_conns":[],"session_indexes":[],"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":"1s","sessions_conns":["*internal"],"timezone":""},"stats":{"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[],"*roundingDecimals":[]},"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":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*session_costs":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_accounts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_action_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_attributes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_chargers":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_dispatcher_hosts":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_dispatcher_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_filters":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_rate_profiles":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_resources":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_routes":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_stats":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*tp_thresholds":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false},"*versions":{"limit":-1,"remote":false,"replicate":false,"static_ttl":false}},"opts":{"mongoQueryTimeout":"10s","mysqlLocation":"Local","sqlConnMaxLifetime":"0s","sqlMaxIdleConns":10,"sqlMaxOpenConns":100,"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"}],"*cdrLog":[{"mandatory":true,"path":"*cdr.ToR","tag":"ToR","type":"*variable","value":"~*req.BalanceType"},{"mandatory":true,"path":"*cdr.OriginHost","tag":"OriginHost","type":"*constant","value":"127.0.0.1"},{"mandatory":true,"path":"*cdr.RequestType","tag":"RequestType","type":"*constant","value":"*none"},{"mandatory":true,"path":"*cdr.Tenant","tag":"Tenant","type":"*variable","value":"~*req.Tenant"},{"mandatory":true,"path":"*cdr.Account","tag":"Account","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Subject","tag":"Subject","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Cost","tag":"Cost","type":"*variable","value":"~*req.Cost"},{"mandatory":true,"path":"*cdr.Source","tag":"Source","type":"*constant","value":"*cdrLog"},{"mandatory":true,"path":"*cdr.Usage","tag":"Usage","type":"*constant","value":"1"},{"mandatory":true,"path":"*cdr.RunID","tag":"RunID","type":"*variable","value":"~*req.ActionType"},{"mandatory":true,"path":"*cdr.SetupTime","tag":"SetupTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.AnswerTime","tag":"AnswerTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.PreRated","tag":"PreRated","type":"*constant","value":"true"}],"*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":{"actions_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*profileIDs":[],"*profileIgnoreFilters":[]},"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/config/loaderscfg_test.go b/config/loaderscfg_test.go index c3234c19f..a7de01be7 100644 --- a/config/loaderscfg_test.go +++ b/config/loaderscfg_test.go @@ -44,31 +44,30 @@ func TestLoaderSCfgloadFromJsonCfgCase1(t *testing.T) { "file_name": "Attributes.csv", "flags": [], "fields": [ - {"tag": "TenantID", "path": "Tenant", "type": "*composed", "value": "~req.0", "mandatory": true,"layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "TenantID", "path": "Tenant", "type": "*composed", "value": "~*req.0", "mandatory": true,"layout": "2006-01-02T15:04:05Z07:00"}, ], }, ], }, ], }` - val, err := NewRSRParsers("~req.0", utils.InfieldSep) - if err != nil { - t.Error(err) - } - ten := "cgrates.org" + var flags utils.FlagsWithParams expected := LoaderSCfgs{ { - Enabled: true, ID: utils.MetaDefault, - Tenant: ten, + Enabled: true, + Tenant: "cgrates.org", + RunDelay: 0, LockFilePath: ".cgr.lck", CacheSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCaches), "*conn1"}, FieldSeparator: ",", TpInDir: "/var/spool/cgrates/loader/in", TpOutDir: "/var/spool/cgrates/loader/out", Action: utils.MetaStore, - Opts: &LoaderSOptsCfg{WithIndex: true}, + Opts: &LoaderSOptsCfg{ + WithIndex: true, + }, Cache: map[string]*CacheParamCfg{ utils.MetaFilters: {Limit: -1, TTL: 5 * time.Second}, utils.MetaAttributes: {Limit: -1, TTL: 5 * time.Second}, @@ -85,1262 +84,823 @@ func TestLoaderSCfgloadFromJsonCfgCase1(t *testing.T) { }, Data: []*LoaderDataType{ { - Type: "*filters", - Filename: "Filters.csv", + Type: utils.MetaFilters, + Filename: utils.FiltersCsv, Flags: flags, Fields: []*FCTemplate{ - { - Tag: "Tenant", + {Tag: "Tenant", Path: "Tenant", - pathSlice: []string{"Tenant"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", + Layout: time.RFC3339}, + {Tag: "ID", Path: "ID", - pathSlice: []string{"ID"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "Type", - Path: "Type", - pathSlice: []string{"Type"}, + Layout: time.RFC3339}, + {Tag: "Type", + Path: "Rules.Type", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Element", - Path: "Element", - pathSlice: []string{"Element"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Values", - Path: "Values", - pathSlice: []string{"Values"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, + NewBranch: true, + Layout: time.RFC3339}, + {Tag: "Element", + Path: "Rules.Element", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Values", + Path: "Rules.Values", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, }, }, { - Type: "*attributes", - Filename: "Attributes.csv", - Flags: utils.FlagsWithParams{}, + Type: utils.MetaAttributes, + Filename: utils.AttributesCsv, + Flags: make(utils.FlagsWithParams), Fields: []*FCTemplate{ - { - Tag: "TenantID", + {Tag: "TenantID", Path: "Tenant", - pathSlice: []string{"Tenant"}, Type: utils.MetaComposed, - Value: val, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), Mandatory: true, Layout: time.RFC3339, }, }, }, { - Type: "*resources", - Filename: "Resources.csv", - Flags: flags, + Type: utils.MetaResources, + Filename: utils.ResourcesCsv, Fields: []*FCTemplate{ - { - Tag: "Tenant", + {Tag: "Tenant", Path: "Tenant", - pathSlice: []string{"Tenant"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", + Layout: time.RFC3339}, + {Tag: "ID", Path: "ID", - pathSlice: []string{"ID"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weight", + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "TTL", + Path: "UsageTTL", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Limit", + Path: "Limit", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "AllocationMessage", + Path: "AllocationMessage", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Blocker", + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Stored", + Path: "Stored", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ThresholdIDs", + Path: "ThresholdIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, + }, + }, + { + Type: utils.MetaStats, + Filename: utils.StatsCsv, + Flags: flags, + Fields: []*FCTemplate{ + {Tag: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weight", - Path: "Weight", - pathSlice: []string{"Weight"}, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "ID", + Path: "ID", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "TTL", - Path: "UsageTTL", - pathSlice: []string{"UsageTTL"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Limit", - Path: "Limit", - pathSlice: []string{"Limit"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "AllocationMessage", - Path: "AllocationMessage", - pathSlice: []string{"AllocationMessage"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Blocker", - Path: "Blocker", - pathSlice: []string{"Blocker"}, + Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weight", + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "QueueLength", + Path: "QueueLength", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "TTL", + Path: "TTL", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "MinItems", + Path: "MinItems", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "MetricIDs", + Path: "Metrics.MetricID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Stored", - Path: "Stored", - pathSlice: []string{"Stored"}, + NewBranch: true, + Layout: time.RFC3339}, + {Tag: "MetricFilterIDs", + Path: "Metrics.FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Blocker", + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Stored", + Path: "Stored", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339}, + + {Tag: "ThresholdIDs", + Path: "ThresholdIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339}, + }, + }, + { + Type: utils.MetaThresholds, + Flags: flags, + Filename: utils.ThresholdsCsv, + Fields: []*FCTemplate{ + {Tag: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ThresholdIDs", - Path: "ThresholdIDs", - pathSlice: []string{"ThresholdIDs"}, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "ID", + Path: "ID", Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, + Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weight", + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "MaxHits", + Path: "MaxHits", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "MinHits", + Path: "MinHits", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "MinSleep", + Path: "MinSleep", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Blocker", + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionProfileIDs", + Path: "ActionProfileIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Async", + Path: "Async", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, + }, + }, + { + Type: utils.MetaRoutes, + Flags: flags, + Filename: utils.RoutesCsv, + Fields: []*FCTemplate{ + {Tag: "Tenant", + Path: "Tenant", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "ID", + Path: "ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weights", + Path: "Weights", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Sorting", + Path: "Sorting", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "SortingParameters", + Path: "SortingParameters", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteID", + Path: "Routes.ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, + {Tag: "RouteFilterIDs", + Path: "Routes.FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteAccountIDs", + Path: "Routes.AccountIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteRateProfileIDs", + Path: "Routes.RateProfileIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteResourceIDs", + Path: "Routes.ResourceIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteStatIDs", + Path: "Routes.StatIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteWeights", + Path: "Routes.Weights", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteBlocker", + Path: "Routes.Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RouteParameters", + Path: "Routes.RouteParameters", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339}, + }, + }, + { + Type: utils.MetaChargers, + Flags: flags, + Filename: utils.ChargersCsv, + Fields: []*FCTemplate{ + {Tag: "Tenant", + Path: "Tenant", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "ID", + Path: "ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weight", + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "RunID", + Path: "RunID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "AttributeIDs", + Path: "AttributeIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339}, + }, + }, + { + Type: utils.MetaDispatchers, + Flags: flags, + Filename: utils.DispatcherProfilesCsv, + Fields: []*FCTemplate{ + {Tag: "Tenant", + Path: "Tenant", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "ID", + Path: "ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "Weight", + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "Strategy", + Path: "Strategy", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "StrategyParameters", + Path: "StrategyParams", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "ConnID", + Path: "Hosts.ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), Layout: time.RFC3339, + NewBranch: true, + }, + {Tag: "ConnFilterIDs", + Path: "Hosts.FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "ConnWeight", + Path: "Hosts.Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "ConnBlocker", + Path: "Hosts.Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "ConnParameters", + Path: "Hosts.Params", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339, }, }, }, { - Type: "*stats", - Filename: "Stats.csv", + Type: utils.MetaDispatcherHosts, Flags: flags, + Filename: utils.DispatcherHostsCsv, Fields: []*FCTemplate{ - { - Tag: "Tenant", + {Tag: "Tenant", Path: "Tenant", - pathSlice: []string{"Tenant"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", + Layout: time.RFC3339}, + {Tag: "ID", Path: "ID", - pathSlice: []string{"ID"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, + Layout: time.RFC3339}, + {Tag: "Address", + Path: "Address", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "Transport", + Path: "Transport", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "ConnectAttempts", + Path: "ConnectAttempts", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "Weight", - Path: "Weight", - pathSlice: []string{"Weight"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "Reconnects", + Path: "Reconnects", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "QueueLength", - Path: "QueueLength", - pathSlice: []string{"QueueLength"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "ConnectTimeout", + Path: "ConnectTimeout", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "TTL", - Path: "TTL", - pathSlice: []string{"TTL"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "ReplyTimeout", + Path: "ReplyTimeout", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "MinItems", - Path: "MinItems", - pathSlice: []string{"MinItems"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "TLS", + Path: "TLS", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "MetricIDs", - Path: "MetricIDs", - pathSlice: []string{"MetricIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "ClientKey", + Path: "ClientKey", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "MetricFilterIDs", - Path: "MetricFilterIDs", - pathSlice: []string{"MetricFilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "ClientCertificate", + Path: "ClientCertificate", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339, }, { - Tag: "Blocker", - Path: "Blocker", - pathSlice: []string{"Blocker"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Stored", - Path: "Stored", - pathSlice: []string{"Stored"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ThresholdIDs", - Path: "ThresholdIDs", - pathSlice: []string{"ThresholdIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + Tag: "CaCertificate", + Path: "CaCertificate", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339, }, }, }, { - Type: "*thresholds", - Filename: "Thresholds.csv", + Type: utils.MetaRateProfiles, Flags: flags, + Filename: utils.RatesCsv, Fields: []*FCTemplate{ - { - Tag: "Tenant", + {Tag: "Tenant", Path: "Tenant", - pathSlice: []string{"Tenant"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", + Layout: time.RFC3339}, + {Tag: "ID", Path: "ID", - pathSlice: []string{"ID"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "Weights", + Path: "Weights", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "Weight", - Path: "Weight", - pathSlice: []string{"Weight"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "MinCost", + Path: "MinCost", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "MaxHits", - Path: "MaxHits", - pathSlice: []string{"MaxHits"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "MaxCost", + Path: "MaxCost", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "MinHits", - Path: "MinHits", - pathSlice: []string{"MinHits"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "MaxCostStrategy", + Path: "MaxCostStrategy", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "MinSleep", - Path: "MinSleep", - pathSlice: []string{"MinSleep"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "RateFilterIDs", + Path: "Rates[<~*req.7>].FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "Blocker", - Path: "Blocker", - pathSlice: []string{"Blocker"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "RateActivationTimes", + Path: "Rates[<~*req.7>].ActivationTimes", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "ActionProfileIDs", - Path: "ActionProfileIDs", - pathSlice: []string{"ActionProfileIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "RateWeights", + Path: "Rates[<~*req.7>].Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339, }, - { - Tag: "Async", - Path: "Async", - pathSlice: []string{"Async"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, + {Tag: "RateBlocker", + Path: "Rates[<~*req.7>].Blocker", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339, }, - }, - }, - { - Type: "*routes", - Filename: "Routes.csv", - Flags: flags, - Fields: []*FCTemplate{ - { - Tag: "Tenant", - Path: "Tenant", - pathSlice: []string{"Tenant"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", - Path: "ID", - pathSlice: []string{"ID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weights", - Path: "Weights", - pathSlice: []string{"Weights"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Sorting", - Path: "Sorting", - pathSlice: []string{"Sorting"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "SortingParameters", - Path: "SortingParameters", - pathSlice: []string{"SortingParameters"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteID", - Path: "RouteID", - pathSlice: []string{"RouteID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteFilterIDs", - Path: "RouteFilterIDs", - pathSlice: []string{"RouteFilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteAccountIDs", - Path: "RouteAccountIDs", - pathSlice: []string{"RouteAccountIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteRateProfileIDs", - Path: "RouteRateProfileIDs", - pathSlice: []string{"RouteRateProfileIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteResourceIDs", - Path: "RouteResourceIDs", - pathSlice: []string{"RouteResourceIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteStatIDs", - Path: "RouteStatIDs", - pathSlice: []string{"RouteStatIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteWeights", - Path: "RouteWeights", - pathSlice: []string{"RouteWeights"}, + {Tag: "RateIntervalStart", + Path: "Rates[<~*req.7>].IntervalRates.IntervalStart", Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Mandatory: false, Layout: time.RFC3339, + NewBranch: true, }, - { - Tag: "RouteBlocker", - Path: "RouteBlocker", - pathSlice: []string{"RouteBlocker"}, + {Tag: "RateFixedFee", + Path: "Rates[<~*req.7>].IntervalRates.FixedFee", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "RateRecurrentFee", + Path: "Rates[<~*req.7>].IntervalRates.RecurrentFee", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "RateUnit", + Path: "Rates[<~*req.7>].IntervalRates.Unit", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), + Layout: time.RFC3339, + }, + {Tag: "RateIncrement", + Path: "Rates[<~*req.7>].IntervalRates.Increment", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), + Layout: time.RFC3339, + }, + }, + }, + { + Type: utils.MetaActionProfiles, + Flags: flags, + Filename: utils.ActionsCsv, + Fields: []*FCTemplate{ + {Tag: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "ID", + Path: "ID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), + Mandatory: true, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weight", + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Schedule", + Path: "Schedule", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "TargetIDs", + Path: "Targets[<~*req.5>]", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionFilterIDs", + Path: "Actions[<~*req.7>].FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionBlocker", + Path: "Actions[<~*req.7>].Blocker", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionTTL", + Path: "Actions[<~*req.7>].TTL", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionType", + Path: "Actions[<~*req.7>].Type", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionOpts", + Path: "Actions[<~*req.7>].Opts", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionPath", + Path: "Actions[<~*req.7>].Diktats.Path", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RouteParameters", - Path: "RouteParameters", - pathSlice: []string{"RouteParameters"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, + NewBranch: true, + Layout: time.RFC3339}, + {Tag: "ActionValue", + Path: "Actions[<~*req.7>].Diktats.Value", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.7:"}, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339}, }, }, { - Type: "*chargers", - Filename: "Chargers.csv", + Type: utils.MetaAccounts, Flags: flags, + Filename: utils.AccountsCsv, Fields: []*FCTemplate{ - { - Tag: "Tenant", + {Tag: "Tenant", Path: "Tenant", - pathSlice: []string{"Tenant"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", + Layout: time.RFC3339}, + {Tag: "ID", Path: "ID", - pathSlice: []string{"ID"}, Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weight", - Path: "Weight", - pathSlice: []string{"Weight"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RunID", - Path: "RunID", - pathSlice: []string{"RunID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "AttributeIDs", - Path: "AttributeIDs", - pathSlice: []string{"AttributeIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - }, - }, - { - Type: "*dispatchers", - Filename: "DispatcherProfiles.csv", - Flags: flags, - Fields: []*FCTemplate{ - { - Tag: "Tenant", - Path: "Tenant", - pathSlice: []string{"Tenant"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", - Path: "ID", - pathSlice: []string{"ID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weight", - Path: "Weight", - pathSlice: []string{"Weight"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Strategy", - Path: "Strategy", - pathSlice: []string{"Strategy"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "StrategyParameters", - Path: "StrategyParameters", - pathSlice: []string{"StrategyParameters"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnID", - Path: "ConnID", - pathSlice: []string{"ConnID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnFilterIDs", - Path: "ConnFilterIDs", - pathSlice: []string{"ConnFilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnWeight", - Path: "ConnWeight", - pathSlice: []string{"ConnWeight"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnBlocker", - Path: "ConnBlocker", - pathSlice: []string{"ConnBlocker"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnParameters", - Path: "ConnParameters", - pathSlice: []string{"ConnParameters"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - }, - }, - { - Type: "*dispatcher_hosts", - Filename: "DispatcherHosts.csv", - Flags: flags, - Fields: []*FCTemplate{ - { - Tag: "Tenant", - Path: "Tenant", - pathSlice: []string{"Tenant"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", - Path: "ID", - pathSlice: []string{"ID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "Address", - Path: "Address", - pathSlice: []string{"Address"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Transport", - Path: "Transport", - pathSlice: []string{"Transport"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnectAttempts", - Path: "ConnectAttempts", - pathSlice: []string{"ConnectAttempts"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Reconnects", - Path: "Reconnects", - pathSlice: []string{"Reconnects"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ConnectTimeout", - Path: "ConnectTimeout", - pathSlice: []string{"ConnectTimeout"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ReplyTimeout", - Path: "ReplyTimeout", - pathSlice: []string{"ReplyTimeout"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "TLS", - Path: "TLS", - pathSlice: []string{"TLS"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ClientKey", - Path: "ClientKey", - pathSlice: []string{"ClientKey"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ClientCertificate", - Path: "ClientCertificate", - pathSlice: []string{"ClientCertificate"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "CaCertificate", - Path: "CaCertificate", - pathSlice: []string{"CaCertificate"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - }, - }, - { - Type: "*rate_profiles", - Filename: "Rates.csv", - Flags: flags, - Fields: []*FCTemplate{ - { - Tag: "Tenant", - Path: "Tenant", - pathSlice: []string{"Tenant"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", - Path: "ID", - pathSlice: []string{"ID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weights", - Path: "Weights", - pathSlice: []string{"Weights"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "MinCost", - Path: "MinCost", - pathSlice: []string{"MinCost"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "MaxCost", - Path: "MaxCost", - pathSlice: []string{"MaxCost"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "MaxCostStrategy", - Path: "MaxCostStrategy", - pathSlice: []string{"MaxCostStrategy"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateID", - Path: "RateID", - pathSlice: []string{"RateID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateFilterIDs", - Path: "RateFilterIDs", - pathSlice: []string{"RateFilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateActivationTimes", - Path: "RateActivationTimes", - pathSlice: []string{"RateActivationTimes"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateWeights", - Path: "RateWeights", - pathSlice: []string{"RateWeights"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateBlocker", - Path: "RateBlocker", - pathSlice: []string{"RateBlocker"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateIntervalStart", - Path: "RateIntervalStart", - pathSlice: []string{"RateIntervalStart"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateFixedFee", - Path: "RateFixedFee", - pathSlice: []string{"RateFixedFee"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateRecurrentFee", - Path: "RateRecurrentFee", - pathSlice: []string{"RateRecurrentFee"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateUnit", - Path: "RateUnit", - pathSlice: []string{"RateUnit"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "RateIncrement", - Path: "RateIncrement", - pathSlice: []string{"RateIncrement"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - }, - }, - { - Type: "*action_profiles", - Filename: "Actions.csv", - Flags: flags, - Fields: []*FCTemplate{ - { - Tag: "Tenant", - Path: "Tenant", - pathSlice: []string{"Tenant"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", - Path: "ID", - pathSlice: []string{"ID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weight", - Path: "Weight", - pathSlice: []string{"Weight"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Schedule", - Path: "Schedule", - pathSlice: []string{"Schedule"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "TargetType", - Path: "TargetType", - pathSlice: []string{"TargetType"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "TargetIDs", - Path: "TargetIDs", - pathSlice: []string{"TargetIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionID", - Path: "ActionID", - pathSlice: []string{"ActionID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionFilterIDs", - Path: "ActionFilterIDs", - pathSlice: []string{"ActionFilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionBlocker", - Path: "ActionBlocker", - pathSlice: []string{"ActionBlocker"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionTTL", - Path: "ActionTTL", - pathSlice: []string{"ActionTTL"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionType", - Path: "ActionType", - pathSlice: []string{"ActionType"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionOpts", - Path: "ActionOpts", - pathSlice: []string{"ActionOpts"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionPath", - Path: "ActionPath", - pathSlice: []string{"ActionPath"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ActionValue", - Path: "ActionValue", - pathSlice: []string{"ActionValue"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - }, - }, - { - Type: "*accounts", - Filename: "Accounts.csv", - Flags: flags, - Fields: []*FCTemplate{ - { - Tag: "Tenant", - Path: "Tenant", - pathSlice: []string{"Tenant"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.0", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "ID", - Path: "ID", - pathSlice: []string{"ID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.1", utils.InfieldSep), - Mandatory: true, - Layout: time.RFC3339, - }, - { - Tag: "FilterIDs", - Path: "FilterIDs", - pathSlice: []string{"FilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Weights", - Path: "Weights", - pathSlice: []string{"Weights"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "Opts", - Path: "Opts", - pathSlice: []string{"Opts"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceID", - Path: "BalanceID", - pathSlice: []string{"BalanceID"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.5", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceFilterIDs", - Path: "BalanceFilterIDs", - pathSlice: []string{"BalanceFilterIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceWeights", - Path: "BalanceWeights", - pathSlice: []string{"BalanceWeights"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceType", - Path: "BalanceType", - pathSlice: []string{"BalanceType"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceUnits", - Path: "BalanceUnits", - pathSlice: []string{"BalanceUnits"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceUnitFactors", - Path: "BalanceUnitFactors", - pathSlice: []string{"BalanceUnitFactors"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceOpts", - Path: "BalanceOpts", - pathSlice: []string{"BalanceOpts"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceCostIncrements", - Path: "BalanceCostIncrements", - pathSlice: []string{"BalanceCostIncrements"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceAttributeIDs", - Path: "BalanceAttributeIDs", - pathSlice: []string{"BalanceAttributeIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "BalanceRateProfileIDs", - Path: "BalanceRateProfileIDs", - pathSlice: []string{"BalanceRateProfileIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, - { - Tag: "ThresholdIDs", - Path: "ThresholdIDs", - pathSlice: []string{"ThresholdIDs"}, - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), - Mandatory: false, - Layout: time.RFC3339, - }, + Layout: time.RFC3339}, + {Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.2", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Weights", + Path: "Weights", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.3", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "Opts", + Path: "Opts", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.4", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceFilterIDs", + Path: "Balances[<~*req.5>].FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.6", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceWeights", + Path: "Balances[<~*req.5>].Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.7", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceType", + Path: "Balances[<~*req.5>].Type", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.8", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceUnits", + Path: "Balances[<~*req.5>].Units", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.9", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceUnitFactors", + Path: "Balances[<~*req.5>].UnitFactors", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.10", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceOpts", + Path: "Balances[<~*req.5>].Opts", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.11", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceCostIncrements", + Path: "Balances[<~*req.5>].CostIncrements", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceAttributeIDs", + Path: "Balances[<~*req.5>].AttributeIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "BalanceRateProfileIDs", + Path: "Balances[<~*req.5>].RateProfileIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.5:"}, + Value: NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ThresholdIDs", + Path: "ThresholdIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), + Layout: time.RFC3339}, }, }, }, }, } + for _, d := range expected[0].Data { + for _, f := range d.Fields { + f.ComputePath() + } + } if jsonCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil { t.Error(err) } else if !reflect.DeepEqual(expected, jsonCfg.loaderCfg) { @@ -1592,20 +1152,21 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.MandatoryCfg: true, }, { - utils.TagCfg: "Type", - utils.PathCfg: "Type", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.2", + utils.NewBranchCfg: true, + utils.PathCfg: "Rules.Type", + utils.TagCfg: "Type", + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.2", }, { utils.TagCfg: "Element", - utils.PathCfg: "Element", + utils.PathCfg: "Rules.Element", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.3", }, { utils.TagCfg: "Values", - utils.PathCfg: "Values", + utils.PathCfg: "Rules.Values", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.4", }, @@ -1750,14 +1311,15 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.ValueCfg: "~*req.6", }, { - utils.TagCfg: "MetricIDs", - utils.PathCfg: "MetricIDs", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.7", + utils.NewBranchCfg: true, + utils.TagCfg: "MetricIDs", + utils.PathCfg: "Metrics.MetricID", + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.7", }, { utils.TagCfg: "MetricFilterIDs", - utils.PathCfg: "MetricFilterIDs", + utils.PathCfg: "Metrics.FilterIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.8", }, @@ -1894,56 +1456,57 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.ValueCfg: "~*req.5", }, { - utils.TagCfg: "RouteID", - utils.PathCfg: "RouteID", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.6", + utils.NewBranchCfg: true, + utils.TagCfg: "RouteID", + utils.PathCfg: "Routes.ID", + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.6", }, { utils.TagCfg: "RouteFilterIDs", - utils.PathCfg: "RouteFilterIDs", + utils.PathCfg: "Routes.FilterIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.7", }, { utils.TagCfg: "RouteAccountIDs", - utils.PathCfg: "RouteAccountIDs", + utils.PathCfg: "Routes.AccountIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.8", }, { utils.TagCfg: "RouteRateProfileIDs", - utils.PathCfg: "RouteRateProfileIDs", + utils.PathCfg: "Routes.RateProfileIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.9", }, { utils.TagCfg: "RouteResourceIDs", - utils.PathCfg: "RouteResourceIDs", + utils.PathCfg: "Routes.ResourceIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.10", }, { utils.TagCfg: "RouteStatIDs", - utils.PathCfg: "RouteStatIDs", + utils.PathCfg: "Routes.StatIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.11", }, { utils.TagCfg: "RouteWeights", - utils.PathCfg: "RouteWeights", + utils.PathCfg: "Routes.Weights", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.12", }, { utils.TagCfg: "RouteBlocker", - utils.PathCfg: "RouteBlocker", + utils.PathCfg: "Routes.Blocker", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.13", }, { utils.TagCfg: "RouteParameters", - utils.PathCfg: "RouteParameters", + utils.PathCfg: "Routes.RouteParameters", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.14", }, @@ -2033,37 +1596,38 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { }, { utils.TagCfg: "StrategyParameters", - utils.PathCfg: "StrategyParameters", + utils.PathCfg: "StrategyParams", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.5", }, { - utils.TagCfg: "ConnID", - utils.PathCfg: "ConnID", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.6", + utils.NewBranchCfg: true, + utils.TagCfg: "ConnID", + utils.PathCfg: "Hosts.ID", + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.6", }, { utils.TagCfg: "ConnFilterIDs", - utils.PathCfg: "ConnFilterIDs", + utils.PathCfg: "Hosts.FilterIDs", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.7", }, { utils.TagCfg: "ConnWeight", - utils.PathCfg: "ConnWeight", + utils.PathCfg: "Hosts.Weight", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.8", }, { utils.TagCfg: "ConnBlocker", - utils.PathCfg: "ConnBlocker", + utils.PathCfg: "Hosts.Blocker", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.9", }, { utils.TagCfg: "ConnParameters", - utils.PathCfg: "ConnParameters", + utils.PathCfg: "Hosts.Params", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.10", }, @@ -2200,64 +1764,68 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.ValueCfg: "~*req.6", }, { - utils.TagCfg: "RateID", - utils.PathCfg: "RateID", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.7", + utils.TagCfg: "RateFilterIDs", + utils.PathCfg: "Rates[<~*req.7>].FilterIDs", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.8", }, { - utils.TagCfg: "RateFilterIDs", - utils.PathCfg: "RateFilterIDs", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.8", + utils.TagCfg: "RateActivationTimes", + utils.PathCfg: "Rates[<~*req.7>].ActivationTimes", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.9", }, { - utils.TagCfg: "RateActivationTimes", - utils.PathCfg: "RateActivationTimes", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.9", + utils.TagCfg: "RateWeights", + utils.PathCfg: "Rates[<~*req.7>].Weights", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.10", }, { - utils.TagCfg: "RateWeights", - utils.PathCfg: "RateWeights", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.10", + utils.TagCfg: "RateBlocker", + utils.PathCfg: "Rates[<~*req.7>].Blocker", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.11", }, { - utils.TagCfg: "RateBlocker", - utils.PathCfg: "RateBlocker", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.11", + utils.NewBranchCfg: true, + utils.TagCfg: "RateIntervalStart", + utils.PathCfg: "Rates[<~*req.7>].IntervalRates.IntervalStart", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.12", }, { - utils.TagCfg: "RateIntervalStart", - utils.PathCfg: "RateIntervalStart", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.12", + utils.TagCfg: "RateFixedFee", + utils.PathCfg: "Rates[<~*req.7>].IntervalRates.FixedFee", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.13", }, { - utils.TagCfg: "RateFixedFee", - utils.PathCfg: "RateFixedFee", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.13", + utils.TagCfg: "RateRecurrentFee", + utils.PathCfg: "Rates[<~*req.7>].IntervalRates.RecurrentFee", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.14", }, { - utils.TagCfg: "RateRecurrentFee", - utils.PathCfg: "RateRecurrentFee", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.14", + utils.TagCfg: "RateUnit", + utils.PathCfg: "Rates[<~*req.7>].IntervalRates.Unit", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.15", }, { - utils.TagCfg: "RateUnit", - utils.PathCfg: "RateUnit", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.15", - }, - { - utils.TagCfg: "RateIncrement", - utils.PathCfg: "RateIncrement", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.16", + utils.TagCfg: "RateIncrement", + utils.PathCfg: "Rates[<~*req.7>].IntervalRates.Increment", + utils.TypeCfg: "*variable", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.ValueCfg: "~*req.16", }, }, }, @@ -2298,65 +1866,61 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.4", }, - { - utils.TagCfg: "TargetType", - utils.PathCfg: "TargetType", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.5", - }, { utils.TagCfg: "TargetIDs", - utils.PathCfg: "TargetIDs", + utils.PathCfg: "Targets[<~*req.5>]", utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.6", }, { - utils.TagCfg: "ActionID", - utils.PathCfg: "ActionID", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.7", + utils.TagCfg: "ActionFilterIDs", + utils.PathCfg: "Actions[<~*req.7>].FilterIDs", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.8", }, { - utils.TagCfg: "ActionFilterIDs", - utils.PathCfg: "ActionFilterIDs", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.8", + utils.TagCfg: "ActionBlocker", + utils.PathCfg: "Actions[<~*req.7>].Blocker", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.9", }, { - utils.TagCfg: "ActionBlocker", - utils.PathCfg: "ActionBlocker", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.9", + utils.TagCfg: "ActionTTL", + utils.PathCfg: "Actions[<~*req.7>].TTL", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.10", }, { - utils.TagCfg: "ActionTTL", - utils.PathCfg: "ActionTTL", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.10", + utils.TagCfg: "ActionType", + utils.PathCfg: "Actions[<~*req.7>].Type", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.11", }, { - utils.TagCfg: "ActionType", - utils.PathCfg: "ActionType", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.11", + utils.TagCfg: "ActionOpts", + utils.PathCfg: "Actions[<~*req.7>].Opts", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.12", }, { - utils.TagCfg: "ActionOpts", - utils.PathCfg: "ActionOpts", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.12", + utils.NewBranchCfg: true, + utils.TagCfg: "ActionPath", + utils.PathCfg: "Actions[<~*req.7>].Diktats.Path", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.13", }, { - utils.TagCfg: "ActionPath", - utils.PathCfg: "ActionPath", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.13", - }, - { - utils.TagCfg: "ActionValue", - utils.PathCfg: "ActionValue", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.14", + utils.TagCfg: "ActionValue", + utils.PathCfg: "Actions[<~*req.7>].Diktats.Value", + utils.FiltersCfg: []string{"*notempty:~*req.7:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.14", }, }, }, @@ -2398,64 +1962,67 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.ValueCfg: "~*req.4", }, { - utils.TagCfg: "BalanceID", - utils.PathCfg: "BalanceID", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.5", + utils.TagCfg: "BalanceFilterIDs", + utils.PathCfg: "Balances[<~*req.5>].FilterIDs", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.6", }, { - utils.TagCfg: "BalanceFilterIDs", - utils.PathCfg: "BalanceFilterIDs", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.6", + utils.TagCfg: "BalanceWeights", + utils.PathCfg: "Balances[<~*req.5>].Weights", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.7", }, { - utils.TagCfg: "BalanceWeights", - utils.PathCfg: "BalanceWeights", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.7", + utils.TagCfg: "BalanceType", + utils.PathCfg: "Balances[<~*req.5>].Type", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.8", }, { - utils.TagCfg: "BalanceType", - utils.PathCfg: "BalanceType", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.8", + utils.TagCfg: "BalanceUnits", + utils.PathCfg: "Balances[<~*req.5>].Units", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.9", }, { - utils.TagCfg: "BalanceUnits", - utils.PathCfg: "BalanceUnits", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.9", + utils.TagCfg: "BalanceUnitFactors", + utils.PathCfg: "Balances[<~*req.5>].UnitFactors", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.10", }, { - utils.TagCfg: "BalanceUnitFactors", - utils.PathCfg: "BalanceUnitFactors", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.10", + utils.TagCfg: "BalanceOpts", + utils.PathCfg: "Balances[<~*req.5>].Opts", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.11", }, { - utils.TagCfg: "BalanceOpts", - utils.PathCfg: "BalanceOpts", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.11", + utils.TagCfg: "BalanceCostIncrements", + utils.PathCfg: "Balances[<~*req.5>].CostIncrements", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.12", }, { - utils.TagCfg: "BalanceCostIncrements", - utils.PathCfg: "BalanceCostIncrements", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.12", + utils.TagCfg: "BalanceAttributeIDs", + utils.PathCfg: "Balances[<~*req.5>].AttributeIDs", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.13", }, { - utils.TagCfg: "BalanceAttributeIDs", - utils.PathCfg: "BalanceAttributeIDs", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.13", - }, - { - utils.TagCfg: "BalanceRateProfileIDs", - utils.PathCfg: "BalanceRateProfileIDs", - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.14", + utils.TagCfg: "BalanceRateProfileIDs", + utils.PathCfg: "Balances[<~*req.5>].RateProfileIDs", + utils.FiltersCfg: []string{"*notempty:~*req.5:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.14", }, { utils.TagCfg: "ThresholdIDs", diff --git a/general_tests/all_cfg_rld_it_test.go b/general_tests/all_cfg_rld_it_test.go index 4ac18eeed..0f944f2df 100644 --- a/general_tests/all_cfg_rld_it_test.go +++ b/general_tests/all_cfg_rld_it_test.go @@ -424,7 +424,7 @@ func testConfigSReload(t *testing.T) { } } else if testCfgDir == "tutmysql" || testCfgDir == "tutmongo" { - cfgStr = "{\"loaders\":[{\"action\":\"*store\",\"cache\":{\"*accounts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*action_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*attributes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*chargers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatcher_hosts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatchers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*filters\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*rate_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*resources\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*routes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*stats\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*thresholds\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"}},\"caches_conns\":[\"*internal\"],\"data\":[{\"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\"}],\"file_name\":\"Filters.csv\",\"flags\":null,\"type\":\"*filters\"},{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"TenantID\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ProfileID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"path\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"AttributeFilterIDs\",\"tag\":\"AttributeFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Path\",\"tag\":\"Path\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Value\",\"tag\":\"Value\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"type\":\"*variable\",\"value\":\"~*req.8\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ActionProfileIDs\",\"tag\":\"ActionProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Async\",\"tag\":\"Async\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"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\":\"RouteRateProfileIDs\",\"tag\":\"RouteRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RouteResourceIDs\",\"tag\":\"RouteResourceIDs\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RouteStatIDs\",\"tag\":\"RouteStatIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RouteWeights\",\"tag\":\"RouteWeights\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RouteBlocker\",\"tag\":\"RouteBlocker\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RouteParameters\",\"tag\":\"RouteParameters\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"RunID\",\"tag\":\"RunID\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"AttributeIDs\",\"tag\":\"AttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.5\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Strategy\",\"tag\":\"Strategy\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"StrategyParameters\",\"tag\":\"StrategyParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnID\",\"tag\":\"ConnID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ConnFilterIDs\",\"tag\":\"ConnFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ConnWeight\",\"tag\":\"ConnWeight\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ConnBlocker\",\"tag\":\"ConnBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ConnParameters\",\"tag\":\"ConnParameters\",\"type\":\"*variable\",\"value\":\"~*req.10\"}],\"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\":\"ConnectAttempts\",\"tag\":\"ConnectAttempts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Reconnects\",\"tag\":\"Reconnects\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnectTimeout\",\"tag\":\"ConnectTimeout\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ReplyTimeout\",\"tag\":\"ReplyTimeout\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"TLS\",\"tag\":\"TLS\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ClientKey\",\"tag\":\"ClientKey\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ClientCertificate\",\"tag\":\"ClientCertificate\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"CaCertificate\",\"tag\":\"CaCertificate\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"MinCost\",\"tag\":\"MinCost\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"MaxCost\",\"tag\":\"MaxCost\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"MaxCostStrategy\",\"tag\":\"MaxCostStrategy\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"RateID\",\"tag\":\"RateID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"RateFilterIDs\",\"tag\":\"RateFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"RateActivationTimes\",\"tag\":\"RateActivationTimes\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RateWeights\",\"tag\":\"RateWeights\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RateBlocker\",\"tag\":\"RateBlocker\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RateIntervalStart\",\"tag\":\"RateIntervalStart\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RateFixedFee\",\"tag\":\"RateFixedFee\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RateRecurrentFee\",\"tag\":\"RateRecurrentFee\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"RateUnit\",\"tag\":\"RateUnit\",\"type\":\"*variable\",\"value\":\"~*req.15\"},{\"path\":\"RateIncrement\",\"tag\":\"RateIncrement\",\"type\":\"*variable\",\"value\":\"~*req.16\"}],\"file_name\":\"Rates.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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Schedule\",\"tag\":\"Schedule\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"TargetType\",\"tag\":\"TargetType\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"TargetIDs\",\"tag\":\"TargetIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ActionID\",\"tag\":\"ActionID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ActionFilterIDs\",\"tag\":\"ActionFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ActionBlocker\",\"tag\":\"ActionBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ActionTTL\",\"tag\":\"ActionTTL\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"ActionType\",\"tag\":\"ActionType\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"ActionOpts\",\"tag\":\"ActionOpts\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"ActionPath\",\"tag\":\"ActionPath\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"ActionValue\",\"tag\":\"ActionValue\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"file_name\":\"Actions.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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Opts\",\"tag\":\"Opts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"BalanceID\",\"tag\":\"BalanceID\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"BalanceFilterIDs\",\"tag\":\"BalanceFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"BalanceWeights\",\"tag\":\"BalanceWeights\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"BalanceType\",\"tag\":\"BalanceType\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"BalanceUnits\",\"tag\":\"BalanceUnits\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"BalanceUnitFactors\",\"tag\":\"BalanceUnitFactors\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"BalanceOpts\",\"tag\":\"BalanceOpts\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"BalanceCostIncrements\",\"tag\":\"BalanceCostIncrements\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"BalanceAttributeIDs\",\"tag\":\"BalanceAttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"BalanceRateProfileIDs\",\"tag\":\"BalanceRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.15\"}],\"file_name\":\"Accounts.csv\",\"flags\":null,\"type\":\"*accounts\"}],\"enabled\":false,\"field_separator\":\",\",\"id\":\"*default\",\"lockfile_path\":\".cgr.lck\",\"opts\":{\"*cache\":\"\",\"*forceLock\":false,\"*stopOnError\":false,\"*withIndex\":true},\"run_delay\":\"0\",\"tenant\":\"\",\"tp_in_dir\":\"/var/spool/cgrates/loader/in\",\"tp_out_dir\":\"/var/spool/cgrates/loader/out\"}]}" + cfgStr = "{\"loaders\":[{\"action\":\"*store\",\"cache\":{\"*accounts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*action_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*attributes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*chargers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatcher_hosts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatchers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*filters\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*rate_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*resources\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*routes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*stats\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*thresholds\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"}},\"caches_conns\":[\"*internal\"],\"data\":[{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"Tenant\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"new_branch\":true,\"path\":\"Rules.Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Rules.Element\",\"tag\":\"Element\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Rules.Values\",\"tag\":\"Values\",\"type\":\"*variable\",\"value\":\"~*req.4\"}],\"file_name\":\"Filters.csv\",\"flags\":null,\"type\":\"*filters\"},{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"TenantID\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ProfileID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"path\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"new_branch\":true,\"path\":\"Attributes.FilterIDs\",\"tag\":\"AttributeFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Attributes.Path\",\"tag\":\"Path\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"Attributes.Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Attributes.Value\",\"tag\":\"Value\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"type\":\"*variable\",\"value\":\"~*req.8\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\"},{\"new_branch\":true,\"path\":\"Metrics.MetricID\",\"tag\":\"MetricIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Metrics.FilterIDs\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ActionProfileIDs\",\"tag\":\"ActionProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Async\",\"tag\":\"Async\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Sorting\",\"tag\":\"Sorting\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"SortingParameters\",\"tag\":\"SortingParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"new_branch\":true,\"path\":\"Routes.ID\",\"tag\":\"RouteID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Routes.FilterIDs\",\"tag\":\"RouteFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Routes.AccountIDs\",\"tag\":\"RouteAccountIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Routes.RateProfileIDs\",\"tag\":\"RouteRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"Routes.ResourceIDs\",\"tag\":\"RouteResourceIDs\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"Routes.StatIDs\",\"tag\":\"RouteStatIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"Routes.Weights\",\"tag\":\"RouteWeights\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"Routes.Blocker\",\"tag\":\"RouteBlocker\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"Routes.RouteParameters\",\"tag\":\"RouteParameters\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"RunID\",\"tag\":\"RunID\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"AttributeIDs\",\"tag\":\"AttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.5\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Strategy\",\"tag\":\"Strategy\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"StrategyParams\",\"tag\":\"StrategyParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"new_branch\":true,\"path\":\"Hosts.ID\",\"tag\":\"ConnID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Hosts.FilterIDs\",\"tag\":\"ConnFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Hosts.Weight\",\"tag\":\"ConnWeight\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Hosts.Blocker\",\"tag\":\"ConnBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"Hosts.Params\",\"tag\":\"ConnParameters\",\"type\":\"*variable\",\"value\":\"~*req.10\"}],\"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\":\"ConnectAttempts\",\"tag\":\"ConnectAttempts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Reconnects\",\"tag\":\"Reconnects\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnectTimeout\",\"tag\":\"ConnectTimeout\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ReplyTimeout\",\"tag\":\"ReplyTimeout\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"TLS\",\"tag\":\"TLS\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ClientKey\",\"tag\":\"ClientKey\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ClientCertificate\",\"tag\":\"ClientCertificate\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"CaCertificate\",\"tag\":\"CaCertificate\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"MinCost\",\"tag\":\"MinCost\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"MaxCost\",\"tag\":\"MaxCost\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"MaxCostStrategy\",\"tag\":\"MaxCostStrategy\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].FilterIDs\",\"tag\":\"RateFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].ActivationTimes\",\"tag\":\"RateActivationTimes\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].Weights\",\"tag\":\"RateWeights\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].Blocker\",\"tag\":\"RateBlocker\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"filters\":[\"*notempty:~*req.7:\"],\"new_branch\":true,\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.IntervalStart\",\"tag\":\"RateIntervalStart\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.FixedFee\",\"tag\":\"RateFixedFee\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.RecurrentFee\",\"tag\":\"RateRecurrentFee\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.Unit\",\"tag\":\"RateUnit\",\"type\":\"*variable\",\"value\":\"~*req.15\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.Increment\",\"tag\":\"RateIncrement\",\"type\":\"*variable\",\"value\":\"~*req.16\"}],\"file_name\":\"Rates.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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Schedule\",\"tag\":\"Schedule\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Targets[\\u003c~*req.5\\u003e]\",\"tag\":\"TargetIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].FilterIDs\",\"tag\":\"ActionFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Blocker\",\"tag\":\"ActionBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].TTL\",\"tag\":\"ActionTTL\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Type\",\"tag\":\"ActionType\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Opts\",\"tag\":\"ActionOpts\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"filters\":[\"*notempty:~*req.7:\"],\"new_branch\":true,\"path\":\"Actions[\\u003c~*req.7\\u003e].Diktats.Path\",\"tag\":\"ActionPath\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Diktats.Value\",\"tag\":\"ActionValue\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"file_name\":\"Actions.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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Opts\",\"tag\":\"Opts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].FilterIDs\",\"tag\":\"BalanceFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Weights\",\"tag\":\"BalanceWeights\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Type\",\"tag\":\"BalanceType\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Units\",\"tag\":\"BalanceUnits\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].UnitFactors\",\"tag\":\"BalanceUnitFactors\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Opts\",\"tag\":\"BalanceOpts\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].CostIncrements\",\"tag\":\"BalanceCostIncrements\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].AttributeIDs\",\"tag\":\"BalanceAttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].RateProfileIDs\",\"tag\":\"BalanceRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.15\"}],\"file_name\":\"Accounts.csv\",\"flags\":null,\"type\":\"*accounts\"}],\"enabled\":false,\"field_separator\":\",\",\"id\":\"*default\",\"lockfile_path\":\".cgr.lck\",\"opts\":{\"*cache\":\"\",\"*forceLock\":false,\"*stopOnError\":false,\"*withIndex\":true},\"run_delay\":\"0\",\"tenant\":\"\",\"tp_in_dir\":\"/var/spool/cgrates/loader/in\",\"tp_out_dir\":\"/var/spool/cgrates/loader/out\"}]}" var rpl26 string if err := testRPC.Call(context.Background(), utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", diff --git a/general_tests/all_sections_cfg_rld_it_test.go b/general_tests/all_sections_cfg_rld_it_test.go index 2a74963cc..b9b2f7511 100644 --- a/general_tests/all_sections_cfg_rld_it_test.go +++ b/general_tests/all_sections_cfg_rld_it_test.go @@ -913,7 +913,7 @@ func testSectConfigSReloadLoaders(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"loaders\":[{\"action\":\"*store\",\"cache\":{\"*accounts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*action_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*attributes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*chargers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatcher_hosts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatchers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*filters\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*rate_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*resources\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*routes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*stats\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*thresholds\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"}},\"caches_conns\":[\"*internal\"],\"data\":[{\"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\"}],\"file_name\":\"Filters.csv\",\"flags\":null,\"type\":\"*filters\"},{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"TenantID\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ProfileID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"path\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"AttributeFilterIDs\",\"tag\":\"AttributeFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Path\",\"tag\":\"Path\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Value\",\"tag\":\"Value\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"type\":\"*variable\",\"value\":\"~*req.8\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ActionProfileIDs\",\"tag\":\"ActionProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Async\",\"tag\":\"Async\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"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\":\"RouteRateProfileIDs\",\"tag\":\"RouteRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RouteResourceIDs\",\"tag\":\"RouteResourceIDs\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RouteStatIDs\",\"tag\":\"RouteStatIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RouteWeights\",\"tag\":\"RouteWeights\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RouteBlocker\",\"tag\":\"RouteBlocker\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RouteParameters\",\"tag\":\"RouteParameters\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"RunID\",\"tag\":\"RunID\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"AttributeIDs\",\"tag\":\"AttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.5\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Strategy\",\"tag\":\"Strategy\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"StrategyParameters\",\"tag\":\"StrategyParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnID\",\"tag\":\"ConnID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ConnFilterIDs\",\"tag\":\"ConnFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ConnWeight\",\"tag\":\"ConnWeight\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ConnBlocker\",\"tag\":\"ConnBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ConnParameters\",\"tag\":\"ConnParameters\",\"type\":\"*variable\",\"value\":\"~*req.10\"}],\"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\":\"ConnectAttempts\",\"tag\":\"ConnectAttempts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Reconnects\",\"tag\":\"Reconnects\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnectTimeout\",\"tag\":\"ConnectTimeout\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ReplyTimeout\",\"tag\":\"ReplyTimeout\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"TLS\",\"tag\":\"TLS\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ClientKey\",\"tag\":\"ClientKey\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ClientCertificate\",\"tag\":\"ClientCertificate\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"CaCertificate\",\"tag\":\"CaCertificate\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"MinCost\",\"tag\":\"MinCost\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"MaxCost\",\"tag\":\"MaxCost\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"MaxCostStrategy\",\"tag\":\"MaxCostStrategy\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"RateID\",\"tag\":\"RateID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"RateFilterIDs\",\"tag\":\"RateFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"RateActivationTimes\",\"tag\":\"RateActivationTimes\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RateWeights\",\"tag\":\"RateWeights\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RateBlocker\",\"tag\":\"RateBlocker\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RateIntervalStart\",\"tag\":\"RateIntervalStart\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RateFixedFee\",\"tag\":\"RateFixedFee\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RateRecurrentFee\",\"tag\":\"RateRecurrentFee\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"RateUnit\",\"tag\":\"RateUnit\",\"type\":\"*variable\",\"value\":\"~*req.15\"},{\"path\":\"RateIncrement\",\"tag\":\"RateIncrement\",\"type\":\"*variable\",\"value\":\"~*req.16\"}],\"file_name\":\"Rates.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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Schedule\",\"tag\":\"Schedule\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"TargetType\",\"tag\":\"TargetType\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"TargetIDs\",\"tag\":\"TargetIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ActionID\",\"tag\":\"ActionID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ActionFilterIDs\",\"tag\":\"ActionFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ActionBlocker\",\"tag\":\"ActionBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ActionTTL\",\"tag\":\"ActionTTL\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"ActionType\",\"tag\":\"ActionType\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"ActionOpts\",\"tag\":\"ActionOpts\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"ActionPath\",\"tag\":\"ActionPath\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"ActionValue\",\"tag\":\"ActionValue\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"file_name\":\"Actions.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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Opts\",\"tag\":\"Opts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"BalanceID\",\"tag\":\"BalanceID\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"BalanceFilterIDs\",\"tag\":\"BalanceFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"BalanceWeights\",\"tag\":\"BalanceWeights\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"BalanceType\",\"tag\":\"BalanceType\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"BalanceUnits\",\"tag\":\"BalanceUnits\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"BalanceUnitFactors\",\"tag\":\"BalanceUnitFactors\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"BalanceOpts\",\"tag\":\"BalanceOpts\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"BalanceCostIncrements\",\"tag\":\"BalanceCostIncrements\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"BalanceAttributeIDs\",\"tag\":\"BalanceAttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"BalanceRateProfileIDs\",\"tag\":\"BalanceRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.15\"}],\"file_name\":\"Accounts.csv\",\"flags\":null,\"type\":\"*accounts\"}],\"enabled\":false,\"field_separator\":\",\",\"id\":\"*default\",\"lockfile_path\":\".cgr.lck\",\"opts\":{\"*cache\":\"\",\"*forceLock\":false,\"*stopOnError\":false,\"*withIndex\":true},\"run_delay\":\"0\",\"tenant\":\"\",\"tp_in_dir\":\"/var/spool/cgrates/loader/in\",\"tp_out_dir\":\"/var/spool/cgrates/loader/out\"}]}" + cfgStr := "{\"loaders\":[{\"action\":\"*store\",\"cache\":{\"*accounts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*action_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*attributes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*chargers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatcher_hosts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatchers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*filters\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*rate_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*resources\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*routes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*stats\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*thresholds\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"}},\"caches_conns\":[\"*internal\"],\"data\":[{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"Tenant\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"new_branch\":true,\"path\":\"Rules.Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Rules.Element\",\"tag\":\"Element\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Rules.Values\",\"tag\":\"Values\",\"type\":\"*variable\",\"value\":\"~*req.4\"}],\"file_name\":\"Filters.csv\",\"flags\":null,\"type\":\"*filters\"},{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"TenantID\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ProfileID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"path\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"new_branch\":true,\"path\":\"Attributes.FilterIDs\",\"tag\":\"AttributeFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Attributes.Path\",\"tag\":\"Path\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"Attributes.Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Attributes.Value\",\"tag\":\"Value\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"type\":\"*variable\",\"value\":\"~*req.8\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\"},{\"new_branch\":true,\"path\":\"Metrics.MetricID\",\"tag\":\"MetricIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Metrics.FilterIDs\",\"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\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"ActionProfileIDs\",\"tag\":\"ActionProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Async\",\"tag\":\"Async\",\"type\":\"*variable\",\"value\":\"~*req.9\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Sorting\",\"tag\":\"Sorting\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"SortingParameters\",\"tag\":\"SortingParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"new_branch\":true,\"path\":\"Routes.ID\",\"tag\":\"RouteID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Routes.FilterIDs\",\"tag\":\"RouteFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Routes.AccountIDs\",\"tag\":\"RouteAccountIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Routes.RateProfileIDs\",\"tag\":\"RouteRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"Routes.ResourceIDs\",\"tag\":\"RouteResourceIDs\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"Routes.StatIDs\",\"tag\":\"RouteStatIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"Routes.Weights\",\"tag\":\"RouteWeights\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"Routes.Blocker\",\"tag\":\"RouteBlocker\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"Routes.RouteParameters\",\"tag\":\"RouteParameters\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"RunID\",\"tag\":\"RunID\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"AttributeIDs\",\"tag\":\"AttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.5\"}],\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Strategy\",\"tag\":\"Strategy\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"StrategyParams\",\"tag\":\"StrategyParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"new_branch\":true,\"path\":\"Hosts.ID\",\"tag\":\"ConnID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Hosts.FilterIDs\",\"tag\":\"ConnFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Hosts.Weight\",\"tag\":\"ConnWeight\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Hosts.Blocker\",\"tag\":\"ConnBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"Hosts.Params\",\"tag\":\"ConnParameters\",\"type\":\"*variable\",\"value\":\"~*req.10\"}],\"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\":\"ConnectAttempts\",\"tag\":\"ConnectAttempts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Reconnects\",\"tag\":\"Reconnects\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnectTimeout\",\"tag\":\"ConnectTimeout\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ReplyTimeout\",\"tag\":\"ReplyTimeout\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"TLS\",\"tag\":\"TLS\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ClientKey\",\"tag\":\"ClientKey\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ClientCertificate\",\"tag\":\"ClientCertificate\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"CaCertificate\",\"tag\":\"CaCertificate\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"MinCost\",\"tag\":\"MinCost\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"MaxCost\",\"tag\":\"MaxCost\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"MaxCostStrategy\",\"tag\":\"MaxCostStrategy\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].FilterIDs\",\"tag\":\"RateFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].ActivationTimes\",\"tag\":\"RateActivationTimes\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].Weights\",\"tag\":\"RateWeights\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].Blocker\",\"tag\":\"RateBlocker\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"filters\":[\"*notempty:~*req.7:\"],\"new_branch\":true,\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.IntervalStart\",\"tag\":\"RateIntervalStart\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.FixedFee\",\"tag\":\"RateFixedFee\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.RecurrentFee\",\"tag\":\"RateRecurrentFee\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.Unit\",\"tag\":\"RateUnit\",\"type\":\"*variable\",\"value\":\"~*req.15\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Rates[\\u003c~*req.7\\u003e].IntervalRates.Increment\",\"tag\":\"RateIncrement\",\"type\":\"*variable\",\"value\":\"~*req.16\"}],\"file_name\":\"Rates.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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Schedule\",\"tag\":\"Schedule\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Targets[\\u003c~*req.5\\u003e]\",\"tag\":\"TargetIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].FilterIDs\",\"tag\":\"ActionFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Blocker\",\"tag\":\"ActionBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].TTL\",\"tag\":\"ActionTTL\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Type\",\"tag\":\"ActionType\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Opts\",\"tag\":\"ActionOpts\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"filters\":[\"*notempty:~*req.7:\"],\"new_branch\":true,\"path\":\"Actions[\\u003c~*req.7\\u003e].Diktats.Path\",\"tag\":\"ActionPath\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"filters\":[\"*notempty:~*req.7:\"],\"path\":\"Actions[\\u003c~*req.7\\u003e].Diktats.Value\",\"tag\":\"ActionValue\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"file_name\":\"Actions.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\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Opts\",\"tag\":\"Opts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].FilterIDs\",\"tag\":\"BalanceFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Weights\",\"tag\":\"BalanceWeights\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Type\",\"tag\":\"BalanceType\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Units\",\"tag\":\"BalanceUnits\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].UnitFactors\",\"tag\":\"BalanceUnitFactors\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].Opts\",\"tag\":\"BalanceOpts\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].CostIncrements\",\"tag\":\"BalanceCostIncrements\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].AttributeIDs\",\"tag\":\"BalanceAttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"filters\":[\"*notempty:~*req.5:\"],\"path\":\"Balances[\\u003c~*req.5\\u003e].RateProfileIDs\",\"tag\":\"BalanceRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.15\"}],\"file_name\":\"Accounts.csv\",\"flags\":null,\"type\":\"*accounts\"}],\"enabled\":false,\"field_separator\":\",\",\"id\":\"*default\",\"lockfile_path\":\".cgr.lck\",\"opts\":{\"*cache\":\"\",\"*forceLock\":false,\"*stopOnError\":false,\"*withIndex\":true},\"run_delay\":\"0\",\"tenant\":\"\",\"tp_in_dir\":\"/var/spool/cgrates/loader/in\",\"tp_out_dir\":\"/var/spool/cgrates/loader/out\"}]}" var rpl string if err := testSectRPC.Call(context.Background(), utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", diff --git a/general_tests/ld_process_match_ac_it_test.go b/general_tests/ld_process_match_ac_it_test.go index b25b32f0a..7a5390be0 100644 --- a/general_tests/ld_process_match_ac_it_test.go +++ b/general_tests/ld_process_match_ac_it_test.go @@ -197,7 +197,7 @@ func testLdPrMatchAcCDRSProcessEvent(t *testing.T) { "CostIncrements": nil, "FilterIDs": nil, "ID": "VoiceBalance", - "Opts": nil, + "Opts": map[string]interface{}{}, "RateProfileIDs": nil, "Type": utils.MetaAbstract, "UnitFactors": nil, @@ -210,12 +210,15 @@ func testLdPrMatchAcCDRSProcessEvent(t *testing.T) { }, }, }, - "FilterIDs": []string{}, + "FilterIDs": nil, "ID": "1001", - "Opts": nil, + "Opts": map[string]interface{}{}, "Tenant": "cgrates.org", - "ThresholdIDs": []string{}, - "Weights": nil, + "ThresholdIDs": nil, + "Weights": []map[string]interface{}{{ + "FilterIDs": nil, + "Weight": 0, + }}, }, }, "Charges": nil, @@ -234,8 +237,8 @@ func testLdPrMatchAcCDRSProcessEvent(t *testing.T) { APIOpts: map[string]interface{}{ utils.MetaUsage: 2 * time.Minute, - utils.OptsRateS: false, utils.OptsCDRsExport: true, + utils.OptsRateS: false, utils.OptsAccountS: true, }, }, diff --git a/general_tests/ld_process_match_rt_it_test.go b/general_tests/ld_process_match_rt_it_test.go index ffcfb64d4..dd3562602 100644 --- a/general_tests/ld_process_match_rt_it_test.go +++ b/general_tests/ld_process_match_rt_it_test.go @@ -208,7 +208,7 @@ func testLdPrMatchRtCDRSProcessEvent(t *testing.T) { "MinCost": 0, "Rates": map[string]interface{}{ utils.IfaceAsString(costIntervalRatesID): map[string]interface{}{ - "FixedFee": 0, + "FixedFee": nil, "Increment": 30000000000, "IntervalStart": 0, "RecurrentFee": 0.4, diff --git a/general_tests/routes_cases_it_test.go b/general_tests/routes_cases_it_test.go index 50e30149b..4a63241bf 100644 --- a/general_tests/routes_cases_it_test.go +++ b/general_tests/routes_cases_it_test.go @@ -152,11 +152,10 @@ func testV1RtsCaseFromFolder(t *testing.T) { func testV1RtsCaseGetRoutesAfterLoading(t *testing.T) { // ROUTE_ACNT_1001 expRt1 := &engine.APIRouteProfile{ - ID: "ROUTE_ACNT_1001", - Tenant: "cgrates.org", - FilterIDs: []string{"*string:~*req.Account:1001"}, - Sorting: "*weight", - SortingParameters: []string{}, + ID: "ROUTE_ACNT_1001", + Tenant: "cgrates.org", + FilterIDs: []string{"*string:~*req.Account:1001"}, + Sorting: "*weight", Routes: []*engine.ExternalRoute{ { ID: "vendor1", @@ -195,11 +194,10 @@ func testV1RtsCaseGetRoutesAfterLoading(t *testing.T) { // ROUTE_ACNT_1002 expRt2 := &engine.APIRouteProfile{ - ID: "ROUTE_ACNT_1002", - Tenant: "cgrates.org", - FilterIDs: []string{"*string:~*req.Account:1002"}, - Sorting: "*lc", - SortingParameters: []string{}, + ID: "ROUTE_ACNT_1002", + Tenant: "cgrates.org", + FilterIDs: []string{"*string:~*req.Account:1002"}, + Sorting: "*lc", Routes: []*engine.ExternalRoute{ { ID: "vendor1", @@ -283,11 +281,10 @@ func testV1RtsCaseGetRoutesAfterLoading(t *testing.T) { // ROUTE_ACNT_1004 expRt4 := &engine.APIRouteProfile{ - ID: "ROUTE_ACNT_1004", - Tenant: "cgrates.org", - FilterIDs: []string{"*string:~*req.Account:1004"}, - Sorting: "*reas", - SortingParameters: []string{}, + ID: "ROUTE_ACNT_1004", + Tenant: "cgrates.org", + FilterIDs: []string{"*string:~*req.Account:1004"}, + Sorting: "*reas", Routes: []*engine.ExternalRoute{ { ID: "vendor1", @@ -360,11 +357,10 @@ func testV1RtsCaseGetRoutesAfterLoading(t *testing.T) { // ROUTE_STATS1 expRt6 := &engine.APIRouteProfile{ - ID: "ROUTE_HC1", - Tenant: "cgrates.org", - FilterIDs: []string{"Fltr_tcc"}, - Sorting: "*hc", - SortingParameters: []string{}, + ID: "ROUTE_HC1", + Tenant: "cgrates.org", + FilterIDs: []string{"Fltr_tcc"}, + Sorting: "*hc", Routes: []*engine.ExternalRoute{ { ID: "route1", diff --git a/utils/account.go b/utils/account.go index 5f54ee749..cd267a620 100644 --- a/utils/account.go +++ b/utils/account.go @@ -743,49 +743,53 @@ func (bL *Balance) Set(path []string, val interface{}, newBranch bool) (err erro case Weights: bL.Weights, err = NewDynamicWeightsFromString(IfaceAsString(val), InfieldSep, ANDSep) case UnitFactors: - sls := strings.Split(IfaceAsString(val), InfieldSep) - if len(sls)%2 != 0 { - return fmt.Errorf("invalid key: <%s> for BalanceUnitFactors", IfaceAsString(val)) - } - for j := 0; j < len(sls); j += 2 { - uf := new(UnitFactor) - if len(sls[j]) != 0 { - uf.FilterIDs = strings.Split(sls[j], ANDSep) + if ufStr := IfaceAsString(val); len(ufStr) != 0 { + sls := strings.Split(ufStr, InfieldSep) + if len(sls)%2 != 0 { + return fmt.Errorf("invalid key: <%s> for BalanceUnitFactors", IfaceAsString(val)) } + for j := 0; j < len(sls); j += 2 { + uf := new(UnitFactor) + if len(sls[j]) != 0 { + uf.FilterIDs = strings.Split(sls[j], ANDSep) + } - var valB *decimal.Big - if valB, err = IfaceAsBig(sls[j+1]); err != nil { - return + var valB *decimal.Big + if valB, err = IfaceAsBig(sls[j+1]); err != nil { + return + } + uf.Factor = &Decimal{valB} + bL.UnitFactors = append(bL.UnitFactors, uf) } - uf.Factor = &Decimal{valB} - bL.UnitFactors = append(bL.UnitFactors, uf) } case CostIncrements: - sls := strings.Split(IfaceAsString(val), InfieldSep) - if len(sls)%4 != 0 { - return fmt.Errorf("invalid key: <%s> for BalanceCostIncrements", IfaceAsString(val)) - } - for j := 0; j < len(sls); j += 4 { - cI := new(CostIncrement) - if len(sls[j]) != 0 { - cI.FilterIDs = strings.Split(sls[j], ANDSep) + if ciStr := IfaceAsString(val); len(ciStr) != 0 { + sls := strings.Split(ciStr, InfieldSep) + if len(sls)%4 != 0 { + return fmt.Errorf("invalid key: <%s> for BalanceCostIncrements", IfaceAsString(val)) } - if len(sls[j+1]) != 0 { - if cI.Increment, err = NewDecimalFromString(sls[j+1]); err != nil { - return + for j := 0; j < len(sls); j += 4 { + cI := new(CostIncrement) + if len(sls[j]) != 0 { + cI.FilterIDs = strings.Split(sls[j], ANDSep) } - } - if len(sls[j+2]) != 0 { - if cI.FixedFee, err = NewDecimalFromString(sls[j+2]); err != nil { - return + if len(sls[j+1]) != 0 { + if cI.Increment, err = NewDecimalFromString(sls[j+1]); err != nil { + return + } } - } - if len(sls[j+3]) != 0 { - if cI.RecurrentFee, err = NewDecimalFromString(sls[j+3]); err != nil { - return + if len(sls[j+2]) != 0 { + if cI.FixedFee, err = NewDecimalFromString(sls[j+2]); err != nil { + return + } } + if len(sls[j+3]) != 0 { + if cI.RecurrentFee, err = NewDecimalFromString(sls[j+3]); err != nil { + return + } + } + bL.CostIncrements = append(bL.CostIncrements, cI) } - bL.CostIncrements = append(bL.CostIncrements, cI) } case Opts: bL.Opts, err = NewMapFromCSV(IfaceAsString(val)) diff --git a/utils/librates.go b/utils/librates.go index 624df1cb1..17a55fe27 100644 --- a/utils/librates.go +++ b/utils/librates.go @@ -649,7 +649,7 @@ func (rt *Rate) Set(path []string, val interface{}, newBranch bool) (err error) return ErrWrongPath } if len(rt.IntervalRates) == 0 || newBranch { - rt.IntervalRates = append(rt.IntervalRates, new(IntervalRate)) + rt.IntervalRates = append(rt.IntervalRates, &IntervalRate{IntervalStart: NewDecimal(0, 0), FixedFee: NewDecimal(0, 0)}) } switch path[1] { case IntervalStart: diff --git a/utils/mapstorage.go b/utils/mapstorage.go index 0e9f92740..126a4fe89 100644 --- a/utils/mapstorage.go +++ b/utils/mapstorage.go @@ -39,7 +39,7 @@ type DataStorage interface { func NewMapFromCSV(str string) (MapStorage, error) { m := make(MapStorage) if len(str) == 0 { - return nil, nil + return m, nil } for _, opt := range InfieldSplit(str) { keyVal := strings.SplitN(opt, ConcatenatedKeySep, 2)