Updated flatstore tests

This commit is contained in:
Trial97
2021-05-14 12:45:22 +03:00
committed by Dan Christian Bogos
parent cae5b4ced5
commit 73de017591
34 changed files with 700 additions and 1814 deletions

View File

@@ -333,9 +333,12 @@
// },
// "ers": { // EventReaderService
// "enabled": false, // starts the EventReader service: <true|false>
// "sessions_conns":["*internal"], // RPC Connections IDs
// "ers": { // EventReaderService
// "enabled": false, // starts the EventReader service: <true|false>
// "sessions_conns":["*internal"], // RPC Connections IDs
// "partial_cache_ttl": "1s", // the duration to cache partial records when not pairing
// "partial_cache_action": "*none", // the action that will be executed for the partial CSVs that are not matched<*post_cdr|*dump_to_file>
// // "partial_path": "/var/spool/cgrates/ers/partial", // the path were the partial events will be sent
// "readers": [
// {
// "id": "*default", // identifier of the EventReader profile
@@ -345,23 +348,18 @@
// "source_path": "/var/spool/cgrates/ers/in", // read data from this path
// "processed_path": "/var/spool/cgrates/ers/out", // move processed data here
// "opts": {
// // FileCSV and PartialCSV
// // Partial
// // "partialPath": "/", // the path were the partial events will be sent
// // "partialCacheAction": "*none", // the action that will be executed for the partial CSVs that are not matched<*none|*post_cdr|*dump_to_file>
// "partialOrderField": "~*req.AnswerTime", // the field after what the events are order when merged
// // "partialcsvFieldSeparator": "," // separator used when dumping the fields
// // FileCSV
// "csvRowLength": 0, // Number of fields from csv file
// "csvFieldSeparator": ",", // separator used when reading the fields
// "csvHeaderDefineChar": ":", // the starting character for header definition used in case of CSV files
// // "csvLazyQuotes": false, // if a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field
// // PartialCSV
// "csvCacheExpiryAction": "*post_cdr", // the action that will be exeuted for the partial CSVs that are not matched<*post_cdr|*dump_to_file>
// // "csvRecordCacheTTL": "1s" // Duration to cache partial records when not pairing
// // FlatStore
// "fstRowLength": 0, // Number of fields from csv file
// "fstFieldSeparator": ",", // separator used when reading the fields
// // "fstFailedCallsPrefix": "" // Used in case of flatstore CDRs to avoid searching for BYE records
// // "fstRecordCacheTTL": "1s" // Duration to cache partial records when not pairing
// // "fstLazyQuotes": false, // if a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field
// // FileXML
// "xmlRootPath": "", // path towards one event in case of XML CDRs
@@ -435,6 +433,7 @@
// {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true},
// {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.13", "mandatory": true},
// ],
// "partial_commit_fields": [],
// "cache_dump_fields": [],
// },
// ],
@@ -489,18 +488,22 @@
// // AMQP
// // "amqpQueueID": "cgrates_cdrs", // the queue id for AMQP exporters from were the events are exported
// // "amqpRoutingKey": "", // RoutingKey
// // "sqlExchange": "", // Exchange
// // "sqlExchangeType": "", // ExchangeType
// // "amqpExchange": "", // Exchange
// // "amqpExchangeType": "", // ExchangeType
// // SQS and S3
// // "sqsQueueID": "cgrates_cdrs", // the queue id for SQS exporters from were the events are exported
// // "s3BucketID": "cgrates_cdrs", // the bucket id for S3 readers from where the events that are exported
// // "awsRegion": "", // AWSRegion
// // "awsKey": "", // AWSKey
// // "awsSecret": "", // AWSSecret
// // "awsToken": "", // AWSToken
// // "s3FolderPath": "", // AWSFolderPath
// //SQS
// // "sqsQueueID": "cgrates_cdrs", // the queue id for SQS exporters from were the events are exported
// // S3
// // "s3BucketID": "cgrates_cdrs", // the bucket id for S3 readers from where the events that are exported
// // "s3FolderPath": "", // S3FolderPath
// }, // extra options for exporter
// "tenant": "", // tenant used in filterS.Pass
@@ -511,7 +514,6 @@
// "attribute_context": "", // context used to discover matching Attribute profiles
// "synchronous": false, // block processing until export has a result
// "attempts": 1, // export attempts
// "field_separator": ",", // separator used in case of csv files
// "fields":[], // import fields template, tag will match internally CDR field, in case of .csv value will be represented by index of the field value
// },
// ],

