Files
cgrates/data/conf/samples/tutmysql_internal/cgrates.json
2020-03-18 09:48:53 +01:00

248 lines
9.8 KiB
JSON

{
// 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: <redis|mongo>
"db_port": 6379, // data_db port to reach the database
"db_name": "10", // data_db database name to connect to
},
"stor_db": {
"db_password": "CGRateS.org",
},
"rals": {
"enabled": true,
"thresholds_conns": ["*internal"],
},
"schedulers": {
"enabled": true,
"cdrs_conns": ["*internal"],
},
"cdrs": {
"enabled": true,
"chargers_conns":["*internal"],
},
"cdre": {
"TestTutITExportCDR": {
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost", "rounding_decimals": 4},
{"path": "*exp.MatchedDestinationID", "type": "*variable", "value": "~*req.CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"},
],
},
},
"loaders": [
{
"id": "TeoLoader", // identifier of the Loader
"enabled": false, // starts as service: <true|false>.
"dry_run": false, // do not send the CDRs to CDRS, just parse them
"run_delay": 0, // sleep interval in seconds between consecutive runs, 0 to use automation via inotify
"lock_filename": ".cgr.lock", // Filename containing concurrency lock in case of delayed processing
"caches_conns": ["*internal"],
"field_separator": ",", // separator used in case of csv files
"tp_in_dir": "/tmp/In", // absolute path towards the directory where the CDRs are stored
"tp_out_dir": "/tmp/Out", // absolute path towards the directory where processed CDRs will be moved
"data":[
{
"type": "*resources", // data source type
"file_name": "Resources.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
{"tag": "TTL", "path": "UsageTTL", "type": "*variable", "value": "~4"},
{"tag": "Limit", "path": "Limit", "type": "*variable", "value": "~5"},
{"tag": "AllocationMessage", "path": "AllocationMessage", "type": "*variable", "value": "~6"},
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"},
{"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~8"},
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~9"},
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~10"},
],
},
{
"type": "*stats", // data source type
"file_name": "Stats.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
{"tag": "QueueLength", "path": "QueueLength", "type": "*variable", "value": "~4"},
{"tag": "TTL", "path": "TTL", "type": "*variable", "value": "~5"},
{"tag": "Metrics", "path": "Metrics", "type": "*variable", "value": "~6"},
{"tag": "MetricParams", "path": "Parameters", "type": "*variable", "value": "~7"},
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~8"},
{"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~9"},
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"},
{"tag": "MinItems", "path": "MinItems", "type": "*variable", "value": "~11"},
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~12"},
],
},
{
"type": "*thresholds", // data source type
"file_name": "Thresholds.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
{"tag": "MaxHits", "path": "MaxHits", "type": "*variable", "value": "~4"},
{"tag": "MinHits", "path": "MinHits", "type": "*variable", "value": "~5"},
{"tag": "MinSleep", "path": "MinSleep", "type": "*variable", "value": "~6"},
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"},
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~8"},
{"tag": "ActionIDs", "path": "ActionIDs", "type": "*variable", "value": "~9"},
{"tag": "Async", "path": "Async", "type": "*variable", "value": "~10"},
],
},
{
"type": "*suppliers", // data source type
"file_name": "Suppliers.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
{"tag": "Sorting", "path": "Sorting", "type": "*variable", "value": "~4"},
{"tag": "SortingParamameters", "path": "SortingParamameters", "type": "*variable", "value": "~5"},
{"tag": "SupplierID", "path": "SupplierID", "type": "*variable", "value": "~6"},
{"tag": "SupplierFilterIDs", "path": "SupplierFilterIDs", "type": "*variable", "value": "~7"},
{"tag": "SupplierAccountIDs", "path": "SupplierAccountIDs", "type": "*variable", "value": "~8"},
{"tag": "SupplierRatingPlanIDs", "path": "SupplierRatingPlanIDs", "type": "*variable", "value": "~9"},
{"tag": "SupplierResourceIDs", "path": "SupplierResourceIDs", "type": "*variable", "value": "~10"},
{"tag": "SupplierStatIDs", "path": "SupplierStatIDs", "type": "*variable", "value": "~11"},
{"tag": "SupplierWeight", "path": "SupplierWeight", "type": "*variable", "value": "~12"},
{"tag": "SupplierBlocker", "path": "SupplierBlocker", "type": "*variable", "value": "~13"},
{"tag": "SupplierParameters", "path": "SupplierParameters", "type": "*variable", "value": "~14"},
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~15"},
],
},
],
},
{
"id": "FilterLoader", // identifier of the Loader
"enabled": false, // starts as service: <true|false>.
"dry_run": false, // do not send the CDRs to CDRS, just parse them
"run_delay": 0, // sleep interval in seconds between consecutive runs, 0 to use automation via inotify
"lock_filename": ".cgr.lock", // Filename containing concurrency lock in case of delayed processing
"caches_conns": ["*internal"],
"field_separator": ",", // separator used in case of csv files
"tp_in_dir": "/tmp/FilterIn", // absolute path towards the directory where the CDRs are stored
"tp_out_dir": "/tmp/FilterOut", // absolute path towards the directory where processed CDRs will be moved
"data":[
{
"type": "*filters", // data source type
"file_name": "Filters.csv", // file name in the tp_in_dir
"fields": [
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~2"},
{"tag": "Element", "path": "Element", "type": "*variable", "value": "~3"},
{"tag": "Values", "path": "Values", "type": "*variable", "value": "~4"},
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~5"},
],
},
],
},
],
"attributes": {
"enabled": true,
},
"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",
},
"suppliers": {
"enabled": true,
"prefix_indexed_fields":["Destination"],
"stats_conns": ["*internal"],
},
"sessions": {
"enabled": true,
"suppliers_conns": ["*internal"],
"resources_conns": ["*internal"],
"attributes_conns": ["*internal"],
"rals_conns": ["*internal"],
"cdrs_conns": ["*internal"],
"chargers_conns": ["*internal"],
},
"migrator":{
"out_stordb_password": "CGRateS.org",
"users_filters":["Account"],
},
"apiers": {
"enabled": true,"enabled": true,
"scheduler_conns": ["*internal"],
},
"filters": {
"apiers_conns": ["*internal"],
},
}