diff --git a/data/conf/samples/actions_gob/cgradmin.json b/data/conf/samples/actions_gob/cgradmin.json index 9226ad587..0a33ef910 100644 --- a/data/conf/samples/actions_gob/cgradmin.json +++ b/data/conf/samples/actions_gob/cgradmin.json @@ -38,7 +38,7 @@ "cdrs": { "enabled": true, // start the CDR Server service: - "chargers_conns":["*conn1"], + "chargers_conns":["conn1"], }, "chargers": { diff --git a/data/conf/samples/dispatchers/dispatchers_gob/cgrates.json b/data/conf/samples/dispatchers/dispatchers_gob/cgrates.json new file mode 100755 index 000000000..b8e1c7de1 --- /dev/null +++ b/data/conf/samples/dispatchers/dispatchers_gob/cgrates.json @@ -0,0 +1,73 @@ +{ + +// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +// Copyright (C) ITsysCOM GmbH +// +// This file contains the default configuration hardcoded into CGRateS. +// This is what you get when you load CGRateS with an empty configuration file. + +"general": { + "node_id": "DispatcherS1", + "log_level": 7, + "reconnects": 1, +}, + + +"listen": { + "rpc_json": ":2012", + "rpc_gob": ":2013", + "http": ":2080", +}, + +"stor_db": { + "db_type":"*internal", +}, + +"cache":{ + "*dispatcher_routes": {"limit": -1, "ttl": "2s"} +}, + + +"attributes": { + "enabled": true +}, + +"scheduler": { + "enabled": true, +}, + +"rals": { + "enabled": true, +}, + +"chargers": { + "enabled": true, +}, + +"rpc_conns": { + "conn1": { + "strategy": "*first", + "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], + }, +}, + +"sessions": { + "enabled": true, + "attributes_conns": ["conn1"], + "rals_conns": ["conn1"], + "resources_conns": ["conn1"], + "chargers_conns": ["conn1"], + "listen_bijson": ":3014", +}, + +"dispatchers":{ + "enabled": true, + "attributes_conns": [ + {"address": "*internal"}, + ], +}, + +"apier": { + "scheduler_conns": ["*internal"], +}, +} \ No newline at end of file diff --git a/data/conf/samples/dispatchers/dispatchers_mongo_gob/cgrates.json b/data/conf/samples/dispatchers/dispatchers_mongo_gob/cgrates.json new file mode 100644 index 000000000..2a28cb711 --- /dev/null +++ b/data/conf/samples/dispatchers/dispatchers_mongo_gob/cgrates.json @@ -0,0 +1,84 @@ +{ + +// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +// Copyright (C) ITsysCOM GmbH +// +// This file contains the default configuration hardcoded into CGRateS. +// This is what you get when you load CGRateS with an empty configuration file. + +"general": { + "node_id": "DispatcherS1", + "log_level": 7, + "reconnects": 1, +}, + + +"listen": { + "rpc_json": ":2012", + "rpc_gob": ":2013", + "http": ":2080", +}, + +"data_db": { + "db_type": "mongo", + "db_name": "10", + "db_port": 27017, +}, + + +"stor_db": { + "db_type": "mongo", + "db_name": "cgrates", + "db_port": 27017, +}, + +"cache":{ + "*dispatcher_routes": {"limit": -1, "ttl": "2s"} +}, + +"scheduler": { + "enabled": true, +}, + +"attributes": { + "enabled": true +}, + +"rals": { + "enabled": true, +}, + + +"chargers": { + "enabled": true, +}, + +"rpc_conns": { + "conn1": { + "strategy": "*first", + "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], + }, +}, + +"sessions": { + "enabled": true, + "attributes_conns": ["conn1"], + "rals_conns": ["conn1"], + "resources_conns": ["conn1"], + "chargers_conns": ["conn1"], + "listen_bijson": ":3014", +}, + + +"dispatchers":{ + "enabled": true, + "attributes_conns": [ + {"address": "*internal"}, + ], +}, + + +"apier": { + "scheduler_conns": ["*internal"], +}, +} \ No newline at end of file diff --git a/data/conf/samples/smg_gob/cgrates.json b/data/conf/samples/smg_gob/cgrates.json index 0162b9956..c87afe23e 100644 --- a/data/conf/samples/smg_gob/cgrates.json +++ b/data/conf/samples/smg_gob/cgrates.json @@ -14,6 +14,13 @@ "http": ":2080", // HTTP listening address }, +"rpc_conns": { + "conn1": { + "strategy": "*first", + "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], + }, +}, + "stor_db": { // database used to store offline tariff plans and CDRs "db_password": "CGRateS.org", // password to use when connecting to stordb }, diff --git a/data/tariffplans/dispatchers_gob/Attributes.csv b/data/tariffplans/dispatchers_gob/Attributes.csv index e73eeaa13..3f4e362d4 100644 --- a/data/tariffplans/dispatchers_gob/Attributes.csv +++ b/data/tariffplans/dispatchers_gob/Attributes.csv @@ -14,7 +14,7 @@ cgrates.org,ATTR_API_RSP_AUTH,*auth,*string:~*req.APIKey:rsp12345,,,APIMethods,* cgrates.org,ATTR_API_CHC_AUTH,*auth,*string:~*req.APIKey:chc12345,,,APIMethods,*constant,CacheSv1.Ping&CacheSv1.GetCacheStats&CacheSv1.LoadCache&CacheSv1.PrecacheStatus&CacheSv1.GetItemIDs&CacheSv1.HasItem&CacheSv1.GetItemExpiryTime&CacheSv1.ReloadCache&CacheSv1.RemoveItem&CacheSv1.FlushCache&CacheSv1.Clear,false,20 cgrates.org,ATTR_API_GRD_AUTH,*auth,*string:~*req.APIKey:grd12345,,,APIMethods,*constant,GuardianSv1.Ping&GuardianSv1.RemoteLock&GuardianSv1.RemoteUnlock,false,20 cgrates.org,ATTR_API_SCHD_AUTH,*auth,*string:~*req.APIKey:sched12345,,,APIMethods,*constant,SchedulerSv1.Ping,false,20 -cgrates.org,ATTR_API_CDRS_AUTH,*auth,*string:~*req.APIKey:cdrs12345,,,APIMethods,*constant,CDRsV1.Ping&CDRsV1.ProcessEvent&CDRsV1.GetCDRs&CDRsV1.CountCDRs&CDRsV1.ProcessCDR&CDRsV1.ProcessExternalCDR,false,20 +cgrates.org,ATTR_API_CDRS_AUTH,*auth,*string:~*req.APIKey:cdrs12345,,,APIMethods,*constant,CDRsV1.Ping&CDRsV1.ProcessEvent&CDRsV1.GetCDRs&CDRsV1.GetCDRsCount&CDRsV1.ProcessCDR&CDRsV1.ProcessExternalCDR,false,20 cgrates.org,ATTR_API_DSP_AUTH,*auth,*string:~*req.APIKey:dsp12345,,,APIMethods,*constant,DispatcherSv1.Ping&DispatcherSv1.GetProfileForEvent,false,20 cgrates.org,ATTR_API_PSE_AUTH,*auth,*string:~*req.APIKey:pse12345,,,APIMethods,*constant,SessionSv1.Ping&SessionSv1.AuthorizeEvent&SessionSv1.AuthorizeEventWithDigest&SessionSv1.InitiateSession&SessionSv1.InitiateSessionWithDigest&SessionSv1.UpdateSession&SessionSv1.SyncSessions&SessionSv1.TerminateSession&SessionSv1.ProcessCDR&SessionSv1.ProcessMessage&SessionSv1.GetActiveSessions&SessionSv1.GetActiveSessionsCount&SessionSv1.ForceDisconnect&SessionSv1.GetPassiveSessions&SessionSv1.GetPassiveSessionsCount&SessionSv1.ReplicateSessions&SessionSv1.SetPassiveSession&AttributeSv1.ProcessEvent&Responder.Debit&ResourceSv1.AllocateResources&ChargerSv1.ProcessEvent&Responder.MaxDebit,false,20 cgrates.org,ATTR_API_CFG_AUTH,*auth,*string:~*req.APIKey:cfg12345,,,APIMethods,*constant,ConfigSv1.GetJSONSection&ConfigSv1.ReloadConfig,false,20 diff --git a/dispatchers/sessions_it_test.go b/dispatchers/sessions_it_test.go index 63353c017..2cf8f7912 100755 --- a/dispatchers/sessions_it_test.go +++ b/dispatchers/sessions_it_test.go @@ -60,7 +60,7 @@ var sTestsDspSession = []func(t *testing.T){ //Test start here func TestDspSessionSTMySQL(t *testing.T) { if *encoding == utils.MetaGOB { - testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers", "testit", "tutorial", "dispatchers_gob") + testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_gob", "testit", "tutorial", "dispatchers_gob") } else { testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers", "testit", "tutorial", "dispatchers") } @@ -68,7 +68,7 @@ func TestDspSessionSTMySQL(t *testing.T) { func TestDspSessionSMongo(t *testing.T) { if *encoding == utils.MetaGOB { - testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mongo", "testit", "tutorial", "dispatchers_gob") + testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mongo_gob", "testit", "tutorial", "dispatchers_gob") } else { testDsp(t, sTestsDspSession, "TestDspSessionS", "all", "all2", "dispatchers_mongo", "testit", "tutorial", "dispatchers") } diff --git a/engine/connmanager.go b/engine/connmanager.go index c64cef8b8..bd04eb5f8 100644 --- a/engine/connmanager.go +++ b/engine/connmanager.go @@ -92,7 +92,7 @@ func (cM *ConnManager) getConn(connID string, biRPCClient rpcclient.ClientConnec func (cM *ConnManager) Call(connIDs []string, biRPCClient rpcclient.ClientConnector, method string, arg, reply interface{}) (err error) { if len(connIDs) == 0 { - return utils.ErrMandatoryIeMissing + return utils.NewErrMandatoryIeMissing("connIDs") } var conn rpcclient.ClientConnector for _, connID := range connIDs { diff --git a/general_tests/broadcast_client_it_test.go b/general_tests/broadcast_client_it_test.go index 004bd0a23..a3c2c2113 100644 --- a/general_tests/broadcast_client_it_test.go +++ b/general_tests/broadcast_client_it_test.go @@ -68,7 +68,7 @@ func testbrodcastItLoadConfig(t *testing.T) { t.Error(err) } brodcastInternalCfgPath = path.Join(*dataDir, "conf", "samples", "tutinternal") - if brodcastInternalCfg, err = config.NewCGRConfigFromPath(brodcastCfgPath); err != nil { + if brodcastInternalCfg, err = config.NewCGRConfigFromPath(brodcastInternalCfgPath); err != nil { t.Error(err) } } diff --git a/general_tests/cdrs_processevent_it_test.go b/general_tests/cdrs_processevent_it_test.go index 4c6177589..7143cb2f5 100644 --- a/general_tests/cdrs_processevent_it_test.go +++ b/general_tests/cdrs_processevent_it_test.go @@ -223,7 +223,6 @@ func testV1CDRsProcessEventAttrS(t *testing.T) { } func testV1CDRsProcessEventChrgS(t *testing.T) { - argsEv := &engine.ArgV1ProcessEvent{ Flags: []string{utils.MetaChargers, "*attributes:false"}, CGREvent: utils.CGREvent{