View File

@@ -266,7 +266,7 @@
"flags": ["*cdrs"],
"processed_path": "",
"opts": {
"csvCacheExpiryAction": "*dump_to_file",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs1/out",
},
@@ -300,7 +300,6 @@
{"tag": "SetupTime", "path":"*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "AnswerTime", "path":"*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "Usage", "path":"*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path":"*exp.Cost", "type": "*variable", "value": "~*req.Cost","rounding_decimals":5},
],
},
{
@@ -312,7 +311,7 @@
"processed_path": "",
"flags": ["*cdrs"],
"opts": {
"csvCacheExpiryAction": "*post_cdr",
"partialCacheAction": "*post_cdr",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs2/out",
},
@@ -373,24 +372,22 @@
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "1", "filters":["*string:~*req.0:BYE"]},
],
"partial_commit_fields": [
// {"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
// {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable","value":"~*req.OriginID", "mandatory": true},
// {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value":"~*req.RequestType", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
// {"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.Account", "mandatory": true},
// {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value":"~*req.Subject", "mandatory": true},
// {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value":"~*req.Destination" , "mandatory": true},
// {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value":"~*req.SetupTime" , "mandatory": true},
// {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value":"~*req.AnswerTime" , "mandatory": true},
// {"tag": "EndTime", "path": "*cgreq.EndTime", "type": "*variable","value": "~*req.EndTime"},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*req.EndTime;~*req.AnswerTime", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls","*exists:~*opts.invite:","*exists:~*opts.bye:"]},
// {"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value":"~*req.DisconnectCause", "mandatory": true},
// {"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value":"~*req.DialogId"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*exists:~*opts.invite:","*exists:~*opts.bye:"]},
],
"cache_dump_fields": [
{"tag": "OriginHost", "path": "*exp.OriginHost", "type": "*variable", "value":"~*req.OriginHost"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value":"~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value":"~*req.RequestType"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value":"~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value":"~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value":"~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value":"~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value":"~*req.AnswerTime"},
{"tag": "EndTime", "path": "*exp.EndTime", "type": "*variable", "value":"~*req.EndTime"},
{"tag": "DisconnectCause", "path": "*exp.DisconnectCause", "type": "*variable", "value":"~*req.DisconnectCause"},
{"tag": "DialogId", "path": "*exp.DialogId", "type": "*variable", "value":"~*req.DialogId"},
],
},

View File

