mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 02:56:24 +05:00
266 lines
14 KiB
JSON
266 lines
14 KiB
JSON
{
|
|
// CGRateS Configuration file
|
|
//
|
|
// Used for SessionSv1 integration tests
|
|
|
|
|
|
"general": {
|
|
"log_level": 7,
|
|
"reply_timeout": "10s", // consider connection down for replies taking longer than this value
|
|
},
|
|
|
|
|
|
"listen": {
|
|
"rpc_json": ":2012",
|
|
"rpc_gob": ":2013",
|
|
"http": ":2080",
|
|
},
|
|
|
|
|
|
"stor_db": {
|
|
"db_type": "postgres",
|
|
"db_port": 5432,
|
|
"db_password": "CGRateS.org",
|
|
},
|
|
|
|
|
|
|
|
"rals": {
|
|
"enabled": true,
|
|
},
|
|
|
|
|
|
"schedulers": {
|
|
"enabled": true,
|
|
},
|
|
|
|
|
|
"chargers": {
|
|
"enabled": true,
|
|
"attributes_conns": ["*internal"],
|
|
},
|
|
|
|
|
|
"resources": {
|
|
"enabled": true,
|
|
},
|
|
|
|
|
|
"attributes": {
|
|
"enabled": true,
|
|
},
|
|
|
|
|
|
"cdrs": {
|
|
"enabled": true,
|
|
"chargers_conns": ["*localhost"],
|
|
"rals_conns": ["*internal"],
|
|
"session_cost_retries": 0,
|
|
},
|
|
|
|
|
|
"sessions": {
|
|
"enabled": true,
|
|
"chargers_conns": ["*localhost"],
|
|
"rals_conns": ["*internal"],
|
|
"cdrs_conns": ["*internal"],
|
|
"resources_conns": ["*internal"],
|
|
"attributes_conns": ["*internal"],
|
|
},
|
|
|
|
|
|
"ers": {
|
|
"enabled": true,
|
|
"sessions_conns": ["*internal"],
|
|
"readers": [
|
|
{
|
|
"id": "file_reader1",
|
|
"run_delay": -1,
|
|
"type": "*file_csv",
|
|
"flags": ["*dryrun"],
|
|
"source_path": "/tmp/ers/in",
|
|
"processed_path": "/tmp/ers/out",
|
|
},
|
|
{
|
|
"id": "file_reader2",
|
|
"run_delay": -1,
|
|
"field_separator": ";",
|
|
"type": "*file_csv",
|
|
"source_path": "/tmp/ers2/in",
|
|
"flags": ["*dryrun"],
|
|
"processed_path": "/tmp/ers2/out",
|
|
"content_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
|
{"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true},
|
|
{"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true},
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true},
|
|
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
|
|
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true},
|
|
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
|
|
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "HDRExtra3", "field_id": "HDRExtra3", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "HDRExtra2", "field_id": "HDRExtra2", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "HDRExtra1", "field_id": "HDRExtra1", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
],
|
|
},
|
|
{
|
|
"id": "init_session",
|
|
"run_delay": -1,
|
|
"field_separator": ",",
|
|
"type": "*file_csv",
|
|
"source_path": "/tmp/init_session/in",
|
|
"flags": ["*initiate","*accounts","*resources","*attributes","*log"],
|
|
"processed_path": "/tmp/init_session/out",
|
|
"content_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
|
{"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
|
|
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true},
|
|
{"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true},
|
|
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true},
|
|
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true},
|
|
],
|
|
},
|
|
{
|
|
"id": "terminate_session",
|
|
"run_delay": -1,
|
|
"field_separator": ",",
|
|
"type": "*file_csv",
|
|
"source_path": "/tmp/terminate_session/in",
|
|
"flags": ["*terminate","*accounts","*resources","*log"],
|
|
"processed_path": "/tmp/terminate_session/out",
|
|
"content_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true},
|
|
],
|
|
},
|
|
{
|
|
"id": "create_cdr",
|
|
"run_delay": -1,
|
|
"field_separator": ",",
|
|
"type": "*file_csv",
|
|
"source_path": "/tmp/cdrs/in",
|
|
"flags": ["*cdrs","*log"],
|
|
"processed_path": "/tmp/cdrs/out",
|
|
"content_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
|
{"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
|
|
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true},
|
|
{"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true},
|
|
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true},
|
|
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true},
|
|
{"tag": "ExtraInfo1", "field_id": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true},
|
|
{"tag": "ExtraInfo2", "field_id": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true},
|
|
],
|
|
},
|
|
{
|
|
"id": "file_reader_with_filters",
|
|
"run_delay": -1,
|
|
"type": "*file_csv",
|
|
"field_separator": ";",
|
|
"source_path": "/tmp/ers_with_filters/in",
|
|
"processed_path": "/tmp/ers_with_filters/out",
|
|
"flags": ["*cdrs","*log"],
|
|
"filters":["*string:~*req.3:1002"],
|
|
"content_fields":[ // import content_fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
|
|
{"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true},
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true},
|
|
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true},
|
|
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Source", "field_id": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true},
|
|
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "~*req.3", "mandatory": true},
|
|
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true},
|
|
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
|
|
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "HDRExtra3", "field_id": "HDRExtra3", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "HDRExtra2", "field_id": "HDRExtra2", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
{"tag": "HDRExtra1", "field_id": "HDRExtra1", "type": "*composed", "value": "~*req.6", "mandatory": true},
|
|
],
|
|
},
|
|
{
|
|
"id": "XmlDryRun",
|
|
"run_delay": -1,
|
|
"type": "*file_xml",
|
|
"source_path": "/tmp/xmlErs/in",
|
|
"flags": ["*cdrs","*log"],
|
|
"processed_path": "/tmp/xmlErs/out",
|
|
"xml_root_path": "broadWorksCDR.cdrData",
|
|
"content_fields":[
|
|
{"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true},
|
|
{"tag": "Direction", "field_id": "Direction", "type": "*constant", "value": "*out", "mandatory": true},
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true},
|
|
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
|
|
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true},
|
|
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true},
|
|
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true},
|
|
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}
|
|
],
|
|
},
|
|
{
|
|
"id": "FWV1",
|
|
"run_delay": -1,
|
|
"type": "*file_fwv",
|
|
"source_path": "/tmp/fwvErs/in",
|
|
"flags": ["*cdrs"],
|
|
"processed_path": "/tmp/fwvErs/out",
|
|
"header_fields": [
|
|
{"tag": "FileName", "field_id": "CdrFileName", "type": "*composed", "value": "~*req.95-135", "padding":"right"},
|
|
{"tag": "FileSeqNr", "field_id": "FileSeqNr", "type": "*composed", "value": "~*req.135-141", "padding":"zeroleft"},
|
|
{"tag": "AccId1", "field_id": "AccId1", "type": "*composed", "value": "~*req.135-141", "padding":"zeroleft"},
|
|
],
|
|
"content_fields": [
|
|
{"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
|
|
{"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "rated", "mandatory": true},
|
|
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true},
|
|
{"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true},
|
|
{"tag": "Tenant", "field_id": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true},
|
|
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
|
|
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true},
|
|
{"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true},
|
|
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true},
|
|
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.14-30:s/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}-${2}-${3} ${4}:${5}:${6}/", "mandatory": true},
|
|
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.14-30:s/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}-${2}-${3} ${4}:${5}:${6}/", "mandatory": true},
|
|
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.127-135:s/(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}h${2}m${3}s/", "mandatory": true},
|
|
{"tag": "DisconnectCause", "field_id": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true},
|
|
{"tag": "RetailAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"},
|
|
{"tag": "WholesaleAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"},
|
|
{"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true},
|
|
{"tag": "AccId2", "field_id": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true},
|
|
],
|
|
"trailer_fields": [
|
|
{"tag": "NrOfCdrs", "type": "metatag", "metatag_id":"total_cdrs", "value": "~*req.142-150"},
|
|
{"tag": "TotalDuration", "type": "metatag", "metatag_id":"total_duration", "value": "~*req.150-162"},
|
|
],
|
|
}
|
|
],
|
|
},
|
|
|
|
|
|
"apier": {
|
|
"scheduler_conns": ["*internal"],
|
|
},
|
|
|
|
|
|
}
|