From b85ebe8214cc0fc4de1154feeba491449e11eb69 Mon Sep 17 00:00:00 2001 From: TeoV Date: Wed, 5 Feb 2020 15:02:53 +0200 Subject: [PATCH] Update EventReader integration tests --- data/conf/samples/ers_internal/cgrates.json | 288 +++++++++---------- data/conf/samples/ers_mongo/cgrates.json | 292 +++++++++---------- data/conf/samples/ers_mysql/cgrates.json | 294 ++++++++++---------- data/conf/samples/ers_postgres/cgrates.json | 294 ++++++++++---------- ers/filecsv.go | 5 +- ers/filefwv.go | 15 +- ers/filexml.go | 5 +- ers/flatstore.go | 7 +- ers/kafka.go | 5 +- ers/kafka_it_test.go | 2 +- ers/partial_csv.go | 15 +- ers/sql.go | 5 +- ers/sql_it_test.go | 2 +- 13 files changed, 610 insertions(+), 619 deletions(-) diff --git a/data/conf/samples/ers_internal/cgrates.json b/data/conf/samples/ers_internal/cgrates.json index 915a0c9a8..52f8c8a0f 100644 --- a/data/conf/samples/ers_internal/cgrates.json +++ b/data/conf/samples/ers_internal/cgrates.json @@ -95,20 +95,20 @@ "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -120,17 +120,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -142,10 +142,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -157,19 +157,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "*cgreq.ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -182,21 +182,21 @@ "flags": ["*cdrs","*log"], "filters":["*string:~*req.3:1002"], "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "*cgreq.Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -208,16 +208,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -229,27 +229,27 @@ "processed_path": "/tmp/fwvErs/out", "fields": [ {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "path": "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", "path": "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", "path": "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", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileSeqNr", "path": "*cgreq.FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "*cgreq.AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"*cgreq.NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"*cgreq.TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -263,34 +263,34 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ - {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag": "OrderID", "type": "*composed", "value": "~OrderID"}, - {"tag": "RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag": "Account", "type": "*composed", "value": "~Account"}, - {"tag": "Destination", "type": "*composed", "value": "~Destination"}, - {"tag": "SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "Usage", "type": "*composed", "value": "~Usage"}, - {"tag": "Cost", "type": "*composed", "value": "~Cost","rounding_decimals":5}, + {"tag": "OriginID", "path":"*exp", "type": "*composed", "value": "~*req.OriginID"}, + {"tag": "OrderID", "path":"*exp", "type": "*composed", "value": "~*req.OrderID"}, + {"tag": "RequestType", "path":"*exp", "type": "*composed", "value": "~*req.RequestType"}, + {"tag": "Account", "path":"*exp", "type": "*composed", "value": "~*req.Account"}, + {"tag": "Destination", "path":"*exp", "type": "*composed", "value": "~*req.Destination"}, + {"tag": "SetupTime", "path":"*exp", "type": "*composed", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "AnswerTime", "path":"*exp", "type": "*composed", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "Usage", "path":"*exp", "type": "*composed", "value": "~*req.Usage"}, + {"tag": "Cost", "path":"*exp", "type": "*composed", "value": "~*req.Cost","rounding_decimals":5}, ], }, { @@ -304,23 +304,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -335,19 +335,19 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record - {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"} ], } ], diff --git a/data/conf/samples/ers_mongo/cgrates.json b/data/conf/samples/ers_mongo/cgrates.json index 99cc868c2..edd3b0dd6 100644 --- a/data/conf/samples/ers_mongo/cgrates.json +++ b/data/conf/samples/ers_mongo/cgrates.json @@ -96,20 +96,20 @@ "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -121,17 +121,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -143,10 +143,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -158,19 +158,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "*cgreq.ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -182,22 +182,22 @@ "processed_path": "/tmp/ers_with_filters/out", "flags": ["*cdrs","*log"], "filters":["*string:~*req.3:1002"], - "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", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + "fields":[ + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "*cgreq.Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -209,16 +209,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -230,27 +230,27 @@ "processed_path": "/tmp/fwvErs/out", "fields": [ {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "path": "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", "path": "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", "path": "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", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileSeqNr", "path": "*cgreq.FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "*cgreq.AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"*cgreq.NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"*cgreq.TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -264,34 +264,34 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ - {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag": "OrderID", "type": "*composed", "value": "~OrderID"}, - {"tag": "RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag": "Account", "type": "*composed", "value": "~Account"}, - {"tag": "Destination", "type": "*composed", "value": "~Destination"}, - {"tag": "SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "Usage", "type": "*composed", "value": "~Usage"}, - {"tag": "Cost", "type": "*composed", "value": "~Cost","rounding_decimals":5}, + {"tag": "OriginID", "path":"*exp", "type": "*composed", "value": "~*req.OriginID"}, + {"tag": "OrderID", "path":"*exp", "type": "*composed", "value": "~*req.OrderID"}, + {"tag": "RequestType", "path":"*exp", "type": "*composed", "value": "~*req.RequestType"}, + {"tag": "Account", "path":"*exp", "type": "*composed", "value": "~*req.Account"}, + {"tag": "Destination", "path":"*exp", "type": "*composed", "value": "~*req.Destination"}, + {"tag": "SetupTime", "path":"*exp", "type": "*composed", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "AnswerTime", "path":"*exp", "type": "*composed", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "Usage", "path":"*exp", "type": "*composed", "value": "~*req.Usage"}, + {"tag": "Cost", "path":"*exp", "type": "*composed", "value": "~*req.Cost","rounding_decimals":5}, ], }, { @@ -305,23 +305,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -336,22 +336,22 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record - {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"} ], } - ], + ] }, diff --git a/data/conf/samples/ers_mysql/cgrates.json b/data/conf/samples/ers_mysql/cgrates.json index 80f6bda1e..3ac57bf7a 100644 --- a/data/conf/samples/ers_mysql/cgrates.json +++ b/data/conf/samples/ers_mysql/cgrates.json @@ -92,21 +92,21 @@ "source_path": "/tmp/ers2/in", "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", - "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", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + "fields":[ + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -118,17 +118,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -140,10 +140,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -155,19 +155,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "*cgreq.ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -179,22 +179,22 @@ "processed_path": "/tmp/ers_with_filters/out", "flags": ["*cdrs","*log"], "filters":["*string:~*req.3:1002"], - "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", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + "fields":[ + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "*cgreq.Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -206,16 +206,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -227,27 +227,27 @@ "processed_path": "/tmp/fwvErs/out", "fields": [ {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "path": "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", "path": "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", "path": "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", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileSeqNr", "path": "*cgreq.FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "*cgreq.AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"*cgreq.NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"*cgreq.TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -261,34 +261,34 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ - {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag": "OrderID", "type": "*composed", "value": "~OrderID"}, - {"tag": "RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag": "Account", "type": "*composed", "value": "~Account"}, - {"tag": "Destination", "type": "*composed", "value": "~Destination"}, - {"tag": "SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "Usage", "type": "*composed", "value": "~Usage"}, - {"tag": "Cost", "type": "*composed", "value": "~Cost","rounding_decimals":5}, + {"tag": "OriginID", "path":"*exp", "type": "*composed", "value": "~*req.OriginID"}, + {"tag": "OrderID", "path":"*exp", "type": "*composed", "value": "~*req.OrderID"}, + {"tag": "RequestType", "path":"*exp", "type": "*composed", "value": "~*req.RequestType"}, + {"tag": "Account", "path":"*exp", "type": "*composed", "value": "~*req.Account"}, + {"tag": "Destination", "path":"*exp", "type": "*composed", "value": "~*req.Destination"}, + {"tag": "SetupTime", "path":"*exp", "type": "*composed", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "AnswerTime", "path":"*exp", "type": "*composed", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "Usage", "path":"*exp", "type": "*composed", "value": "~*req.Usage"}, + {"tag": "Cost", "path":"*exp", "type": "*composed", "value": "~*req.Cost","rounding_decimals":5}, ], }, { @@ -302,23 +302,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -333,22 +333,22 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record - {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"} ], } - ], + ] }, diff --git a/data/conf/samples/ers_postgres/cgrates.json b/data/conf/samples/ers_postgres/cgrates.json index 57bb69996..2b0092dcc 100644 --- a/data/conf/samples/ers_postgres/cgrates.json +++ b/data/conf/samples/ers_postgres/cgrates.json @@ -89,21 +89,21 @@ "source_path": "/tmp/ers2/in", "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", - "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", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + "fields":[ + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -115,17 +115,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -137,10 +137,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -152,19 +152,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/out", "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", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "*cgreq.ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -176,22 +176,22 @@ "processed_path": "/tmp/ers_with_filters/out", "flags": ["*cdrs","*log"], "filters":["*string:~*req.3:1002"], - "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", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, + "fields":[ + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "*cgreq.Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "*cgreq.HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "*cgreq.HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "*cgreq.HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -203,16 +203,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -224,27 +224,27 @@ "processed_path": "/tmp/fwvErs/out", "fields": [ {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "path": "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", "path": "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", "path": "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", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileSeqNr", "path": "*cgreq.FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.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", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "*cgreq.RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "*cgreq.AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "*cgreq.AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"*cgreq.NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"*cgreq.TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -258,34 +258,34 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ - {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag": "OrderID", "type": "*composed", "value": "~OrderID"}, - {"tag": "RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag": "Account", "type": "*composed", "value": "~Account"}, - {"tag": "Destination", "type": "*composed", "value": "~Destination"}, - {"tag": "SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, - {"tag": "Usage", "type": "*composed", "value": "~Usage"}, - {"tag": "Cost", "type": "*composed", "value": "~Cost","rounding_decimals":5}, + {"tag": "OriginID", "path":"*exp", "type": "*composed", "value": "~*req.OriginID"}, + {"tag": "OrderID", "path":"*exp", "type": "*composed", "value": "~*req.OrderID"}, + {"tag": "RequestType", "path":"*exp", "type": "*composed", "value": "~*req.RequestType"}, + {"tag": "Account", "path":"*exp", "type": "*composed", "value": "~*req.Account"}, + {"tag": "Destination", "path":"*exp", "type": "*composed", "value": "~*req.Destination"}, + {"tag": "SetupTime", "path":"*exp", "type": "*composed", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "AnswerTime", "path":"*exp", "type": "*composed", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"tag": "Usage", "path":"*exp", "type": "*composed", "value": "~*req.Usage"}, + {"tag": "Cost", "path":"*exp", "type": "*composed", "value": "~*req.Cost","rounding_decimals":5}, ], }, { @@ -299,23 +299,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "*cgreq.OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "*cgreq.OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "*cgreq.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -330,22 +330,22 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record - {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"} ], } - ], + ] }, diff --git a/ers/filecsv.go b/ers/filecsv.go index e3481fb71..fc836262a 100644 --- a/ers/filecsv.go +++ b/ers/filecsv.go @@ -153,14 +153,13 @@ func (rdr *CSVFileER) processFile(fPath, fName string) (err error) { agReq); err != nil || !pass { continue } - navMp, err := agReq.AsNavigableMap(rdr.Config().Fields) - if err != nil { + if err := agReq.SetFields(rdr.Config().Fields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) continue } - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ diff --git a/ers/filefwv.go b/ers/filefwv.go index 49d2d2f39..92cd38030 100644 --- a/ers/filefwv.go +++ b/ers/filefwv.go @@ -196,8 +196,7 @@ func (rdr *FWVFileER) processFile(fPath, fName string) (err error) { agReq); err != nil || !pass { continue } - navMp, err := agReq.AsNavigableMap(rdr.Config().Fields) - if err != nil { + if err := agReq.SetFields(rdr.Config().Fields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) @@ -205,7 +204,7 @@ func (rdr *FWVFileER) processFile(fPath, fName string) (err error) { continue } rdr.offset += rdr.lineLen // increase the offset - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ @@ -286,14 +285,13 @@ func (rdr *FWVFileER) processTrailer(file *os.File, rowNr, evsPosted int, absPat agReq); err != nil || !pass { return nil } - navMp, err := agReq.AsNavigableMap(trailerFields) - if err != nil { + if err := agReq.SetFields(trailerFields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) return err } - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ @@ -326,8 +324,7 @@ func (rdr *FWVFileER) createHeaderMap(record string, rowNr, evsPosted int, absPa agReq); err != nil || !pass { return nil } - navMp, err := agReq.AsNavigableMap(hdrFields) - if err != nil { + if err := agReq.SetFields(hdrFields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) @@ -335,7 +332,7 @@ func (rdr *FWVFileER) createHeaderMap(record string, rowNr, evsPosted int, absPa return err } rdr.offset += rdr.headerOffset // increase the offset - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ diff --git a/ers/filexml.go b/ers/filexml.go index c8953f406..fbde7a2c9 100644 --- a/ers/filexml.go +++ b/ers/filexml.go @@ -145,14 +145,13 @@ func (rdr *XMLFileER) processFile(fPath, fName string) (err error) { agReq); err != nil || !pass { continue } - navMp, err := agReq.AsNavigableMap(rdr.Config().Fields) - if err != nil { + if err := agReq.SetFields(rdr.Config().Fields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) continue } - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ diff --git a/ers/flatstore.go b/ers/flatstore.go index 653df432f..95877542b 100644 --- a/ers/flatstore.go +++ b/ers/flatstore.go @@ -176,7 +176,7 @@ func (rdr *FlatstoreER) processFile(fPath, fName string) (err error) { // build Usage from Fields based on record lenght for i, cntFld := range rdr.Config().Fields { - if cntFld.Path == utils.Usage { + if cntFld.Path == utils.MetaCgreq+utils.NestingSep+utils.Usage { rdr.Config().Fields[i].Value = config.NewRSRParsersMustCompile("~*req."+strconv.Itoa(len(record)-1), true, utils.INFIELD_SEP) // in case of flatstore, last element will be the duration computed by us } } @@ -192,15 +192,14 @@ func (rdr *FlatstoreER) processFile(fPath, fName string) (err error) { agReq); err != nil || !pass { continue } - navMp, err := agReq.AsNavigableMap(rdr.Config().Fields) - if err != nil { + if err := agReq.SetFields(rdr.Config().Fields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) continue } - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ diff --git a/ers/kafka.go b/ers/kafka.go index d7ff9050e..986ae1a47 100644 --- a/ers/kafka.go +++ b/ers/kafka.go @@ -171,11 +171,10 @@ func (rdr *KafkaER) processMessage(msg []byte) (err error) { agReq); err != nil || !pass { return } - var navMp *config.NavigableMap - if navMp, err = agReq.AsNavigableMap(rdr.Config().Fields); err != nil { + if err = agReq.SetFields(rdr.Config().Fields); err != nil { return } - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent( + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent( agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} return diff --git a/ers/kafka_it_test.go b/ers/kafka_it_test.go index 03712e0fe..4401d6aea 100644 --- a/ers/kafka_it_test.go +++ b/ers/kafka_it_test.go @@ -56,7 +56,7 @@ func TestKafkaER(t *testing.T) { "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing "fields":[ // import fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value - {"tag": "CGRID", "type": "*composed", "value": "~*req.CGRID", "path": "CGRID"}, + {"tag": "CGRID", "type": "*composed", "value": "~*req.CGRID", "path": "*cgreq.CGRID"}, ], }, ], diff --git a/ers/partial_csv.go b/ers/partial_csv.go index adb26d8d3..211ab0b0a 100644 --- a/ers/partial_csv.go +++ b/ers/partial_csv.go @@ -168,8 +168,7 @@ func (rdr *PartialCSVFileER) processFile(fPath, fName string) (err error) { agReq); err != nil || !pass { continue } - navMp, err := agReq.AsNavigableMap(rdr.Config().Fields) - if err != nil { + if err := agReq.SetFields(rdr.Config().Fields); err != nil { utils.Logger.Warning( fmt.Sprintf("<%s> reading file: <%s> row <%d>, ignoring due to error: <%s>", utils.ERs, absPath, rowNr, err.Error())) @@ -177,14 +176,14 @@ func (rdr *PartialCSVFileER) processFile(fPath, fName string) (err error) { } // take OriginID and OriginHost to compose CGRID - orgId, err := navMp.FieldAsString([]string{utils.OriginID}) + orgId, err := agReq.CGRRequest.FieldAsString([]string{utils.OriginID}) if err == utils.ErrNotFound { utils.Logger.Warning( fmt.Sprintf("<%s> Missing field for row <%d> , <%s>", utils.ERs, rowNr, record)) continue } - orgHost, err := navMp.FieldAsString([]string{utils.OriginHost}) + orgHost, err := agReq.CGRRequest.FieldAsString([]string{utils.OriginHost}) if err == utils.ErrNotFound { utils.Logger.Warning( fmt.Sprintf("<%s> Missing field for row <%d> , <%s>", @@ -193,19 +192,19 @@ func (rdr *PartialCSVFileER) processFile(fPath, fName string) (err error) { } cgrID := utils.Sha1(orgId, orgHost) // take Partial field from NavigableMap - partial, _ := navMp.FieldAsString([]string{utils.Partial}) + partial, _ := agReq.CGRRequest.FieldAsString([]string{utils.Partial}) if val, has := rdr.cache.Get(cgrID); !has { if utils.IsSliceMember([]string{"false", utils.EmptyString}, partial) { // complete CDR - rdr.rdrEvents <- &erEvent{cgrEvent: navMp.AsCGREvent(agReq.Tenant, utils.NestingSep), + rdr.rdrEvents <- &erEvent{cgrEvent: agReq.CGRRequest.AsCGREvent(agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config()} evsPosted++ } else { rdr.cache.Set(cgrID, - []*utils.CGREvent{navMp.AsCGREvent(agReq.Tenant, utils.NestingSep)}, nil) + []*utils.CGREvent{agReq.CGRRequest.AsCGREvent(agReq.Tenant, utils.NestingSep)}, nil) } } else { origCgrEvs := val.([]*utils.CGREvent) - origCgrEvs = append(origCgrEvs, navMp.AsCGREvent(agReq.Tenant, utils.NestingSep)) + origCgrEvs = append(origCgrEvs, agReq.CGRRequest.AsCGREvent(agReq.Tenant, utils.NestingSep)) if utils.IsSliceMember([]string{"false", utils.EmptyString}, partial) { // complete CDR //sort CGREvents based on AnswertTime and SetupTime sort.Slice(origCgrEvs, func(i, j int) bool { diff --git a/ers/sql.go b/ers/sql.go index d898b771e..bedf46e58 100644 --- a/ers/sql.go +++ b/ers/sql.go @@ -198,12 +198,11 @@ func (rdr *SQLEventReader) processMessage(msg map[string]interface{}) (err error agReq); err != nil || !pass { return } - var navMp *config.NavigableMap - if navMp, err = agReq.AsNavigableMap(rdr.Config().Fields); err != nil { + if err = agReq.SetFields(rdr.Config().Fields); err != nil { return } rdr.rdrEvents <- &erEvent{ - cgrEvent: navMp.AsCGREvent(agReq.Tenant, utils.NestingSep), + cgrEvent: agReq.CGRRequest.AsCGREvent(agReq.Tenant, utils.NestingSep), rdrCfg: rdr.Config(), } return diff --git a/ers/sql_it_test.go b/ers/sql_it_test.go index 16f5c3c65..9f1b1a5cd 100644 --- a/ers/sql_it_test.go +++ b/ers/sql_it_test.go @@ -85,7 +85,7 @@ func testSQLInitConfig(t *testing.T) { "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing "fields":[ // import fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value - {"tag": "CGRID", "type": "*composed", "value": "~*req.cgrid", "path": "CGRID"}, + {"tag": "CGRID", "type": "*composed", "value": "~*req.cgrid", "path": "*cgreq.CGRID"}, ], }, ],