@@ -76,9 +76,11 @@
},
"ers": {
"enabled": true,
"sessions_conns": ["*internal"],
"partial_cache_ttl": "500ms",
"readers": [
{
"id": "file_reader1",
@@ -264,10 +266,11 @@
"type": "*file_csv",
"source_path": "/tmp/partErs1/in",
"flags": ["*cdrs"],
"processed_path": "/tmp/partErs1/out",
"processed_path": "",
"opts": {
"csvCacheExpiryAction": "*dump_to_file",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs1/out",
},
"fields":[
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
@@ -287,8 +290,8 @@
{"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"]},// keep this here for partial cdr field
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]},
],
"cache_dump_fields": [
{"tag": "OriginID", "path":"*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
@@ -299,7 +302,6 @@
{"tag": "SetupTime", "path":"*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "AnswerTime", "path":"*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "Usage", "path":"*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path":"*exp.Cost", "type": "*variable", "value": "~*req.Cost","rounding_decimals":5},
],
},
{
@@ -308,11 +310,12 @@
"run_delay": "-1",
"type": "*file_csv",
"source_path": "/tmp/partErs2/in",
"processed_path": "/tmp/partErs2/out",
"processed_path": "",
"flags": ["*cdrs"],
"opts": {
"csvCacheExpiryAction": "*post_cdr",
"partialCacheAction": "*post_cdr",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs2/out",
},
"fields":[
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
@@ -332,39 +335,63 @@
{"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"]},// keep this here for partial cdr field
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]}
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]}
],
},
{
"id": "FlatstoreOsips",
"enabled": true,
"run_delay": "-1",
"type": "*flatstore",
"type": "*file_csv",
"opts": {
"fstFieldSeparator":"|",
"fstFailedCallsPrefix": "missed_calls",
"fstRecordCacheTTL": "500ms",
"csvFieldSeparator":"|",
"partialcsvFieldSeparator": "|",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*opts.order",
"partialPath": "/tmp/flatstoreErs/out",
},
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"flags": ["*cdrs"],
"fields":[
{"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant","value":"flatStore", "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": "~*invite.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": "~*invite.8", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*invite.8", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*invite.9", "mandatory": true},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*invite.6", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*invite.6", "mandatory": true},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*bye.6;~*invite.6", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls"]},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "EndTime", "path": "*cgreq.EndTime", "type": "*variable","value": "~*req.6", "mandatory": true, "filters": ["*string:~*req.0:BYE"]},
{"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"}
{"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Invite", "path": "*opts.invite", "type": "*constant", "value": "true", "filters":["*string:~*req.0:INVITE"]},
{"tag": "Bye", "path": "*opts.bye", "type": "*constant", "value": "true", "filters":["*string:~*req.0:BYE"]},
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "0", "filters":["*string:~*req.0:INVITE"]},
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "1", "filters":["*string:~*req.0:BYE"]},
],
"partial_commit_fields": [
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*req.EndTime;~*req.AnswerTime", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls","*exists:~*opts.invite:","*exists:~*opts.bye:"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*exists:~*opts.invite:","*exists:~*opts.bye:"]},
],
"cache_dump_fields": [
{"tag": "OriginHost", "path": "*exp.OriginHost", "type": "*variable", "value":"~*req.OriginHost"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value":"~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value":"~*req.RequestType"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value":"~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value":"~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value":"~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value":"~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value":"~*req.AnswerTime"},
{"tag": "EndTime", "path": "*exp.EndTime", "type": "*variable", "value":"~*req.EndTime"},
{"tag": "DisconnectCause", "path": "*exp.DisconnectCause", "type": "*variable", "value":"~*req.DisconnectCause"},
{"tag": "DialogId", "path": "*exp.DialogId", "type": "*variable", "value":"~*req.DialogId"},
],
},
{
"id": "JSONReader",
@@ -400,7 +427,7 @@
{"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2"},
],
}
]
],
},

View File

