diff --git a/apier/v1/dispatcher_it_test.go b/apier/v1/dispatcher_it_test.go index fe0c303c6..279d21e0a 100644 --- a/apier/v1/dispatcher_it_test.go +++ b/apier/v1/dispatcher_it_test.go @@ -310,6 +310,7 @@ func testDispatcherSGetDispatcherHostIDs(t *testing.T) { func testDispatcherSUpdateDispatcherHost(t *testing.T) { var result string dispatcherHost.RemoteHost = &config.RemoteHost{ + ID: "DspHst1", Address: ":4012", Transport: utils.MetaGOB, TLS: false, diff --git a/cmd/cgr-loader/cgr-loader_it_test.go b/cmd/cgr-loader/cgr-loader_it_test.go index af3101e9f..44c85f61c 100644 --- a/cmd/cgr-loader/cgr-loader_it_test.go +++ b/cmd/cgr-loader/cgr-loader_it_test.go @@ -93,6 +93,7 @@ func TestLoadConfig(t *testing.T) { utils.MaxOpenConnsCfg: 100., utils.MaxIdleConnsCfg: 10., utils.SSLModeCfg: "disable", + utils.MysqlLocation: "Local", }, } // Loader diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index 039e3e87e..b823abe06 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -45,7 +45,7 @@ // "rpc_conns": { // "*localhost": { -// "conns": [{"address": "127.0.0.1:2012", "transport":"*json"},{"id":"dynconn"}], +// "conns": [{"address": "127.0.0.1:2012", "transport":"*json"}], // }, // }, // rpc connections definitions @@ -174,7 +174,7 @@ // "http": { // HTTP server configuration // "json_rpc_url": "/jsonrpc", // JSON RPC relative URL ("" to disable) -// "dispatchers_registrar_url": "/dispatchers_registrar", // dispatcherH registrar service relative URL +// "registrars_url": "/registrar", // registrar service relative URL // "ws_url": "/ws", // WebSockets relative URL ("" to disable) // "freeswitch_cdrs_url": "/freeswitch_json", // Freeswitch CDRS relative URL ("" to disable) // "http_cdrs": "/cdr_http", // CDRS relative URL ("" to disable) @@ -943,11 +943,19 @@ // }, -// "dispatcherh":{ -// "enabled": false, -// "dispatchers_conns": [], -// "hosts": {}, -// "register_interval": "5m", +// "registrarc":{ +// "rpc":{ +// "enabled": false, +// "registrars_conns": [], +// "hosts": {}, +// "refresh_interval": "5m", +// }, +// "dispatcher":{ +// "enabled": false, +// "registrars_conns": [], +// "hosts": {}, +// "refresh_interval": "5m", +// }, // }, diff --git a/data/conf/samples/dispatcherh/all_mongo/cgrates.json b/data/conf/samples/dispatcherh/all_mongo/cgrates.json deleted file mode 100644 index 6e3cf2e7a..000000000 --- a/data/conf/samples/dispatcherh/all_mongo/cgrates.json +++ /dev/null @@ -1,121 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "node_id": "ALL", - "log_level": 7 -}, - - -"listen": { - "rpc_json": ":6012", - "rpc_gob": ":6013", - "http": ":6080", -}, - -"data_db": { - "db_type": "mongo", - "db_name": "11", - "db_port": 27017, -}, - - -"stor_db": { - "db_type": "mongo", - "db_name": "cgrates", - "db_port": 27017, -}, - - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:6012", "transport":"*json"}], - }, - "rplConn": { - "strategy": "*broadcast_sync", - "conns": [{"address": "127.0.0.1:7012", "transport":"*json"}], - }, - "dispConn": { - "strategy": "*first", - "conns": [{"address": "http://127.0.0.1:2080/registrar", "transport":"*http_jsonrpc"}] - } -}, - -"attributes": { - "enabled": true -}, - -"rals": { - "enabled": true, -}, - -"schedulers": { - "enabled": true, -}, - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - -"thresholds": { - "enabled": true, -}, - -"routes": { - "enabled": true, - "rals_conns": ["*internal"] -}, - -"stats": { - "enabled": true, -}, - -"resources": { - "enabled": true, -}, - - -"rates": { - "enabled": true, -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], -}, - -"sessions": { - "enabled": true, - "listen_bijson": ":6014", - "routes_conns": ["*internal"], - "resources_conns": ["*internal"], - "attributes_conns": ["*internal"], - "rals_conns": ["*internal"], - "chargers_conns": ["*internal"], - "cdrs_conns": ["*internal"], -}, - -"apiers": { - "enabled": true, - "caches_conns":["conn1"], - "scheduler_conns": ["*internal"], -}, - - -"dispatcherh":{ - "enabled": true, - "dispatchers_conns": ["dispConn"], - "hosts": { - "*default":[{"ID":"ALL", "register_transport": "*json", "register_tls": false}] - }, - "register_interval": "1s", -}, - - -} diff --git a/data/conf/samples/dispatcherh/all2_mongo/cgrates.json b/data/conf/samples/registrarc/all2_mongo/cgrates.json similarity index 87% rename from data/conf/samples/dispatcherh/all2_mongo/cgrates.json rename to data/conf/samples/registrarc/all2_mongo/cgrates.json index 3c8c1a8f8..afda81f15 100644 --- a/data/conf/samples/dispatcherh/all2_mongo/cgrates.json +++ b/data/conf/samples/registrarc/all2_mongo/cgrates.json @@ -103,15 +103,16 @@ "scheduler_conns": ["*internal"], }, - -"dispatcherh":{ - "enabled": true, - "dispatchers_conns": ["dispConn"], - "hosts": { - "*default":[{"ID":"ALL", "register_transport": "*json", "register_tls": false}] - }, - "register_interval": "1s", -}, - + +"registrarc":{ + "dispatcher":{ + "enabled": true, + "registrars_conns": ["dispConn"], + "hosts": { + "*default":[{"ID":"ALL2", "transport": "*json", "tls": false}] + }, + "refresh_interval": "1s", + }, +} } diff --git a/data/conf/samples/dispatcherh/all2_mysql/cgrates.json b/data/conf/samples/registrarc/all2_mysql/cgrates.json similarity index 90% rename from data/conf/samples/dispatcherh/all2_mysql/cgrates.json rename to data/conf/samples/registrarc/all2_mysql/cgrates.json index 7f2cb35bb..128c8b029 100644 --- a/data/conf/samples/dispatcherh/all2_mysql/cgrates.json +++ b/data/conf/samples/registrarc/all2_mysql/cgrates.json @@ -103,14 +103,6 @@ "registrarc":{ - "rpc":{ - "enabled": true, - "registrars_conns": ["dispConn"], - "hosts": { - "*default":[{"ID":"ALL2", "transport": "*json", "tls": false}] - }, - "refresh_interval": "1s", - }, "dispatcher":{ "enabled": true, "registrars_conns": ["dispConn"], diff --git a/data/conf/samples/dispatcherh/test_dispatcherh/cgrates.json b/data/conf/samples/registrarc/all_mongo/cgrates.json similarity index 87% rename from data/conf/samples/dispatcherh/test_dispatcherh/cgrates.json rename to data/conf/samples/registrarc/all_mongo/cgrates.json index c9ae00b2f..e0add73c0 100644 --- a/data/conf/samples/dispatcherh/test_dispatcherh/cgrates.json +++ b/data/conf/samples/registrarc/all_mongo/cgrates.json @@ -107,13 +107,16 @@ "scheduler_conns": ["*internal"], }, - -"dispatcherh":{ - "enabled": true, - "dispatchers_conns": [], - "hosts": {}, - "register_interval": "5m" -}, - + +"registrarc":{ + "dispatcher":{ + "enabled": true, + "registrars_conns": ["dispConn"], + "hosts": { + "*default":[{"ID":"ALL2", "transport": "*json", "tls": false}] + }, + "refresh_interval": "1s", + }, +} } diff --git a/data/conf/samples/dispatcherh/all_mysql/cgrates.json b/data/conf/samples/registrarc/all_mysql/cgrates.json similarity index 88% rename from data/conf/samples/dispatcherh/all_mysql/cgrates.json rename to data/conf/samples/registrarc/all_mysql/cgrates.json index 3e79ad4b0..d2b5e0749 100644 --- a/data/conf/samples/dispatcherh/all_mysql/cgrates.json +++ b/data/conf/samples/registrarc/all_mysql/cgrates.json @@ -105,15 +105,17 @@ "scheduler_conns": ["*internal"], }, - -"dispatcherh":{ - "enabled": true, - "dispatchers_conns": ["dispConn"], - "hosts": { - "*default":[{"ID":"ALL2", "register_transport": "*json", "register_tls": false}] - }, - "register_interval": "1s", -}, + +"registrarc":{ + "dispatcher":{ + "enabled": true, + "registrars_conns": ["dispConn"], + "hosts": { + "*default":[{"ID":"ALL2", "transport": "*json", "tls": false}] + }, + "refresh_interval": "1s", + }, +} } diff --git a/data/conf/samples/dispatcherh/dispatchers_mongo/cgrates.json b/data/conf/samples/registrarc/dispatchers_mongo/cgrates.json similarity index 100% rename from data/conf/samples/dispatcherh/dispatchers_mongo/cgrates.json rename to data/conf/samples/registrarc/dispatchers_mongo/cgrates.json diff --git a/data/conf/samples/dispatcherh/dispatchers_mysql/cgrates.json b/data/conf/samples/registrarc/dispatchers_mysql/cgrates.json similarity index 100% rename from data/conf/samples/dispatcherh/dispatchers_mysql/cgrates.json rename to data/conf/samples/registrarc/dispatchers_mysql/cgrates.json diff --git a/data/tariffplans/dispatcherh/DispatcherProfiles.csv b/data/tariffplans/registrarc/DispatcherProfiles.csv similarity index 100% rename from data/tariffplans/dispatcherh/DispatcherProfiles.csv rename to data/tariffplans/registrarc/DispatcherProfiles.csv diff --git a/registrarc/registrarc_it_test.go b/registrarc/registrarc_it_test.go index 9f32d5b28..4f9f0a154 100644 --- a/registrarc/registrarc_it_test.go +++ b/registrarc/registrarc_it_test.go @@ -82,9 +82,9 @@ func TestDspHosts(t *testing.T) { } func testDsphInitCfg(t *testing.T) { - dspCfgPath = path.Join(*dataDir, "conf", "samples", "dispatcherh", dspDir) - allCfgPath = path.Join(*dataDir, "conf", "samples", "dispatcherh", allDir) - all2CfgPath = path.Join(*dataDir, "conf", "samples", "dispatcherh", all2Dir) + dspCfgPath = path.Join(*dataDir, "conf", "samples", "registrarc", dspDir) + allCfgPath = path.Join(*dataDir, "conf", "samples", "registrarc", allDir) + all2CfgPath = path.Join(*dataDir, "conf", "samples", "registrarc", all2Dir) var err error if dspCfg, err = config.NewCGRConfigFromPath(dspCfgPath); err != nil { t.Error(err) @@ -112,7 +112,7 @@ func testDsphStartEngine(t *testing.T) { } func testDsphLoadData(t *testing.T) { - loader := exec.Command("cgr-loader", "-config_path", dspCfgPath, "-path", path.Join(*dataDir, "tariffplans", "dispatcherh"), "-caches_address=") + loader := exec.Command("cgr-loader", "-config_path", dspCfgPath, "-path", path.Join(*dataDir, "tariffplans", "registrarc"), "-caches_address=") output := bytes.NewBuffer(nil) outerr := bytes.NewBuffer(nil) loader.Stdout = output diff --git a/services/registrarc_it_test.go b/services/registrarc_it_test.go index 1b0ae6352..71b2cc258 100644 --- a/services/registrarc_it_test.go +++ b/services/registrarc_it_test.go @@ -68,7 +68,7 @@ func TestDispatcherHReload(t *testing.T) { var reply string if err := cfg.V1ReloadConfig(&config.ReloadArgs{ - Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "dispatcherh", "all_mongo"), + Path: path.Join("/usr", "share", "cgrates", "conf", "samples", "registrarc", "all_mongo"), Section: config.RegistrarCJson, }, &reply); err != nil { t.Fatal(err)