Add test for Flatstore in ERs

This commit is contained in:
TeoV
2020-01-22 11:06:29 +02:00
parent e7f95a98f3
commit 0d4e989832
10 changed files with 334 additions and 39 deletions

View File

@@ -330,10 +330,12 @@
"enabled": true,
"run_delay": -1,
"type": "*opensips_flatstore",
"field_separator": "|",
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"failed_calls_prefix": "missed_calls",
"flags": ["*cdrs"],
"partial_record_cache": "1s",
"partial_record_cache": "2s",
"content_fields":[
{"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed","value":"~*req.3;~*req.1;~*req.2", "mandatory": true},
@@ -345,7 +347,7 @@
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*none", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "DisconnectCause", "field_id": "DisconnectCause", "type": "*composed", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"}
],

View File

@@ -333,10 +333,12 @@
"enabled": true,
"run_delay": -1,
"type": "*opensips_flatstore",
"field_separator": "|",
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"failed_calls_prefix": "missed_calls",
"flags": ["*cdrs"],
"partial_record_cache": "1s",
"partial_record_cache": "2s",
"content_fields":[
{"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed","value":"~*req.3;~*req.1;~*req.2", "mandatory": true},
@@ -348,7 +350,7 @@
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*none", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "DisconnectCause", "field_id": "DisconnectCause", "type": "*composed", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"}
],

View File

@@ -324,6 +324,33 @@
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true},
{"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}
],
},
{
"id": "FlatstoreOsips",
"enabled": true,
"run_delay": -1,
"type": "*opensips_flatstore",
"field_separator": "|",
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"failed_calls_prefix": "missed_calls",
"flags": ["*cdrs"],
"partial_record_cache": "2s",
"content_fields":[
{"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed","value":"~*req.3;~*req.1;~*req.2", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true},
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "DisconnectCause", "field_id": "DisconnectCause", "type": "*composed", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"}
],
}
],
},

View File

@@ -327,10 +327,12 @@
"enabled": true,
"run_delay": -1,
"type": "*opensips_flatstore",
"field_separator": "|",
"source_path": "/tmp/flatstoreErs/in",
"processed_path": "/tmp/flatstoreErs/out",
"failed_calls_prefix": "missed_calls",
"flags": ["*cdrs"],
"partial_record_cache": "1s",
"partial_record_cache": "2s",
"content_fields":[
{"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed","value":"~*req.3;~*req.1;~*req.2", "mandatory": true},
@@ -342,7 +344,7 @@
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*none", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record
{"tag": "DisconnectCause", "field_id": "DisconnectCause", "type": "*composed", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"}
],