@@ -73,9 +73,11 @@
},
"ers": {
"enabled": true,
"sessions_conns": ["*internal"],
"partial_cache_ttl": "500ms",
"readers": [
{
"id": "file_reader1",
@@ -261,10 +263,11 @@
"type": "*file_csv",
"source_path": "/tmp/partErs1/in",
"flags": ["*cdrs"],
"processed_path": "/tmp/partErs1/out",
"processed_path": "",
"opts": {
"csvCacheExpiryAction": "*dump_to_file",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs1/out",
},
"fields":[
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
@@ -284,8 +287,8 @@
{"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"]},// keep this here for partial cdr field
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]},
],
"cache_dump_fields": [
{"tag": "OriginID", "path":"*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
@@ -296,7 +299,6 @@
{"tag": "SetupTime", "path":"*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "AnswerTime", "path":"*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "Usage", "path":"*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path":"*exp.Cost", "type": "*variable", "value": "~*req.Cost","rounding_decimals":5},
],
},
{
@@ -305,11 +307,12 @@
"run_delay": "-1",
"type": "*file_csv",
"source_path": "/tmp/partErs2/in",
"processed_path": "/tmp/partErs2/out",
"processed_path": "",
"flags": ["*cdrs"],
"opts": {
"csvCacheExpiryAction": "*post_cdr",
"partialCacheAction": "*post_cdr",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs2/out",
},
"fields":[
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
@@ -329,39 +332,63 @@
{"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"]},// keep this here for partial cdr field
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]}
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]}
],
},
{
"id": "FlatstoreOsips",
"enabled": true,
"run_delay": "-1",
"type": "*flatstore",
"type": "*file_csv",
"opts": {
"fstFieldSeparator":"|",
"fstFailedCallsPrefix": "missed_calls",
"fstRecordCacheTTL": "500ms",
"csvFieldSeparator":"|",
"partialcsvFieldSeparator": "|",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*opts.order",
"partialPath": "/tmp/flatstoreErs/out",
},
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"flags": ["*cdrs"],
"fields":[
{"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant","value":"flatStore", "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": "~*invite.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": "~*invite.8", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*invite.8", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*invite.9", "mandatory": true},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*invite.6", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*invite.6", "mandatory": true},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*bye.6;~*invite.6", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls"]},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "EndTime", "path": "*cgreq.EndTime", "type": "*variable","value": "~*req.6", "mandatory": true, "filters": ["*string:~*req.0:BYE"]},
{"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"}
{"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Invite", "path": "*opts.invite", "type": "*constant", "value": "true", "filters":["*string:~*req.0:INVITE"]},
{"tag": "Bye", "path": "*opts.bye", "type": "*constant", "value": "true", "filters":["*string:~*req.0:BYE"]},
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "0", "filters":["*string:~*req.0:INVITE"]},
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "1", "filters":["*string:~*req.0:BYE"]},
],
"partial_commit_fields": [
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*req.EndTime;~*req.AnswerTime", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls","*exists:~*opts.invite:","*exists:~*opts.bye:"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*exists:~*opts.invite:","*exists:~*opts.bye:"]},
],
"cache_dump_fields": [
{"tag": "OriginHost", "path": "*exp.OriginHost", "type": "*variable", "value":"~*req.OriginHost"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value":"~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value":"~*req.RequestType"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value":"~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value":"~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value":"~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value":"~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value":"~*req.AnswerTime"},
{"tag": "EndTime", "path": "*exp.EndTime", "type": "*variable", "value":"~*req.EndTime"},
{"tag": "DisconnectCause", "path": "*exp.DisconnectCause", "type": "*variable", "value":"~*req.DisconnectCause"},
{"tag": "DialogId", "path": "*exp.DialogId", "type": "*variable", "value":"~*req.DialogId"},
],
},
{
"id": "JSONReader",
@@ -397,7 +424,7 @@
{"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2"},
],
}
]
],
},

View File

