diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index 3157e81a0..d35b64cbc 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -1380,7 +1380,6 @@ func main() { // Done initing DBs engine.SetRoundingDecimals(cfg.GeneralCfg().RoundingDecimals) engine.SetRpSubjectPrefixMatching(cfg.RalsCfg().RpSubjectPrefixMatching) - engine.SetLcrSubjectPrefixMatching(cfg.RalsCfg().LcrSubjectPrefixMatching) stopHandled := false // Rpc/http server diff --git a/config/config_json_test.go b/config/config_json_test.go index e8219cc17..68a70480f 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -227,14 +227,13 @@ func TestDfStorDBJsonCfg(t *testing.T) { func TestDfRalsJsonCfg(t *testing.T) { eCfg := &RalsJsonCfg{ - Enabled: utils.BoolPointer(false), - Thresholds_conns: &[]*HaPoolJsonCfg{}, - Stats_conns: &[]*HaPoolJsonCfg{}, - Pubsubs_conns: &[]*HaPoolJsonCfg{}, - Users_conns: &[]*HaPoolJsonCfg{}, - Aliases_conns: &[]*HaPoolJsonCfg{}, - Rp_subject_prefix_matching: utils.BoolPointer(false), - Lcr_subject_prefix_matching: utils.BoolPointer(false), + Enabled: utils.BoolPointer(false), + Thresholds_conns: &[]*HaPoolJsonCfg{}, + Stats_conns: &[]*HaPoolJsonCfg{}, + Pubsubs_conns: &[]*HaPoolJsonCfg{}, + Users_conns: &[]*HaPoolJsonCfg{}, + Aliases_conns: &[]*HaPoolJsonCfg{}, + Rp_subject_prefix_matching: utils.BoolPointer(false), Max_computed_usage: &map[string]string{ utils.ANY: "189h", utils.VOICE: "72h", diff --git a/config/config_test.go b/config/config_test.go index 5d2423bf5..516ab8ca5 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -477,9 +477,6 @@ func TestCgrCfgJSONDefaultsRALs(t *testing.T) { if cgrCfg.RalsCfg().RpSubjectPrefixMatching != false { t.Errorf("Expecting: false , received: %+v", cgrCfg.RalsCfg().RpSubjectPrefixMatching) } - if cgrCfg.RalsCfg().LcrSubjectPrefixMatching != false { - t.Errorf("Expecting: false , received: %+v", cgrCfg.RalsCfg().LcrSubjectPrefixMatching) - } eMaxCU := map[string]time.Duration{ utils.ANY: time.Duration(189 * time.Hour), utils.VOICE: time.Duration(72 * time.Hour), diff --git a/config/libconfig_json.go b/config/libconfig_json.go index 3d41d700c..f1eab9352 100755 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -98,15 +98,14 @@ type FilterSJsonCfg struct { // Rater config section type RalsJsonCfg struct { - Enabled *bool - Thresholds_conns *[]*HaPoolJsonCfg - Stats_conns *[]*HaPoolJsonCfg - Pubsubs_conns *[]*HaPoolJsonCfg - Aliases_conns *[]*HaPoolJsonCfg - Users_conns *[]*HaPoolJsonCfg - Rp_subject_prefix_matching *bool - Lcr_subject_prefix_matching *bool - Max_computed_usage *map[string]string + Enabled *bool + Thresholds_conns *[]*HaPoolJsonCfg + Stats_conns *[]*HaPoolJsonCfg + Pubsubs_conns *[]*HaPoolJsonCfg + Aliases_conns *[]*HaPoolJsonCfg + Users_conns *[]*HaPoolJsonCfg + Rp_subject_prefix_matching *bool + Max_computed_usage *map[string]string } // Scheduler config section diff --git a/config/ralscfg.go b/config/ralscfg.go index 9e7a5abe2..538ee62b0 100644 --- a/config/ralscfg.go +++ b/config/ralscfg.go @@ -26,15 +26,14 @@ import ( // Rater config section type RalsCfg struct { - RALsEnabled bool // start standalone server (no balancer) - RALsThresholdSConns []*HaPoolConfig // address where to reach ThresholdS config - RALsStatSConns []*HaPoolConfig - RALsPubSubSConns []*HaPoolConfig - RALsUserSConns []*HaPoolConfig - RALsAliasSConns []*HaPoolConfig - RpSubjectPrefixMatching bool // enables prefix matching for the rating profile subject - LcrSubjectPrefixMatching bool // enables prefix matching for the lcr subject - RALsMaxComputedUsage map[string]time.Duration + RALsEnabled bool // start standalone server (no balancer) + RALsThresholdSConns []*HaPoolConfig // address where to reach ThresholdS config + RALsStatSConns []*HaPoolConfig + RALsPubSubSConns []*HaPoolConfig + RALsUserSConns []*HaPoolConfig + RALsAliasSConns []*HaPoolConfig + RpSubjectPrefixMatching bool // enables prefix matching for the rating profile subject + RALsMaxComputedUsage map[string]time.Duration } //loadFromJsonCfg loads Rals config from JsonCfg @@ -83,9 +82,6 @@ func (ralsCfg *RalsCfg) loadFromJsonCfg(jsnRALsCfg *RalsJsonCfg) (err error) { if jsnRALsCfg.Rp_subject_prefix_matching != nil { ralsCfg.RpSubjectPrefixMatching = *jsnRALsCfg.Rp_subject_prefix_matching } - if jsnRALsCfg.Lcr_subject_prefix_matching != nil { - ralsCfg.LcrSubjectPrefixMatching = *jsnRALsCfg.Lcr_subject_prefix_matching - } if jsnRALsCfg.Max_computed_usage != nil { for k, v := range *jsnRALsCfg.Max_computed_usage { if ralsCfg.RALsMaxComputedUsage[k], err = utils.ParseDurationWithNanosecs(v); err != nil { diff --git a/config/ralscfg_test.go b/config/ralscfg_test.go index 9fb6bc269..9987e84e3 100644 --- a/config/ralscfg_test.go +++ b/config/ralscfg_test.go @@ -58,14 +58,13 @@ func TestRalsCfgFromJsonCfg(t *testing.T) { }` ralscfg.RALsMaxComputedUsage = make(map[string]time.Duration) expected = RalsCfg{ - RALsEnabled: false, - RALsThresholdSConns: []*HaPoolConfig{}, - RALsStatSConns: []*HaPoolConfig{}, - RALsPubSubSConns: []*HaPoolConfig{}, - RALsUserSConns: []*HaPoolConfig{}, - RALsAliasSConns: []*HaPoolConfig{}, - RpSubjectPrefixMatching: false, - LcrSubjectPrefixMatching: false, + RALsEnabled: false, + RALsThresholdSConns: []*HaPoolConfig{}, + RALsStatSConns: []*HaPoolConfig{}, + RALsPubSubSConns: []*HaPoolConfig{}, + RALsUserSConns: []*HaPoolConfig{}, + RALsAliasSConns: []*HaPoolConfig{}, + RpSubjectPrefixMatching: false, RALsMaxComputedUsage: map[string]time.Duration{ utils.ANY: time.Duration(189 * time.Hour), utils.VOICE: time.Duration(72 * time.Hour), diff --git a/engine/calldesc.go b/engine/calldesc.go index faff2916d..b283c6bcf 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -53,18 +53,17 @@ func init() { } var ( - dm *DataManager - cdrStorage CdrStorage - debitPeriod = 10 * time.Second - globalRoundingDecimals = 6 - thresholdS rpcclient.RpcClientConnection // used by RALs to communicate with ThresholdS - statS rpcclient.RpcClientConnection - pubSubServer rpcclient.RpcClientConnection - userService rpcclient.RpcClientConnection - aliasService rpcclient.RpcClientConnection - schedCdrsConns rpcclient.RpcClientConnection - rpSubjectPrefixMatching bool - lcrSubjectPrefixMatching bool + dm *DataManager + cdrStorage CdrStorage + debitPeriod = 10 * time.Second + globalRoundingDecimals = 6 + thresholdS rpcclient.RpcClientConnection // used by RALs to communicate with ThresholdS + statS rpcclient.RpcClientConnection + pubSubServer rpcclient.RpcClientConnection + userService rpcclient.RpcClientConnection + aliasService rpcclient.RpcClientConnection + schedCdrsConns rpcclient.RpcClientConnection + rpSubjectPrefixMatching bool ) // Exported method to set the storage getter. @@ -89,10 +88,6 @@ func SetRpSubjectPrefixMatching(flag bool) { rpSubjectPrefixMatching = flag } -func SetLcrSubjectPrefixMatching(flag bool) { - lcrSubjectPrefixMatching = flag -} - /* Sets the database for CDR storing, used by *cdrlog in first place */