From be6bdb7c11e2a06e5ef1db982bfffab80614ecf8 Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Tue, 7 Dec 2021 15:35:39 +0200 Subject: [PATCH] Fixed tests for config with indexes --- apis/config_test.go | 76 +++-- config/accountscfg_test.go | 76 ++--- config/actionscfg_test.go | 8 + config/attributescfg_test.go | 99 +++--- config/chargerscfg.go | 8 +- config/chargerscfg_test.go | 68 +++-- config/config_defaults.go | 22 ++ config/config_json_test.go | 146 +++++---- config/config_test.go | 556 +++++++++++++++++++--------------- config/dispatcherscfg_test.go | 96 +++--- config/ratescfg_test.go | 120 +++++--- config/resourcescfg_test.go | 72 +++-- config/routescfg_test.go | 130 ++++---- config/statscfg.go | 8 +- config/statscfg_test.go | 10 + config/thresholdscfg_test.go | 74 +++-- 16 files changed, 905 insertions(+), 664 deletions(-) diff --git a/apis/config_test.go b/apis/config_test.go index a066cfb4c..31a769ef9 100644 --- a/apis/config_test.go +++ b/apis/config_test.go @@ -65,14 +65,16 @@ func TestConfigSetGetConfig(t *testing.T) { err = rlcCfg.GetConfig(context.Background(), argsGet, &replyGet) expectedGet := map[string]interface{}{ "attributes": map[string]interface{}{ - "accounts_conns": []string{"*localhost"}, - "enabled": true, - "indexed_selects": true, - "nested_fields": false, - "prefix_indexed_fields": []string{}, - "resources_conns": []string{"*localhost"}, - "stats_conns": []string{"*localhost"}, - "suffix_indexed_fields": []string{}, + "accounts_conns": []string{"*localhost"}, + "enabled": true, + "indexed_selects": true, + "nested_fields": false, + "prefix_indexed_fields": []string{}, + "resources_conns": []string{"*localhost"}, + "stats_conns": []string{"*localhost"}, + "suffix_indexed_fields": []string{}, + "exists_indexed_fields": []string{}, + "notexists_indexed_fields": []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{}, @@ -102,14 +104,16 @@ func TestConfigSetGetReloadConfig(t *testing.T) { Tenant: utils.CGRateSorg, Config: map[string]interface{}{ "attributes": map[string]interface{}{ - "accounts_conns": []string{"*internal"}, - "enabled": true, - "indexed_selects": false, - "nested_fields": false, - "prefix_indexed_fields": []string{}, - "resources_conns": []string{"*internal"}, - "stats_conns": []string{"*internal"}, - "suffix_indexed_fields": []string{}, + "accounts_conns": []string{"*internal"}, + "enabled": true, + "indexed_selects": false, + "nested_fields": false, + "prefix_indexed_fields": []string{}, + "resources_conns": []string{"*internal"}, + "stats_conns": []string{"*internal"}, + "suffix_indexed_fields": []string{}, + "exists_indexed_fields": []string{}, + "notexists_indexed_fields": []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{ { @@ -137,14 +141,16 @@ func TestConfigSetGetReloadConfig(t *testing.T) { errGet := rlcCfg.GetConfig(context.Background(), argsGet, &replyGet) expectedGet := map[string]interface{}{ "attributes": map[string]interface{}{ - "accounts_conns": []string{"*localhost"}, - "enabled": true, - "indexed_selects": true, - "nested_fields": false, - "prefix_indexed_fields": []string{}, - "resources_conns": []string{"*localhost"}, - "stats_conns": []string{"*localhost"}, - "suffix_indexed_fields": []string{}, + "accounts_conns": []string{"*localhost"}, + "enabled": true, + "indexed_selects": true, + "nested_fields": false, + "prefix_indexed_fields": []string{}, + "resources_conns": []string{"*localhost"}, + "stats_conns": []string{"*localhost"}, + "suffix_indexed_fields": []string{}, + "exists_indexed_fields": []string{}, + "notexists_indexed_fields": []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{}, @@ -181,14 +187,16 @@ func TestConfigSetGetReloadConfig(t *testing.T) { errGetRld := rlcCfg.GetConfig(context.Background(), argsGetRld, &replyGetRld) expectedGetRld := map[string]interface{}{ "attributes": map[string]interface{}{ - "accounts_conns": []string{"*localhost"}, - "enabled": true, - "indexed_selects": true, - "nested_fields": false, - "prefix_indexed_fields": []string{}, - "resources_conns": []string{"*localhost"}, - "stats_conns": []string{"*localhost"}, - "suffix_indexed_fields": []string{}, + "accounts_conns": []string{"*localhost"}, + "enabled": true, + "indexed_selects": true, + "nested_fields": false, + "prefix_indexed_fields": []string{}, + "resources_conns": []string{"*localhost"}, + "stats_conns": []string{"*localhost"}, + "suffix_indexed_fields": []string{}, + "exists_indexed_fields": []string{}, + "notexists_indexed_fields": []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{}, @@ -240,6 +248,8 @@ func TestConfigGetSetConfigFromJSONErr(t *testing.T) { "resources_conns":["*localhost"], "stats_conns":["*localhost"], "suffix_indexed_fields":[], + "exists_indexed_fields":[], + "notexists_indexed_fields":[], }, }`, DryRun: true, @@ -261,7 +271,7 @@ func TestConfigGetSetConfigFromJSONErr(t *testing.T) { } var replyGet string errGet := rlcCfg.GetConfigAsJSON(context.Background(), argsGet, &replyGet) - expectedGet := `{"attributes":{"accounts_conns":["*localhost"],"enabled":true,"indexed_selects":true,"nested_fields":false,"opts":{"*processRuns":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*profileRuns":[]},"prefix_indexed_fields":[],"resources_conns":["*localhost"],"stats_conns":["*localhost"],"suffix_indexed_fields":[]}}` + expectedGet := `{"attributes":{"accounts_conns":["*localhost"],"enabled":true,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"opts":{"*processRuns":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*profileRuns":[]},"prefix_indexed_fields":[],"resources_conns":["*localhost"],"stats_conns":["*localhost"],"suffix_indexed_fields":[]}}` if err != nil { t.Errorf("Expected <%+v>, \nReceived <%+v>", nil, errGet) } diff --git a/config/accountscfg_test.go b/config/accountscfg_test.go index 3ea5623e4..bf0c58921 100644 --- a/config/accountscfg_test.go +++ b/config/accountscfg_test.go @@ -28,34 +28,38 @@ import ( func TestAccountSCfgLoadFromJSONCfg(t *testing.T) { jsonCfg := &AccountSJsonCfg{ - Enabled: utils.BoolPointer(true), - Attributes_conns: &[]string{utils.MetaInternal}, - Rates_conns: &[]string{utils.MetaInternal}, - Thresholds_conns: &[]string{utils.MetaInternal}, - Indexed_selects: utils.BoolPointer(false), - String_indexed_fields: &[]string{"*req.index1"}, - Prefix_indexed_fields: &[]string{"*req.index1"}, - Suffix_indexed_fields: &[]string{"*req.index1"}, - Nested_fields: utils.BoolPointer(true), - Max_iterations: utils.IntPointer(1000), - Max_usage: utils.StringPointer("200h"), + Enabled: utils.BoolPointer(true), + Attributes_conns: &[]string{utils.MetaInternal}, + Rates_conns: &[]string{utils.MetaInternal}, + Thresholds_conns: &[]string{utils.MetaInternal}, + Indexed_selects: utils.BoolPointer(false), + String_indexed_fields: &[]string{"*req.index1"}, + Prefix_indexed_fields: &[]string{"*req.index1"}, + Suffix_indexed_fields: &[]string{"*req.index1"}, + Exists_indexed_fields: &[]string{"*req.index1"}, + Notexists_indexed_fields: &[]string{"*req.index1"}, + Nested_fields: utils.BoolPointer(true), + Max_iterations: utils.IntPointer(1000), + Max_usage: utils.StringPointer("200h"), } usage, err := utils.NewDecimalFromUsage("200h") if err != nil { t.Error(err) } expected := &AccountSCfg{ - Enabled: true, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes)}, - RateSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaRateS)}, - ThresholdSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds)}, - IndexedSelects: false, - StringIndexedFields: &[]string{"*req.index1"}, - PrefixIndexedFields: &[]string{"*req.index1"}, - SuffixIndexedFields: &[]string{"*req.index1"}, - NestedFields: true, - MaxIterations: 1000, - MaxUsage: usage, + Enabled: true, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes)}, + RateSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaRateS)}, + ThresholdSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds)}, + IndexedSelects: false, + StringIndexedFields: &[]string{"*req.index1"}, + PrefixIndexedFields: &[]string{"*req.index1"}, + SuffixIndexedFields: &[]string{"*req.index1"}, + ExistsIndexedFields: &[]string{"*req.index1"}, + NotExistsIndexedFields: &[]string{"*req.index1"}, + NestedFields: true, + MaxIterations: 1000, + MaxUsage: usage, Opts: &AccountsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, Usage: []*utils.DynamicDecimalBigOpt{}, @@ -143,7 +147,9 @@ func TestAccountSCfgAsMapInterface(t *testing.T) { "thresholds_conns": ["*internal:*thresholds"], "string_indexed_fields": ["*req.index1"], "prefix_indexed_fields": ["*req.index1"], - "suffix_indexed_fields": ["*req.index1"], + "suffix_indexed_fields": ["*req.index1"], + "exists_indexed_fields": ["*req.index1"], + "notexists_indexed_fields": ["*req.index1"], "nested_fields": true, "max_iterations": 100, "max_usage": "72h", @@ -151,17 +157,19 @@ func TestAccountSCfgAsMapInterface(t *testing.T) { }` eMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.IndexedSelectsCfg: false, - utils.AttributeSConnsCfg: []string{utils.MetaInternal}, - utils.RateSConnsCfg: []string{utils.MetaInternal}, - utils.ThresholdSConnsCfg: []string{utils.MetaInternal}, - utils.StringIndexedFieldsCfg: []string{"*req.index1"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.index1"}, - utils.SuffixIndexedFieldsCfg: []string{"*req.index1"}, - utils.NestedFieldsCfg: true, - utils.MaxIterations: 100, - utils.MaxUsage: "259200000000000", // 72h in ns + utils.EnabledCfg: true, + utils.IndexedSelectsCfg: false, + utils.AttributeSConnsCfg: []string{utils.MetaInternal}, + utils.RateSConnsCfg: []string{utils.MetaInternal}, + utils.ThresholdSConnsCfg: []string{utils.MetaInternal}, + utils.StringIndexedFieldsCfg: []string{"*req.index1"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.index1"}, + utils.SuffixIndexedFieldsCfg: []string{"*req.index1"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.index1"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.index1"}, + utils.NestedFieldsCfg: true, + utils.MaxIterations: 100, + utils.MaxUsage: "259200000000000", // 72h in ns utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaUsage: []*utils.DynamicDecimalBigOpt{}, diff --git a/config/actionscfg_test.go b/config/actionscfg_test.go index 22e0f41f1..515187476 100644 --- a/config/actionscfg_test.go +++ b/config/actionscfg_test.go @@ -38,6 +38,8 @@ func TestActionSCfgLoadFromJSONCfg(t *testing.T) { String_indexed_fields: &[]string{"*req.index1"}, Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, Suffix_indexed_fields: &[]string{"*req.index1"}, + Exists_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Notexists_indexed_fields: &[]string{"*req.index1"}, Nested_fields: utils.BoolPointer(true), Dynaprepaid_actionprofile: &[]string{"val1", "val2"}, } @@ -53,6 +55,8 @@ func TestActionSCfgLoadFromJSONCfg(t *testing.T) { StringIndexedFields: &[]string{"*req.index1"}, PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, SuffixIndexedFields: &[]string{"*req.index1"}, + NotExistsIndexedFields: &[]string{"*req.index1"}, + ExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, NestedFields: true, DynaprepaidActionProfile: []string{"val1", "val2"}, Opts: &ActionsOpts{ @@ -118,6 +122,8 @@ func TestActionSCfgAsMapInterface(t *testing.T) { "string_indexed_fields": ["*req.index1"], "prefix_indexed_fields": ["*req.index1","*req.index2"], "suffix_indexed_fields": ["*req.index1"], + "exists_indexed_fields": ["*req.index1","*req.index2"], + "notexists_indexed_fields": ["*req.index1"], "nested_fields": true, "DynaprepaidActionProfile": [], }, @@ -135,6 +141,8 @@ func TestActionSCfgAsMapInterface(t *testing.T) { utils.StringIndexedFieldsCfg: []string{"*req.index1"}, utils.PrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, utils.SuffixIndexedFieldsCfg: []string{"*req.index1"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.index1"}, utils.NestedFieldsCfg: true, utils.DynaprepaidActionplansCfg: []string{}, utils.OptsCfg: map[string]interface{}{ diff --git a/config/attributescfg_test.go b/config/attributescfg_test.go index d25922530..b2987f6e9 100644 --- a/config/attributescfg_test.go +++ b/config/attributescfg_test.go @@ -26,26 +26,30 @@ import ( func TestAttributeSCfgloadFromJsonCfg(t *testing.T) { jsonCfg := &AttributeSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(false), - Resources_conns: &[]string{"*internal", "*conn1"}, - Stats_conns: &[]string{"*internal", "*conn1"}, - Accounts_conns: &[]string{"*internal", "*conn1"}, - String_indexed_fields: &[]string{"*req.index1"}, - Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, - Suffix_indexed_fields: &[]string{"*req.index1"}, - Nested_fields: utils.BoolPointer(true), + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(false), + Resources_conns: &[]string{"*internal", "*conn1"}, + Stats_conns: &[]string{"*internal", "*conn1"}, + Accounts_conns: &[]string{"*internal", "*conn1"}, + String_indexed_fields: &[]string{"*req.index1"}, + Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Suffix_indexed_fields: &[]string{"*req.index1"}, + Exists_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Notexists_indexed_fields: &[]string{"*req.index1"}, + Nested_fields: utils.BoolPointer(true), } expected := &AttributeSCfg{ - Enabled: true, - AccountSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts), "*conn1"}, - StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats), "*conn1"}, - ResourceSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResources), "*conn1"}, - IndexedSelects: false, - StringIndexedFields: &[]string{"*req.index1"}, - PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, - SuffixIndexedFields: &[]string{"*req.index1"}, - NestedFields: true, + Enabled: true, + AccountSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts), "*conn1"}, + StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats), "*conn1"}, + ResourceSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResources), "*conn1"}, + IndexedSelects: false, + StringIndexedFields: &[]string{"*req.index1"}, + PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, + SuffixIndexedFields: &[]string{"*req.index1"}, + ExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, + NotExistsIndexedFields: &[]string{"*req.index1"}, + NestedFields: true, Opts: &AttributesOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProcessRuns: []*utils.DynamicIntOpt{}, @@ -128,6 +132,8 @@ func TestAttributeSCfgAsMapInterface(t *testing.T) { "accounts_conns": ["*internal"], "prefix_indexed_fields": ["*req.index1","*req.index2"], "string_indexed_fields": ["*req.index1"], + "exists_indexed_fields": ["*req.index1","*req.index2"], + "notexists_indexed_fields": ["*req.index1"], "opts": { "*processRuns": [ { @@ -138,15 +144,17 @@ func TestAttributeSCfgAsMapInterface(t *testing.T) { }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.StatSConnsCfg: []string{utils.MetaInternal}, - utils.ResourceSConnsCfg: []string{utils.MetaInternal}, - utils.AccountSConnsCfg: []string{utils.MetaInternal}, - utils.StringIndexedFieldsCfg: []string{"*req.index1"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, - utils.IndexedSelectsCfg: true, - utils.NestedFieldsCfg: false, - utils.SuffixIndexedFieldsCfg: []string{}, + utils.EnabledCfg: true, + utils.StatSConnsCfg: []string{utils.MetaInternal}, + utils.ResourceSConnsCfg: []string{utils.MetaInternal}, + utils.AccountSConnsCfg: []string{utils.MetaInternal}, + utils.StringIndexedFieldsCfg: []string{"*req.index1"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.index1"}, + utils.IndexedSelectsCfg: true, + utils.NestedFieldsCfg: false, + utils.SuffixIndexedFieldsCfg: []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{ @@ -169,6 +177,7 @@ func TestAttributeSCfgAsMapInterface2(t *testing.T) { cfgJSONStr := `{ "attributes": { "suffix_indexed_fields": ["*req.index1","*req.index2"], + "notexists_indexed_fields": ["*req.index1","*req.index2"], "nested_fields": true, "enabled": true, "opts": { @@ -181,14 +190,16 @@ func TestAttributeSCfgAsMapInterface2(t *testing.T) { }, }` expectedMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.StatSConnsCfg: []string{}, - utils.ResourceSConnsCfg: []string{}, - utils.AccountSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, - utils.NestedFieldsCfg: true, + utils.EnabledCfg: true, + utils.StatSConnsCfg: []string{}, + utils.ResourceSConnsCfg: []string{}, + utils.AccountSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.NestedFieldsCfg: true, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{ @@ -214,14 +225,16 @@ func TestAttributeSCfgAsMapInterface3(t *testing.T) { } ` expectedMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.StatSConnsCfg: []string{}, - utils.ResourceSConnsCfg: []string{}, - utils.AccountSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, + utils.EnabledCfg: false, + utils.StatSConnsCfg: []string{}, + utils.ResourceSConnsCfg: []string{}, + utils.AccountSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{}, diff --git a/config/chargerscfg.go b/config/chargerscfg.go index e9c4254c4..54f328855 100644 --- a/config/chargerscfg.go +++ b/config/chargerscfg.go @@ -70,8 +70,8 @@ func (cS *ChargerSCfg) loadFromJSONCfg(jsnCfg *ChargerSJsonCfg) (err error) { if jsnCfg.Exists_indexed_fields != nil { cS.ExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*jsnCfg.Exists_indexed_fields)) } - if jsnCfg.NotExists_indexed_fields != nil { - cS.NotExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*jsnCfg.NotExists_indexed_fields)) + if jsnCfg.Notexists_indexed_fields != nil { + cS.NotExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*jsnCfg.Notexists_indexed_fields)) } if jsnCfg.Nested_fields != nil { cS.NestedFields = *jsnCfg.Nested_fields @@ -148,7 +148,7 @@ type ChargerSJsonCfg struct { Prefix_indexed_fields *[]string Suffix_indexed_fields *[]string Exists_indexed_fields *[]string - NotExists_indexed_fields *[]string + Notexists_indexed_fields *[]string Nested_fields *bool // applies when indexed fields is not defined } @@ -169,7 +169,7 @@ func diffChargerSJsonCfg(d *ChargerSJsonCfg, v1, v2 *ChargerSCfg) *ChargerSJsonC d.Prefix_indexed_fields = diffIndexSlice(d.Prefix_indexed_fields, v1.PrefixIndexedFields, v2.PrefixIndexedFields) d.Suffix_indexed_fields = diffIndexSlice(d.Suffix_indexed_fields, v1.SuffixIndexedFields, v2.SuffixIndexedFields) d.Exists_indexed_fields = diffIndexSlice(d.Exists_indexed_fields, v1.ExistsIndexedFields, v2.ExistsIndexedFields) - d.NotExists_indexed_fields = diffIndexSlice(d.NotExists_indexed_fields, v1.NotExistsIndexedFields, v2.NotExistsIndexedFields) + d.Notexists_indexed_fields = diffIndexSlice(d.Notexists_indexed_fields, v1.NotExistsIndexedFields, v2.NotExistsIndexedFields) if v1.NestedFields != v2.NestedFields { d.Nested_fields = utils.BoolPointer(v2.NestedFields) } diff --git a/config/chargerscfg_test.go b/config/chargerscfg_test.go index d40a04c0c..2d77c6478 100644 --- a/config/chargerscfg_test.go +++ b/config/chargerscfg_test.go @@ -26,22 +26,26 @@ import ( func TestChargerSCfgloadFromJsonCfg(t *testing.T) { jsonCfg := &ChargerSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(true), - Attributes_conns: &[]string{utils.MetaInternal, "*conn1"}, - String_indexed_fields: &[]string{"*req.Field1"}, - Prefix_indexed_fields: &[]string{"*req.Field1", "*req.Field2"}, - Suffix_indexed_fields: &[]string{"*req.Field1", "*req.Field2"}, - Nested_fields: utils.BoolPointer(true), + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(true), + Attributes_conns: &[]string{utils.MetaInternal, "*conn1"}, + String_indexed_fields: &[]string{"*req.Field1"}, + Prefix_indexed_fields: &[]string{"*req.Field1", "*req.Field2"}, + Suffix_indexed_fields: &[]string{"*req.Field1", "*req.Field2"}, + Exists_indexed_fields: &[]string{"*req.Field1", "*req.Field2"}, + Notexists_indexed_fields: &[]string{"*req.Field1", "*req.Field2"}, + Nested_fields: utils.BoolPointer(true), } expected := &ChargerSCfg{ - Enabled: true, - IndexedSelects: true, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, - StringIndexedFields: &[]string{"*req.Field1"}, - PrefixIndexedFields: &[]string{"*req.Field1", "*req.Field2"}, - SuffixIndexedFields: &[]string{"*req.Field1", "*req.Field2"}, - NestedFields: true, + Enabled: true, + IndexedSelects: true, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, + StringIndexedFields: &[]string{"*req.Field1"}, + PrefixIndexedFields: &[]string{"*req.Field1", "*req.Field2"}, + SuffixIndexedFields: &[]string{"*req.Field1", "*req.Field2"}, + ExistsIndexedFields: &[]string{"*req.Field1", "*req.Field2"}, + NotExistsIndexedFields: &[]string{"*req.Field1", "*req.Field2"}, + NestedFields: true, } jsncfg := NewDefaultCGRConfig() if err = jsncfg.chargerSCfg.loadFromJSONCfg(jsonCfg); err != nil { @@ -67,12 +71,14 @@ func TestChargerSCfgAsMapInterface(t *testing.T) { }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.AttributeSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.SuffixIndexedFieldsCfg: []string{}, + utils.EnabledCfg: false, + utils.AttributeSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, } if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil { t.Error(err) @@ -88,19 +94,23 @@ func TestChargerSCfgAsMapInterface1(t *testing.T) { "attributes_conns": ["*internal:*attributes", "*conn1"], "indexed_selects":true, "string_indexed_fields": ["*req.Field1","*req.Field2","*req.Field3"], - "prefix_indexed_fields": ["*req.DestinationPrefix"], - "suffix_indexed_fields": ["*req.Field1","*req.Field2","*req.Field3"], + "prefix_indexed_fields": ["*req.DestinationPrefix"], + "suffix_indexed_fields": ["*req.Field1","*req.Field2","*req.Field3"], + "exists_indexed_fields": ["*req.DestinationPrefix"], + "notexists_indexed_fields": [], "nested_fields": false, }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.AttributeSConnsCfg: []string{utils.MetaInternal, "*conn1"}, - utils.IndexedSelectsCfg: true, - utils.StringIndexedFieldsCfg: []string{"*req.Field1", "*req.Field2", "*req.Field3"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.DestinationPrefix"}, - utils.NestedFieldsCfg: false, - utils.SuffixIndexedFieldsCfg: []string{"*req.Field1", "*req.Field2", "*req.Field3"}, + utils.EnabledCfg: false, + utils.AttributeSConnsCfg: []string{utils.MetaInternal, "*conn1"}, + utils.IndexedSelectsCfg: true, + utils.StringIndexedFieldsCfg: []string{"*req.Field1", "*req.Field2", "*req.Field3"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.DestinationPrefix"}, + utils.NestedFieldsCfg: false, + utils.SuffixIndexedFieldsCfg: []string{"*req.Field1", "*req.Field2", "*req.Field3"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.DestinationPrefix"}, + utils.NotExistsIndexedFieldsCfg: []string{}, } if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil { t.Error(err) diff --git a/config/config_defaults.go b/config/config_defaults.go index 9c517f17c..0cc31dfc2 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -943,6 +943,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "opts":{ // "*profileIDs": [ @@ -984,6 +986,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) }, @@ -996,6 +1000,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "opts":{ // "*usageID": [ @@ -1032,6 +1038,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "opts": { // "*profileIDs": [ @@ -1066,6 +1074,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "actions_conns": [], // connections to ActionS to execute the actions "opts":{ // @@ -1093,6 +1103,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "attributes_conns": [], // connections to AttributeS for altering events before route queries: <""|*internal|$rpc_conns_id> "resources_conns": [], // connections to ResourceS for *res sorting, empty to disable functionality: <""|*internal|$rpc_conns_id> @@ -1479,6 +1491,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "attributes_conns": [], // connections to AttributeS for API authorization, empty to disable auth functionality: <""|*internal|$rpc_conns_id> }, @@ -1524,11 +1538,15 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "rate_indexed_selects": true, // enable profile matching exclusively on indexes //"rate_string_indexed_fields": [], // query indexes based on these fields for faster processing "rate_prefix_indexed_fields": [], // query indexes based on these fields for faster processing "rate_suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "rate_exists_indexed_fields": [], // query indexes based on these fields for faster processing + "rate_notexists_indexed_fields": [], // query indexes based on these fields for faster processing "rate_nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "verbosity": 1000, // number of increment iterations allowed "opts":{ // @@ -1698,6 +1716,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "dynaprepaid_actionprofile": [], // "opts":{ // @@ -1728,6 +1748,8 @@ const CGRATES_CFG_JSON = ` //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing "suffix_indexed_fields": [], // query indexes based on these fields for faster processing + "exists_indexed_fields": [], // query indexes based on these fields for faster processing + "notexists_indexed_fields": [], // query indexes based on these fields for faster processing "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level) "max_iterations": 1000, // maximum number of iterations "max_usage": "72h", // maximum time of usage diff --git a/config/config_json_test.go b/config/config_json_test.go index 7397c0746..e38e12703 100644 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -936,15 +936,17 @@ func TestDNSAgentJsonCfg(t *testing.T) { func TestDfAttributeServJsonCfg(t *testing.T) { eCfg := &AttributeSJsonCfg{ - Enabled: utils.BoolPointer(false), - Stats_conns: &[]string{}, - Resources_conns: &[]string{}, - Accounts_conns: &[]string{}, - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Nested_fields: utils.BoolPointer(false), + Enabled: utils.BoolPointer(false), + Stats_conns: &[]string{}, + Resources_conns: &[]string{}, + Accounts_conns: &[]string{}, + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Nested_fields: utils.BoolPointer(false), Opts: &AttributesOptsJson{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProcessRuns: []*utils.DynamicIntOpt{}, @@ -966,13 +968,15 @@ func TestDfAttributeServJsonCfg(t *testing.T) { func TestDfChargerServJsonCfg(t *testing.T) { eCfg := &ChargerSJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - Attributes_conns: &[]string{}, - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Nested_fields: utils.BoolPointer(false), + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + Attributes_conns: &[]string{}, + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Nested_fields: utils.BoolPointer(false), } dfCgrJSONCfg, err := NewCgrJsonCfgFromBytes([]byte(CGRATES_CFG_JSON)) if err != nil { @@ -1006,14 +1010,16 @@ func TestDfFilterSJsonCfg(t *testing.T) { func TestDfResourceLimiterSJsonCfg(t *testing.T) { eCfg := &ResourceSJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - Thresholds_conns: &[]string{}, - Store_interval: utils.StringPointer(""), - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Nested_fields: utils.BoolPointer(false), + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + Thresholds_conns: &[]string{}, + Store_interval: utils.StringPointer(""), + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Nested_fields: utils.BoolPointer(false), Opts: &ResourcesOptsJson{ UsageID: []*utils.DynamicStringOpt{}, UsageTTL: []*utils.DynamicStringOpt{}, @@ -1042,6 +1048,8 @@ func TestDfStatServiceJsonCfg(t *testing.T) { String_indexed_fields: nil, Prefix_indexed_fields: &[]string{}, Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, Nested_fields: utils.BoolPointer(false), Opts: &StatsOptsJson{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, @@ -1063,14 +1071,16 @@ func TestDfStatServiceJsonCfg(t *testing.T) { func TestDfThresholdSJsonCfg(t *testing.T) { eCfg := &ThresholdSJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - Store_interval: utils.StringPointer(""), - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Nested_fields: utils.BoolPointer(false), - Actions_conns: &[]string{}, + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + Store_interval: utils.StringPointer(""), + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Nested_fields: utils.BoolPointer(false), + Actions_conns: &[]string{}, Opts: &ThresholdsOptsJson{ ProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, }, @@ -1089,18 +1099,20 @@ func TestDfThresholdSJsonCfg(t *testing.T) { func TestDfRouteSJsonCfg(t *testing.T) { eCfg := &RouteSJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Attributes_conns: &[]string{}, - Resources_conns: &[]string{}, - Stats_conns: &[]string{}, - Rates_conns: &[]string{}, - Accounts_conns: &[]string{}, - Default_ratio: utils.IntPointer(1), - Nested_fields: utils.BoolPointer(false), + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Attributes_conns: &[]string{}, + Resources_conns: &[]string{}, + Stats_conns: &[]string{}, + Rates_conns: &[]string{}, + Accounts_conns: &[]string{}, + Default_ratio: utils.IntPointer(1), + Nested_fields: utils.BoolPointer(false), Opts: &RoutesOptsJson{ Context: []*utils.DynamicStringOpt{}, ProfileCount: []*utils.DynamicIntOpt{}, @@ -1903,13 +1915,15 @@ func TestDfHttpJsonCfg(t *testing.T) { func TestDfDispatcherSJsonCfg(t *testing.T) { eCfg := &DispatcherSJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Attributes_conns: &[]string{}, - Nested_fields: utils.BoolPointer(false), + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Attributes_conns: &[]string{}, + Nested_fields: utils.BoolPointer(false), } dfCgrJSONCfg, err := NewCgrJsonCfgFromBytes([]byte(CGRATES_CFG_JSON)) if err != nil { @@ -2163,18 +2177,22 @@ func TestDfEventExporterCfg(t *testing.T) { func TestDfRateSJsonCfg(t *testing.T) { eCfg := &RateSJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, - Suffix_indexed_fields: &[]string{}, - Nested_fields: utils.BoolPointer(false), - Rate_indexed_selects: utils.BoolPointer(true), - Rate_string_indexed_fields: nil, - Rate_prefix_indexed_fields: &[]string{}, - Rate_suffix_indexed_fields: &[]string{}, - Rate_nested_fields: utils.BoolPointer(false), - Verbosity: utils.IntPointer(1000), + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, + Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, + Nested_fields: utils.BoolPointer(false), + Rate_indexed_selects: utils.BoolPointer(true), + Rate_string_indexed_fields: nil, + Rate_prefix_indexed_fields: &[]string{}, + Rate_suffix_indexed_fields: &[]string{}, + Rate_exists_indexed_fields: &[]string{}, + Rate_notexists_indexed_fields: &[]string{}, + Rate_nested_fields: utils.BoolPointer(false), + Verbosity: utils.IntPointer(1000), Opts: &RatesOptsJson{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, StartTime: []*utils.DynamicStringOpt{}, @@ -2469,6 +2487,8 @@ func TestDfActionSJsonCfg(t *testing.T) { String_indexed_fields: nil, Prefix_indexed_fields: &[]string{}, Suffix_indexed_fields: &[]string{}, + Exists_indexed_fields: &[]string{}, + Notexists_indexed_fields: &[]string{}, Nested_fields: utils.BoolPointer(false), Dynaprepaid_actionprofile: &[]string{}, Opts: &ActionsOptsJson{ diff --git a/config/config_test.go b/config/config_test.go index 4fe8770b7..a265b5ea8 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -649,12 +649,14 @@ func TestCgrCfgJSONDefaultFiltersCfg(t *testing.T) { func TestCgrCfgJSONDefaultSChargerSCfg(t *testing.T) { eChargerSCfg := &ChargerSCfg{ - Enabled: false, - IndexedSelects: true, - AttributeSConns: []string{}, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, + Enabled: false, + IndexedSelects: true, + AttributeSConns: []string{}, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, } if !reflect.DeepEqual(eChargerSCfg, cgrCfg.chargerSCfg) { t.Errorf("received: %+v, expecting: %+v", eChargerSCfg, cgrCfg.chargerSCfg) @@ -663,13 +665,15 @@ func TestCgrCfgJSONDefaultSChargerSCfg(t *testing.T) { func TestCgrCfgJSONDefaultsResLimCfg(t *testing.T) { eResLiCfg := &ResourceSConfig{ - Enabled: false, - IndexedSelects: true, - ThresholdSConns: []string{}, - StoreInterval: 0, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, + Enabled: false, + IndexedSelects: true, + ThresholdSConns: []string{}, + StoreInterval: 0, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, Opts: &ResourcesOpts{ UsageID: []*utils.DynamicStringOpt{}, UsageTTL: []*utils.DynamicDurationOpt{}, @@ -684,13 +688,15 @@ func TestCgrCfgJSONDefaultsResLimCfg(t *testing.T) { func TestCgrCfgJSONDefaultStatsCfg(t *testing.T) { eStatsCfg := &StatSCfg{ - Enabled: false, - IndexedSelects: true, - StoreInterval: 0, - ThresholdSConns: []string{}, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, + Enabled: false, + IndexedSelects: true, + StoreInterval: 0, + ThresholdSConns: []string{}, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, Opts: &StatsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, @@ -704,13 +710,15 @@ func TestCgrCfgJSONDefaultStatsCfg(t *testing.T) { func TestCgrCfgJSONDefaultThresholdSCfg(t *testing.T) { eThresholdSCfg := &ThresholdSCfg{ - Enabled: false, - IndexedSelects: true, - StoreInterval: 0, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - ActionSConns: []string{}, + Enabled: false, + IndexedSelects: true, + StoreInterval: 0, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + ActionSConns: []string{}, Opts: &ThresholdsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, @@ -723,17 +731,19 @@ func TestCgrCfgJSONDefaultThresholdSCfg(t *testing.T) { func TestCgrCfgJSONDefaultRouteSCfg(t *testing.T) { eSupplSCfg := &RouteSCfg{ - Enabled: false, - IndexedSelects: true, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - AttributeSConns: []string{}, - ResourceSConns: []string{}, - StatSConns: []string{}, - RateSConns: []string{}, - AccountSConns: []string{}, - DefaultRatio: 1, + Enabled: false, + IndexedSelects: true, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + AttributeSConns: []string{}, + ResourceSConns: []string{}, + StatSConns: []string{}, + RateSConns: []string{}, + AccountSConns: []string{}, + DefaultRatio: 1, Opts: &RoutesOpts{ Context: []*utils.DynamicStringOpt{}, ProfileCount: []*utils.DynamicIntPointerOpt{}, @@ -1823,14 +1833,16 @@ func TestDNSAgentConfig(t *testing.T) { func TestAttributeSConfig(t *testing.T) { expected := &AttributeSCfg{ - Enabled: false, - AccountSConns: []string{}, - StatSConns: []string{}, - ResourceSConns: []string{}, - IndexedSelects: true, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - NestedFields: false, + Enabled: false, + AccountSConns: []string{}, + StatSConns: []string{}, + ResourceSConns: []string{}, + IndexedSelects: true, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + NestedFields: false, Opts: &AttributesOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProcessRuns: []*utils.DynamicIntOpt{}, @@ -1850,12 +1862,14 @@ func TestAttributeSConfig(t *testing.T) { func TestChargersConfig(t *testing.T) { expected := &ChargerSCfg{ - Enabled: false, - IndexedSelects: true, - AttributeSConns: []string{}, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - NestedFields: false, + Enabled: false, + IndexedSelects: true, + AttributeSConns: []string{}, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + NestedFields: false, } cgrConfig := NewDefaultCGRConfig() if err != nil { @@ -1869,13 +1883,15 @@ func TestChargersConfig(t *testing.T) { func TestResourceSConfig(t *testing.T) { expected := &ResourceSConfig{ - Enabled: false, - IndexedSelects: true, - StoreInterval: 0, - ThresholdSConns: []string{}, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - NestedFields: false, + Enabled: false, + IndexedSelects: true, + StoreInterval: 0, + ThresholdSConns: []string{}, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + NestedFields: false, Opts: &ResourcesOpts{ UsageID: []*utils.DynamicStringOpt{}, UsageTTL: []*utils.DynamicDurationOpt{}, @@ -1901,6 +1917,8 @@ func TestStatSConfig(t *testing.T) { ThresholdSConns: []string{}, PrefixIndexedFields: &[]string{}, SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, NestedFields: false, Opts: &StatsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, @@ -1920,13 +1938,15 @@ func TestStatSConfig(t *testing.T) { func TestThresholdSConfig(t *testing.T) { expected := &ThresholdSCfg{ - Enabled: false, - IndexedSelects: true, - StoreInterval: 0, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - NestedFields: false, - ActionSConns: []string{}, + Enabled: false, + IndexedSelects: true, + StoreInterval: 0, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + NestedFields: false, + ActionSConns: []string{}, Opts: &ThresholdsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, @@ -1944,17 +1964,19 @@ func TestThresholdSConfig(t *testing.T) { func TestRouteSConfig(t *testing.T) { expected := &RouteSCfg{ - Enabled: false, - IndexedSelects: true, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - AttributeSConns: []string{}, - ResourceSConns: []string{}, - StatSConns: []string{}, - RateSConns: []string{}, - AccountSConns: []string{}, - DefaultRatio: 1, - NestedFields: false, + Enabled: false, + IndexedSelects: true, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + AttributeSConns: []string{}, + ResourceSConns: []string{}, + StatSConns: []string{}, + RateSConns: []string{}, + AccountSConns: []string{}, + DefaultRatio: 1, + NestedFields: false, Opts: &RoutesOpts{ Context: []*utils.DynamicStringOpt{}, ProfileCount: []*utils.DynamicIntPointerOpt{}, @@ -2187,12 +2209,14 @@ func TestLoaderConfig(t *testing.T) { func TestDispatcherSConfig(t *testing.T) { expected := &DispatcherSCfg{ - Enabled: false, - IndexedSelects: true, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - AttributeSConns: []string{}, - NestedFields: false, + Enabled: false, + IndexedSelects: true, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + AttributeSConns: []string{}, + NestedFields: false, } cgrConfig := NewDefaultCGRConfig() if err != nil { @@ -2324,16 +2348,20 @@ func TestEEsNoLksConfig(t *testing.T) { func TestRateSConfig(t *testing.T) { expected := &RateSCfg{ - Enabled: false, - IndexedSelects: true, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - NestedFields: false, - RateIndexedSelects: true, - RatePrefixIndexedFields: &[]string{}, - RateSuffixIndexedFields: &[]string{}, - RateNestedFields: false, - Verbosity: 1000, + Enabled: false, + IndexedSelects: true, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + NestedFields: false, + RateIndexedSelects: true, + RatePrefixIndexedFields: &[]string{}, + RateSuffixIndexedFields: &[]string{}, + RateExistsIndexedFields: &[]string{}, + RateNotExistsIndexedFields: &[]string{}, + RateNestedFields: false, + Verbosity: 1000, Opts: &RatesOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, StartTime: []*utils.DynamicStringOpt{}, @@ -3435,12 +3463,14 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { func TestCgrCfgJSONDefaultDispatcherSCfg(t *testing.T) { eDspSCfg := &DispatcherSCfg{ - Enabled: false, - IndexedSelects: true, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - AttributeSConns: []string{}, + Enabled: false, + IndexedSelects: true, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + AttributeSConns: []string{}, } if !reflect.DeepEqual(cgrCfg.dispatcherSCfg, eDspSCfg) { t.Errorf("received: %+v, expecting: %+v", cgrCfg.dispatcherSCfg, eDspSCfg) @@ -3614,18 +3644,22 @@ func TestCgrCfgJSONDefaultApierCfg(t *testing.T) { func TestCgrCfgJSONDefaultRateCfg(t *testing.T) { eCfg := &RateSCfg{ - Enabled: false, - IndexedSelects: true, - StringIndexedFields: nil, - PrefixIndexedFields: &[]string{}, - SuffixIndexedFields: &[]string{}, - NestedFields: false, - RateIndexedSelects: true, - RateStringIndexedFields: nil, - RatePrefixIndexedFields: &[]string{}, - RateSuffixIndexedFields: &[]string{}, - RateNestedFields: false, - Verbosity: 1000, + Enabled: false, + IndexedSelects: true, + StringIndexedFields: nil, + PrefixIndexedFields: &[]string{}, + SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, + NestedFields: false, + RateIndexedSelects: true, + RateStringIndexedFields: nil, + RatePrefixIndexedFields: &[]string{}, + RateSuffixIndexedFields: &[]string{}, + RateExistsIndexedFields: &[]string{}, + RateNotExistsIndexedFields: &[]string{}, + RateNestedFields: false, + Verbosity: 1000, Opts: &RatesOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, StartTime: []*utils.DynamicStringOpt{}, @@ -4270,14 +4304,16 @@ func TestV1GetConfigAttribute(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ AttributeSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.StatSConnsCfg: []string{}, - utils.ResourceSConnsCfg: []string{}, - utils.AccountSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, + utils.EnabledCfg: false, + utils.StatSConnsCfg: []string{}, + utils.ResourceSConnsCfg: []string{}, + utils.AccountSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProcessRunsCfg: []*utils.DynamicIntOpt{}, @@ -4298,12 +4334,14 @@ func TestV1GetConfigChargers(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ ChargerSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.AttributeSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.SuffixIndexedFieldsCfg: []string{}, + utils.EnabledCfg: false, + utils.AttributeSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, }, } cfgCgr := NewDefaultCGRConfig() @@ -4318,13 +4356,15 @@ func TestV1GetConfigResourceS(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ ResourceSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.StoreIntervalCfg: utils.EmptyString, - utils.ThresholdSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, + utils.EnabledCfg: false, + utils.StoreIntervalCfg: utils.EmptyString, + utils.ThresholdSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, utils.OptsCfg: map[string]interface{}{ utils.MetaUsageIDCfg: []*utils.DynamicStringOpt{}, utils.MetaUsageTTLCfg: []*utils.DynamicDurationOpt{}, @@ -4351,6 +4391,8 @@ func TestV1GetConfigStats(t *testing.T) { utils.IndexedSelectsCfg: true, utils.PrefixIndexedFieldsCfg: []string{}, utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, utils.NestedFieldsCfg: false, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, @@ -4371,13 +4413,15 @@ func TestV1GetConfigThresholds(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ ThresholdSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.StoreIntervalCfg: utils.EmptyString, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.ActionSConnsCfg: []string{}, + utils.EnabledCfg: false, + utils.StoreIntervalCfg: utils.EmptyString, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.ActionSConnsCfg: []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, @@ -4396,16 +4440,18 @@ func TestV1GetConfigAcounts(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ AccountSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.AttributeSConnsCfg: []string{}, - utils.RateSConnsCfg: []string{}, - utils.ThresholdSConnsCfg: []string{}, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.MaxIterations: 1000, - utils.MaxUsage: "259200000000000", // 72h in ns + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.AttributeSConnsCfg: []string{}, + utils.RateSConnsCfg: []string{}, + utils.ThresholdSConnsCfg: []string{}, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.MaxIterations: 1000, + utils.MaxUsage: "259200000000000", // 72h in ns utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaUsage: []*utils.DynamicDecimalBigOpt{}, @@ -4425,17 +4471,19 @@ func TestV1GetConfigRoutes(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ RouteSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.AttributeSConnsCfg: []string{}, - utils.ResourceSConnsCfg: []string{}, - utils.StatSConnsCfg: []string{}, - utils.RateSConnsCfg: []string{}, - utils.AccountSConnsCfg: []string{}, - utils.DefaultRatioCfg: 1, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.AttributeSConnsCfg: []string{}, + utils.ResourceSConnsCfg: []string{}, + utils.StatSConnsCfg: []string{}, + utils.RateSConnsCfg: []string{}, + utils.AccountSConnsCfg: []string{}, + utils.DefaultRatioCfg: 1, utils.OptsCfg: map[string]interface{}{ utils.OptsContext: []*utils.DynamicStringOpt{}, utils.MetaProfileCountCfg: []*utils.DynamicIntPointerOpt{}, @@ -4500,12 +4548,14 @@ func TestV1GetConfigDispatcherS(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ DispatcherSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.AttributeSConnsCfg: []string{}, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.AttributeSConnsCfg: []string{}, }, } cfgCgr := NewDefaultCGRConfig() @@ -4918,16 +4968,20 @@ func TestV1GetConfigSectionRateS(t *testing.T) { var reply map[string]interface{} expected := map[string]interface{}{ RateSJSON: map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.RateIndexedSelectsCfg: true, - utils.RatePrefixIndexedFieldsCfg: []string{}, - utils.RateSuffixIndexedFieldsCfg: []string{}, - utils.RateNestedFieldsCfg: false, - utils.Verbosity: 1000, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.RateIndexedSelectsCfg: true, + utils.RatePrefixIndexedFieldsCfg: []string{}, + utils.RateSuffixIndexedFieldsCfg: []string{}, + utils.RateExistsIndexedFieldsCfg: []string{}, + utils.RateNotExistsIndexedFieldsCfg: []string{}, + utils.RateNestedFieldsCfg: false, + utils.Verbosity: 1000, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaStartTime: []*utils.DynamicStringOpt{}, @@ -5064,7 +5118,7 @@ func TestV1GetConfigAsJSONTListen(t *testing.T) { func TestV1GetConfigAsJSONAccounts(t *testing.T) { var reply string - expected := `{"accounts":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"max_iterations":1000,"max_usage":"259200000000000","nested_fields":false,"opts":{"*profileIDs":[],"*profileIgnoreFilters":[],"*usage":[]},"prefix_indexed_fields":[],"rates_conns":[],"suffix_indexed_fields":[],"thresholds_conns":[]}}` + 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":[]}}` cfg := NewDefaultCGRConfig() if err := cfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{AccountSJSON}}, &reply); err != nil { t.Error(err) @@ -5185,7 +5239,7 @@ func TestV1GetConfigAsJSONDNSAgent(t *testing.T) { func TestV1GetConfigAsJSONAttributes(t *testing.T) { var reply string - expected := `{"attributes":{"accounts_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"opts":{"*processRuns":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*profileRuns":[]},"prefix_indexed_fields":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]}}` + expected := `{"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":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{AttributeSJSON}}, &reply); err != nil { t.Error(err) @@ -5196,7 +5250,7 @@ func TestV1GetConfigAsJSONAttributes(t *testing.T) { func TestV1GetConfigAsJSONChargerS(t *testing.T) { var reply string - expected := `{"chargers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]}}` + expected := `{"chargers":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"prefix_indexed_fields":[],"suffix_indexed_fields":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{ChargerSJSON}}, &reply); err != nil { t.Error(err) @@ -5207,7 +5261,7 @@ func TestV1GetConfigAsJSONChargerS(t *testing.T) { func TestV1GetConfigAsJSONResourceS(t *testing.T) { var reply string - expected := `{"resources":{"enabled":false,"indexed_selects":true,"nested_fields":false,"opts":{"*units":[],"*usageID":[],"*usageTTL":[]},"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]}}` + expected := `{"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":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{ResourceSJSON}}, &reply); err != nil { t.Error(err) @@ -5218,7 +5272,7 @@ func TestV1GetConfigAsJSONResourceS(t *testing.T) { func TestV1GetConfigAsJSONStatS(t *testing.T) { var reply string - expected := `{"stats":{"enabled":false,"indexed_selects":true,"nested_fields":false,"opts":{"*profileIDs":[],"*profileIgnoreFilters":[],"*roundingDecimals":[]},"prefix_indexed_fields":[],"store_interval":"","store_uncompressed_limit":0,"suffix_indexed_fields":[],"thresholds_conns":[]}}` + expected := `{"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":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{StatSJSON}}, &reply); err != nil { t.Error(err) @@ -5229,7 +5283,7 @@ func TestV1GetConfigAsJSONStatS(t *testing.T) { func TestV1GetConfigAsJSONThresholdS(t *testing.T) { var reply string - expected := `{"thresholds":{"actions_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"opts":{"*profileIDs":[],"*profileIgnoreFilters":[]},"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[]}}` + expected := `{"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":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{ThresholdSJSON}}, &reply); err != nil { t.Error(err) @@ -5240,7 +5294,7 @@ func TestV1GetConfigAsJSONThresholdS(t *testing.T) { func TestV1GetConfigAsJSONRouteS(t *testing.T) { var reply string - expected := `{"routes":{"accounts_conns":[],"attributes_conns":[],"default_ratio":1,"enabled":false,"indexed_selects":true,"nested_fields":false,"opts":{"*context":[],"*ignoreErrors":[],"*limit":[],"*maxCost":[],"*offset":[],"*profileCount":[],"*usage":[]},"prefix_indexed_fields":[],"rates_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]}}` + expected := `{"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":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{RouteSJSON}}, &reply); err != nil { t.Error(err) @@ -5264,7 +5318,7 @@ func TestV1GetConfigAsJSONSureTax(t *testing.T) { func TestV1GetConfigAsJSONDispatcherS(t *testing.T) { var reply string - expected := `{"dispatchers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]}}` + expected := `{"dispatchers":{"attributes_conns":[],"enabled":false,"exists_indexed_fields":[],"indexed_selects":true,"nested_fields":false,"notexists_indexed_fields":[],"prefix_indexed_fields":[],"suffix_indexed_fields":[]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{DispatcherSJSON}}, &reply); err != nil { t.Error(err) @@ -5429,7 +5483,7 @@ func TestV1GetConfigAsJSONAnalyzer(t *testing.T) { func TestV1GetConfigAsJSONRateS(t *testing.T) { var reply string - expected := `{"rates":{"enabled":false,"indexed_selects":true,"nested_fields":false,"opts":{"*intervalStart":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*startTime":[],"*usage":[]},"prefix_indexed_fields":[],"rate_indexed_selects":true,"rate_nested_fields":false,"rate_prefix_indexed_fields":[],"rate_suffix_indexed_fields":[],"suffix_indexed_fields":[],"verbosity":1000}}` + expected := `{"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}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{RateSJSON}}, &reply); err != nil { t.Error(err) @@ -5503,7 +5557,7 @@ func TestV1GetConfigAsJSONAllConfig(t *testing.T) { } }` var reply string - expected := `{"accounts":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"max_iterations":1000,"max_usage":"259200000000000","nested_fields":false,"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,"indexed_selects":true,"nested_fields":false,"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,"indexed_selects":true,"nested_fields":false,"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,"indexed_selects":true,"nested_fields":false,"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","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,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"dns_agent":{"enabled":false,"listen":"127.0.0.1:2053","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"],"timezone":""},"ees":{"attributes_conns":[],"cache":{"*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","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,"indexed_selects":true,"nested_fields":false,"opts":{"*intervalStart":[],"*profileIDs":[],"*profileIgnoreFilters":[],"*startTime":[],"*usage":[]},"prefix_indexed_fields":[],"rate_indexed_selects":true,"rate_nested_fields":false,"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,"indexed_selects":true,"nested_fields":false,"opts":{"*units":[],"*usageID":[],"*usageTTL":[]},"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"accounts_conns":[],"attributes_conns":[],"default_ratio":1,"enabled":false,"indexed_selects":true,"nested_fields":false,"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,"indexed_selects":true,"nested_fields":false,"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,"indexed_selects":true,"nested_fields":false,"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","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","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}}` cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSON) if err != nil { t.Fatal(err) @@ -5889,6 +5943,8 @@ func TestActionSConfig(t *testing.T) { StringIndexedFields: nil, PrefixIndexedFields: &[]string{}, SuffixIndexedFields: &[]string{}, + ExistsIndexedFields: &[]string{}, + NotExistsIndexedFields: &[]string{}, NestedFields: false, DynaprepaidActionProfile: []string{}, Opts: &ActionsOpts{ @@ -5917,6 +5973,8 @@ func TestV1GetConfigSectionActionSJSON(t *testing.T) { utils.IndexedSelectsCfg: true, utils.PrefixIndexedFieldsCfg: []string{}, utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, utils.NestedFieldsCfg: false, utils.DynaprepaidActionplansCfg: []string{}, utils.OptsCfg: map[string]interface{}{ @@ -6005,14 +6063,16 @@ func TestSetCfgInDb(t *testing.T) { db := &CgrJsonCfg{} cfg.db = db cfg.attributeSCfg = &AttributeSCfg{ - Enabled: true, - ResourceSConns: []string{"*internal"}, - StatSConns: []string{"*internal"}, - AccountSConns: []string{"*internal"}, - IndexedSelects: true, - StringIndexedFields: &[]string{"field1"}, - SuffixIndexedFields: &[]string{"field1"}, - PrefixIndexedFields: &[]string{"field1"}, + Enabled: true, + ResourceSConns: []string{"*internal"}, + StatSConns: []string{"*internal"}, + AccountSConns: []string{"*internal"}, + IndexedSelects: true, + StringIndexedFields: &[]string{"field1"}, + SuffixIndexedFields: &[]string{"field1"}, + PrefixIndexedFields: &[]string{"field1"}, + ExistsIndexedFields: &[]string{"field1"}, + NotExistsIndexedFields: &[]string{"field1"}, Opts: &AttributesOpts{ ProcessRuns: []*utils.DynamicIntOpt{ &utils.DynamicIntOpt{ @@ -6027,14 +6087,16 @@ func TestSetCfgInDb(t *testing.T) { args := &SetConfigArgs{ Config: map[string]interface{}{ "attributes": &AttributeSJsonCfg{ - Enabled: utils.BoolPointer(false), - Resources_conns: &[]string{"*localhost"}, - Stats_conns: &[]string{"*localhost"}, - Accounts_conns: &[]string{"*localhost"}, - Indexed_selects: utils.BoolPointer(false), - String_indexed_fields: &[]string{"field2"}, - Suffix_indexed_fields: &[]string{"field2"}, - Prefix_indexed_fields: &[]string{"field2"}, + Enabled: utils.BoolPointer(false), + Resources_conns: &[]string{"*localhost"}, + Stats_conns: &[]string{"*localhost"}, + Accounts_conns: &[]string{"*localhost"}, + Indexed_selects: utils.BoolPointer(false), + String_indexed_fields: &[]string{"field2"}, + Suffix_indexed_fields: &[]string{"field2"}, + Prefix_indexed_fields: &[]string{"field2"}, + Exists_indexed_fields: &[]string{"field2"}, + Notexists_indexed_fields: &[]string{"field2"}, Opts: &AttributesOptsJson{ ProcessRuns: []*utils.DynamicIntOpt{ { @@ -6047,14 +6109,16 @@ func TestSetCfgInDb(t *testing.T) { }, } expected := &AttributeSJsonCfg{ - Enabled: utils.BoolPointer(false), - Resources_conns: &[]string{"*localhost"}, - Stats_conns: &[]string{"*localhost"}, - Accounts_conns: &[]string{"*localhost"}, - Indexed_selects: utils.BoolPointer(false), - String_indexed_fields: &[]string{"field2"}, - Suffix_indexed_fields: &[]string{"field2"}, - Prefix_indexed_fields: &[]string{"field2"}, + Enabled: utils.BoolPointer(false), + Resources_conns: &[]string{"*localhost"}, + Stats_conns: &[]string{"*localhost"}, + Accounts_conns: &[]string{"*localhost"}, + Indexed_selects: utils.BoolPointer(false), + String_indexed_fields: &[]string{"field2"}, + Suffix_indexed_fields: &[]string{"field2"}, + Prefix_indexed_fields: &[]string{"field2"}, + Exists_indexed_fields: &[]string{"field2"}, + Notexists_indexed_fields: &[]string{"field2"}, Opts: &AttributesOptsJson{ ProcessRuns: []*utils.DynamicIntOpt{ { @@ -6086,14 +6150,16 @@ func TestSetNilCfgInDb(t *testing.T) { db := &CgrJsonCfg{} cfg.db = db cfg.attributeSCfg = &AttributeSCfg{ - Enabled: true, - ResourceSConns: []string{"*internal"}, - StatSConns: []string{"*internal"}, - AccountSConns: []string{"*internal"}, - IndexedSelects: true, - StringIndexedFields: &[]string{"field1"}, - SuffixIndexedFields: &[]string{"field1"}, - PrefixIndexedFields: &[]string{"field1"}, + Enabled: true, + ResourceSConns: []string{"*internal"}, + StatSConns: []string{"*internal"}, + AccountSConns: []string{"*internal"}, + IndexedSelects: true, + StringIndexedFields: &[]string{"field1"}, + SuffixIndexedFields: &[]string{"field1"}, + PrefixIndexedFields: &[]string{"field1"}, + ExistsIndexedFields: &[]string{"field1"}, + NotExistsIndexedFields: &[]string{"field1"}, Opts: &AttributesOpts{ ProcessRuns: []*utils.DynamicIntOpt{ &utils.DynamicIntOpt{ @@ -6134,14 +6200,16 @@ func TestReloadCfgInDb(t *testing.T) { db := &CgrJsonCfg{} cfg.db = db cfg.attributeSCfg = &AttributeSCfg{ - Enabled: true, - ResourceSConns: []string{"*internal"}, - StatSConns: []string{"*internal"}, - AccountSConns: []string{"*internal"}, - IndexedSelects: false, - StringIndexedFields: &[]string{"field1"}, - SuffixIndexedFields: &[]string{"field1"}, - PrefixIndexedFields: &[]string{"field1"}, + Enabled: true, + ResourceSConns: []string{"*internal"}, + StatSConns: []string{"*internal"}, + AccountSConns: []string{"*internal"}, + IndexedSelects: false, + StringIndexedFields: &[]string{"field1"}, + SuffixIndexedFields: &[]string{"field1"}, + PrefixIndexedFields: &[]string{"field1"}, + ExistsIndexedFields: &[]string{"field1"}, + NotExistsIndexedFields: &[]string{"field1"}, Opts: &AttributesOpts{ ProcessRuns: []*utils.DynamicIntOpt{ { @@ -6157,14 +6225,16 @@ func TestReloadCfgInDb(t *testing.T) { cfg.rldCh = make(chan string, 100) cfg.ConfigPath = path.Join("/usr", "share", "cgrates", "conf", "samples", "attributes_internal") jsn := &AttributeSJsonCfg{ - Enabled: utils.BoolPointer(false), - Resources_conns: &[]string{"*localhost"}, - Stats_conns: &[]string{"*localhost"}, - Accounts_conns: &[]string{"*localhost"}, - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: &[]string{"field2"}, - Suffix_indexed_fields: &[]string{"field2"}, - Prefix_indexed_fields: &[]string{"field2"}, + Enabled: utils.BoolPointer(false), + Resources_conns: &[]string{"*localhost"}, + Stats_conns: &[]string{"*localhost"}, + Accounts_conns: &[]string{"*localhost"}, + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: &[]string{"field2"}, + Suffix_indexed_fields: &[]string{"field2"}, + Prefix_indexed_fields: &[]string{"field2"}, + Exists_indexed_fields: &[]string{"field2"}, + Notexists_indexed_fields: &[]string{"field2"}, Opts: &AttributesOptsJson{ ProcessRuns: []*utils.DynamicIntOpt{ { @@ -6176,14 +6246,16 @@ func TestReloadCfgInDb(t *testing.T) { } db.SetSection(context.Background(), AttributeSJSON, jsn) expected := &AttributeSCfg{ - Enabled: false, - ResourceSConns: []string{"*localhost"}, - StatSConns: []string{"*localhost"}, - AccountSConns: []string{"*localhost"}, - IndexedSelects: true, - StringIndexedFields: &[]string{"field2"}, - SuffixIndexedFields: &[]string{"field2"}, - PrefixIndexedFields: &[]string{"field2"}, + Enabled: false, + ResourceSConns: []string{"*localhost"}, + StatSConns: []string{"*localhost"}, + AccountSConns: []string{"*localhost"}, + IndexedSelects: true, + StringIndexedFields: &[]string{"field2"}, + SuffixIndexedFields: &[]string{"field2"}, + PrefixIndexedFields: &[]string{"field2"}, + ExistsIndexedFields: &[]string{"field2"}, + NotExistsIndexedFields: &[]string{"field2"}, Opts: &AttributesOpts{ ProcessRuns: []*utils.DynamicIntOpt{ { diff --git a/config/dispatcherscfg_test.go b/config/dispatcherscfg_test.go index e23801595..3a86af663 100644 --- a/config/dispatcherscfg_test.go +++ b/config/dispatcherscfg_test.go @@ -27,22 +27,26 @@ import ( func TestDispatcherSCfgloadFromJsonCfg(t *testing.T) { jsonCfg := &DispatcherSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: &[]string{"*req.prefix", "*req.indexed"}, - Prefix_indexed_fields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - Suffix_indexed_fields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - Attributes_conns: &[]string{utils.MetaInternal, "*conn1"}, - Nested_fields: utils.BoolPointer(true), + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: &[]string{"*req.prefix", "*req.indexed"}, + Prefix_indexed_fields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + Suffix_indexed_fields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + Exists_indexed_fields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + Notexists_indexed_fields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + Attributes_conns: &[]string{utils.MetaInternal, "*conn1"}, + Nested_fields: utils.BoolPointer(true), } expected := &DispatcherSCfg{ - Enabled: true, - IndexedSelects: true, - StringIndexedFields: &[]string{"*req.prefix", "*req.indexed"}, - PrefixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - SuffixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, - NestedFields: true, + Enabled: true, + IndexedSelects: true, + StringIndexedFields: &[]string{"*req.prefix", "*req.indexed"}, + PrefixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + SuffixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + ExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + NotExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, + NestedFields: true, } jsnCfg := NewDefaultCGRConfig() if err = jsnCfg.dispatcherSCfg.loadFromJSONCfg(jsonCfg); err != nil { @@ -63,18 +67,22 @@ func TestDispatcherSCfgAsMapInterface(t *testing.T) { "indexed_selects":true, "prefix_indexed_fields": [], "suffix_indexed_fields": [], + "exists_indexed_fields": [], + "notexists_indexed_fields": [], "nested_fields": false, "attributes_conns": [], }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.AttributeSConnsCfg: []string{}, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.AttributeSConnsCfg: []string{}, } if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil { t.Error(err) @@ -91,19 +99,23 @@ func TestDispatcherSCfgAsMapInterface1(t *testing.T) { "string_indexed_fields": ["*req.prefix"], "prefix_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], "suffix_indexed_fields": ["*req.prefix"], + "exists_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], + "notexists_indexed_fields": ["*req.prefix"], "nested_fields": false, "attributes_conns": ["*internal:*attributes", "*conn1"], }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.StringIndexedFieldsCfg: []string{"*req.prefix"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, - utils.SuffixIndexedFieldsCfg: []string{"*req.prefix"}, - utils.NestedFieldsCfg: false, - utils.AttributeSConnsCfg: []string{"*internal", "*conn1"}, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.StringIndexedFieldsCfg: []string{"*req.prefix"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, + utils.SuffixIndexedFieldsCfg: []string{"*req.prefix"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.prefix"}, + utils.NestedFieldsCfg: false, + utils.AttributeSConnsCfg: []string{"*internal", "*conn1"}, } if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil { t.Error(err) @@ -117,12 +129,14 @@ func TestDispatcherSCfgAsMapInterface2(t *testing.T) { "dispatchers":{}, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.AttributeSConnsCfg: []string{}, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.AttributeSConnsCfg: []string{}, } if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil { t.Error(err) @@ -132,13 +146,15 @@ func TestDispatcherSCfgAsMapInterface2(t *testing.T) { } func TestDispatcherSCfgClone(t *testing.T) { ban := &DispatcherSCfg{ - Enabled: true, - IndexedSelects: true, - StringIndexedFields: &[]string{"*req.prefix", "*req.indexed"}, - PrefixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - SuffixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, - NestedFields: true, + Enabled: true, + IndexedSelects: true, + StringIndexedFields: &[]string{"*req.prefix", "*req.indexed"}, + PrefixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + SuffixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + ExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + NotExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, + NestedFields: true, } rcv := ban.Clone() if !reflect.DeepEqual(ban, rcv) { diff --git a/config/ratescfg_test.go b/config/ratescfg_test.go index 772972f1d..f43fbacca 100644 --- a/config/ratescfg_test.go +++ b/config/ratescfg_test.go @@ -28,32 +28,40 @@ import ( func TestRateSConfigloadFromJsonCfg(t *testing.T) { cfgJSON := &RateSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: &[]string{"*req.index1"}, - Prefix_indexed_fields: &[]string{"*req.index1"}, - Suffix_indexed_fields: &[]string{"*req.index1"}, - Nested_fields: utils.BoolPointer(true), - Rate_indexed_selects: utils.BoolPointer(true), - Rate_string_indexed_fields: &[]string{"*req.index1"}, - Rate_prefix_indexed_fields: &[]string{"*req.index1"}, - Rate_suffix_indexed_fields: &[]string{"*req.index1"}, - Rate_nested_fields: utils.BoolPointer(true), - Verbosity: utils.IntPointer(20), + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: &[]string{"*req.index1"}, + Prefix_indexed_fields: &[]string{"*req.index1"}, + Suffix_indexed_fields: &[]string{"*req.index1"}, + Exists_indexed_fields: &[]string{"*req.index1"}, + Notexists_indexed_fields: &[]string{"*req.index1"}, + Nested_fields: utils.BoolPointer(true), + Rate_indexed_selects: utils.BoolPointer(true), + Rate_string_indexed_fields: &[]string{"*req.index1"}, + Rate_prefix_indexed_fields: &[]string{"*req.index1"}, + Rate_suffix_indexed_fields: &[]string{"*req.index1"}, + Rate_exists_indexed_fields: &[]string{"*req.index1"}, + Rate_notexists_indexed_fields: &[]string{"*req.index1"}, + Rate_nested_fields: utils.BoolPointer(true), + Verbosity: utils.IntPointer(20), } expected := &RateSCfg{ - Enabled: true, - IndexedSelects: true, - StringIndexedFields: &[]string{"*req.index1"}, - PrefixIndexedFields: &[]string{"*req.index1"}, - SuffixIndexedFields: &[]string{"*req.index1"}, - NestedFields: true, - RateIndexedSelects: true, - RateStringIndexedFields: &[]string{"*req.index1"}, - RatePrefixIndexedFields: &[]string{"*req.index1"}, - RateSuffixIndexedFields: &[]string{"*req.index1"}, - RateNestedFields: true, - Verbosity: 20, + Enabled: true, + IndexedSelects: true, + StringIndexedFields: &[]string{"*req.index1"}, + PrefixIndexedFields: &[]string{"*req.index1"}, + SuffixIndexedFields: &[]string{"*req.index1"}, + ExistsIndexedFields: &[]string{"*req.index1"}, + NotExistsIndexedFields: &[]string{"*req.index1"}, + NestedFields: true, + RateIndexedSelects: true, + RateStringIndexedFields: &[]string{"*req.index1"}, + RatePrefixIndexedFields: &[]string{"*req.index1"}, + RateSuffixIndexedFields: &[]string{"*req.index1"}, + RateExistsIndexedFields: &[]string{"*req.index1"}, + RateNotExistsIndexedFields: &[]string{"*req.index1"}, + RateNestedFields: true, + Verbosity: 20, Opts: &RatesOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, StartTime: []*utils.DynamicStringOpt{}, @@ -79,16 +87,20 @@ func TestRatesCfgAsMapInterface(t *testing.T) { "rates": {} }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.RateIndexedSelectsCfg: true, - utils.RatePrefixIndexedFieldsCfg: []string{}, - utils.RateSuffixIndexedFieldsCfg: []string{}, - utils.RateNestedFieldsCfg: false, - utils.Verbosity: 1000, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.RateIndexedSelectsCfg: true, + utils.RatePrefixIndexedFieldsCfg: []string{}, + utils.RateSuffixIndexedFieldsCfg: []string{}, + utils.RateExistsIndexedFieldsCfg: []string{}, + utils.RateNotExistsIndexedFieldsCfg: []string{}, + utils.RateNestedFieldsCfg: false, + utils.Verbosity: 1000, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaStartTime: []*utils.DynamicStringOpt{}, @@ -109,30 +121,38 @@ func TestRatesCfgAsMapInterface1(t *testing.T) { "rates": { "enabled": true, "indexed_selects": false, - "string_indexed_fields": ["*req.index1"], + "string_indexed_fields": ["*req.index1"], "prefix_indexed_fields": ["*req.index1", "*req.index2"], - "suffix_indexed_fields": ["*req.index1"], + "suffix_indexed_fields": ["*req.index1"], + "exists_indexed_fields": ["*req.index1", "*req.index2"], + "notexists_indexed_fields": ["*req.index1"], "nested_fields": true, "rate_indexed_selects": false, "rate_string_indexed_fields": ["*req.index1"], - "rate_prefix_indexed_fields": ["*req.index1", "*req.index2"], - "rate_suffix_indexed_fields": ["*req.index1", "*req.index2", "*req.index3"], + "rate_prefix_indexed_fields": ["*req.index1", "*req.index2"], + "rate_suffix_indexed_fields": ["*req.index1", "*req.index2", "*req.index3"], + "rate_exists_indexed_fields": ["*req.index1", "*req.index2"], + "rate_notexists_indexed_fields": ["*req.index1"], "rate_nested_fields": true, }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.IndexedSelectsCfg: false, - utils.StringIndexedFieldsCfg: []string{"*req.index1"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, - utils.SuffixIndexedFieldsCfg: []string{"*req.index1"}, - utils.NestedFieldsCfg: true, - utils.RateIndexedSelectsCfg: false, - utils.RateStringIndexedFieldsCfg: []string{"*req.index1"}, - utils.RatePrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, - utils.RateSuffixIndexedFieldsCfg: []string{"*req.index1", "*req.index2", "*req.index3"}, - utils.RateNestedFieldsCfg: true, - utils.Verbosity: 1000, + utils.EnabledCfg: true, + utils.IndexedSelectsCfg: false, + utils.StringIndexedFieldsCfg: []string{"*req.index1"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.SuffixIndexedFieldsCfg: []string{"*req.index1"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.index1"}, + utils.NestedFieldsCfg: true, + utils.RateIndexedSelectsCfg: false, + utils.RateStringIndexedFieldsCfg: []string{"*req.index1"}, + utils.RatePrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.RateSuffixIndexedFieldsCfg: []string{"*req.index1", "*req.index2", "*req.index3"}, + utils.RateExistsIndexedFieldsCfg: []string{"*req.index1", "*req.index2"}, + utils.RateNotExistsIndexedFieldsCfg: []string{"*req.index1"}, + utils.RateNestedFieldsCfg: true, + utils.Verbosity: 1000, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaStartTime: []*utils.DynamicStringOpt{}, diff --git a/config/resourcescfg_test.go b/config/resourcescfg_test.go index ecdfb0145..6e8a57024 100644 --- a/config/resourcescfg_test.go +++ b/config/resourcescfg_test.go @@ -27,24 +27,28 @@ import ( func TestResourceSConfigloadFromJsonCfgCase1(t *testing.T) { cfgJSON := &ResourceSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(true), - Thresholds_conns: &[]string{utils.MetaInternal, "*conn1"}, - Store_interval: utils.StringPointer("2s"), - String_indexed_fields: &[]string{"*req.index1"}, - Prefix_indexed_fields: &[]string{"*req.index1"}, - Suffix_indexed_fields: &[]string{"*req.index1"}, - Nested_fields: utils.BoolPointer(true), + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(true), + Thresholds_conns: &[]string{utils.MetaInternal, "*conn1"}, + Store_interval: utils.StringPointer("2s"), + String_indexed_fields: &[]string{"*req.index1"}, + Prefix_indexed_fields: &[]string{"*req.index1"}, + Suffix_indexed_fields: &[]string{"*req.index1"}, + Exists_indexed_fields: &[]string{"*req.index1"}, + Notexists_indexed_fields: &[]string{"*req.index1"}, + Nested_fields: utils.BoolPointer(true), } expected := &ResourceSConfig{ - Enabled: true, - IndexedSelects: true, - StoreInterval: 2 * time.Second, - ThresholdSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds), "*conn1"}, - StringIndexedFields: &[]string{"*req.index1"}, - PrefixIndexedFields: &[]string{"*req.index1"}, - SuffixIndexedFields: &[]string{"*req.index1"}, - NestedFields: true, + Enabled: true, + IndexedSelects: true, + StoreInterval: 2 * time.Second, + ThresholdSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds), "*conn1"}, + StringIndexedFields: &[]string{"*req.index1"}, + PrefixIndexedFields: &[]string{"*req.index1"}, + SuffixIndexedFields: &[]string{"*req.index1"}, + ExistsIndexedFields: &[]string{"*req.index1"}, + NotExistsIndexedFields: &[]string{"*req.index1"}, + NestedFields: true, Opts: &ResourcesOpts{ UsageID: []*utils.DynamicStringOpt{}, UsageTTL: []*utils.DynamicDurationOpt{}, @@ -128,13 +132,15 @@ func TestResourceSConfigAsMapInterface(t *testing.T) { "resources": {}, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.StoreIntervalCfg: utils.EmptyString, - utils.ThresholdSConnsCfg: []string{}, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, + utils.EnabledCfg: false, + utils.StoreIntervalCfg: utils.EmptyString, + utils.ThresholdSConnsCfg: []string{}, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, utils.OptsCfg: map[string]interface{}{ utils.MetaUsageIDCfg: []*utils.DynamicStringOpt{}, utils.MetaUsageTTLCfg: []*utils.DynamicDurationOpt{}, @@ -158,18 +164,22 @@ func TestResourceSConfigAsMapInterface1(t *testing.T) { "string_indexed_fields": ["*req.index1"], "prefix_indexed_fields": ["*req.prefix_indexed_fields1","*req.prefix_indexed_fields2"], "suffix_indexed_fields": ["*req.prefix_indexed_fields1"], + "exists_indexed_fields": ["*req.prefix_indexed_fields1","*req.prefix_indexed_fields2"], + "notexists_indexed_fields": ["*req.prefix_indexed_fields1"], "nested_fields": true, }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.StoreIntervalCfg: "7m0s", - utils.ThresholdSConnsCfg: []string{utils.MetaInternal, "*conn1"}, - utils.IndexedSelectsCfg: true, - utils.StringIndexedFieldsCfg: []string{"*req.index1"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1", "*req.prefix_indexed_fields2"}, - utils.SuffixIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1"}, - utils.NestedFieldsCfg: true, + utils.EnabledCfg: true, + utils.StoreIntervalCfg: "7m0s", + utils.ThresholdSConnsCfg: []string{utils.MetaInternal, "*conn1"}, + utils.IndexedSelectsCfg: true, + utils.StringIndexedFieldsCfg: []string{"*req.index1"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1", "*req.prefix_indexed_fields2"}, + utils.SuffixIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1", "*req.prefix_indexed_fields2"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1"}, + utils.NestedFieldsCfg: true, utils.OptsCfg: map[string]interface{}{ utils.MetaUsageIDCfg: []*utils.DynamicStringOpt{}, utils.MetaUsageTTLCfg: []*utils.DynamicDurationOpt{}, diff --git a/config/routescfg_test.go b/config/routescfg_test.go index fe2e76e78..36fa4bad4 100644 --- a/config/routescfg_test.go +++ b/config/routescfg_test.go @@ -27,33 +27,37 @@ import ( func TestRouteSCfgloadFromJsonCfg(t *testing.T) { cfgJSON := &RouteSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(true), - String_indexed_fields: &[]string{"*req.index1"}, - Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, - Suffix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, - Attributes_conns: &[]string{utils.MetaInternal, "conn1"}, - Resources_conns: &[]string{utils.MetaInternal, "conn1"}, - Stats_conns: &[]string{utils.MetaInternal, "conn1"}, - Rates_conns: &[]string{utils.MetaInternal, "conn1"}, - Accounts_conns: &[]string{utils.MetaInternal, "conn1"}, - Default_ratio: utils.IntPointer(10), - Nested_fields: utils.BoolPointer(true), - Opts: &RoutesOptsJson{}, + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(true), + String_indexed_fields: &[]string{"*req.index1"}, + Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Suffix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Exists_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Notexists_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Attributes_conns: &[]string{utils.MetaInternal, "conn1"}, + Resources_conns: &[]string{utils.MetaInternal, "conn1"}, + Stats_conns: &[]string{utils.MetaInternal, "conn1"}, + Rates_conns: &[]string{utils.MetaInternal, "conn1"}, + Accounts_conns: &[]string{utils.MetaInternal, "conn1"}, + Default_ratio: utils.IntPointer(10), + Nested_fields: utils.BoolPointer(true), + Opts: &RoutesOptsJson{}, } expected := &RouteSCfg{ - Enabled: true, - IndexedSelects: true, - StringIndexedFields: &[]string{"*req.index1"}, - PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, - SuffixIndexedFields: &[]string{"*req.index1", "*req.index2"}, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "conn1"}, - ResourceSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResources), "conn1"}, - StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats), "conn1"}, - RateSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaRateS), "conn1"}, - AccountSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts), "conn1"}, - DefaultRatio: 10, - NestedFields: true, + Enabled: true, + IndexedSelects: true, + StringIndexedFields: &[]string{"*req.index1"}, + PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, + SuffixIndexedFields: &[]string{"*req.index1", "*req.index2"}, + ExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, + NotExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "conn1"}, + ResourceSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResources), "conn1"}, + StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats), "conn1"}, + RateSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaRateS), "conn1"}, + AccountSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts), "conn1"}, + DefaultRatio: 10, + NestedFields: true, Opts: &RoutesOpts{ Context: []*utils.DynamicStringOpt{}, ProfileCount: []*utils.DynamicIntPointerOpt{}, @@ -100,17 +104,19 @@ func TestRouteSCfgAsMapInterface(t *testing.T) { "routes": {}, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.AttributeSConnsCfg: []string{}, - utils.ResourceSConnsCfg: []string{}, - utils.StatSConnsCfg: []string{}, - utils.RateSConnsCfg: []string{}, - utils.AccountSConnsCfg: []string{}, - utils.DefaultRatioCfg: 1, + utils.EnabledCfg: false, + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.AttributeSConnsCfg: []string{}, + utils.ResourceSConnsCfg: []string{}, + utils.StatSConnsCfg: []string{}, + utils.RateSConnsCfg: []string{}, + utils.AccountSConnsCfg: []string{}, + utils.DefaultRatioCfg: 1, utils.OptsCfg: map[string]interface{}{ utils.OptsContext: []*utils.DynamicStringOpt{}, utils.MetaLimitCfg: []*utils.DynamicIntPointerOpt{}, @@ -136,6 +142,8 @@ func TestRouteSCfgAsMapInterface1(t *testing.T) { "string_indexed_fields": ["*req.string"], "prefix_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], "suffix_indexed_fields": ["*req.prefix","*req.indexed"], + "exists_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], + "notexists_indexed_fields": ["*req.prefix","*req.indexed"], "nested_fields": true, "attributes_conns": ["*internal:*attributes", "conn1"], "resources_conns": ["*internal:*resources", "conn1"], @@ -147,18 +155,20 @@ func TestRouteSCfgAsMapInterface1(t *testing.T) { }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.IndexedSelectsCfg: false, - utils.StringIndexedFieldsCfg: []string{"*req.string"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, - utils.SuffixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed"}, - utils.NestedFieldsCfg: true, - utils.AttributeSConnsCfg: []string{utils.MetaInternal, "conn1"}, - utils.ResourceSConnsCfg: []string{utils.MetaInternal, "conn1"}, - utils.StatSConnsCfg: []string{utils.MetaInternal, "conn1"}, - utils.RateSConnsCfg: []string{utils.MetaInternal, "conn1"}, - utils.AccountSConnsCfg: []string{utils.MetaInternal, "conn1"}, - utils.DefaultRatioCfg: 2, + utils.EnabledCfg: true, + utils.IndexedSelectsCfg: false, + utils.StringIndexedFieldsCfg: []string{"*req.string"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, + utils.SuffixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed"}, + utils.NestedFieldsCfg: true, + utils.AttributeSConnsCfg: []string{utils.MetaInternal, "conn1"}, + utils.ResourceSConnsCfg: []string{utils.MetaInternal, "conn1"}, + utils.StatSConnsCfg: []string{utils.MetaInternal, "conn1"}, + utils.RateSConnsCfg: []string{utils.MetaInternal, "conn1"}, + utils.AccountSConnsCfg: []string{utils.MetaInternal, "conn1"}, + utils.DefaultRatioCfg: 2, utils.OptsCfg: map[string]interface{}{ utils.OptsContext: []*utils.DynamicStringOpt{}, utils.MetaLimitCfg: []*utils.DynamicIntPointerOpt{}, @@ -178,17 +188,19 @@ func TestRouteSCfgAsMapInterface1(t *testing.T) { func TestRouteSCfgClone(t *testing.T) { ban := &RouteSCfg{ - Enabled: true, - IndexedSelects: true, - StringIndexedFields: &[]string{"*req.index1"}, - PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, - SuffixIndexedFields: &[]string{"*req.index1", "*req.index2"}, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "conn1"}, - ResourceSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResources), "conn1"}, - StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats), "conn1"}, - DefaultRatio: 10, - NestedFields: true, - Opts: &RoutesOpts{}, + Enabled: true, + IndexedSelects: true, + StringIndexedFields: &[]string{"*req.index1"}, + PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, + SuffixIndexedFields: &[]string{"*req.index1", "*req.index2"}, + ExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, + NotExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "conn1"}, + ResourceSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResources), "conn1"}, + StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats), "conn1"}, + DefaultRatio: 10, + NestedFields: true, + Opts: &RoutesOpts{}, } rcv := ban.Clone() if !reflect.DeepEqual(ban, rcv) { diff --git a/config/statscfg.go b/config/statscfg.go index e85cdf8b6..b89ec42ab 100644 --- a/config/statscfg.go +++ b/config/statscfg.go @@ -204,11 +204,11 @@ func (st StatSCfg) Clone() (cln *StatSCfg) { if st.SuffixIndexedFields != nil { cln.SuffixIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*st.SuffixIndexedFields)) } - if cln.ExistsIndexedFields != nil { - cln.ExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*cln.ExistsIndexedFields)) + if st.ExistsIndexedFields != nil { + cln.ExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*st.ExistsIndexedFields)) } - if cln.NotExistsIndexedFields != nil { - cln.NotExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*cln.NotExistsIndexedFields)) + if st.NotExistsIndexedFields != nil { + cln.NotExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*st.NotExistsIndexedFields)) } return } diff --git a/config/statscfg_test.go b/config/statscfg_test.go index 951fe9905..c740cdcda 100644 --- a/config/statscfg_test.go +++ b/config/statscfg_test.go @@ -35,6 +35,8 @@ func TestStatSCfgloadFromJsonCfgCase1(t *testing.T) { String_indexed_fields: &[]string{"*req.string"}, Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, Suffix_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Exists_indexed_fields: &[]string{"*req.index1", "*req.index2"}, + Notexists_indexed_fields: &[]string{"*req.index1", "*req.index2"}, Nested_fields: utils.BoolPointer(true), } expected := &StatSCfg{ @@ -46,6 +48,8 @@ func TestStatSCfgloadFromJsonCfgCase1(t *testing.T) { StringIndexedFields: &[]string{"*req.string"}, PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"}, SuffixIndexedFields: &[]string{"*req.index1", "*req.index2"}, + ExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, + NotExistsIndexedFields: &[]string{"*req.index1", "*req.index2"}, NestedFields: true, Opts: &StatsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, @@ -121,6 +125,8 @@ func TestStatSCfgAsMapInterface(t *testing.T) { utils.IndexedSelectsCfg: true, utils.PrefixIndexedFieldsCfg: []string{}, utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, utils.NestedFieldsCfg: false, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, @@ -146,6 +152,8 @@ func TestStatSCfgAsMapInterface1(t *testing.T) { "string_indexed_fields": ["*req.string"], "prefix_indexed_fields": ["*req.prefix_indexed_fields1","*req.prefix_indexed_fields2"], "suffix_indexed_fields":["*req.suffix_indexed_fields"], + "exists_indexed_fields":["*req.exists_indexed_fields"], + "notexists_indexed_fields":["*req.notexists_indexed_fields"], "nested_fields": true, }, }` @@ -158,6 +166,8 @@ func TestStatSCfgAsMapInterface1(t *testing.T) { utils.StringIndexedFieldsCfg: []string{"*req.string"}, utils.PrefixIndexedFieldsCfg: []string{"*req.prefix_indexed_fields1", "*req.prefix_indexed_fields2"}, utils.SuffixIndexedFieldsCfg: []string{"*req.suffix_indexed_fields"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.exists_indexed_fields"}, + utils.NotExistsIndexedFieldsCfg: []string{"*req.notexists_indexed_fields"}, utils.NestedFieldsCfg: true, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, diff --git a/config/thresholdscfg_test.go b/config/thresholdscfg_test.go index 67798e9a5..d1d6d48c7 100644 --- a/config/thresholdscfg_test.go +++ b/config/thresholdscfg_test.go @@ -27,25 +27,29 @@ import ( func TestThresholdSCfgloadFromJsonCfgCase1(t *testing.T) { cfgJSON := &ThresholdSJsonCfg{ - Enabled: utils.BoolPointer(true), - Indexed_selects: utils.BoolPointer(true), - Store_interval: utils.StringPointer("2"), - String_indexed_fields: &[]string{"*req.prefix"}, - Prefix_indexed_fields: &[]string{"*req.index1"}, - Suffix_indexed_fields: &[]string{"*req.index1"}, - Nested_fields: utils.BoolPointer(true), - Actions_conns: &[]string{utils.MetaInternal}, - Opts: &ThresholdsOptsJson{}, + Enabled: utils.BoolPointer(true), + Indexed_selects: utils.BoolPointer(true), + Store_interval: utils.StringPointer("2"), + String_indexed_fields: &[]string{"*req.prefix"}, + Prefix_indexed_fields: &[]string{"*req.index1"}, + Suffix_indexed_fields: &[]string{"*req.index1"}, + Exists_indexed_fields: &[]string{"*req.index1"}, + Notexists_indexed_fields: &[]string{"*req.index1"}, + Nested_fields: utils.BoolPointer(true), + Actions_conns: &[]string{utils.MetaInternal}, + Opts: &ThresholdsOptsJson{}, } expected := &ThresholdSCfg{ - Enabled: true, - IndexedSelects: true, - StoreInterval: 2, - StringIndexedFields: &[]string{"*req.prefix"}, - PrefixIndexedFields: &[]string{"*req.index1"}, - SuffixIndexedFields: &[]string{"*req.index1"}, - NestedFields: true, - ActionSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaActions)}, + Enabled: true, + IndexedSelects: true, + StoreInterval: 2, + StringIndexedFields: &[]string{"*req.prefix"}, + PrefixIndexedFields: &[]string{"*req.index1"}, + SuffixIndexedFields: &[]string{"*req.index1"}, + ExistsIndexedFields: &[]string{"*req.index1"}, + NotExistsIndexedFields: &[]string{"*req.index1"}, + NestedFields: true, + ActionSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaActions)}, Opts: &ThresholdsOpts{ ProfileIDs: []*utils.DynamicStringSliceOpt{}, ProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, @@ -115,13 +119,15 @@ func TestThresholdSCfgAsMapInterfaceCase1(t *testing.T) { "thresholds": {}, }` eMap := map[string]interface{}{ - utils.EnabledCfg: false, - utils.StoreIntervalCfg: "", - utils.IndexedSelectsCfg: true, - utils.PrefixIndexedFieldsCfg: []string{}, - utils.SuffixIndexedFieldsCfg: []string{}, - utils.NestedFieldsCfg: false, - utils.ActionSConnsCfg: []string{}, + utils.EnabledCfg: false, + utils.StoreIntervalCfg: "", + utils.IndexedSelectsCfg: true, + utils.PrefixIndexedFieldsCfg: []string{}, + utils.SuffixIndexedFieldsCfg: []string{}, + utils.ExistsIndexedFieldsCfg: []string{}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: false, + utils.ActionSConnsCfg: []string{}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProfileIgnoreFilters: []*utils.DynamicBoolOpt{}, @@ -143,19 +149,23 @@ func TestThresholdSCfgAsMapInterfaceCase2(t *testing.T) { "string_indexed_fields": ["*req.string"], "prefix_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], "suffix_indexed_fields": ["*req.suffix_indexed_fields1", "*req.suffix_indexed_fields2"], + "exists_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], + "notexists_indexed_fields": [], "nested_fields": true, "actions_conns": ["*internal"], }, }` eMap := map[string]interface{}{ - utils.EnabledCfg: true, - utils.StoreIntervalCfg: "96h0m0s", - utils.IndexedSelectsCfg: false, - utils.StringIndexedFieldsCfg: []string{"*req.string"}, - utils.PrefixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, - utils.SuffixIndexedFieldsCfg: []string{"*req.suffix_indexed_fields1", "*req.suffix_indexed_fields2"}, - utils.NestedFieldsCfg: true, - utils.ActionSConnsCfg: []string{utils.MetaInternal}, + utils.EnabledCfg: true, + utils.StoreIntervalCfg: "96h0m0s", + utils.IndexedSelectsCfg: false, + utils.StringIndexedFieldsCfg: []string{"*req.string"}, + utils.PrefixIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, + utils.SuffixIndexedFieldsCfg: []string{"*req.suffix_indexed_fields1", "*req.suffix_indexed_fields2"}, + utils.ExistsIndexedFieldsCfg: []string{"*req.prefix", "*req.indexed", "*req.fields"}, + utils.NotExistsIndexedFieldsCfg: []string{}, + utils.NestedFieldsCfg: true, + utils.ActionSConnsCfg: []string{utils.MetaInternal}, utils.OptsCfg: map[string]interface{}{ utils.MetaProfileIDs: []*utils.DynamicStringSliceOpt{}, utils.MetaProfileIgnoreFilters: []*utils.DynamicBoolOpt{},