From 5209a650e1321df5ecc8006f21938c20bb2c5de9 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Tue, 22 Mar 2022 18:22:38 +0200 Subject: [PATCH] Remove unused configs and repair tests --- .../acc_balance_keep_internal/cgrates.json | 99 -- .../cgrates.json | 107 -- .../acc_balance_keep_mongo/cgrates.json | 100 -- .../acc_balance_keep_mongo_gob/cgrates.json | 110 -- .../acc_balance_keep_mysql/cgrates.json | 100 -- .../acc_balance_keep_mysql_gob/cgrates.json | 108 -- .../samples/accounts_internal/cgrates.json | 43 - data/conf/samples/accounts_mysql/cgrates.json | 49 - data/conf/samples/apier_mongo/apier.json | 83 - data/conf/samples/apier_mysql/apier.json | 81 - data/conf/samples/caps_busy/cgrates.json | 43 - .../samples/caps_queue_bench/cgrates.json | 129 -- .../samples/cdrsexport_internal/cgrates.json | 156 -- .../samples/cdrsexport_mongo/cgrates.json | 160 -- .../samples/cdrsexport_mysql/cgrates.json | 157 -- data/conf/samples/cdrsv1internal/cgrates.json | 38 - data/conf/samples/cdrsv1mongo/cgrates.json | 41 - data/conf/samples/cdrsv1mysql/cgrates.json | 39 - data/conf/samples/cdrsv1postgres/cgrates.json | 36 - data/conf/samples/configs_active/cgrates.json | 32 - data/conf/samples/diam_tutmysql/cgrates.json | 82 - data/conf/samples/diam_tutmysql/data.json | 216 --- data/conf/samples/diam_tutmysql/sms.json | 92 -- data/conf/samples/diam_tutmysql/voice.json | 278 ---- .../filtered_scheduler2_internal/cgrates.json | 44 - .../filtered_scheduler2_mongo/cgrates.json | 46 - .../filtered_scheduler2_mysql/cgrates.json | 46 - .../filtered_scheduler_internal/cgrates.json | 45 - .../filtered_scheduler_mongo/cgrates.json | 46 - .../filtered_scheduler_mysql/cgrates.json | 46 - .../samples/full_remote/internal/cgrates.json | 90 - .../samples/full_remote/remote/cgrates.json | 40 - data/conf/samples/hundred_rates/cgrates.json | 42 - .../conf/samples/migwithinternal/cgrates.json | 18 - data/conf/samples/mongoatlas/cgrates.json | 124 -- data/conf/samples/mongoreplica/cgrates.json | 89 - data/conf/samples/redis_cluster/cgrates.json | 42 - data/conf/samples/redis_sentinel/cgrates.json | 41 - data/conf/samples/redis_tls/cgrates.json | 45 - .../engine1_mongo/cgrates.json | 40 - .../engine1_redis/cgrates.json | 39 - .../engine2_mongo/cgrates.json | 51 - .../engine2_redis/cgrates.json | 50 - .../remote_replication/internal/cgrates.json | 95 -- .../internal_gob/cgrates.json | 93 -- .../replication/engine1_mongo/cgrates.json | 41 - .../replication/engine1_redis/cgrates.json | 42 - .../replication/engine2_mongo/cgrates.json | 43 - .../replication/engine2_redis/cgrates.json | 39 - .../samples/replication/internal/cgrates.json | 88 - .../replication/internal_gob/cgrates.json | 88 - .../replication_cache/engine1/cgrates.json | 72 - .../replication_cache/engine2/cgrates.json | 47 - data/conf/samples/rpcconn_mysql/cgrates.json | 141 -- data/conf/samples/tutinternal/cgrates.json | 10 +- data/conf/samples/tutmongonew/cgrates.json | 112 -- data/conf/samples/tutmysql2/cgrates.json | 106 -- data/conf/samples/tutmysql2_gob/cgrates.json | 116 -- data/docker/integration/scripts/mongo | 1 - data/docker/integration/scripts/mysql | 1 - data/docker/integration/scripts/postgres | 1 - general_tests/oldtutorial_it_test.go | 1457 ----------------- general_tests/resourcesv1_it_test.go | 365 +++-- 63 files changed, 189 insertions(+), 6132 deletions(-) delete mode 100644 data/conf/samples/acc_balance_keep_internal/cgrates.json delete mode 100644 data/conf/samples/acc_balance_keep_internal_gob/cgrates.json delete mode 100644 data/conf/samples/acc_balance_keep_mongo/cgrates.json delete mode 100644 data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json delete mode 100644 data/conf/samples/acc_balance_keep_mysql/cgrates.json delete mode 100644 data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json delete mode 100644 data/conf/samples/accounts_internal/cgrates.json delete mode 100644 data/conf/samples/accounts_mysql/cgrates.json delete mode 100644 data/conf/samples/apier_mongo/apier.json delete mode 100644 data/conf/samples/apier_mysql/apier.json delete mode 100644 data/conf/samples/caps_busy/cgrates.json delete mode 100644 data/conf/samples/caps_queue_bench/cgrates.json delete mode 100644 data/conf/samples/cdrsexport_internal/cgrates.json delete mode 100644 data/conf/samples/cdrsexport_mongo/cgrates.json delete mode 100644 data/conf/samples/cdrsexport_mysql/cgrates.json delete mode 100644 data/conf/samples/cdrsv1internal/cgrates.json delete mode 100644 data/conf/samples/cdrsv1mongo/cgrates.json delete mode 100644 data/conf/samples/cdrsv1mysql/cgrates.json delete mode 100644 data/conf/samples/cdrsv1postgres/cgrates.json delete mode 100644 data/conf/samples/configs_active/cgrates.json delete mode 100644 data/conf/samples/diam_tutmysql/cgrates.json delete mode 100644 data/conf/samples/diam_tutmysql/data.json delete mode 100644 data/conf/samples/diam_tutmysql/sms.json delete mode 100644 data/conf/samples/diam_tutmysql/voice.json delete mode 100644 data/conf/samples/filtered_scheduler2_internal/cgrates.json delete mode 100644 data/conf/samples/filtered_scheduler2_mongo/cgrates.json delete mode 100644 data/conf/samples/filtered_scheduler2_mysql/cgrates.json delete mode 100644 data/conf/samples/filtered_scheduler_internal/cgrates.json delete mode 100644 data/conf/samples/filtered_scheduler_mongo/cgrates.json delete mode 100644 data/conf/samples/filtered_scheduler_mysql/cgrates.json delete mode 100644 data/conf/samples/full_remote/internal/cgrates.json delete mode 100644 data/conf/samples/full_remote/remote/cgrates.json delete mode 100644 data/conf/samples/hundred_rates/cgrates.json delete mode 100755 data/conf/samples/migwithinternal/cgrates.json delete mode 100755 data/conf/samples/mongoatlas/cgrates.json delete mode 100755 data/conf/samples/mongoreplica/cgrates.json delete mode 100755 data/conf/samples/redis_cluster/cgrates.json delete mode 100755 data/conf/samples/redis_sentinel/cgrates.json delete mode 100755 data/conf/samples/redis_tls/cgrates.json delete mode 100644 data/conf/samples/remote_replication/engine1_mongo/cgrates.json delete mode 100644 data/conf/samples/remote_replication/engine1_redis/cgrates.json delete mode 100644 data/conf/samples/remote_replication/engine2_mongo/cgrates.json delete mode 100644 data/conf/samples/remote_replication/engine2_redis/cgrates.json delete mode 100644 data/conf/samples/remote_replication/internal/cgrates.json delete mode 100644 data/conf/samples/remote_replication/internal_gob/cgrates.json delete mode 100644 data/conf/samples/replication/engine1_mongo/cgrates.json delete mode 100644 data/conf/samples/replication/engine1_redis/cgrates.json delete mode 100644 data/conf/samples/replication/engine2_mongo/cgrates.json delete mode 100644 data/conf/samples/replication/engine2_redis/cgrates.json delete mode 100644 data/conf/samples/replication/internal/cgrates.json delete mode 100644 data/conf/samples/replication/internal_gob/cgrates.json delete mode 100644 data/conf/samples/replication_cache/engine1/cgrates.json delete mode 100644 data/conf/samples/replication_cache/engine2/cgrates.json delete mode 100644 data/conf/samples/rpcconn_mysql/cgrates.json delete mode 100644 data/conf/samples/tutmongonew/cgrates.json delete mode 100644 data/conf/samples/tutmysql2/cgrates.json delete mode 100644 data/conf/samples/tutmysql2_gob/cgrates.json delete mode 120000 data/docker/integration/scripts/mongo delete mode 120000 data/docker/integration/scripts/mysql delete mode 120000 data/docker/integration/scripts/postgres delete mode 100644 general_tests/oldtutorial_it_test.go diff --git a/data/conf/samples/acc_balance_keep_internal/cgrates.json b/data/conf/samples/acc_balance_keep_internal/cgrates.json deleted file mode 100644 index 370344539..000000000 --- a/data/conf/samples/acc_balance_keep_internal/cgrates.json +++ /dev/null @@ -1,99 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "*internal", -}, - - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "remove_expired":false, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["*localhost"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*localhost"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"stats": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"route": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json b/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json deleted file mode 100644 index 0d3da98d7..000000000 --- a/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json +++ /dev/null @@ -1,107 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], - }, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "*internal", -}, - - - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "remove_expired":false, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["conn1"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["conn1"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"route": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/acc_balance_keep_mongo/cgrates.json b/data/conf/samples/acc_balance_keep_mongo/cgrates.json deleted file mode 100644 index 7408d9b6e..000000000 --- a/data/conf/samples/acc_balance_keep_mongo/cgrates.json +++ /dev/null @@ -1,100 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "remove_expired":false, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["*localhost"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*localhost"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"stats": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"routes": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", - -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json b/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json deleted file mode 100644 index 3cca347e3..000000000 --- a/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json +++ /dev/null @@ -1,110 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], - }, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "remove_expired":false, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["conn1"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["conn1"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", - -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/acc_balance_keep_mysql/cgrates.json b/data/conf/samples/acc_balance_keep_mysql/cgrates.json deleted file mode 100644 index 5eed325e0..000000000 --- a/data/conf/samples/acc_balance_keep_mysql/cgrates.json +++ /dev/null @@ -1,100 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "remove_expired":false, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["*localhost"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*localhost"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", - -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json b/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json deleted file mode 100644 index 00de32725..000000000 --- a/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json +++ /dev/null @@ -1,108 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], - }, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "remove_expired":false, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["conn1"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["conn1"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", - -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/accounts_internal/cgrates.json b/data/conf/samples/accounts_internal/cgrates.json deleted file mode 100644 index 91ff2f142..000000000 --- a/data/conf/samples/accounts_internal/cgrates.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - -// CGRateS sample configuration file -// Copyright (C) ITsysCOM GmbH -// - - - -"data_db": { - "db_type": "*internal", -}, - - - -"attributes": { - "enabled": true, - -}, - - -"rates": { - "enabled": true, -}, - - -"rals": { - "enabled": true, -}, - - -"accounts": { - "enabled": true, - "attributes_conns": ["*localhost"], - "rates_conns": ["*localhost"], -}, - - -"admins": { - "enabled": true, -}, - -} - diff --git a/data/conf/samples/accounts_mysql/cgrates.json b/data/conf/samples/accounts_mysql/cgrates.json deleted file mode 100644 index 553618efa..000000000 --- a/data/conf/samples/accounts_mysql/cgrates.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - -// CGRateS sample configuration file -// Copyright (C) ITsysCOM GmbH -// - - - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - -"attributes": { - "enabled": true, - -}, - - -"rates": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"rals": { - "enabled": true, -}, - - -"accounts": { - "enabled": true, - "attributes_conns": ["*localhost"], - "rates_conns": ["*internal"], -}, - - -"admins": { - "enabled": true, -}, - -} - diff --git a/data/conf/samples/apier_mongo/apier.json b/data/conf/samples/apier_mongo/apier.json deleted file mode 100644 index b7c643708..000000000 --- a/data/conf/samples/apier_mongo/apier.json +++ /dev/null @@ -1,83 +0,0 @@ -{ -// CGRateS Configuration file -// -// Used in apier_local_tests -// Starts rater, cdrs and mediator connecting over internal channel - -"general": { - "log_level": 7, - "poster_attempts": 1, -}, - - -"listen": { - "rpc_json": ":2012", // RPC JSON listening address - "rpc_gob": ":2013", // RPC GOB listening address - "http": ":2080", // HTTP listening address -}, - - -"data_db": { - "db_type": "*mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - - -"rals": { - "enabled": true, // enable Rater service: - -}, - - -"schedulers": { - "enabled": true, // start Scheduler service: -}, - - -"cdrs": { - "enabled": true, // start the CDR Server service: - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"resources": { - "enabled": true, -}, - - -"stats": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, -}, - - -"chargers": { - "enabled": true, -}, - - -"routes": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/apier_mysql/apier.json b/data/conf/samples/apier_mysql/apier.json deleted file mode 100644 index 749969e58..000000000 --- a/data/conf/samples/apier_mysql/apier.json +++ /dev/null @@ -1,81 +0,0 @@ -{ -// CGRateS Configuration file -// -// Used in apier_local_tests -// Starts rater, cdrs and mediator connecting over internal channel - -"general": { - "log_level": 7, - "poster_attempts": 1, -}, - - -"listen": { - "rpc_json": ":2012", // RPC JSON listening address - "rpc_gob": ":2013", // RPC GOB listening address - "http": ":2080", // HTTP listening address -}, - - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - - -"rals": { - "enabled": true, // enable Rater service: - -}, - - -"schedulers": { - "enabled": true, // start Scheduler service: -}, - - -"cdrs": { - "enabled": true, // start the CDR Server service: - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"resources": { - "enabled": true, -}, - - -"stats": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, -}, - - -"chargers": { - "enabled": true, -}, - - -"routes": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/caps_busy/cgrates.json b/data/conf/samples/caps_busy/cgrates.json deleted file mode 100644 index 0d70b51b2..000000000 --- a/data/conf/samples/caps_busy/cgrates.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - -"general": { - "log_level": 7, - "node_id": "ConcurrentBusyEngine", - "reply_timeout": "50s", -}, - - -"cores": { - "caps": 2, - "caps_strategy": "*busy", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080" -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10" // data_db database name to connect to -}, - - - - -"admins": { - "enabled": true -}, - - -"sessions": { - "enabled": true, - "listen_bijson": "127.0.0.1:2014" -}, - - -} diff --git a/data/conf/samples/caps_queue_bench/cgrates.json b/data/conf/samples/caps_queue_bench/cgrates.json deleted file mode 100644 index 8876373bc..000000000 --- a/data/conf/samples/caps_queue_bench/cgrates.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - -"general": { - "log_level": 7, - "node_id": "ConcurrentQueueEngine", - "reply_timeout": "50s", -}, - - -"cores": { - "caps": 1000000, - "caps_strategy": "*queue", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080" -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10" // data_db database name to connect to -}, - - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "max_increments":3000000, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["*internal"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], -}, - - -"attributes": { - "enabled": true, - "stats_conns": ["*localhost"], - "resources_conns": ["*localhost"], - "accounts_conns": ["*localhost"] -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, - "prefix_indexed_fields":["*req.Destination"], - "stats_conns": ["*internal"], - "resources_conns": ["*internal"], - "rals_conns": ["*internal"], -}, - - -"sessions": { - "enabled": true, - "routes_conns": ["*internal"], - "resources_conns": ["*internal"], - "attributes_conns": ["*internal"], - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "chargers_conns": ["*internal"], -}, - - -"migrator":{ - - "users_filters":["Account"], -}, - - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -"rates": { - "enabled": true -}, - -"filters": { - "accounts_conns": ["*internal"], -}, - -"accounts": { - "enabled": true -}, - -} \ No newline at end of file diff --git a/data/conf/samples/cdrsexport_internal/cgrates.json b/data/conf/samples/cdrsexport_internal/cgrates.json deleted file mode 100644 index b9a7f6942..000000000 --- a/data/conf/samples/cdrsexport_internal/cgrates.json +++ /dev/null @@ -1,156 +0,0 @@ -{ -// Sample CGRateS Configuration file for EEs -// -// Copyright (C) ITsysCOM GmbH - -"general": { - "log_level": 7, - "poster_attempts": 2, - "failed_posts_dir": "/var/spool/cgrates/failed_posts2", - "failed_posts_ttl": "1s" -}, - -"data_db": { - "db_type": "*internal" -}, - - - -"rals": { - "enabled": true -}, - - -"attributes": { - "enabled": true -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"] -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], - "session_cost_retries": 0, - "online_cdr_exports": ["http_localhost", "amqp_localhost", "aws_test_file", "sqs_test_file", "kafka_localhost", "s3_test_file"], - "ees_conns": ["*localhost"] -}, - - -"ees": { - "enabled": true, - "exporters": [ - { - "id": "http_localhost", - "type": "*httpPost", - "export_path": "http://127.0.0.1:12081/cdr_http", - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} - ] - }, - { - "id": "amqp_localhost", - "type": "*amqpJSONMap", - "export_path": "amqp://guest:guest@localhost:5672/", - "opts": { - "amqpQueueID": "cgrates_cdrs", - "amqpExchange": "exchangename", - "amqpExchangeType": "fanout", - "amqpRoutingKey": "cgr_cdrs", - }, - "attempts": 20, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} - ] - }, - { - "id": "aws_test_file", - "type": "*amqpv1JSONMap", - "export_path": "amqps://guest:guest@localhost:95672/", - "opts": { - "amqpQueueID": "cgrates_cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} - ] - }, - { - "id": "sqs_test_file", - "type": "*sqsJSONMap", - // export_path for sqs: "endpoint" - "export_path": "http://sqs.eu-west-2.amazonaws.com/", - "opts": { - // posible options for sqs: - "awsRegion": "eu-west-2", - "awsKey": "testkey", - "awsSecret": "testsecret", - "sqsQueueID": "cgrates-cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} - ] - }, - { - "id": "kafka_localhost", - "type": "*kafkaJSONMap", - "export_path": "127.0.0.1:9092", - "opts":{ - "kafkaTopic": "cgrates_cdrs" - }, - "attempts": 10, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} - ] - }, - { - "id": "s3_test_file", - "type": "*s3JSONMap", - // export_path for s3: "endpoint" - "export_path": "http://s3.us-east-2.amazonaws.com/", - "opts": { - // posible options for s3: - "awsRegion": "eu-west-2", - "awsKey": "testkey", - "awsSecret": "testsecret", - "s3BucketID": "cgrates-cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} - ] - } - ] -}, - - -"templates": { - "requiredFields": [ - {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, - {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, - {"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"}, - {"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"}, - {"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"}, - {"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"}, - {"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"}, - {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, - {"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"}, - {"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"}, - {"tag": "OrderID", "path": "*exp.OrderID", "type": "*variable", "value": "~*req.OrderID","filter":"*string:~*opts.AddOrderID:true"} - ] -}, - - -"admins": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/cdrsexport_mongo/cgrates.json b/data/conf/samples/cdrsexport_mongo/cgrates.json deleted file mode 100644 index badccfd6a..000000000 --- a/data/conf/samples/cdrsexport_mongo/cgrates.json +++ /dev/null @@ -1,160 +0,0 @@ -{ -// Sample CGRateS Configuration file for EEs -// -// Copyright (C) ITsysCOM GmbH - -"general": { - "log_level": 7, - "poster_attempts": 2, - "failed_posts_dir": "/var/spool/cgrates/failed_posts2", - "failed_posts_ttl": "1s" -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - -"rals": { - "enabled": true -}, - - -"attributes": { - "enabled": true, -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], - "session_cost_retries": 0, - "online_cdr_exports": ["http_localhost", "amqp_localhost", "aws_test_file", "sqs_test_file", "kafka_localhost", "s3_test_file"], - "ees_conns": ["*localhost"] -}, - - -"ees": { - "enabled": true, - "exporters": [ - { - "id": "http_localhost", - "type": "*httpPost", - "export_path": "http://127.0.0.1:12081/cdr_http", - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "amqp_localhost", - "type": "*amqpJSONMap", - "export_path": "amqp://guest:guest@localhost:5672/", - "opts": { - "amqpQueueID": "cgrates_cdrs", - "amqpExchange": "exchangename", - "amqpExchangeType": "fanout", - "amqpRoutingKey": "cgr_cdrs", - }, - "attempts": 20, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "aws_test_file", - "type": "*amqpv1JSONMap", - "export_path": "amqps://guest:guest@localhost:95672/", - "opts": { - "amqpQueueID": "cgrates_cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "sqs_test_file", - "type": "*sqsJSONMap", - // export_path for sqs: "endpoint" - "export_path": "http://sqs.eu-west-2.amazonaws.com/", - "opts": { - // posible options for sqs: - "awsRegion": "eu-west-2", - "awsKey": "testkey", - "awsSecret": "testsecret", - "sqsQueueID": "cgrates-cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "kafka_localhost", - "type": "*kafkaJSONMap", - "export_path": "127.0.0.1:9092", - "opts":{ - "kafkaTopic": "cgrates_cdrs", - }, - "attempts": 10, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "s3_test_file", - "type": "*s3JSONMap", - // export_path for s3: "endpoint" - "export_path": "http://s3.us-east-2.amazonaws.com/", - "opts": { - // posible options for s3: - "awsRegion": "eu-west-2", - "awsKey": "testkey", - "awsSecret": "testsecret", - "s3BucketID": "cgrates-cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - ], -}, - - -"templates": { - "requiredFields": [ - {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, - {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, - {"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"}, - {"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"}, - {"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"}, - {"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"}, - {"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"}, - {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, - {"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"}, - {"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"}, - {"tag": "OrderID", "path": "*exp.OrderID", "type": "*variable", "value": "~*req.OrderID","filter":"*string:~*opts.AddOrderID:true"} - ] -}, - - -"admins": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/cdrsexport_mysql/cgrates.json b/data/conf/samples/cdrsexport_mysql/cgrates.json deleted file mode 100644 index 393dbf007..000000000 --- a/data/conf/samples/cdrsexport_mysql/cgrates.json +++ /dev/null @@ -1,157 +0,0 @@ -{ -// Sample CGRateS Configuration file for EEs -// -// Copyright (C) ITsysCOM GmbH - -"general": { - "log_level": 7, - "poster_attempts": 1, - "failed_posts_dir": "/var/spool/cgrates/failed_posts2", - "failed_posts_ttl": "1s" -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10" -}, - - - - -"rals": { - "enabled": true -}, - - -"attributes": { - "enabled": true, -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], - "session_cost_retries": 0, - "online_cdr_exports": ["http_localhost", "amqp_localhost", "aws_test_file", "sqs_test_file", "kafka_localhost", "s3_test_file"], - "ees_conns": ["*localhost"] -}, - - -"ees": { - "enabled": true, - "exporters": [ - { - "id": "http_localhost", - "type": "*httpPost", - "export_path": "http://127.0.0.1:12081/cdr_http", - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "amqp_localhost", - "type": "*amqpJSONMap", - "export_path": "amqp://guest:guest@localhost:5672/", - "opts": { - "amqpQueueID": "cgrates_cdrs", - "amqpExchange": "exchangename", - "amqpExchangeType": "fanout", - "amqpRoutingKey": "cgr_cdrs", - }, - "attempts": 20, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "aws_test_file", - "type": "*amqpv1JSONMap", - "export_path": "amqps://guest:guest@localhost:95672/", - "opts": { - "amqpQueueID": "cgrates_cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "sqs_test_file", - "type": "*sqsJSONMap", - // export_path for sqs: "endpoint" - "export_path": "http://sqs.eu-west-2.amazonaws.com/", - "opts": { - "awsRegion": "eu-west-2", - "awsKey": "testkey", - "awsSecret": "testsecret", - "sqsQueueID": "cgrates-cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "kafka_localhost", - "type": "*kafkaJSONMap", - "export_path": "127.0.0.1:9092", - "opts": { - "kafkaTopic": "cgrates_cdrs", - }, - "attempts": 10, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - { - "id": "s3_test_file", - "type": "*s3JSONMap", - // export_path for s3: "endpoint" - "export_path": "http://s3.us-east-2.amazonaws.com/", - "opts": { - "awsRegion": "eu-west-2", - "awsKey": "testkey", - "awsSecret": "testsecret", - "s3BucketID": "cgrates-cdrs", - }, - "attempts": 1, - "fields":[ - {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, - ], - }, - ], -}, - - -"templates": { - "requiredFields": [ - {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, - {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, - {"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"}, - {"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"}, - {"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"}, - {"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"}, - {"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"}, - {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, - {"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"}, - {"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"}, - {"tag": "OrderID", "path": "*exp.OrderID", "type": "*variable", "value": "~*req.OrderID","filter":"*string:~*opts.AddOrderID:true"} - ] -}, - - -"admins": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/cdrsv1internal/cgrates.json b/data/conf/samples/cdrsv1internal/cgrates.json deleted file mode 100644 index 70ce587d0..000000000 --- a/data/conf/samples/cdrsv1internal/cgrates.json +++ /dev/null @@ -1,38 +0,0 @@ -{ -// CGRateS Configuration file -// -// Used in apier/v1/cdrs_it_test - - -"data_db":{ - "db_type": "*internal" -}, - - - -"rals": { - "enabled": true, - "balance_rating_subject":{ - "*data":"*zero1s" - }, -}, - - -"schedulers": { - "enabled": true -}, - - -"cdrs": { - "enabled": true, - "rals_conns": ["*localhost"], - "session_cost_retries": 1, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/cdrsv1mongo/cgrates.json b/data/conf/samples/cdrsv1mongo/cgrates.json deleted file mode 100644 index 8c567d6cc..000000000 --- a/data/conf/samples/cdrsv1mongo/cgrates.json +++ /dev/null @@ -1,41 +0,0 @@ -{ -// CGRateS Configuration file -// -// Used in apier/v1/cdrs_it_test - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - -"rals": { - "enabled": true, - "balance_rating_subject":{ - "*data":"*zero1s" - }, -}, - - -"schedulers": { - "enabled": true -}, - - -"cdrs": { - "enabled": true, - "rals_conns": ["*localhost"], - "session_cost_retries": 1 -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/cdrsv1mysql/cgrates.json b/data/conf/samples/cdrsv1mysql/cgrates.json deleted file mode 100644 index 805bc9542..000000000 --- a/data/conf/samples/cdrsv1mysql/cgrates.json +++ /dev/null @@ -1,39 +0,0 @@ -{ -// CGRateS Configuration file -// -// Used in apier/v1/cdrs_it_test - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to -}, - - -"rals": { - "enabled": true, - "balance_rating_subject":{ - "*data":"*zero1s" - } -}, - - -"schedulers": { - "enabled": true -}, - - -"cdrs": { - "enabled": true, - "rals_conns": ["*localhost"], - "session_cost_retries": 1 -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/cdrsv1postgres/cgrates.json b/data/conf/samples/cdrsv1postgres/cgrates.json deleted file mode 100644 index e5a9e77d1..000000000 --- a/data/conf/samples/cdrsv1postgres/cgrates.json +++ /dev/null @@ -1,36 +0,0 @@ -{ -// CGRateS Configuration file -// -// Used in apier/v1/cdrs_it_test - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to -}, - - - -"rals": { - "enabled": true -}, - - -"schedulers": { - "enabled": true -}, - - -"cdrs": { - "enabled": true, - "rals_conns": ["*localhost"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/configs_active/cgrates.json b/data/conf/samples/configs_active/cgrates.json deleted file mode 100644 index 4462f6c11..000000000 --- a/data/conf/samples/configs_active/cgrates.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - - -"general": { - "node_id": "EngineWithConfigSActive", - "log_level": 7, - "reply_timeout": "50s", -}, - - -"listen": { - "rpc_json": ":3012", - "rpc_gob": ":3013", - "http": ":3080", -}, - - -"data_db": { - "db_type": "*internal", -}, - - - - -"configs": { - "enabled": true, - "url": "/configs/", - "root_dir": "/usr/share/cgrates/conf/samples", -}, - - -} diff --git a/data/conf/samples/diam_tutmysql/cgrates.json b/data/conf/samples/diam_tutmysql/cgrates.json deleted file mode 100644 index 253872918..000000000 --- a/data/conf/samples/diam_tutmysql/cgrates.json +++ /dev/null @@ -1,82 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], - "rals_conns": ["*internal"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"attributes": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, -}, - - -"stats": { - "enabled": true, - "thresholds_conns": ["*internal"], -}, - - -"sessions": { - "enabled": true, - "chargers_conns": ["*internal"], - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "thresholds_conns": ["*internal"], - "stats_conns": ["*internal"], - "attributes_conns": ["*internal"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -"diameter_agent": { - "enabled": true, - "listen": ":3868", - "sessions_conns": ["*birpc_internal"], -}, - - -} \ No newline at end of file diff --git a/data/conf/samples/diam_tutmysql/data.json b/data/conf/samples/diam_tutmysql/data.json deleted file mode 100644 index 38b1c7d8c..000000000 --- a/data/conf/samples/diam_tutmysql/data.json +++ /dev/null @@ -1,216 +0,0 @@ - -{ - -"diameter_agent": { - - "request_processors": [ - - { - "id": "data_init", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.CC-Request-Type:1", - "*prefix:~*req.Service-Context-Id:gprs" - ], - "flags": ["*initiate", "*accounts"], - "request_fields":[ - { - "tag": "ToR", "path": "*cgreq.ToR", - "type": "*constant", "value": "*data" - }, - { - "tag": "OriginID", "path": "*cgreq.OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id" - }, - { - "tag": "RequestType", "path": "*cgreq.RequestType", - "type": "*constant", "value": "*prepaid" - }, - { - "tag": "Category", "path": "*cgreq.Category", - "type": "*constant", "value": "data" - }, - { - "tag": "Account", "path": "*cgreq.Account", - "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]" - }, - { - "tag": "Destination", "path": "*cgreq.Destination", - "type": "*constant", "value": "data" - }, - { - "tag": "SetupTime", "path": "*cgreq.SetupTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "AnswerTime", "path": "*cgreq.AnswerTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "Usage", "path": "*cgreq.Usage", - "type": "*constant", "value": "2048" - }, - ], - "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "ResultCodeError", - "filters": ["*notempty:~*cgrep.Error:"], - "path": "*rep.Result-Code", "blocker": true, - "type": "*constant", "value": "5030" - }, - ], - }, - - { - "id": "data_update_grp1", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", - "*prefix:~*req.Service-Context-Id:gprs" - ], - "flags": ["*update", "*accounts","*continue"], - "request_fields":[ - { - "tag": "ToR", "path": "ToR", - "type": "*constant", "value": "*data" - }, - { - "tag": "InitialOriginID", "path": "InitialOriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id" - }, - { - "tag": "OriginID", "path": "OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id;_grp1" - }, - { - "tag": "Account", "path": "Account", - "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" - }, - { - "tag": "Usage", "path": "Usage", - "type": "*constant", "value": "2048" - }, - { - "tag": "LastUsed", "path": "LastUsed", "type": "*sum", - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)>;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]" - }, - ], - "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "ResultCodeError", - "filters": ["*notempty:~*cgrep.Error:"], - "path": "*rep.Result-Code", "blocker": true, - "type": "*constant", "value": "5030" - }, - ], - }, - - { - "id": "data_update_grp2", - "filters": [ - "*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", - "*prefix:~*req.Service-Context-Id:gprs" - ], - "flags": ["*update", "*accounts"], - "request_fields":[ - { - "tag": "ToR", "path": "ToR", - "type": "*constant", "value": "*data" - }, - { - "tag": "InitialOriginID", "path": "InitialOriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id" - }, - { - "tag": "OriginID", "path": "OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id;_grp2"}, - { - "tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid" - }, - { - "tag": "Category", "path": "Category", - "type": "*constant", "value": "data" - }, - { - "tag": "Account", "path": "Account", - "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" - }, - { - "tag": "Destination", "path": "Destination", - "type": "*constant", "value": "data" - }, - { - "tag": "SetupTime", "path": "SetupTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "AnswerTime", "path": "AnswerTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "Usage", "path": "Usage", - "type": "*constant", "value": "2048" - }, - { - "tag": "LastUsed", "path": "LastUsed", "type": "*sum", - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)>;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]" - }, - ], - "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "ResultCodeError", - "filters": ["*notempty:~*cgrep.Error:"], - "path": "*rep.Result-Code", "blocker": true, - "type": "*constant", "value": "5030" - }, - ], - }, - - { - "id": "data_terminate", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.CC-Request-Type:3", - "*prefix:~*req.Service-Context-Id:gprs" - ], - "flags": ["*terminate", "*accounts", "*cdrs"], - "request_fields":[ - { - "tag": "OriginID", "path": "OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id" - }, - { - "tag": "OriginIDPrefix", "path": "OriginIDPrefix", - "type": "*variable", "mandatory": true, - "value": "~*req.Session-Id" - }, - { - "tag": "LastUsed", "path": "LastUsed", - "type": "*handler", "handler_id": "*sum", - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets" - }, - ], - }, - ] -} - -} diff --git a/data/conf/samples/diam_tutmysql/sms.json b/data/conf/samples/diam_tutmysql/sms.json deleted file mode 100644 index e1dcdd90f..000000000 --- a/data/conf/samples/diam_tutmysql/sms.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - - -"diameter_agent": { - "request_processors": [ - { - "id": "SMSProcessing", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.CC-Request-Type:4", - "*string:~*req.Service-Context-Id:sms" - ], - "flags": ["*event", "*accounts", "*cdrs"], - "request_fields":[ - { - "tag": "ToR", "path": "*cgreq.ToR", - "type": "*constant", "value": "*sms" - }, - { - "tag": "OriginID", "path": "*cgreq.OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Service-Identifier" - }, - { - "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*variable", "value": "~*vars.OriginHost" - }, - { - "tag": "Source", "path": "*cgreq.Source", - "type": "*constant", "mandatory": true, - "value": "DiameterAgent" - }, - { - "tag": "RequestType", "path": "*cgreq.RequestType", - "type": "*constant", "value": "*prepaid" - }, - { - "tag": "Category", "path": "*cgreq.Category", - "type": "*constant", "value": "sms" - }, - { - "tag": "Account", "path": "*cgreq.Account", - "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" - }, - { - "tag": "Destination", "path": "*cgreq.Destination", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.SMS-Information.Recipient-Info.Recipient-Address.Address-Data:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" - }, - { - "tag": "SetupTime", "path": "*cgreq.SetupTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "AnswerTime", "path": "*cgreq.AnswerTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "Usage", "path": "*cgreq.Usage", - "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Requested-Service-Unit.CC-Service-Specific-Units" - }, - { - "tag": "Originator-SCCP-Address", "path": "*cgreq.Originator-SCCP-Address", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.SMS-Information.Originator-SCCP-Address" - }, - ], - "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "ResultCode","path": "*rep.Result-Code", - "filters": ["*eq:~*cgrep.MaxUsage[*raw]:0"], - "type": "*constant", "value": "4012", - "blocker": true - }, - { - "tag": "ResultCode", "path": "*rep.Result-Code", - "filters": ["*notempty:~*cgrep.Error:"], - "type": "*constant", "value": "5030", - "blocker": true - } - ] - } - - ] -} - -} \ No newline at end of file diff --git a/data/conf/samples/diam_tutmysql/voice.json b/data/conf/samples/diam_tutmysql/voice.json deleted file mode 100644 index 0d32af004..000000000 --- a/data/conf/samples/diam_tutmysql/voice.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - -"diameter_agent": { - "request_processors": [ - { - "id": "VoiceInit", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.CC-Request-Type:1", - "*string:~*req.Service-Context-Id:voice" - ], - "flags": ["*authorize", "*accounts"], - "request_fields":[ - {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, - { - "tag": "OriginID", "path": "*cgreq.OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.User-Session-Id" - }, - { - "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*variable", "mandatory": true, - "value": "~*vars.OriginHost" - }, - { - "tag": "Source", "path": "*cgreq.Source", - "type": "*constant", "value": "DiameterAgent" - }, - { - "tag": "RequestType", "path": "*cgreq.RequestType", - "type": "*constant", "value": "*prepaid" - }, - { - "tag": "Account", "path": "*cgreq.Account", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" - }, - { - "tag": "Account", "path": "*cgreq.Account", - "filters":["*string:~*req.Service-Information.IMS-Information.Role-Of-Node:2"], - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Requested-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/sip:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/49${1}/" - }, - { - "tag": "Destination", "path": "*cgreq.Destination", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" - }, - { - "tag": "Destination", "path": "*cgreq.Destination", - "filters": [ - "*prefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+", - "*notprefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+49" - ], - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+(\\d+)/int${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+00${1}/" - }, - { - "tag": "SetupTime", "path": "*cgreq.SetupTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "SetupTime", "path": "*cgreq.SetupTime", - "type": "*variable", "mandatory": true, - "filters": ["*exists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp:"], - "value": "~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp" - }, - { - "tag": "Usage", "path": "*cgreq.Usage", - "type": "*constant", "mandatory": true, - "value": "10s" - }, - { - "tag": "IMSI", "path": "*cgreq.IMSI", - "type": "*variable", "value": "~*req.User-Name" - } - ], - "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "GrantedUnitsError", - "path": "*rep.Granted-Service-Unit.CC-Time", - "filters": ["*notempty:~*cgrep.Error:"], - "type": "*constant", "blocker": true, - "value": "0" - }, - { - "tag": "GrantedUnitsUnlimited", - "path": "*rep.Granted-Service-Unit.CC-Time", - "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "blocker": true, - "type": "*constant", "value": "10"}, - {"tag": "GrantedUnits", "path": "*rep.Granted-Service-Unit.CC-Time", - "type": "*variable", "mandatory": true, - "value": "~*cgrep.MaxUsage{*duration_seconds}"} - ] - }, - { - "id": "VoiceUpdate1", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.CC-Request-Type:2", - "*eq:~*req.CC-Request-Number:1", - "*string:~*req.Service-Context-Id:voice", - ], - "flags": ["*initiate", "*accounts"], - "request_fields":[ - { - "tag": "OriginID", "path": "*cgreq.OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.User-Session-Id"}, - { - "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*variable", "value": "~*vars.OriginHost" - }, - { - "tag": "Source", "path": "*cgreq.Source", - "type": "*constant","value": "DiameterAgent" - }, - { - "tag": "RequestType", "path": "*cgreq.RequestType", - "type": "*constant", "value": "*prepaid" - }, - { - "tag": "Account", "path": "*cgreq.Account", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" - }, - { - "tag": "Account", "path": "*cgreq.Account", - "filters":["*string:~*req.Service-Information.IMS-Information.Role-Of-Node:2"], - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Requested-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/sip:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/49${1}/" - }, - { - "tag": "Destination", "path": "*cgreq.Destination", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" - }, - { - "tag": "Destination", "path": "*cgreq.Destination", - "filters": [ - "*prefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+", - "*notprefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+49" - ], - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+(\\d+)/int${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+00${1}/" - }, - { - "tag": "SetupTime", "path": "*cgreq.SetupTime", - "filters": ["*exists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp:"], - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp" - }, - { - "tag": "AnswerTime", "path": "*cgreq.AnswerTime", - "type": "*variable", "mandatory": true, - "value": "~*req.Event-Timestamp" - }, - { - "tag": "Usage", "path": "*cgreq.Usage", - "type": "*constant", "value": "10s" - }, - { - "tag": "IMSI", "path": "*cgreq.IMSI", - "type": "*variable", "mandatory": true, - "value": "~*req.User-Name" - } - ], - "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "GrantedUnitsError", - "filters": ["*notempty:~*cgrep.Error:"], - "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, - "type": "*constant", "value": "0" - }, - { - "tag": "GrantedUnitsUnlimited", - "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, - "type": "*constant", "value": "10" - }, - { - "tag": "GrantedUnits", "path": "*rep.Granted-Service-Unit.CC-Time", - "type": "*variable", "mandatory": true, - "value": "~*cgrep.MaxUsage{*duration_seconds}" - } - ] - }, - { - "id": "VoiceUpdate2", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.Service-Context-Id:voice", - "*string:~*req.CC-Request-Type:2", - "*gte:~*req.CC-Request-Number:2" - ], - "flags": ["*update", "*accounts"], - "request_fields":[ - { - "tag": "OriginID", "path": "*cgreq.OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.User-Session-Id" - }, - { - "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*variable", "value": "~*vars.OriginHost" - }, - { - "tag": "Usage", "path": "*cgreq.Usage", - "type": "*constant", "value": "10s" - }, - ], - "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - { - "tag": "GrantedUnitsOnError", - "filters": ["*notempty:~*cgrep.Error:"], - "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, - "type": "*constant", "value": "0" - }, - { - "tag": "GrantedUnitsUnlimited", - "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, - "type": "*constant", "value": "10" - }, - { - "tag": "GrantedUnits", "path": "*rep.Granted-Service-Unit.CC-Time", - "type": "*variable", "mandatory": true, - "value": "~*cgrep.MaxUsage{*duration_seconds}" - } - ] - }, - { - "id": "VoiceTerminate", - "filters": [ - "*string:~*vars.*cmd:CCR", - "*string:~*req.Service-Context-Id:voice", - "*string:~*req.CC-Request-Type:3" - ], - "flags": ["*terminate", "*accounts", "*cdrs"], - "request_fields":[ - { - "tag": "OriginID", "path": "*cgreq.OriginID", - "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.User-Session-Id" - }, - { - "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*variable", "value": "~*vars.OriginHost" - }, - { - "tag": "Usage", "path": "*cgreq.Usage", - "filters": ["*exists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Response-Timestamp:"], - "type": "*usageDifference", "mandatory": true, - "value": "~*req.Event-Timestamp;~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Response-Timestamp"}, - { - "tag": "Usage", "path": "*cgreq.Usage", - "filters": ["*notexists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Response-Timestamp:"], - "type": "*constant", "value": "0s" - }, - ], - "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "path": "*rep.Result-Code", "blocker": true, - "type": "*constant", "value": "5030"}, - {"tag": "ResultCode", "path": "*rep.Result-Code", - "type": "*constant", "value": "2001"} - ] - }, - ] -} - -} diff --git a/data/conf/samples/filtered_scheduler2_internal/cgrates.json b/data/conf/samples/filtered_scheduler2_internal/cgrates.json deleted file mode 100644 index 8122a11ca..000000000 --- a/data/conf/samples/filtered_scheduler2_internal/cgrates.json +++ /dev/null @@ -1,44 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, - "reply_timeout": "50s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "*internal", -}, - - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, - "filters": ["*suffix:~*act.AccountID:1002|1003"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/filtered_scheduler2_mongo/cgrates.json b/data/conf/samples/filtered_scheduler2_mongo/cgrates.json deleted file mode 100644 index 24f8733d4..000000000 --- a/data/conf/samples/filtered_scheduler2_mongo/cgrates.json +++ /dev/null @@ -1,46 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, - "reply_timeout": "50s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, - "filters": ["*suffix:~*act.AccountID:1002|1003"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/filtered_scheduler2_mysql/cgrates.json b/data/conf/samples/filtered_scheduler2_mysql/cgrates.json deleted file mode 100644 index 4dfa3a5ca..000000000 --- a/data/conf/samples/filtered_scheduler2_mysql/cgrates.json +++ /dev/null @@ -1,46 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, - "reply_timeout": "50s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to -}, - - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, - "filters": ["*suffix:~*act.AccountID:1002|1003"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/filtered_scheduler_internal/cgrates.json b/data/conf/samples/filtered_scheduler_internal/cgrates.json deleted file mode 100644 index f306f996b..000000000 --- a/data/conf/samples/filtered_scheduler_internal/cgrates.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - // CGRateS Configuration file - // - - - "general": { - "log_level": 7, - "reply_timeout": "50s", - }, - - - "listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", - }, - - - "data_db": { - "db_type": "*internal", - }, - - - - - - "rals": { - "enabled": true, - }, - - - "schedulers": { - "enabled": true, - "filters": ["*suffix:~*act.AccountID:1001"], - }, - - - "admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - }, - - - } - \ No newline at end of file diff --git a/data/conf/samples/filtered_scheduler_mongo/cgrates.json b/data/conf/samples/filtered_scheduler_mongo/cgrates.json deleted file mode 100644 index 298a9eb8a..000000000 --- a/data/conf/samples/filtered_scheduler_mongo/cgrates.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - // CGRateS Configuration file - // - - - "general": { - "log_level": 7, - "reply_timeout": "50s", - }, - - - "listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", - }, - - - "data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, - }, - - - - - "rals": { - "enabled": true, - }, - - - "schedulers": { - "enabled": true, - "filters": ["*suffix:~*act.AccountID:1001"], - }, - - - "admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - }, - - - } - \ No newline at end of file diff --git a/data/conf/samples/filtered_scheduler_mysql/cgrates.json b/data/conf/samples/filtered_scheduler_mysql/cgrates.json deleted file mode 100644 index 5ebf02bb5..000000000 --- a/data/conf/samples/filtered_scheduler_mysql/cgrates.json +++ /dev/null @@ -1,46 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, - "reply_timeout": "50s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to -}, - - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, - "filters": ["*suffix:~*act.AccountID:1001"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/full_remote/internal/cgrates.json b/data/conf/samples/full_remote/internal/cgrates.json deleted file mode 100644 index 33ed38eaa..000000000 --- a/data/conf/samples/full_remote/internal/cgrates.json +++ /dev/null @@ -1,90 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "InternalEngine", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2023", "transport":"*gob"}], - }, -}, - -"caches":{ - "partitions": { - "*resource_profiles": {"limit":0 }, - "*resources": {"limit":0 }, - "*statqueue_profiles": {"limit":0 }, - "*statqueues": {"limit":0 }, - "*threshold_profiles": {"limit":0 }, - "*thresholds": {"limit":0 }, - "*filters": {"limit":0 }, - "*route_profiles": {"limit":0 }, - "*attribute_profiles": {"limit":0 }, - "*charger_profiles": {"limit":0 }, - "*dispatcher_profiles": {"limit":0 }, - "*dispatcher_hosts": {"limit":0 }, - "*rate_profiles": {"limit":0 }, - "*action_profiles": {"limit":0 }, - "*account_profiles": {"limit":0 }, - "*resource_filter_indexes" : {"limit":0}, - "*stat_filter_indexes" : {"limit":0}, - "*threshold_filter_indexes" : {"limit":0}, - "*route_filter_indexes" : {"limit":0}, - "*attribute_filter_indexes" : {"limit":0}, - "*charger_filter_indexes" : {"limit":0}, - "*dispatcher_filter_indexes" : {"limit":0}, - "*rate_profile_filter_indexes" : {"limit":0}, - "*rate_filter_indexes" : {"limit":0}, - "*action_profile_filter_indexes" : {"limit":0}, - "*account_profile_filter_indexes" : {"limit":0}, - "*reverse_filter_indexes" : {"limit":0}, - "*dispatcher_routes": {"limit":0}, - "*dispatcher_loads": {"limit":0}, - "*dispatchers": {"limit":0}, - }, - }, - - -"data_db": { - "db_type": "*internal", - "remote_conns": ["conn1"], - "items":{ - "*accounts":{"remote":true,"replicate":false}, - "*resource_profiles":{"remote":true,"replicate":false}, - "*resources":{"remote":true,"replicate":false}, - "*statqueue_profiles": {"remote":true,"replicate":false}, - "*statqueues": {"remote":true,"replicate":false}, - "*threshold_profiles": {"remote":true,"replicate":false}, - "*thresholds": {"remote":true,"replicate":false}, - "*filters": {"remote":true,"replicate":false}, - "*route_profiles":{"remote":true,"replicate":false}, - "*attribute_profiles":{"remote":true,"replicate":false}, - "*charger_profiles": {"remote":true,"replicate":false}, - "*action_profiles":{"remote":true,"replicate":false}, - "*dispatcher_profiles":{"remote":true,"replicate":false}, - "*dispatcher_hosts":{"remote":true,"replicate":false}, - "*rate_profiles":{"remote":true,"replicate":false}, - "*account_profiles":{"remote":true, "replicate":false}, - "*load_ids":{"remote":true,"replicate":false}, - "*indexes":{"remote":true, "replicate":false}, - }, -}, - - - - -"admins": { - "enabled": true, -}, - -} diff --git a/data/conf/samples/full_remote/remote/cgrates.json b/data/conf/samples/full_remote/remote/cgrates.json deleted file mode 100644 index d81a9bac2..000000000 --- a/data/conf/samples/full_remote/remote/cgrates.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - -"general": { - "log_level": 7, - "node_id": "EngineRedis" -}, - - -"listen": { - "rpc_json": ":2022", - "rpc_gob": ":2023", - "http": ":2280", -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/hundred_rates/cgrates.json b/data/conf/samples/hundred_rates/cgrates.json deleted file mode 100644 index 551e6c456..000000000 --- a/data/conf/samples/hundred_rates/cgrates.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - - "general": { - "rounding_decimals": 20, - }, - - "data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", - }, - - - // "caches":{ - // "partitions": { - // "*rating_plans": {"limit": 10000, "ttl":"0s","precache": true}, - // "*rating_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, - - // "*rate_profiles": {"limit": 10000, "ttl": "", "static_ttl": false, "precache": true, "replicate": false}, // control rate profile caching - // }, - // }, - - "rals": { - "enabled": true, - }, - - - "schedulers": { - "enabled": true - }, - - "admins": { - "enabled": true, - }, - - "rates": { - "enabled": true, - "rate_string_indexed_fields": ["*req.PrefixDestination"] - }, - - -}, diff --git a/data/conf/samples/migwithinternal/cgrates.json b/data/conf/samples/migwithinternal/cgrates.json deleted file mode 100755 index 0278d5e4f..000000000 --- a/data/conf/samples/migwithinternal/cgrates.json +++ /dev/null @@ -1,18 +0,0 @@ -{ -// CGRateS Configuration file -// - -"general": { - "log_level": 7, -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to -}, - - - -} \ No newline at end of file diff --git a/data/conf/samples/mongoatlas/cgrates.json b/data/conf/samples/mongoatlas/cgrates.json deleted file mode 100755 index 2dd02fb04..000000000 --- a/data/conf/samples/mongoatlas/cgrates.json +++ /dev/null @@ -1,124 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "mongo", - "db_host": "cgrates-shard-00-00-dbhlm.mongodb.net:27017,cgrates-shard-00-01-dbhlm.mongodb.net:27017,cgrates-shard-00-02-dbhlm.mongodb.net", // data_db host address - "db_port": 27017, - "db_name": "OnlineTarrifPlans?replicaSet=CGRateS-shard-0&authSource=admin&ssl=true", - "db_user": "CGRateS", - "db_password": "CGRateS.org", -}, - - -"caches":{ - "partitions": { - "*resource_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, - "*resources": {"limit": 10000, "ttl":"0s", "precache": true}, - "*statqueues": {"limit": 10000, "ttl":"0s", "precache": true}, - "*statqueue_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, - "*thresholds": {"limit": 10000, "ttl":"0s", "precache": true}, - "*threshold_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, - "*filters": {"limit": 10000, "ttl":"0s", "precache": true}, - "*route_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, - "*attribute_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, - "*resource_filter_indexes" :{"limit": 10000, "ttl":"0s"}, - "*stat_filter_indexes" : {"limit": 10000, "ttl":"0s"}, - "*threshold_filter_indexes" : {"limit": 10000, "ttl":"0s"}, - "*route_filter_indexes" : {"limit": 10000, "ttl":"0s"}, - "*attribute_filter_indexes" : {"limit": 10000, "ttl":"0s"}, - "*charger_filter_indexes" : {"limit": 10000, "ttl":"0s"} - }, -}, - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], -}, - - -"schedulers": { - "enabled": true, -}, - - -"cdrs": { - "enabled": true, -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, -}, - - -"attributes": { - "enabled": true, -}, - - -"sessions": { - "enabled": true, - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "chargers_conns": ["*internal"], -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_host": "cgrates-shard-00-00-dbhlm.mongodb.net:27017,cgrates-shard-00-01-dbhlm.mongodb.net:27017,cgrates-shard-00-02-dbhlm.mongodb.net", - "out_datadb_port": "27017", - "out_datadb_name": "OnlineTarrifPlans?replicaSet=CGRateS-shard-0&authSource=admin&ssl=true", - "out_datadb_user": "CGRateS", - "out_datadb_password":"CGRateS.org", -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - -} diff --git a/data/conf/samples/mongoreplica/cgrates.json b/data/conf/samples/mongoreplica/cgrates.json deleted file mode 100755 index 82b24ab2c..000000000 --- a/data/conf/samples/mongoreplica/cgrates.json +++ /dev/null @@ -1,89 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "mongo", // data_db type: - "db_host": "192.168.56.202:27017,192.168.56.203:27017,192.168.56.204", // data_db host address - "db_port": 27017, // data_db port to reach the database - "db_name": "teoOnline?replicaSet=rs0&authSource=admin", - "db_user": "cgrates", // username to use when connecting to data_db - "db_password": "CGRateS.org", // password to use when connecting to data_db -}, - - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], -}, - - -"schedulers": { - "enabled": true, -}, - - -"cdrs": { - "enabled": true, -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - -"sessions": { - "enabled": true, - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "chargers_conns": ["*internal"], -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/redis_cluster/cgrates.json b/data/conf/samples/redis_cluster/cgrates.json deleted file mode 100755 index 5877bf482..000000000 --- a/data/conf/samples/redis_cluster/cgrates.json +++ /dev/null @@ -1,42 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_host":"127.0.0.1:7001", - "db_name": "10", // data_db database name to connect to - "opts": { - "redisCluster": true, - "redisClusterSync": "100ms", // the sync interval for the redis cluster - }, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"admins": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/redis_sentinel/cgrates.json b/data/conf/samples/redis_sentinel/cgrates.json deleted file mode 100755 index 23e42ada6..000000000 --- a/data/conf/samples/redis_sentinel/cgrates.json +++ /dev/null @@ -1,41 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_host":"127.0.0.1:16381;127.0.0.1:16382", - "db_name": "10", // data_db database name to connect to - "opts": { - "redisSentinel":"redis-cluster", - }, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"admins": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/redis_tls/cgrates.json b/data/conf/samples/redis_tls/cgrates.json deleted file mode 100755 index 3d0ef391e..000000000 --- a/data/conf/samples/redis_tls/cgrates.json +++ /dev/null @@ -1,45 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "log_level": 7, - "node_id": "RedisTLS" -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "redis", - "db_host":"127.0.0.1:6400", - "db_name": "10", - "opts": { - "redisTLS": true, - "redisClientCertificate":"/usr/share/cgrates/tls/client.crt", - "redisClientKey":"/usr/share/cgrates/tls/client.key", - "redisCACertificate":"/usr/share/cgrates/tls/ca.crt", - }, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"admins": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/remote_replication/engine1_mongo/cgrates.json b/data/conf/samples/remote_replication/engine1_mongo/cgrates.json deleted file mode 100644 index 187f547d2..000000000 --- a/data/conf/samples/remote_replication/engine1_mongo/cgrates.json +++ /dev/null @@ -1,40 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id" : "EngineMongo1", -}, - - -"listen": { - "rpc_json": ":2022", - "rpc_gob": ":2023", - "http": ":2280", -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/remote_replication/engine1_redis/cgrates.json b/data/conf/samples/remote_replication/engine1_redis/cgrates.json deleted file mode 100644 index 1b28becc3..000000000 --- a/data/conf/samples/remote_replication/engine1_redis/cgrates.json +++ /dev/null @@ -1,39 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "EngineRedis1" -}, - - -"listen": { - "rpc_json": ":2022", - "rpc_gob": ":2023", - "http": ":2280", -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/remote_replication/engine2_mongo/cgrates.json b/data/conf/samples/remote_replication/engine2_mongo/cgrates.json deleted file mode 100644 index 6112f2f8c..000000000 --- a/data/conf/samples/remote_replication/engine2_mongo/cgrates.json +++ /dev/null @@ -1,51 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id" : "EngineMongo2", -}, - - -"listen": { - "rpc_json": ":2032", - "rpc_gob": ":2033", - "http": ":2380", -}, - -"rpc_conns": { - "replicateToCache": { - "strategy": "*broadcast_sync", - "conns": [ - {"address": "*internal"}, - {"address": "127.0.0.1:2012", "transport":"*json"}, - ], - } -}, - -"data_db": { - "db_type": "mongo", - "db_name": "11", - "db_port": 27017, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - "caches_conns": ["replicateToCache"], -}, - - -}, diff --git a/data/conf/samples/remote_replication/engine2_redis/cgrates.json b/data/conf/samples/remote_replication/engine2_redis/cgrates.json deleted file mode 100644 index 78cdcfa8e..000000000 --- a/data/conf/samples/remote_replication/engine2_redis/cgrates.json +++ /dev/null @@ -1,50 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "EngineRedis2" -}, - - -"listen": { - "rpc_json": ":2032", - "rpc_gob": ":2033", - "http": ":2380", -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "11", -}, - - - - -"rpc_conns": { - "replicateToCache": { - "strategy": "*broadcast_sync", - "conns": [ - {"address": "*internal"}, - {"address": "127.0.0.1:2012", "transport":"*json"}, - ], - } -}, - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - "caches_conns": ["replicateToCache"], -}, - -} diff --git a/data/conf/samples/remote_replication/internal/cgrates.json b/data/conf/samples/remote_replication/internal/cgrates.json deleted file mode 100644 index b05eb1ecf..000000000 --- a/data/conf/samples/remote_replication/internal/cgrates.json +++ /dev/null @@ -1,95 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "InternalEngine", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2033", "transport":"*gob"}], - }, - "conn2": { - "strategy": "*broadcast_sync", - "conns": [ - {"address": "127.0.0.1:2023", "transport":"*gob"}, - {"address": "127.0.0.1:2033", "transport":"*gob"} - ], - }, - "connCache": { - "strategy": "*broadcast", - "conns": [ - {"address": "127.0.0.1:2022", "transport":"*json"}, - {"address": "127.0.0.1:2032", "transport":"*json"} - ], - } - -}, - - -"data_db": { - "db_type": "*internal", - "remote_conns": ["conn1"], - "replication_conns": ["conn2"], - "items":{ - "*accounts":{"remote":true,"replicate":true}, - "*resource_profiles":{"remote":true,"replicate":true}, - "*resources":{"remote":true,"replicate":true}, - "*statqueue_profiles": {"remote":true,"replicate":true}, - "*statqueues": {"remote":true,"replicate":true}, - "*threshold_profiles": {"remote":true,"replicate":true}, - "*thresholds": {"remote":true,"replicate":true}, - "*filters": {"remote":true,"replicate":true}, - "*route_profiles":{"remote":true,"replicate":true}, - "*attribute_profiles":{"remote":true,"replicate":true}, - "*charger_profiles": {"remote":true,"replicate":true}, - "*dispatcher_profiles":{"remote":true,"replicate":true}, - "*dispatcher_hosts":{"remote":true,"replicate":true}, - "*rate_profiles":{"remote":true,"replicate":true}, - "*load_ids":{"remote":true,"replicate":true}, - "*indexes":{"remote":true, "replicate":true}, - }, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - "caches_conns":["connCache"], -}, - -} diff --git a/data/conf/samples/remote_replication/internal_gob/cgrates.json b/data/conf/samples/remote_replication/internal_gob/cgrates.json deleted file mode 100644 index 4c4e9d7da..000000000 --- a/data/conf/samples/remote_replication/internal_gob/cgrates.json +++ /dev/null @@ -1,93 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "InternalEngine", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2033", "transport":"*gob"}], - }, - "conn2": { - "strategy": "*broadcast", - "conns": [ - {"address": "127.0.0.1:2023", "transport":"*gob"}, - {"address": "127.0.0.1:2033", "transport":"*gob"} - ], - } -}, - - -"data_db": { - "db_type": "*internal", - "remote_conns": ["conn1"], - "replication_conns": ["conn2"], - "items":{ - "*accounts":{"remote":true,"replicate":true}, - "*resource_profiles":{"remote":true,"replicate":true}, - "*resources":{"remote":true,"replicate":true}, - "*statqueue_profiles": {"remote":true,"replicate":true}, - "*statqueues": {"remote":true,"replicate":true}, - "*threshold_profiles": {"remote":true,"replicate":true}, - "*thresholds": {"remote":true,"replicate":true}, - "*filters": {"remote":true,"replicate":true}, - "*route_profiles":{"remote":true,"replicate":true}, - "*attribute_profiles":{"remote":true,"replicate":true}, - "*charger_profiles": {"remote":true,"replicate":true}, - "*dispatcher_profiles":{"remote":true,"replicate":true}, - "*dispatcher_hosts":{"remote":true,"replicate":true}, - "*rate_profiles":{"remote":true,"replicate":true}, - "*load_ids":{"remote":true,"replicate":true}, - "*indexes":{"remote":true, "replicate":true}, - }, -}, - - - - - -"rals": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"stats": { - "enabled": false, - "store_interval": "-1", -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/replication/engine1_mongo/cgrates.json b/data/conf/samples/replication/engine1_mongo/cgrates.json deleted file mode 100644 index 02383976b..000000000 --- a/data/conf/samples/replication/engine1_mongo/cgrates.json +++ /dev/null @@ -1,41 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id" : "EngineMongo1", -}, - - -"listen": { - "rpc_json": ":2022", - "rpc_gob": ":2023", - "http": ":2280", -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, -"thresholds": { - "enabled": true, -}, - -} diff --git a/data/conf/samples/replication/engine1_redis/cgrates.json b/data/conf/samples/replication/engine1_redis/cgrates.json deleted file mode 100644 index b2085d721..000000000 --- a/data/conf/samples/replication/engine1_redis/cgrates.json +++ /dev/null @@ -1,42 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "EngineRedis1" -}, - - -"listen": { - "rpc_json": ":2022", - "rpc_gob": ":2023", - "http": ":2280", -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -"thresholds": { - "enabled": true, -}, - - -} diff --git a/data/conf/samples/replication/engine2_mongo/cgrates.json b/data/conf/samples/replication/engine2_mongo/cgrates.json deleted file mode 100644 index c27421c8b..000000000 --- a/data/conf/samples/replication/engine2_mongo/cgrates.json +++ /dev/null @@ -1,43 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id" : "EngineMongo2", -}, - - -"listen": { - "rpc_json": ":2032", - "rpc_gob": ":2033", - "http": ":2380", -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "11", - "db_port": 27017, -}, - - - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -"thresholds": { - "enabled": true, -}, - -} diff --git a/data/conf/samples/replication/engine2_redis/cgrates.json b/data/conf/samples/replication/engine2_redis/cgrates.json deleted file mode 100644 index 029344a66..000000000 --- a/data/conf/samples/replication/engine2_redis/cgrates.json +++ /dev/null @@ -1,39 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "EngineRedis2" -}, - - -"listen": { - "rpc_json": ":2032", - "rpc_gob": ":2033", - "http": ":2380", -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "11", -}, - - -"rals": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -"thresholds": { - "enabled": true, -}, -} diff --git a/data/conf/samples/replication/internal/cgrates.json b/data/conf/samples/replication/internal/cgrates.json deleted file mode 100644 index 8a731e5b8..000000000 --- a/data/conf/samples/replication/internal/cgrates.json +++ /dev/null @@ -1,88 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "InternalEngine", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"rpc_conns": { - "conn2": { - "strategy": "*broadcast_sync", - "conns": [ - {"address": "127.0.0.1:2023", "transport":"*gob"}, - {"address": "127.0.0.1:2033", "transport":"*gob"} - ], - }, - "connCache": { - "strategy": "*broadcast_sync",// be brodcast sync in test - "conns": [ - {"address": "127.0.0.1:2022", "transport":"*json"}, - {"address": "127.0.0.1:2032", "transport":"*json"} - ], - } -}, - - -"data_db": { - "db_type": "*internal", - "replication_conns": ["conn2"], - "items":{ - "*accounts":{"remote":false,"replicate":true}, - "*resource_profiles":{"remote":false,"replicate":true}, - "*resources":{"remote":false,"replicate":true}, - "*statqueue_profiles": {"remote":false,"replicate":true}, - "*statqueues": {"remote":false,"replicate":true}, - "*threshold_profiles": {"remote":false,"replicate":true}, - "*thresholds": {"remote":false,"replicate":true}, - "*filters": {"remote":false,"replicate":true}, - "*route_profiles":{"remote":false,"replicate":true}, - "*attribute_profiles":{"remote":false,"replicate":true}, - "*charger_profiles": {"remote":false,"replicate":true}, - "*dispatcher_profiles":{"remote":false,"replicate":true}, - "*dispatcher_hosts":{"remote":false,"replicate":true}, - "*indexes" :{"remote":false,"replicate":true}, - "*rate_profiles":{"remote":false,"replicate":true}, - "*load_ids":{"remote":false,"replicate":true}, - }, -}, - - - - -"rals": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - "caches_conns":["connCache"], -}, - -} diff --git a/data/conf/samples/replication/internal_gob/cgrates.json b/data/conf/samples/replication/internal_gob/cgrates.json deleted file mode 100644 index d781c5b0e..000000000 --- a/data/conf/samples/replication/internal_gob/cgrates.json +++ /dev/null @@ -1,88 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "InternalEngine", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"rpc_conns": { - "conn2": { - "strategy": "*broadcast_sync", - "conns": [ - {"address": "127.0.0.1:2023", "transport":"*gob"}, - {"address": "127.0.0.1:2033", "transport":"*gob"} - ] - }, - "connCache": { - "strategy": "*broadcast_sync",// be brodcast sync in test - "conns": [ - {"address": "127.0.0.1:2023", "transport":"*gob"}, - {"address": "127.0.0.1:2033", "transport":"*gob"} - ] - } -}, - - -"data_db": { - "db_type": "*internal", - "replication_conns": ["conn2"], - "items":{ - "*accounts":{"remote":false,"replicate":true}, - "*resource_profiles":{"remote":false,"replicate":true}, - "*resources":{"remote":false,"replicate":true}, - "*statqueue_profiles": {"remote":false,"replicate":true}, - "*statqueues": {"remote":false,"replicate":true}, - "*threshold_profiles": {"remote":false,"replicate":true}, - "*thresholds": {"remote":false,"replicate":true}, - "*filters": {"remote":false,"replicate":true}, - "*route_profiles":{"remote":false,"replicate":true}, - "*attribute_profiles":{"remote":false,"replicate":true}, - "*charger_profiles": {"remote":false,"replicate":true}, - "*dispatcher_profiles":{"remote":false,"replicate":true}, - "*dispatcher_hosts":{"remote":false,"replicate":true}, - "*indexes" :{"remote":false,"replicate":true}, - "*rate_profiles":{"remote":false,"replicate":true}, - "*load_ids":{"remote":false,"replicate":true}, - } -}, - - - - -"rals": { - "enabled": true, -}, - - -"thresholds": { - "enabled": true, - "store_interval": "-1", -}, - - -"resources": { - "enabled": true, - "store_interval": "-1", - "thresholds_conns": ["*internal"], -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], - "caches_conns":["connCache"], -} - -} diff --git a/data/conf/samples/replication_cache/engine1/cgrates.json b/data/conf/samples/replication_cache/engine1/cgrates.json deleted file mode 100644 index c263387d2..000000000 --- a/data/conf/samples/replication_cache/engine1/cgrates.json +++ /dev/null @@ -1,72 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "Engine1" -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2180" -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10" -}, - - - -"rpc_conns": { - "connCache": { - "strategy": "*broadcast_sync", - "conns": [ - {"address": "127.0.0.1:2013", "transport":"*gob"}, - {"address": "127.0.0.1:2023", "transport":"*gob"} - ] - } -}, - - -"caches":{ - "partitions": { - "*attribute_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": true}, - "*attribute_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": true}, - "*rate_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": true}, - "*rate_profile_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": true}, - "*rate_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": true} - }, - "replication_conns": ["connCache"] -}, - - -"rals": { - "enabled": true -}, - - -"attributes": { - "enabled": true -}, - - -"rates": { - "enabled": true -}, - - -"schedulers": { - "enabled": true -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"] -}, - - - -}, diff --git a/data/conf/samples/replication_cache/engine2/cgrates.json b/data/conf/samples/replication_cache/engine2/cgrates.json deleted file mode 100644 index 35a1ea853..000000000 --- a/data/conf/samples/replication_cache/engine2/cgrates.json +++ /dev/null @@ -1,47 +0,0 @@ -{ -"general": { - "log_level": 7, - "node_id": "Engine2" -}, - - -"listen": { - "rpc_json": ":2022", - "rpc_gob": ":2023", - "http": ":2280", -}, - -"data_db": { - "db_type": "redis", - "db_port": 6379, - "db_name": "10", -}, - - -"rals": { - "enabled": true, -}, - - -"attributes": { - "enabled": true, -}, - - -"rates": { - "enabled": true, -}, - - -"schedulers": { - "enabled": true, -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -} diff --git a/data/conf/samples/rpcconn_mysql/cgrates.json b/data/conf/samples/rpcconn_mysql/cgrates.json deleted file mode 100644 index 9d38e21ea..000000000 --- a/data/conf/samples/rpcconn_mysql/cgrates.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - // CGRateS Configuration file - // - - -"general": { - "log_level": 7, - "reply_timeout": "50s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - -"data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to -}, - - - -"rpc_conns": { - "group_id": { - "conn1": [ - { - "address":"127.0.0.1:2012", - "transport":"*json", - "connect_attempts":5, - "reconnects": -1, - "connect_timeout":"1s", - "reply_timeout":"2s", - "tls": false, - "client_key":"", - "client_certificate":"", - "ca_certificate":"" - } - ] - } -}, - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], - "max_increments":3000000, -}, - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["*internal"], - "stats_conns": ["*localhost"], -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*internal"], -}, - - -"attributes": { - "enabled": true, - "stats_conns": ["*localhost"], - "resources_conns": ["*localhost"], - "accounts_conns": ["*localhost"] -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, - "prefix_indexed_fields":["*req.Destination"], - "stats_conns": ["*internal"], - "resources_conns": ["*internal"], - "rals_conns": ["*internal"], -}, - - -"sessions": { - "enabled": true, - "routes_conns": ["*internal"], - "resources_conns": ["*internal"], - "attributes_conns": ["*internal"], - "rals_conns": ["*internal"], - "cdrs_conns": ["*localhost"], - "chargers_conns": ["*internal"], -}, - - -"migrator":{ - "users_filters":["Account"], -}, - - -"apiers": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -"filters": { - "stats_conns": ["*localhost"], - "resources_conns": ["*internal"], - "accounts_conns": ["*internal"], -}, - -"accounts": { - "enabled": true -}, - -} - \ No newline at end of file diff --git a/data/conf/samples/tutinternal/cgrates.json b/data/conf/samples/tutinternal/cgrates.json index 5688a5f2b..05650aef0 100644 --- a/data/conf/samples/tutinternal/cgrates.json +++ b/data/conf/samples/tutinternal/cgrates.json @@ -1,7 +1,4 @@ { -// CGRateS Configuration file -// - "general": { "log_level": 7, @@ -63,6 +60,7 @@ "prefix_indexed_fields":["*req.Destination"], "stats_conns": ["*internal"], "resources_conns": ["*internal"], + "rates_conns": ["*internal"] }, @@ -77,7 +75,7 @@ "admins": { - "enabled": true, + "enabled": true }, @@ -100,11 +98,11 @@ "filters": { "stats_conns": ["*internal"], "resources_conns": ["*internal"], - "accounts_conns": ["*internal"], + "accounts_conns": ["*internal"] }, "tpes": { "enabled": true -}, +} } diff --git a/data/conf/samples/tutmongonew/cgrates.json b/data/conf/samples/tutmongonew/cgrates.json deleted file mode 100644 index 612710e59..000000000 --- a/data/conf/samples/tutmongonew/cgrates.json +++ /dev/null @@ -1,112 +0,0 @@ -{ -// CGRateS Configuration file - - -"general": { - "log_level": 7, - "reply_timeout": "30s", -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - -"data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, -}, - - - - - -"rals": { - "enabled": true, - "thresholds_conns": ["*internal"], -}, - - -"schedulers": { - "enabled": true, -}, - - -"cdrs": { - "enabled": true, - "chargers_conns":["*localhost"], -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*internal"], -}, - - -"resources": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"] -}, - - -"stats": { - "enabled": true, - "store_interval": "1s", - "thresholds_conns": ["*internal"], -}, - - -"thresholds": { - "enabled": true, - "store_interval": "1s", -}, - - -"routes": { - "enabled": true, - "stats_conns": ["*internal"], -}, - - -"attributes": { // Attribute service - "enabled": true, // starts Attribute service: . -}, - - -"sessions": { - "enabled": true, - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "chargers_conns": ["*internal"], -}, - - -"migrator": { - "out_datadb_type": "mongo", - "out_datadb_port": "27017", - "out_datadb_name": "10", - -}, - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - - -"filters": { - "accounts_conns": ["*internal"], -}, - -"accounts": { - "enabled": true -}, - -} diff --git a/data/conf/samples/tutmysql2/cgrates.json b/data/conf/samples/tutmysql2/cgrates.json deleted file mode 100644 index 924511297..000000000 --- a/data/conf/samples/tutmysql2/cgrates.json +++ /dev/null @@ -1,106 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "node_id": "CGRateSTutorial", - "log_level": 7 -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["*localhost"], -}, - - -"rals": { - "enabled": true, - "thresholds_conns": ["*localhost"], - "stats_conns": ["*localhost"], -}, - - -"cdrs": { - "enabled": true, - "extra_fields": ["~*req.PayPalAccount", "~*req.LCRProfile", "~*req.ResourceID"], - "chargers_conns":["*localhost"], - "online_cdr_exports": [] -}, - - -"sessions": { - "enabled": true, - "resources_conns": ["*localhost"], - "routes_conns": ["*localhost"], - "attributes_conns": ["*localhost"], - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "chargers_conns": ["*internal"], -}, - - -"attributes": { - "enabled": true, - "string_indexed_fields": ["*req.Account"] -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["*localhost"], - "string_indexed_fields": ["*req.Account"] -}, - - -"resources": { - "enabled": true, - "thresholds_conns": ["*localhost"], - "string_indexed_fields": ["*req.Account"] -}, - - -"stats": { - "enabled": true, - "thresholds_conns": ["*localhost"], - "string_indexed_fields": ["*req.Account"] -}, - - -"thresholds": { - "enabled": true, - "string_indexed_fields": ["*req.Account"] -}, - - -"routes": { - "enabled": true, - "string_indexed_fields": ["*req.LCRProfile"], - "prefix_indexed_fields":["*req.Destination"], -}, - - - -"admins": { - "enabled": true, - "scheduler_conns": ["*localhost"], -}, - -"filters": { - "accounts_conns": ["*internal"], -}, - -"accounts": { - "enabled": true -}, - -} diff --git a/data/conf/samples/tutmysql2_gob/cgrates.json b/data/conf/samples/tutmysql2_gob/cgrates.json deleted file mode 100644 index ef895a013..000000000 --- a/data/conf/samples/tutmysql2_gob/cgrates.json +++ /dev/null @@ -1,116 +0,0 @@ -{ -// CGRateS Configuration file -// - - -"general": { - "node_id": "CGRateSTutorial", - "log_level": 7 -}, - - -"rpc_conns": { - "conn1": { - "strategy": "*first", - "conns": [{"address": "127.0.0.1:2013", "transport":"*gob"}], - }, -}, - - -"listen": { - "rpc_json": ":2012", - "rpc_gob": ":2013", - "http": ":2080", -}, - - - - -"schedulers": { - "enabled": true, - "cdrs_conns": ["conn1"], -}, - - -"rals": { - "enabled": true, - "thresholds_conns": ["conn1"], - "stats_conns": ["conn1"], -}, - - -"cdrs": { - "enabled": true, - "extra_fields": ["~*req.PayPalAccount", "~*req.LCRProfile", "~*req.ResourceID"], - "chargers_conns":["conn1"], - "online_cdr_exports": [] -}, - - - -"sessions": { - "enabled": true, - "resources_conns": ["conn1"], - "routes_conns": ["conn1"], - "attributes_conns": ["conn1"], - "rals_conns": ["*internal"], - "cdrs_conns": ["*internal"], - "chargers_conns": ["*internal"], -}, - - -"attributes": { - "enabled": true, - "string_indexed_fields": ["*req.Account"] -}, - - -"chargers": { - "enabled": true, - "attributes_conns": ["conn1"], - "string_indexed_fields": ["*req.Account"] -}, - - -"resources": { - "enabled": true, - "thresholds_conns": ["conn1"], - "string_indexed_fields": ["*req.Account"] -}, - - -"stats": { - "enabled": true, - "thresholds_conns": ["conn1"], - "string_indexed_fields": ["*req.Account"] -}, - - -"thresholds": { - "enabled": true, - "string_indexed_fields": ["*req.Account"] -}, - - -"routes": { - "enabled": true, - "string_indexed_fields": ["*req.LCRProfile"], - "prefix_indexed_fields":["*req.Destination"], -}, - - - -"admins": { - "enabled": true, - "scheduler_conns": ["*internal"], -}, - -"filters": { - "accounts_conns": ["*internal"], -}, - -"accounts": { - "enabled": true -}, - -} diff --git a/data/docker/integration/scripts/mongo b/data/docker/integration/scripts/mongo deleted file mode 120000 index 221af3976..000000000 --- a/data/docker/integration/scripts/mongo +++ /dev/null @@ -1 +0,0 @@ -../../../storage/mongo/ \ No newline at end of file diff --git a/data/docker/integration/scripts/mysql b/data/docker/integration/scripts/mysql deleted file mode 120000 index 50ba904e1..000000000 --- a/data/docker/integration/scripts/mysql +++ /dev/null @@ -1 +0,0 @@ -../../../storage/mysql/ \ No newline at end of file diff --git a/data/docker/integration/scripts/postgres b/data/docker/integration/scripts/postgres deleted file mode 120000 index a019a3978..000000000 --- a/data/docker/integration/scripts/postgres +++ /dev/null @@ -1 +0,0 @@ -../../../storage/postgres/ \ No newline at end of file diff --git a/general_tests/oldtutorial_it_test.go b/general_tests/oldtutorial_it_test.go deleted file mode 100644 index f1d36f749..000000000 --- a/general_tests/oldtutorial_it_test.go +++ /dev/null @@ -1,1457 +0,0 @@ -//go:build integration -// +build integration - -/* -Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments -Copyright (C) ITsysCOM GmbH - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - -package general_tests - -// import ( -// "net/rpc" -// "net/rpc/jsonrpc" -// "os" -// "path" -// "reflect" -// "testing" -// "time" - -// "github.com/cgrates/cgrates/config" -// "github.com/cgrates/cgrates/engine" -// "github.com/cgrates/cgrates/utils" -// ) - -// var tutLocalCfgPath string -// var tutFsLocalCfg *config.CGRConfig -// var tutLocalRpc *rpc.Client -// var loadInst utils.LoadInstance // Share load information between tests - -// func TestTutITInitCfg(t *testing.T) { -// tutLocalCfgPath = path.Join(**dataDir, "conf", "samples", "tutmysql") -// // Init config first -// var err error -// tutFsLocalCfg, err = config.NewCGRConfigFromPath(tutLocalCfgPath) -// if err != nil { -// t.Error(err) -// } -// tutFsLocalCfg.DataFolderPath = **dataDir // Share DataFolderPath through config towards StoreDb for Flush() -// config.SetCgrConfig(tutFsLocalCfg) -// } - -// // Remove data in dataDB -// func TestTutITResetDataDb(t *testing.T) { -// if err := engine.InitDataDb(tutFsLocalCfg); err != nil { -// t.Fatal(err) -// } -// } - -// // Start CGR Engine -// func TestTutITStartEngine(t *testing.T) { -// if _, err := engine.StopStartEngine(tutLocalCfgPath, **waitRater); err != nil { -// t.Fatal(err) -// } -// } - -// // Connect rpc client to rater -// func TestTutITRpcConn(t *testing.T) { -// var err error -// tutLocalRpc, err = jsonrpc.Dial(utils.TCP, tutFsLocalCfg.ListenCfg().RPCJSONListen) // We connect over JSON so we can also troubleshoot if needed -// if err != nil { -// t.Fatal(err) -// } -// } - -// // Load the tariff plan, creating accounts and their balances -// func TestTutITLoadTariffPlanFromFolder(t *testing.T) { -// attrs := &utils.AttrLoadTpFromFolder{FolderPath: path.Join(**dataDir, "tariffplans", "oldtutorial")} -// if err := tutLocalRpc.Call(utils.APIerSv2LoadTariffPlanFromFolder, attrs, &loadInst); err != nil { -// t.Error(err) -// } -// time.Sleep(100*time.Millisecond + time.Duration(**waitRater)*time.Millisecond) // Give time for scheduler to execute topups -// } - -// // Check loaded stats -// func TestTutITCacheStats(t *testing.T) { -// var reply string -// if err := tutLocalRpc.Call("APIerSv1.LoadCache", utils.AttrReloadCache{}, &reply); err != nil { -// t.Error(err) -// } else if reply != utils.OK { -// t.Error(reply) -// } -// var rcvStats *utils.CacheStats -// expectedStats := &utils.CacheStats{Destinations: 5, ReverseDestinations: 7, RatingPlans: 4, RatingProfiles: 10, -// Actions: 9, ActionPlans: 4, AccountActionPlans: 5, SharedGroups: 1, DerivedChargers: 1, LcrProfiles: 5, -// Aliases: 1, ReverseAliases: 2, ResourceProfiles: 3, Resources: 3, StatQueues: 1, StatQueueProfiles: 1, Thresholds: 7, -// ThresholdProfiles: 7, Filters: 16, SupplierProfiles: 3, AttributeProfiles: 1, -// CdrStats: 0, Users: 0} // CdrStats and Users are 0 because deprecated. To be removed -// var args utils.AttrCacheStats -// if err := tutLocalRpc.Call(utils.APIerSv1GetCacheStats, args, &rcvStats); err != nil { -// t.Error("Got error on APIerSv1.GetCacheStats: ", err.Error()) -// } else if !reflect.DeepEqual(expectedStats, rcvStats) { -// t.Errorf("Calling APIerSv1.GetCacheStats expected: %+v, received: %+v", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats)) -// } -// expKeys := utils.ArgsCache{ -// DestinationIDs: &[]string{"DST_1003", "DST_1002", "DST_DE_MOBILE", "DST_1007", "DST_FS"}, -// RateProfileIDs: &[]string{"RP_RETAIL1", "RP_GENERIC"}, -// } -// var rcvKeys utils.ArgsCache -// argsAPI := utils.ArgsCacheKeys{ArgsCache: utils.ArgsCache{ -// DestinationIDs: &[]string{}, RateProfileIDs: &[]string{"RP_RETAIL1", "RP_GENERIC", "NONEXISTENT"}}} -// if err := tutLocalRpc.Call(utils.APIerSv1GetCacheKeys, argsAPI, &rcvKeys); err != nil { -// t.Error("Got error on APIerSv1.GetCacheStats: ", err.Error()) -// } else { -// if rcvKeys.DestinationIDs == nil { -// t.Errorf("Expecting rcvKeys.DestinationIDs to not be nil") -// // rcvKeys.DestinationIDs shoud not be nil so exit function -// // to avoid nil segmentation fault; -// // if this happens try to run this test manualy -// return -// } -// if len(*expKeys.DestinationIDs) != len(*rcvKeys.DestinationIDs) { -// t.Errorf("Expected: %+v, received: %+v", expKeys.DestinationIDs, rcvKeys.DestinationIDs) -// } -// if !reflect.DeepEqual(*expKeys.RateProfileIDs, *rcvKeys.RateProfileIDs) { -// t.Errorf("Expected: %+v, received: %+v", expKeys.RateProfileIDs, rcvKeys.RateProfileIDs) -// } -// } -// if _, err := engine.StopStartEngine(tutLocalCfgPath, 1500); err != nil { -// t.Fatal(err) -// } -// var err error -// tutLocalRpc, err = jsonrpc.Dial(utils.TCP, tutFsLocalCfg.ListenCfg().RPCJSONListen) // We connect over JSON so we can also troubleshoot if needed -// if err != nil { -// t.Fatal(err) -// } -// if err := tutLocalRpc.Call(utils.APIerSv1GetCacheStats, args, &rcvStats); err != nil { -// t.Error("Got error on APIerSv1.GetCacheStats: ", err.Error()) -// } else if !reflect.DeepEqual(expectedStats, rcvStats) { -// t.Errorf("Calling APIerSv1.GetCacheStats expected: %+v, received: %+v", expectedStats, rcvStats) -// } -// } - -// // Deprecated -// // func TestTutITGetUsers(t *testing.T) { -// // var users engine.UserProfiles -// // if err := tutLocalRpc.Call("UsersV1.GetUsers", engine.UserProfile{}, &users); err != nil { -// // t.Error("Got error on UsersV1.GetUsers: ", err.Error()) -// // } else if len(users) != 3 { -// // t.Error("Calling UsersV1.GetUsers got users:", len(users)) -// // } -// // } - -// // func TestTutITGetMatchingAlias(t *testing.T) { -// // args := engine.AttrMatchingAlias{ -// // Destination: "1005", -// // Tenant: "cgrates.org", -// // Category: "call", -// // Account: "1006", -// // Subject: "1006", -// // Context: utils.MetaRating, -// // Target: "Account", -// // Original: "1006", -// // } -// // eMatchingAlias := "1002" -// // var matchingAlias string -// // if err := tutLocalRpc.Call("AliasesV1.GetMatchingAlias", args, &matchingAlias); err != nil { -// // t.Error(err) -// // } else if matchingAlias != eMatchingAlias { -// // t.Errorf("Expecting: %s, received: %+v", eMatchingAlias, matchingAlias) -// // } -// // } - -// // Check call costs -// func TestTutITGetCosts(t *testing.T) { -// tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ := utils.ParseDate("2014-08-04T13:00:20Z") -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1002", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// var cc engine.CallCost -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.6 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// // Make sure that the same cost is returned via users aliasing -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: utils.USERS, -// Subject: utils.USERS, -// Account: utils.USERS, -// Destination: "1002", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// ExtraFields: map[string]string{"Uuid": "388539dfd4f5cefee8f488b78c6c244b9e19138e"}, -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.6 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ = utils.ParseDate("2014-08-04T13:01:25Z") -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1002", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.6418 { // 0.01 first minute, 0.04 25 seconds with RT_20CNT -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ = utils.ParseDate("2014-08-04T13:00:20Z") -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1003", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 1 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ = utils.ParseDate("2014-08-04T13:01:25Z") -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1003", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 1.3 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ = utils.ParseDate("2014-08-04T13:00:20Z") -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1004", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 1 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// tStart, _ = utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ = utils.ParseDate("2014-08-04T13:01:25Z") -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1004", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 1.3 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// tStart = time.Date(2014, 8, 4, 13, 0, 0, 0, time.UTC) -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1007", -// TimeStart: tStart, -// TimeEnd: tStart.Add(50 * time.Second), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.5 { -// t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1007", -// TimeStart: tStart, -// TimeEnd: tStart.Add(70 * time.Second), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.62 { -// t.Errorf("Calling Responder.GetCost got callcost: %v", cc.Cost) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1002", -// Account: "1002", -// Destination: "1007", -// TimeStart: tStart, -// TimeEnd: tStart.Add(50 * time.Second), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.5 { -// t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1002", -// Account: "1002", -// Destination: "1007", -// TimeStart: tStart, -// TimeEnd: tStart.Add(70 * time.Second), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.7 { // In case of *disconnect strategy, it will not be applied so we can go on negative costs -// t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1004", -// TimeStart: time.Date(2016, 1, 6, 19, 0, 0, 0, time.UTC), -// TimeEnd: time.Date(2016, 1, 6, 19, 1, 30, 0, time.UTC), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.3249 { // -// t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1004", -// TimeStart: time.Date(2016, 1, 6, 18, 31, 5, 0, time.UTC), -// TimeEnd: time.Date(2016, 1, 6, 18, 32, 35, 0, time.UTC), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 1.3 { // -// t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1002", -// TimeStart: time.Date(2014, 12, 7, 8, 42, 26, 0, time.UTC), -// TimeEnd: time.Date(2014, 12, 7, 8, 44, 26, 0, time.UTC), -// } -// if err := tutLocalRpc.Call(utils.ResponderGetCost, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.Cost != 0.3498 { // -// t.Errorf("Calling Responder.GetCost got callcost: %s", cc.AsJSON()) -// } -// } - -// // Check call costs -// func TestTutITMaxDebit(t *testing.T) { -// tStart := time.Date(2014, 8, 4, 13, 0, 0, 0, time.UTC) -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1002", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tStart.Add(20 * time.Second), -// } -// var cc engine.CallCost -// if err := tutLocalRpc.Call(utils.ResponderMaxDebit, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.GetDuration() == 20 { -// t.Errorf("Calling Responder.MaxDebit got callcost: %v", cc.GetDuration()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1003", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tStart.Add(200 * time.Second), -// } -// if err := tutLocalRpc.Call(utils.ResponderMaxDebit, cd, &cc); err != nil { -// t.Error("Got error on Responder.MaxDebit: ", err.Error()) -// } else if cc.GetDuration() == 200 { -// t.Errorf("Calling Responder.MaxDebit got duration: %v", cc.GetDuration()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1007", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tStart.Add(120 * time.Second), -// } -// cd.CgrID = "1" -// if err := tutLocalRpc.Call(utils.ResponderMaxDebit, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.GetDuration() == 120 { -// t.Errorf("Calling Responder.MaxDebit got callcost: %v", cc.GetDuration()) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1004", -// Account: "1004", -// Destination: "1007", -// DurationIndex: 0, -// TimeStart: tStart, -// TimeEnd: tStart.Add(120 * time.Second), -// } -// cd.CgrID = "2" -// if err := tutLocalRpc.Call(utils.ResponderMaxDebit, cd, &cc); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if cc.GetDuration() != 62*time.Second { // We have as strategy *dsconnect -// t.Errorf("Calling Responder.MaxDebit got callcost: %v", cc.GetDuration()) -// } -// var maxTime float64 -// if err := tutLocalRpc.Call("Responder.GetMaxSessionTime", cd, &maxTime); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if maxTime != 62000000000 { // We have as strategy *dsconnect -// t.Errorf("Calling Responder.GetMaxSessionTime got maxTime: %f", maxTime) -// } -// } - -// // Check call costs -// func TestTutITDerivedMaxSessionTime(t *testing.T) { -// tStart := time.Date(2014, 8, 4, 13, 0, 0, 0, time.UTC) -// ev := engine.CDR{ -// CGRID: utils.Sha1("testevent1", tStart.String()), -// ToR: utils.VOICE, -// OriginID: "testevent1", -// OriginHost: "127.0.0.1", -// RequestType: utils.META_PREPAID, -// Tenant: "cgrates.org", -// Category: "call", -// Account: "1004", -// Subject: "1004", -// Destination: "1007", -// SetupTime: tStart, -// AnswerTime: tStart, -// Usage: 120 * time.Second, -// Cost: -1, -// } -// var maxTime float64 -// if err := tutLocalRpc.Call("Responder.GetDerivedMaxSessionTime", ev, &maxTime); err != nil { -// t.Error("Got error on Responder.GetCost: ", err.Error()) -// } else if maxTime != 62000000000 { // We have as strategy *dsconnect -// t.Errorf("Calling Responder.GetMaxSessionTime got maxTime: %f", maxTime) -// } -// } - -// // Check MaxUsage -// func TestTutITMaxUsage(t *testing.T) { -// setupReq := &engine.UsageRecord{ToR: utils.VOICE, -// RequestType: utils.META_PREPAID, Tenant: "cgrates.org", Category: "call", -// Account: "1003", Subject: "1003", Destination: "1001", -// SetupTime: "2014-08-04T13:00:00Z", Usage: "1s", -// } -// var maxTime float64 -// if err := tutLocalRpc.Call("APIerSv2.GetMaxUsage", setupReq, &maxTime); err != nil { -// t.Error(err) -// } else if maxTime != 1 { -// t.Errorf("Calling APIerSv2.MaxUsage got maxTime: %f", maxTime) -// } -// setupReq = &engine.UsageRecord{ToR: utils.VOICE, RequestType: utils.MetaRated, Tenant: "cgrates.org", Category: "call", -// Account: "test_max_usage", Destination: "1001", -// SetupTime: "2014-08-04T13:00:00Z", -// } -// if err := tutLocalRpc.Call("APIerSv2.GetMaxUsage", setupReq, &maxTime); err != nil { -// t.Error(err) -// } else if maxTime != -1 { -// t.Errorf("Calling APIerSv2.MaxUsage got maxTime: %f", maxTime) -// } -// } - -// // Check DebitUsage -// func TestTutITDebitUsage(t *testing.T) { -// setupReq := &engine.UsageRecord{ToR: utils.VOICE, RequestType: utils.META_PREPAID, Tenant: "cgrates.org", Category: "call", -// Account: "1003", Subject: "1003", Destination: "1001", -// AnswerTime: "2014-08-04T13:00:00Z", Usage: "1", -// } -// var reply string -// if err := tutLocalRpc.Call("APIerSv2.DebitUsage", setupReq, &reply); err != nil { -// t.Error(err) -// } else if reply != utils.OK { -// t.Error("Calling APIerSv2.DebitUsage reply: ", reply) -// } -// } - -// // Test CDR from external sources -// func TestTutITProcessExternalCdr(t *testing.T) { -// cdr := &engine.ExternalCDR{ToR: utils.VOICE, -// OriginID: "testextcdr1", OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1003", Subject: "1003", Destination: "1001", -// SetupTime: "2014-08-04T13:00:00Z", AnswerTime: "2014-08-04T13:00:07Z", -// Usage: "1", ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, -// } -// var reply string -// if err := tutLocalRpc.Call("CdrsV1.ProcessExternalCdr", cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// } - -// // Test CDR involving UserProfile -// func TestTutITProcessExternalCdrUP(t *testing.T) { -// cdr := &engine.ExternalCDR{ToR: utils.VOICE, -// OriginID: "testextcdr2", OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, -// RequestType: utils.USERS, Tenant: utils.USERS, Account: utils.USERS, Destination: "1001", -// SetupTime: "2014-08-04T13:00:00Z", AnswerTime: "2014-08-04T13:00:07Z", Usage: "2s", -// ExtraFields: map[string]string{"Cli": "+4986517174964", "fieldextr2": "valextr2", "SysUserName": utils.USERS}, -// } -// var reply string -// if err := tutLocalRpc.Call("CdrsV1.ProcessExternalCdr", cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// time.Sleep(time.Duration(**waitRater) * time.Millisecond) -// eCdr := &engine.ExternalCDR{CGRID: "63a8d2bfeca2cfb790826c3ec461696d6574cfde", OrderID: 2, -// ToR: utils.VOICE, -// OriginID: "testextcdr2", OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1004", Subject: "1004", Destination: "1001", -// SetupTime: time.Date(2014, 8, 4, 13, 0, 0, 0, time.UTC).Local().Format(time.RFC3339), -// AnswerTime: time.Date(2014, 8, 4, 13, 0, 7, 0, time.UTC).Local().Format(time.RFC3339), Usage: "2s", -// ExtraFields: map[string]string{"Cli": "+4986517174964", "fieldextr2": "valextr2", "SysUserName": "danb4"}, -// RunID: utils.MetaDefault, Cost: 1} -// var cdrs []*engine.ExternalCDR -// req := utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, -// Accounts: []string{"1004"}, DestinationPrefixes: []string{"1001"}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].CGRID != eCdr.CGRID { -// t.Errorf("Unexpected CGRID for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].ToR != eCdr.ToR { -// t.Errorf("Unexpected ToR for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Source != eCdr.Source { -// t.Errorf("Unexpected Source for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].RequestType != eCdr.RequestType { -// t.Errorf("Unexpected RequestType for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Tenant != eCdr.Tenant { -// t.Errorf("Unexpected Tenant for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Category != eCdr.Category { -// t.Errorf("Unexpected Category for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Account != eCdr.Account { -// t.Errorf("Unexpected Account for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Subject != eCdr.Subject { -// t.Errorf("Unexpected Subject for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Destination != eCdr.Destination { -// t.Errorf("Unexpected Destination for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].SetupTime != eCdr.SetupTime { -// t.Errorf("Unexpected SetupTime for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].AnswerTime != eCdr.AnswerTime { -// t.Errorf("Unexpected AnswerTime for CDR: %+v", cdrs[0]) -// } -// if cdrs[0].Usage != eCdr.Usage { -// t.Errorf("Unexpected Usage for CDR: %+v", cdrs[0]) -// } -// } -// } - -// func TestTutITCostErrors(t *testing.T) { -// cdr := &engine.ExternalCDR{ToR: utils.VOICE, -// OriginID: "TestTutIT_1", OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "fake", Account: "2001", Subject: "2001", Destination: "1001", -// SetupTime: "2014-08-04T13:00:00Z", AnswerTime: "2014-08-04T13:00:07Z", -// Usage: "1", ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, -// } -// var reply string -// if err := tutLocalRpc.Call("CdrsV1.ProcessExternalCdr", cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// time.Sleep(time.Duration(**waitRater) * time.Millisecond) -// var cdrs []*engine.ExternalCDR -// req := utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, Accounts: []string{cdr.Account}, DestinationPrefixes: []string{cdr.Destination}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].OriginID != cdr.OriginID { -// t.Errorf("Unexpected OriginID for Cdr received: %+v", cdrs[0]) -// } -// if cdrs[0].Cost != -1 { -// t.Errorf("Unexpected Cost for Cdr received: %+v", cdrs[0]) -// } -// } -// cdr2 := &engine.ExternalCDR{ToR: utils.VOICE, -// OriginID: "TestTutIT_2", OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.MetaPostpaid , -// Tenant: "cgrates.org", Category: "fake", Account: "2002", Subject: "2002", Destination: "1001", -// SetupTime: "2014-08-04T13:00:00Z", AnswerTime: "2014-08-04T13:00:07Z", -// Usage: "1", ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, -// } -// if err := tutLocalRpc.Call("CdrsV1.ProcessExternalCdr", cdr2, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// time.Sleep(time.Duration(**waitRater) * time.Millisecond) // Give time for CDR to be processed -// req = utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, Accounts: []string{cdr2.Account}, DestinationPrefixes: []string{cdr2.Destination}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].OriginID != cdr2.OriginID { -// t.Errorf("Unexpected OriginID for Cdr received: %+v", cdrs[0]) -// } -// if cdrs[0].Cost != -1 { -// t.Errorf("Unexpected Cost for Cdr received: %+v", cdrs[0]) -// } -// } -// cdr3 := &engine.ExternalCDR{ToR: utils.VOICE, -// OriginID: "TestTutIT_3", OriginHost: "192.168.1.1", Source: utils.UNIT_TEST, RequestType: utils.MetaPostpaid , -// Tenant: "cgrates.org", Category: "fake", Account: "1001", Subject: "1001", Destination: "2002", -// SetupTime: "2014-08-04T13:00:00Z", AnswerTime: "2014-08-04T13:00:07Z", -// Usage: "1", ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}, -// } -// if err := tutLocalRpc.Call("CdrsV1.ProcessExternalCdr", cdr3, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// time.Sleep(time.Duration(**waitRater) * time.Millisecond) // Give time for CDR to be processed -// req = utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, Accounts: []string{cdr3.Account}, DestinationPrefixes: []string{cdr3.Destination}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].OriginID != cdr3.OriginID { -// t.Errorf("Unexpected OriginID for Cdr received: %+v", cdrs[0]) -// } -// if cdrs[0].Cost != -1 { -// t.Errorf("Unexpected Cost for Cdr received: %+v", cdrs[0]) -// } -// } -// } - -// // Make sure queueids were created -// func TestTutITCdrStats(t *testing.T) { -// var queueIds []string -// eQueueIds := []string{"CDRST1", "CDRST_1001", "CDRST_1002", "CDRST_1003", "STATS_SUPPL1", "STATS_SUPPL2"} -// if err := tutLocalRpc.Call("CDRStatsV1.GetQueueIds", "", &queueIds); err != nil { -// t.Error("Calling CDRStatsV1.GetQueueIds, got error: ", err.Error()) -// } else if len(eQueueIds) != len(queueIds) { -// t.Errorf("Expecting: %v, received: %v", eQueueIds, queueIds) -// } -// } - -// func TestTutITLeastCost(t *testing.T) { -// tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1005", -// Account: "1005", -// Destination: "1002", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eStLcr := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: "DST_1002", RPCategory: "lcr_profile2", Strategy: engine.LCR_STRATEGY_LOWEST, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile2:suppl3", Cost: 0.01, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile2:suppl1", Cost: 0.6, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile2:suppl2", Cost: 1.2, Duration: 60 * time.Second}, -// }, -// } -// var lcr engine.LCRCost -// cd.CgrID = "10" -// cd.RunID = "10" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts, lcr.SupplierCosts) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1005", -// Account: "1005", -// Destination: "1003", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eStLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_LOWEST, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 1.2, Duration: 60 * time.Second}, -// }, -// } -// eStLcr2 := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_LOWEST, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 1.2, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second}, -// }, -// } -// cd.CgrID = "11" -// cd.RunID = "11" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) && !reflect.DeepEqual(eStLcr2.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// } - -// // Check LCR -// func TestTutITLcrStatic(t *testing.T) { -// tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1002", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eStLcr := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: "DST_1002", RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_STATIC, StrategyParams: "suppl2;suppl1", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 0.6, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second}, -// }, -// } -// var lcr engine.LCRCost -// cd.CgrID = "1" -// cd.RunID = "1" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1001", -// Account: "1001", -// Destination: "1003", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eStLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_STATIC, StrategyParams: "suppl1;suppl2", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 1.2, Duration: 60 * time.Second}, -// }, -// } -// cd.CgrID = "2" -// cd.RunID = "2" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// } - -// func TestTutITLcrHighestCost(t *testing.T) { -// tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1002", -// Account: "1002", -// Destination: "1002", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eStLcr := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: "DST_1002", RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_HIGHEST, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 0.6, Duration: 60 * time.Second}, -// }, -// } -// var lcr engine.LCRCost -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// // LCR with Alias -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1006", -// Account: "1006", -// Destination: "1002", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(eStLcr.Entry), utils.ToJSON(lcr.Entry)) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// } - -// func TestTutITLcrQos(t *testing.T) { -// tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1002", -// Account: "1002", -// Destination: "1003", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eStLcr := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", -// Strategy: engine.LCR_STRATEGY_QOS, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", -// Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: -1, engine.ACC: -1, engine.TCC: -1, -// engine.ASR: -1, engine.ACD: -1, engine.DDC: -1}}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", -// Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: -1, engine.ACC: -1, engine.TCC: -1, -// engine.ASR: -1, engine.ACD: -1, engine.DDC: -1}}, -// }, -// } -// /* -// eStLcr2 := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", -// Strategy: engine.LCR_STRATEGY_QOS, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// &engine.LCRSupplierCost{Supplier: "*out:cgrates.org:lcr_profile1:suppl2", -// Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: -1, engine.ACC: -1, engine.TCC: -1, -// engine.ASR: -1, engine.ACD: -1, engine.DDC: -1}}, -// &engine.LCRSupplierCost{Supplier: "*out:cgrates.org:lcr_profile1:suppl1", -// Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: -1, engine.ACC: -1, engine.TCC: -1, -// engine.ASR: -1, engine.ACD: -1, engine.DDC: -1}}, -// }, -// } -// */ -// var lcr engine.LCRCost -// // Since there is no real quality difference, the suppliers will come in random order here -// cd.CgrID = "3" -// cd.RunID = "3" -// /* -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// } else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) && -// !reflect.DeepEqual(eStLcr2.SupplierCosts, lcr.SupplierCosts) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// */ -// // Post some CDRs to influence stats -// testCdr1 := &engine.CDR{CGRID: utils.Sha1("testcdr1", -// time.Date(2013, 12, 7, 8, 42, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testcdr1", OriginHost: "192.168.1.1", -// Source: "TEST_QOS_LCR", RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1001", -// Subject: "1001", Destination: "1002", -// SetupTime: time.Date(2014, 12, 7, 8, 42, 24, 0, time.UTC), -// AnswerTime: time.Date(2014, 12, 7, 8, 42, 26, 0, time.UTC), -// Usage: 2 * time.Minute, -// ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}} -// testCdr2 := &engine.CDR{CGRID: utils.Sha1("testcdr2", -// time.Date(2013, 12, 7, 8, 42, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testcdr2", OriginHost: "192.168.1.1", -// Source: "TEST_QOS_LCR", RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1002", -// Subject: "1002", Destination: "1003", -// SetupTime: time.Date(2014, 12, 7, 8, 42, 24, 0, time.UTC), -// AnswerTime: time.Date(2014, 12, 7, 8, 42, 26, 0, time.UTC), -// Usage: 90 * time.Second, -// ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}} -// var reply string -// for _, cdr := range []*engine.CDR{testCdr1, testCdr2} { -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// } -// // Based on stats, supplier1 should always be better since he has a higer ACD -// eStLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, -// RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS, -// StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// { -// Supplier: "*out:cgrates.org:lcr_profile1:suppl1", -// Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, -// engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// { -// Supplier: "*out:cgrates.org:lcr_profile1:suppl2", -// Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 90, engine.ACC: 0.325, -// engine.TCC: 0.325, engine.ASR: 100, engine.ACD: 90}}, -// }, -// } -// cd.CgrID = "4" -// cd.RunID = "4" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// //} else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) && !reflect.DeepEqual(eStLcr2.SupplierCosts, lcr.SupplierCosts) { -// // t.Errorf("Expecting: %+v, %+v, received: %+v, %+v", eStLcr.SupplierCosts[0], eStLcr.SupplierCosts[1], lcr.SupplierCosts[0], lcr.SupplierCosts[1]) -// } -// testCdr3 := &engine.CDR{CGRID: utils.Sha1("testcdr3", time.Date(2013, 12, 7, 8, 42, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testcdr3", OriginHost: "192.168.1.1", Source: "TEST_QOS_LCR", RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1003", Subject: "1003", Destination: "1004", -// SetupTime: time.Date(2014, 12, 7, 8, 42, 24, 0, time.UTC), AnswerTime: time.Date(2014, 12, 7, 8, 42, 26, 0, time.UTC), -// Usage: 180 * time.Second} -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, testCdr3, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// // Since ACD has considerably increased for supplier2, we should have it as first prio now -// eStLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS, StrategyParams: "", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 270, engine.ACC: 0.3625, engine.TCC: 0.725, engine.ASR: 100, engine.ACD: 135}}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// }, -// } -// cd.CgrID = "5" -// cd.RunID = "5" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) -// //} else if !reflect.DeepEqual(eStLcr.SupplierCosts, lcr.SupplierCosts) && !reflect.DeepEqual(eStLcr2.SupplierCosts, lcr.SupplierCosts) { -// // t.Errorf("Expecting: %+v, %+v, received: %+v, %+v", eStLcr.SupplierCosts[0], eStLcr.SupplierCosts[1], lcr.SupplierCosts[0], lcr.SupplierCosts[1]) -// } -// } - -// func TestTutITLcrQosThreshold(t *testing.T) { -// tStart, _ := utils.ParseDate("2014-08-04T13:00:00Z") -// tEnd, _ := utils.ParseDate("2014-08-04T13:01:00Z") -// cd := engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1003", -// Account: "1003", -// Destination: "1002", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eLcr := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: "DST_1002", RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS_THRESHOLD, StrategyParams: "20;;;;2m;;;;;;;", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 0.6, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 270, engine.ACC: 0.3625, engine.TCC: 0.725, engine.ASR: 100, engine.ACD: 135}}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// }, -// } -// var lcr engine.LCRCost -// cd.CgrID = "6" -// cd.RunID = "6" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eLcr.Entry, lcr.Entry) -// //} else if !reflect.DeepEqual(eLcr.SupplierCosts, lcr.SupplierCosts) { -// // t.Errorf("Expecting: %+v, %+v received: %+v, %+v", eLcr.SupplierCosts[0], eLcr.SupplierCosts[1], lcr.SupplierCosts[0], lcr.SupplierCosts[1]) -// } -// testCdr4 := &engine.CDR{CGRID: utils.Sha1("testcdr4", time.Date(2013, 12, 7, 8, 42, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testcdr4", OriginHost: "192.168.1.1", Source: "TEST_QOS_LCR", RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1003", Subject: "1003", Destination: "1004", -// SetupTime: time.Date(2014, 12, 7, 8, 42, 24, 0, time.UTC), AnswerTime: time.Date(2014, 12, 7, 8, 42, 26, 0, time.UTC), -// Usage: 60 * time.Second} -// var reply string -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, testCdr4, &reply); err != nil { // Should drop ACD under the 2m required by threshold, removing suppl2 from lcr -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// eLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: "DST_1002", RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS_THRESHOLD, StrategyParams: "20;;;;2m;;;;;;;", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// }, -// } -// cd.CgrID = "7" -// cd.RunID = "7" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eLcr.Entry, lcr.Entry) -// //} else if !reflect.DeepEqual(eLcr.SupplierCosts, lcr.SupplierCosts) { -// // t.Errorf("Expecting: %+v, received: %+v", eLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// cd = engine.CallDescriptor{ -// Category: "call", -// Tenant: "cgrates.org", -// Subject: "1003", -// Account: "1003", -// Destination: "1004", -// TimeStart: tStart, -// TimeEnd: tEnd, -// } -// eLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS_THRESHOLD, StrategyParams: "40;;;;90s;;;;;;;", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 330, engine.ACC: 0.3416666667, engine.TCC: 1.025, engine.ASR: 100, engine.ACD: 110}}, -// }, -// } -// /*eLcr2 := &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS_THRESHOLD, StrategyParams: "40;;90s;;;;;;;", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// &engine.LCRSupplierCost{Supplier: "*out:cgrates.org:lcr_profile1:suppl2", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 330, engine.ACC: 0.3416666667, engine.TCC: 1.025, engine.ASR: 100, engine.ACD: 110}}, -// &engine.LCRSupplierCost{Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// }, -// } -// */ -// cd.CgrID = "8" -// cd.RunID = "8" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eLcr.Entry, lcr.Entry) -// //} else if !reflect.DeepEqual(eLcr.SupplierCosts, lcr.SupplierCosts) && !reflect.DeepEqual(eLcr2.SupplierCosts, lcr.SupplierCosts) { -// // t.Errorf("Expecting: %+v, received: %+v", eLcr.SupplierCosts[1], lcr.SupplierCosts[1]) -// } -// testCdr5 := &engine.CDR{CGRID: utils.Sha1("testcdr5", time.Date(2013, 12, 7, 8, 42, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testcdr5", OriginHost: "192.168.1.1", Source: "TEST_QOS_LCR", RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1003", Subject: "1003", Destination: "1004", -// SetupTime: time.Date(2014, 12, 7, 8, 42, 24, 0, time.UTC), AnswerTime: time.Date(2014, 12, 7, 8, 42, 26, 0, time.UTC), -// Usage: time.Second} -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, testCdr5, &reply); err != nil { // Should drop ACD under the 1m required by threshold, removing suppl2 from lcr -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// eLcr = &engine.LCRCost{ -// Entry: &engine.LCREntry{DestinationId: utils.ANY, RPCategory: "lcr_profile1", Strategy: engine.LCR_STRATEGY_QOS_THRESHOLD, StrategyParams: "40;;;;90s;;;;;;;", Weight: 10.0}, -// SupplierCosts: []*engine.LCRSupplierCost{ -// {Supplier: "*out:cgrates.org:lcr_profile1:suppl1", Cost: 1.2, Duration: 60 * time.Second, -// QOS: map[string]float64{engine.TCD: 240, engine.ACC: 0.35, engine.TCC: 0.7, engine.ASR: 100, engine.ACD: 120}}, -// }, -// } -// cd.CgrID = "9" -// cd.RunID = "9" -// if err := tutLocalRpc.Call("Responder.GetLCR", cd, &lcr); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eLcr.Entry, lcr.Entry) { -// t.Errorf("Expecting: %+v, received: %+v", eLcr.Entry, lcr.Entry) -// //} else if !reflect.DeepEqual(eLcr.SupplierCosts, lcr.SupplierCosts) { -// // t.Errorf("Expecting: %+v, received: %+v", eLcr.SupplierCosts[0], lcr.SupplierCosts[0]) -// } -// } - -// // Test adding the account via API, using the data previously devined in .csv -// func TestTutITSetAccount(t *testing.T) { -// var reply string -// attrs := &v2.AttrSetAccount{Tenant: "cgrates.org", Account: "tutacnt1", ActionPlanIDs: &[]string{"PACKAGE_10"}, ActionTriggerIDs: &[]string{"STANDARD_TRIGGERS"}, ReloadScheduler: true} -// if err := tutLocalRpc.Call(utils.APIerSv2SetAccount, attrs, &reply); err != nil { -// t.Error("Got error on APIerSv2.SetAccount: ", err.Error()) -// } else if reply != utils.OK { -// t.Errorf("Calling APIerSv2.SetAccount received: %s", reply) -// } -// type AttrGetAccounts struct { -// Tenant string -// AccountIds []string -// Offset int // Set the item offset -// Limit int // Limit number of items retrieved -// } -// time.Sleep(time.Duration(**waitRater) * time.Millisecond) // Give time for scheduler to execute topups -// var acnts []*engine.Account -// if err := tutLocalRpc.Call("APIerSv2.GetAccounts", utils.AttrGetAccounts{Tenant: attrs.Tenant, AccountIds: []string{attrs.Account}}, &acnts); err != nil { -// t.Error(err) -// } else if len(acnts) != 1 { -// t.Errorf("Accounts received: %+v", acnts) -// } else { -// acnt := acnts[0] -// dta, _ := utils.NewTAFromAccountKey(acnt.ID) -// if dta.Tenant != attrs.Tenant || dta.Account != attrs.Account { -// t.Error("Unexpected account id received: ", acnt.ID) -// } -// if balances := acnt.BalanceMap["*monetary"]; len(balances) != 1 { -// t.Errorf("Unexpected balances found: %+v", balances) -// } -// if len(acnt.ActionTriggers) != 4 { -// t.Errorf("Unexpected action triggers for account: %+v", acnt.ActionTriggers) -// } -// if acnt.AllowNegative { -// t.Error("AllowNegative should not be set") -// } -// if acnt.Disabled { -// t.Error("Disabled should not be set") -// } -// } -// attrs = &v2.AttrSetAccount{Tenant: "cgrates.org", Account: "tutacnt1", ActionPlanIDs: &[]string{"PACKAGE_10"}, ActionTriggerIDs: &[]string{"STANDARD_TRIGGERS"}, AllowNegative: utils.BoolPointer(true), Disabled: utils.BoolPointer(true), ReloadScheduler: true} - -// if err := tutLocalRpc.Call(utils.APIerSv2SetAccount, attrs, &reply); err != nil { -// t.Error("Got error on APIerSv2.SetAccount: ", err.Error()) -// } else if reply != utils.OK { -// t.Errorf("Calling APIerSv2.SetAccount received: %s", reply) -// } -// if err := tutLocalRpc.Call("APIerSv2.GetAccounts", utils.AttrGetAccounts{Tenant: attrs.Tenant, AccountIds: []string{attrs.Account}}, &acnts); err != nil { -// t.Error(err) -// } else if len(acnts) != 1 { -// t.Errorf("Accounts received: %+v", acnts) -// } else { -// acnt := acnts[0] -// dta, _ := utils.NewTAFromAccountKey(acnt.ID) -// if dta.Tenant != attrs.Tenant || dta.Account != attrs.Account { -// t.Error("Unexpected account id received: ", acnt.ID) -// } -// if balances := acnt.BalanceMap["*monetary"]; len(balances) != 1 { -// t.Errorf("Unexpected balances found: %+v", balances) -// } -// if len(acnt.ActionTriggers) != 4 { -// t.Errorf("Unexpected action triggers for account: %+v", acnt.ActionTriggers) -// } -// if !acnt.AllowNegative { -// t.Error("AllowNegative should be set") -// } -// if !acnt.Disabled { -// t.Error("Disabled should be set") -// } -// } -// attrs = &v2.AttrSetAccount{Tenant: "cgrates.org", Account: "tutacnt1", ActionPlanIDs: &[]string{"PACKAGE_1001"}, ActionTriggerIDs: &[]string{"CDRST1_WARN"}, AllowNegative: utils.BoolPointer(true), Disabled: utils.BoolPointer(true), ReloadScheduler: true} - -// if err := tutLocalRpc.Call(utils.APIerSv2SetAccount, attrs, &reply); err != nil { -// t.Error("Got error on APIerSv2.SetAccount: ", err.Error()) -// } else if reply != utils.OK { -// t.Errorf("Calling APIerSv2.SetAccount received: %s", reply) -// } -// time.Sleep(100*time.Millisecond + time.Duration(**waitRater)*time.Millisecond) // Give time for scheduler to execute topups -// if err := tutLocalRpc.Call("APIerSv2.GetAccounts", utils.AttrGetAccounts{Tenant: attrs.Tenant, AccountIds: []string{attrs.Account}}, &acnts); err != nil { -// t.Error(err) -// } else if len(acnts) != 1 { -// t.Errorf("Accounts received: %+v", acnts) -// } else { -// acnt := acnts[0] -// dta, _ := utils.NewTAFromAccountKey(acnt.ID) -// if dta.Tenant != attrs.Tenant || dta.Account != attrs.Account { -// t.Error("Unexpected account id received: ", acnt.ID) -// } -// if balances := acnt.BalanceMap["*monetary"]; len(balances) != 3 { -// t.Errorf("Unexpected balances found: %+v", balances) -// } -// if len(acnt.ActionTriggers) != 7 { -// t.Errorf("Unexpected action triggers for account: %+v", acnt.ActionTriggers) -// } -// if !acnt.AllowNegative { -// t.Error("AllowNegative should be set") -// } -// if !acnt.Disabled { -// t.Error("Disabled should be set") -// } -// } -// } - -// /* -// // Make sure all stats queues were updated -// func TestTutITCdrStatsAfter(t *testing.T) { -// var statMetrics map[string]float64 -// eMetrics := map[string]float64{engine.ACD: 90.2, engine.ASR: 100, engine.TCC: 1.675, engine.TCD: 451, engine.ACC: 0.335} -// if err := tutLocalRpc.Call("CDRStatsV1.GetMetrics", v1.AttrGetMetrics{StatsQueueId: "CDRST1"}, &statMetrics); err != nil { -// t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error()) -// } else if !reflect.DeepEqual(eMetrics, statMetrics) { -// t.Errorf("Expecting: %v, received: %v", eMetrics, statMetrics) -// } -// eMetrics = map[string]float64{engine.ACC: 0.35, engine.ACD: 120, engine.ASR: 100, engine.TCC: 1.675, engine.TCD: 451} -// if err := tutLocalRpc.Call("CDRStatsV1.GetMetrics", v1.AttrGetMetrics{StatsQueueId: "CDRST_1001"}, &statMetrics); err != nil { -// t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error()) -// } else if !reflect.DeepEqual(eMetrics, statMetrics) { -// t.Errorf("Expecting: %v, received: %v", eMetrics, statMetrics) -// } -// eMetrics = map[string]float64{engine.TCD: 451, engine.ACC: 0.325, engine.ACD: 90, engine.ASR: 100, engine.TCC: 1.675} -// if err := tutLocalRpc.Call("CDRStatsV1.GetMetrics", v1.AttrGetMetrics{StatsQueueId: "CDRST_1002"}, &statMetrics); err != nil { -// t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error()) -// } else if !reflect.DeepEqual(eMetrics, statMetrics) { -// t.Errorf("Expecting: %v, received: %v", eMetrics, statMetrics) -// } -// eMetrics = map[string]float64{engine.TCC: 1.675, engine.TCD: 451, engine.ACC: 0.325, engine.ACD: 90, engine.ASR: 100} -// if err := tutLocalRpc.Call("CDRStatsV1.GetMetrics", v1.AttrGetMetrics{StatsQueueId: "CDRST_1003"}, &statMetrics); err != nil { -// t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error()) -// } else if !reflect.DeepEqual(eMetrics, statMetrics) { -// t.Errorf("Expecting: %v, received: %v", eMetrics, statMetrics) -// } -// eMetrics = map[string]float64{engine.TCC: 0.7, engine.TCD: 240, engine.ACC: 0.35, engine.ACD: 120, engine.ASR: 100} -// if err := tutLocalRpc.Call("CDRStatsV1.GetMetrics", v1.AttrGetMetrics{StatsQueueId: "STATS_SUPPL1"}, &statMetrics); err != nil { -// t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error()) -// //} else if !reflect.DeepEqual(eMetrics, statMetrics) { -// // t.Errorf("Expecting: %v, received: %v", eMetrics, statMetrics) -// } -// eMetrics = map[string]float64{engine.TCD: 331, engine.ACC: 0.33125, engine.ACD: 82.75, engine.ASR: 100, engine.TCC: 1.325} -// if err := tutLocalRpc.Call("CDRStatsV1.GetMetrics", v1.AttrGetMetrics{StatsQueueId: "STATS_SUPPL2"}, &statMetrics); err != nil { -// t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error()) -// } else if !reflect.DeepEqual(eMetrics, statMetrics) { -// t.Errorf("Expecting: %v, received: %v", eMetrics, statMetrics) -// } -// } -// */ - -// /* FixMe : In CallCost (Timespans) Increments is not populated so does not convert properly CallCost to Event - -// func TestTutITPrepaidCDRWithSMCost(t *testing.T) { -// cdr := &engine.CDR{CGRID: utils.Sha1("testprepaid1", time.Date(2016, 4, 6, 13, 29, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testprepaid1", OriginHost: "192.168.1.1", -// Source: "TEST_PREPAID_CDR_SMCOST1", RequestType: utils.META_PREPAID, Tenant: "cgrates.org", -// RunID: utils.MetaDefault, -// Category: "call", Account: "1001", Subject: "1001", Destination: "1003", -// SetupTime: time.Date(2016, 4, 6, 13, 29, 24, 0, time.UTC), -// AnswerTime: time.Date(2016, 4, 6, 13, 30, 0, 0, time.UTC), -// Usage: 90 * time.Second, -// ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}} - -// cc := &engine.CallCost{ -// Category: "call", -// Account: "1001", -// Subject: "1001", -// Tenant: "cgrates.org", -// Destination: "1003", -// Timespans: []*engine.TimeSpan{ -// &engine.TimeSpan{ -// TimeStart: time.Date(2016, 4, 6, 13, 30, 0, 0, time.UTC), -// TimeEnd: time.Date(2016, 4, 6, 13, 31, 30, 0, time.UTC), -// DurationIndex: 0, -// RateInterval: &engine.RateInterval{ -// Rating: &engine.RIRate{ -// Rates: engine.RateGroups{ -// &engine.Rate{ -// GroupIntervalStart: 0, -// Value: 0.01, -// RateIncrement: 10 * time.Second, -// RateUnit: time.Second}}}}, -// }, -// }, -// ToR: utils.VOICE} -// smCost := &engine.SMCost{CGRID: cdr.CGRID, -// RunID: utils.MetaDefault, -// OriginHost: cdr.OriginHost, -// OriginID: cdr.OriginID, -// CostSource: "TestTutITPrepaidCDRWithSMCost", -// Usage: cdr.Usage, -// CostDetails: engine.NewEventCostFromCallCost(cc, cdr.CGRID, utils.MetaDefault), -// } -// var reply string -// if err := tutLocalRpc.Call("CdrsV1.StoreSMCost", &engine.AttrCDRSStoreSMCost{Cost: smCost}, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// time.Sleep(time.Duration(**waitRater) * time.Millisecond) // Give time for CDR to be processed -// var cdrs []*engine.ExternalCDR -// req := utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, CGRIDs: []string{cdr.CGRID}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].OriginID != cdr.OriginID { -// t.Errorf("Unexpected OriginID for Cdr received: %+v", cdrs[0].OriginID) -// } -// if cdrs[0].Cost != 0.9 { -// t.Errorf("Unexpected Cost for Cdr received: %+v", utils.ToJSON(cdrs[0].Cost)) -// } -// } -// } -// */ - -// func TestTutITPrepaidCDRWithoutSMCost(t *testing.T) { -// cdr := &engine.CDR{CGRID: utils.Sha1("testprepaid2", time.Date(2016, 4, 6, 13, 29, 24, 0, time.UTC).String()), -// ToR: utils.VOICE, OriginID: "testprepaid2", OriginHost: "192.168.1.1", Source: "TEST_PREPAID_CDR_NO_SMCOST1", RequestType: utils.META_PREPAID, -// Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1003", -// SetupTime: time.Date(2016, 4, 6, 13, 29, 24, 0, time.UTC), AnswerTime: time.Date(2016, 4, 6, 13, 30, 0, 0, time.UTC), -// Usage: 90 * time.Second, -// ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}} -// var reply string -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// /* -// time.Sleep(7000 * time.Millisecond) // Give time for CDR to be processed -// var cdrs []*engine.ExternalCDR -// req := utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, CGRIDs: []string{cdr.CGRID}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].OriginID != cdr.OriginID { -// t.Errorf("Unexpected OriginID for Cdr received: %+v", cdrs[0]) -// } -// if cdrs[0].Cost != 0.9 { -// t.Errorf("Unexpected Cost for Cdr received: %+v", cdrs[0]) -// } -// } -// */ -// } - -// func TestTutITExportCDR(t *testing.T) { -// cdr := &engine.CDR{ToR: utils.VOICE, OriginID: "testexportcdr1", OriginHost: "192.168.1.1", Source: "TestTutITExportCDR", RequestType: utils.MetaRated, -// Tenant: "cgrates.org", Category: "call", Account: "1001", Subject: "1001", Destination: "1003", -// SetupTime: time.Date(2016, 11, 30, 17, 5, 24, 0, time.UTC), AnswerTime: time.Date(2016, 11, 30, 17, 6, 4, 0, time.UTC), -// Usage: 98 * time.Second, -// ExtraFields: map[string]string{"field_extr1": "val_extr1", "fieldextr2": "valextr2"}} -// cdr.ComputeCGRID() -// var reply string -// if err := tutLocalRpc.Call(utils.CDRsV1ProcessCDR, cdr, &reply); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if reply != utils.OK { -// t.Error("Unexpected reply received: ", reply) -// } -// time.Sleep(50 * time.Millisecond) // Give time for CDR to be processed -// var cdrs []*engine.ExternalCDR -// req := utils.RPCCDRsFilter{RunIDs: []string{utils.MetaDefault}, CGRIDs: []string{cdr.CGRID}} -// if err := tutLocalRpc.Call(utils.APIerSv2GetCDRs, req, &cdrs); err != nil { -// t.Error("Unexpected error: ", err.Error()) -// } else if len(cdrs) != 1 { -// t.Error("Unexpected number of CDRs returned: ", len(cdrs)) -// } else { -// if cdrs[0].OriginID != cdr.OriginID { -// t.Errorf("Unexpected OriginID for Cdr received: %+v", cdrs[0]) -// } -// if cdrs[0].Cost != 1.3334 { -// t.Errorf("Unexpected Cost for Cdr received: %+v", cdrs[0]) -// } -// } -// var replyExport v1.RplExportedCDRs -// exportArgs := v1.ArgExportCDRs{ -// ExportPath: utils.StringPointer("/tmp"), -// ExportFileName: utils.StringPointer("TestTutITExportCDR.csv"), -// ExportTemplate: utils.StringPointer("TestTutITExportCDR"), -// RPCCDRsFilter: utils.RPCCDRsFilter{CGRIDs: []string{cdr.CGRID}, NotRunIDs: []string{utils.MetaRaw}}} -// if err := tutLocalRpc.Call(utils.APIerSv1ExportCDRs, exportArgs, &replyExport); err != nil { -// t.Error(err) -// } -// eExportContent := `f0a92222a7d21b4d9f72744aabe82daef52e20d8,*default,testexportcdr1,*rated,cgrates.org,call,1001,1003,2016-11-30T18:06:04+01:00,98,1.33340,RETA -// f0a92222a7d21b4d9f72744aabe82daef52e20d8,derived_run1,testexportcdr1,*rated,cgrates.org,call,1001,1003,2016-11-30T18:06:04+01:00,98,1.33340,RETA -// ` -// eExportContent2 := `f0a92222a7d21b4d9f72744aabe82daef52e20d8,derived_run1,testexportcdr1,*rated,cgrates.org,call,1001,1003,2016-11-30T18:06:04+01:00,98,1.33340,RETA -// f0a92222a7d21b4d9f72744aabe82daef52e20d8,*default,testexportcdr1,*rated,cgrates.org,call,1001,1003,2016-11-30T18:06:04+01:00,98,1.33340,RETA -// ` -// expFilePath := path.Join(*exportArgs.ExportPath, *exportArgs.ExportFileName) -// if expContent, err := os.ReadFile(expFilePath); err != nil { -// t.Error(err) -// } else if eExportContent != string(expContent) && eExportContent2 != string(expContent) { // CDRs are showing up randomly so we cannot predict order of export -// t.Errorf("Expecting: <%q> or <%q> received: <%q>", eExportContent, eExportContent2, string(expContent)) -// } -// if err := os.Remove(expFilePath); err != nil { -// t.Error(err) -// } - -// } - -// func TestTutITStopCgrEngine(t *testing.T) { -// if err := engine.KillEngine(1000); err != nil { -// t.Error(err) -// } -// } diff --git a/general_tests/resourcesv1_it_test.go b/general_tests/resourcesv1_it_test.go index f9fd4137b..18a49944c 100644 --- a/general_tests/resourcesv1_it_test.go +++ b/general_tests/resourcesv1_it_test.go @@ -20,198 +20,203 @@ along with this program. If not, see */ package general_tests -// import ( -// "net/rpc" -// "path" -// "testing" +import ( + "path" + "testing" -// "github.com/cgrates/cgrates/config" -// "github.com/cgrates/cgrates/engine" -// "github.com/cgrates/cgrates/utils" -// ) + "github.com/cgrates/birpc" + "github.com/cgrates/birpc/context" + "github.com/cgrates/cgrates/config" + "github.com/cgrates/cgrates/engine" + "github.com/cgrates/cgrates/utils" +) -// var ( -// rlsV1CfgPath string -// rlsV1Cfg *config.CGRConfig -// rlsV1Rpc *rpc.Client -// rlsV1ConfDIR string //run tests for specific configuration +var ( + rlsV1CfgPath string + rlsV1Cfg *config.CGRConfig + rlsV1Rpc *birpc.Client + rlsV1ConfDIR string //run tests for specific configuration -// sTestsRLSV1 = []func(t *testing.T){ -// testV1RsLoadConfig, -// testV1RsInitDataDb, + sTestsRLSV1 = []func(t *testing.T){ + testV1RsLoadConfig, + testV1RsInitDataDb, -// testV1RsStartEngine, -// testV1RsRpcConn, -// testV1RsSetProfile, -// testV1RsAllocate, -// testV1RsAuthorize, -// testV1RsStopEngine, -// } -// ) + testV1RsStartEngine, + testV1RsRpcConn, + testV1RsSetProfile, + testV1RsAllocate, + testV1RsAuthorize, + testV1RsStopEngine, + } +) -// //Test start here -// func TestRsV1IT(t *testing.T) { -// switch *dbType { -// case utils.MetaInternal: -// rlsV1ConfDIR = "tutinternal" -// case utils.MetaMySQL: -// rlsV1ConfDIR = "tutmysql" -// case utils.MetaMongo: -// rlsV1ConfDIR = "tutmongo" -// case utils.MetaPostgres: -// t.SkipNow() -// default: -// t.Fatal("Unknown Database type") -// } -// for _, stest := range sTestsRLSV1 { -// t.Run(rlsV1ConfDIR, stest) -// } -// } +//Test start here +func TestRsV1IT(t *testing.T) { + switch *dbType { + case utils.MetaInternal: + rlsV1ConfDIR = "tutinternal" + case utils.MetaMySQL: + rlsV1ConfDIR = "tutmysql" + case utils.MetaMongo: + rlsV1ConfDIR = "tutmongo" + case utils.MetaPostgres: + t.SkipNow() + default: + t.Fatal("Unknown Database type") + } + for _, stest := range sTestsRLSV1 { + t.Run(rlsV1ConfDIR, stest) + } +} -// func testV1RsLoadConfig(t *testing.T) { -// var err error -// rlsV1CfgPath = path.Join(*dataDir, "conf", "samples", rlsV1ConfDIR) -// if rlsV1Cfg, err = config.NewCGRConfigFromPath(rlsV1CfgPath); err != nil { -// t.Error(err) -// } -// } +func testV1RsLoadConfig(t *testing.T) { + var err error + rlsV1CfgPath = path.Join(*dataDir, "conf", "samples", rlsV1ConfDIR) + if rlsV1Cfg, err = config.NewCGRConfigFromPath(context.Background(), rlsV1CfgPath); err != nil { + t.Error(err) + } +} -// func testV1RsInitDataDb(t *testing.T) { -// if err := engine.InitDataDB(rlsV1Cfg); err != nil { -// t.Fatal(err) -// } -// } +func testV1RsInitDataDb(t *testing.T) { + if err := engine.InitDataDB(rlsV1Cfg); err != nil { + t.Fatal(err) + } +} -// func testV1RsStartEngine(t *testing.T) { -// if _, err := engine.StopStartEngine(rlsV1CfgPath, *waitRater); err != nil { -// t.Fatal(err) -// } -// } +func testV1RsStartEngine(t *testing.T) { + if _, err := engine.StopStartEngine(rlsV1CfgPath, *waitRater); err != nil { + t.Fatal(err) + } +} -// func testV1RsRpcConn(t *testing.T) { -// var err error -// rlsV1Rpc, err = newRPCClient(rlsV1Cfg.ListenCfg()) // We connect over JSON so we can also troubleshoot if needed -// if err != nil { -// t.Fatal("Could not connect to rater: ", err.Error()) -// } -// } +func testV1RsRpcConn(t *testing.T) { + var err error + rlsV1Rpc, err = newRPCClient(rlsV1Cfg.ListenCfg()) // We connect over JSON so we can also troubleshoot if needed + if err != nil { + t.Fatal("Could not connect to rater: ", err.Error()) + } +} -// func testV1RsSetProfile(t *testing.T) { -// rls := &engine.ResourceProfileWithAPIOpts{ -// ResourceProfile: &engine.ResourceProfile{ -// Tenant: "cgrates.org", -// ID: "RES_GR_TEST", -// FilterIDs: []string{"*string:~*req.Account:1001", "*ai:~*req.AnswerTime:2014-07-14T14:25:00Z|2014-07-14T14:26:00Z"}, -// UsageTTL: -1, -// Limit: 2, -// AllocationMessage: "Account1Channels", -// Weight: 20, -// ThresholdIDs: []string{utils.MetaNone}, -// }, -// } -// var result string -// if err := rlsV1Rpc.Call(utils.APIerSv1SetResourceProfile, rls, &result); err != nil { -// t.Error(err) -// } else if result != utils.OK { -// t.Error("Unexpected reply returned", result) -// } -// } +func testV1RsSetProfile(t *testing.T) { + rls := &engine.ResourceProfileWithAPIOpts{ + ResourceProfile: &engine.ResourceProfile{ + Tenant: "cgrates.org", + ID: "RES_GR_TEST", + FilterIDs: []string{"*string:~*req.Account:1001"}, + UsageTTL: -1, + Limit: 2, + AllocationMessage: "Account1Channels", + Weights: utils.DynamicWeights{ + { + Weight: 20, + }, + }, + ThresholdIDs: []string{utils.MetaNone}, + }, + } + var result string + if err := rlsV1Rpc.Call(context.Background(), utils.AdminSv1SetResourceProfile, rls, &result); err != nil { + t.Error(err) + } else if result != utils.OK { + t.Error("Unexpected reply returned", result) + } +} -// func testV1RsAllocate(t *testing.T) { -// argsRU := &utils.CGREvent{ -// Tenant: "cgrates.org", -// ID: utils.UUIDSha1Prefix(), -// Event: map[string]interface{}{ -// "Account": "1001", -// "Destination": "1002", -// }, -// APIOpts: map[string]interface{}{ -// utils.OptsResourcesUsageID: "chan_1", -// utils.OptsResourcesUnits: 1, -// }, -// } -// var reply string -// if err := rlsV1Rpc.Call(utils.ResourceSv1AllocateResources, -// argsRU, &reply); err != nil { -// t.Error(err) -// } else if reply != "Account1Channels" { -// t.Error("Unexpected reply returned", reply) -// } +func testV1RsAllocate(t *testing.T) { + argsRU := &utils.CGREvent{ + Tenant: "cgrates.org", + ID: utils.UUIDSha1Prefix(), + Event: map[string]interface{}{ + "Account": "1001", + "Destination": "1002", + }, + APIOpts: map[string]interface{}{ + utils.OptsResourcesUsageID: "chan_1", + utils.OptsResourcesUnits: 1, + }, + } + var reply string + if err := rlsV1Rpc.Call(context.Background(), utils.ResourceSv1AllocateResources, + argsRU, &reply); err != nil { + t.Error(err) + } else if reply != "Account1Channels" { + t.Error("Unexpected reply returned", reply) + } -// argsRU2 := &utils.CGREvent{ -// Tenant: "cgrates.org", -// ID: utils.UUIDSha1Prefix(), -// Event: map[string]interface{}{ -// "Account": "1001", -// "Destination": "1002", -// }, -// APIOpts: map[string]interface{}{ -// utils.OptsResourcesUsageID: "chan_2", -// utils.OptsResourcesUnits: 1, -// }, -// } -// if err := rlsV1Rpc.Call(utils.ResourceSv1AllocateResources, -// argsRU2, &reply); err != nil { -// t.Error(err) -// } else if reply != "Account1Channels" { -// t.Error("Unexpected reply returned", reply) -// } -// } + argsRU2 := &utils.CGREvent{ + Tenant: "cgrates.org", + ID: utils.UUIDSha1Prefix(), + Event: map[string]interface{}{ + "Account": "1001", + "Destination": "1002", + }, + APIOpts: map[string]interface{}{ + utils.OptsResourcesUsageID: "chan_2", + utils.OptsResourcesUnits: 1, + }, + } + if err := rlsV1Rpc.Call(context.Background(), utils.ResourceSv1AllocateResources, + argsRU2, &reply); err != nil { + t.Error(err) + } else if reply != "Account1Channels" { + t.Error("Unexpected reply returned", reply) + } +} -// func testV1RsAuthorize(t *testing.T) { -// var reply *engine.Resources -// args := &utils.CGREvent{ -// Tenant: "cgrates.org", -// ID: utils.UUIDSha1Prefix(), -// Event: map[string]interface{}{ -// "Account": "1001", -// "Destination": "1002", -// }, -// APIOpts: map[string]interface{}{ -// utils.OptsResourcesUsageID: "RandomUsageID", -// }, -// } -// if err := rlsV1Rpc.Call(utils.ResourceSv1GetResourcesForEvent, -// args, &reply); err != nil { -// t.Error(err) -// } -// if reply == nil { -// t.Errorf("Expecting reply to not be nil") -// // reply shoud not be nil so exit function -// // to avoid nil segmentation fault; -// // if this happens try to run this test manualy -// return -// } -// if len(*reply) != 1 { -// t.Errorf("Expecting: %+v, received: %+v", 1, len(*reply)) -// } -// if (*reply)[0].ID != "RES_GR_TEST" { -// t.Errorf("Expecting: %+v, received: %+v", "RES_GR_TEST", (*reply)[0].ID) -// } -// if len((*reply)[0].Usages) != 2 { -// t.Errorf("Expecting: %+v, received: %+v", 2, len((*reply)[0].Usages)) -// } +func testV1RsAuthorize(t *testing.T) { + var reply *engine.Resources + args := &utils.CGREvent{ + Tenant: "cgrates.org", + ID: utils.UUIDSha1Prefix(), + Event: map[string]interface{}{ + "Account": "1001", + "Destination": "1002", + }, + APIOpts: map[string]interface{}{ + utils.OptsResourcesUsageID: "RandomUsageID", + }, + } + if err := rlsV1Rpc.Call(context.Background(), utils.ResourceSv1GetResourcesForEvent, + args, &reply); err != nil { + t.Error(err) + } + if reply == nil { + t.Errorf("Expecting reply to not be nil") + // reply shoud not be nil so exit function + // to avoid nil segmentation fault; + // if this happens try to run this test manualy + return + } + if len(*reply) != 1 { + t.Errorf("Expecting: %+v, received: %+v", 1, len(*reply)) + } + if (*reply)[0].ID != "RES_GR_TEST" { + t.Errorf("Expecting: %+v, received: %+v", "RES_GR_TEST", (*reply)[0].ID) + } + if len((*reply)[0].Usages) != 2 { + t.Errorf("Expecting: %+v, received: %+v", 2, len((*reply)[0].Usages)) + } -// var reply2 string -// argsRU := &utils.CGREvent{ -// Tenant: "cgrates.org", -// ID: utils.UUIDSha1Prefix(), -// Event: map[string]interface{}{ -// "Account": "1001", -// "Destination": "1002"}, -// APIOpts: map[string]interface{}{ -// utils.OptsResourcesUsageID: "chan_1", -// utils.OptsResourcesUnits: 1, -// }, -// } -// if err := rlsV1Rpc.Call(utils.ResourceSv1AuthorizeResources, -// &argsRU, &reply2); err.Error() != "RESOURCE_UNAUTHORIZED" { -// t.Error(err) -// } -// } + var reply2 string + argsRU := &utils.CGREvent{ + Tenant: "cgrates.org", + ID: utils.UUIDSha1Prefix(), + Event: map[string]interface{}{ + "Account": "1001", + "Destination": "1002"}, + APIOpts: map[string]interface{}{ + utils.OptsResourcesUsageID: "chan_1", + utils.OptsResourcesUnits: 1, + }, + } + if err := rlsV1Rpc.Call(context.Background(), utils.ResourceSv1AuthorizeResources, + &argsRU, &reply2); err.Error() != "RESOURCE_UNAUTHORIZED" { + t.Error(err) + } +} -// func testV1RsStopEngine(t *testing.T) { -// if err := engine.KillEngine(*waitRater); err != nil { -// t.Error(err) -// } -// } +func testV1RsStopEngine(t *testing.T) { + if err := engine.KillEngine(*waitRater); err != nil { + t.Error(err) + } +}