@@ -70,9 +70,11 @@
},
"ers": {
"enabled": true,
"sessions_conns": ["*internal"],
"partial_cache_ttl": "500ms",
"readers": [
{
"id": "file_reader1",
@@ -258,10 +260,11 @@
"type": "*file_csv",
"source_path": "/tmp/partErs1/in",
"flags": ["*cdrs"],
"processed_path": "/tmp/partErs1/out",
"processed_path": "",
"opts": {
"csvCacheExpiryAction": "*dump_to_file",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs1/out",
},
"fields":[
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
@@ -281,8 +284,8 @@
{"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"]},// keep this here for partial cdr field
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]},
],
"cache_dump_fields": [
{"tag": "OriginID", "path":"*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
@@ -293,7 +296,6 @@
{"tag": "SetupTime", "path":"*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "AnswerTime", "path":"*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "Usage", "path":"*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path":"*exp.Cost", "type": "*variable", "value": "~*req.Cost","rounding_decimals":5},
],
},
{
@@ -302,11 +304,12 @@
"run_delay": "-1",
"type": "*file_csv",
"source_path": "/tmp/partErs2/in",
"processed_path": "/tmp/partErs2/out",
"processed_path": "",
"flags": ["*cdrs"],
"opts": {
"csvCacheExpiryAction": "*post_cdr",
"partialCacheAction": "*post_cdr",
"partialOrderField": "~*req.AnswerTime",
"partialPath": "/tmp/partErs2/out",
},
"fields":[
{"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
@@ -326,39 +329,63 @@
{"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"]},// keep this here for partial cdr field
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.Partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]}
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false", "filters":["*notstring:~*req.10:partial"]}
],
},
{
"id": "FlatstoreOsips",
"enabled": true,
"run_delay": "-1",
"type": "*flatstore",
"type": "*file_csv",
"opts": {
"fstFieldSeparator":"|",
"fstFailedCallsPrefix": "missed_calls",
"fstRecordCacheTTL": "500ms",
"csvFieldSeparator":"|",
"partialcsvFieldSeparator": "|",
"partialCacheAction": "*dump_to_file",
"partialOrderField": "~*opts.order",
"partialPath": "/tmp/flatstoreErs/out",
},
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"flags": ["*cdrs"],
"fields":[
{"tag": "Tor", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*constant","value":"flatStore", "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": "~*invite.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": "~*invite.8", "mandatory": true},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*invite.8", "mandatory": true},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*invite.9", "mandatory": true},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*invite.6", "mandatory": true},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*invite.6", "mandatory": true},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*bye.6;~*invite.6", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls"]},
{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.8", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.8", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.9", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true,"filters": ["*string:~*req.0:INVITE"]},
{"tag": "EndTime", "path": "*cgreq.EndTime", "type": "*variable","value": "~*req.6", "mandatory": true, "filters": ["*string:~*req.0:BYE"]},
{"tag": "DisconnectCause", "path": "*cgreq.DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"}
{"tag": "DialogId", "path": "*cgreq.DialogId", "type": "*variable", "value": "~*req.11"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "true"},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Invite", "path": "*opts.invite", "type": "*constant", "value": "true", "filters":["*string:~*req.0:INVITE"]},
{"tag": "Bye", "path": "*opts.bye", "type": "*constant", "value": "true", "filters":["*string:~*req.0:BYE"]},
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "0", "filters":["*string:~*req.0:INVITE"]},
{"tag": "Order", "path": "*opts.order", "type": "*constant", "value": "1", "filters":["*string:~*req.0:BYE"]},
],
"partial_commit_fields": [
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant","value": "0", "mandatory": true, "filters": ["*prefix:~*vars.FileName:missed_calls"]},
{"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference","value": "~*req.EndTime;~*req.AnswerTime", "mandatory": true, "filters": ["*notprefix:~*vars.FileName:missed_calls","*exists:~*opts.invite:","*exists:~*opts.bye:"]},
{"tag": "Partial", "path": "*opts.*partial", "type": "*constant", "value": "false","filters": ["*exists:~*opts.invite:","*exists:~*opts.bye:"]},
],
"cache_dump_fields": [
{"tag": "OriginHost", "path": "*exp.OriginHost", "type": "*variable", "value":"~*req.OriginHost"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value":"~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value":"~*req.RequestType"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value":"~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value":"~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value":"~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value":"~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value":"~*req.AnswerTime"},
{"tag": "EndTime", "path": "*exp.EndTime", "type": "*variable", "value":"~*req.EndTime"},
{"tag": "DisconnectCause", "path": "*exp.DisconnectCause", "type": "*variable", "value":"~*req.DisconnectCause"},
{"tag": "DialogId", "path": "*exp.DialogId", "type": "*variable", "value":"~*req.DialogId"},
],
},
{
"id": "JSONReader",
@@ -394,7 +421,7 @@
{"tag": "ExtraInfo2", "path": "*cgreq.ExtraInfo2", "type": "*constant", "value": "ExtraInfo2"},
],
}
]
],
},