Added tests with FilterIDs for fwv

This commit is contained in:
Trial97
2018-09-25 15:28:05 +03:00
committed by Dan Christian Bogos
parent 095735ee66
commit cb3e76e6c2
2 changed files with 151 additions and 0 deletions

View File

@@ -71,6 +71,48 @@
{"tag": "TotalDuration", "type": "metatag", "metatag_id":"total_duration", "value": "~150-162"},
],
},
{
"id": "FWVWithFilterID",
"enabled": true, // enable CDR client functionality
"dry_run": false,
"cdrs_conns": [
{"address": "*internal"} // address where to reach CDR server. <*internal|x.y.z.y:1234>
],
"cdr_format": "fwv", // CDR file format <csv|freeswitch_csv|fwv|opensips_flatstore>
"cdr_in_dir": "/tmp/cgr_fwv/cdrc/in", // absolute path towards the directory where the CDRs are stored
"cdr_out_dir": "/tmp/cgr_fwv/cdrc/out", // absolute path towards the directory where processed CDRs will be moved
"cdr_source_id": "cdrc", // free form field, id identifying the source of the CDRs within CDRS database
"filters":["FLTR_FWV"],
"header_fields": [
{"tag": "FileName", "field_id": "CdrFileName", "type": "*composed", "value": "~95-135", "padding":"right"},
{"tag": "FileSeqNr", "field_id": "FileSeqNr", "type": "*composed", "value": "~135-141", "padding":"zeroleft"},
{"tag": "AccId1", "field_id": "AccId1", "type": "*composed", "value": "~135-141", "padding":"zeroleft"},
],
"content_fields": [ // import template, id will match internally CDR field, in case of .csv value will be represented by index of the field value
{"tag": "Tor", "field_id": "ToR", "type": "*composed", "value": "*voice", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "rated", "mandatory": true},
{"tag": "Direction", "field_id": "Direction", "type": "*composed", "value": "*out", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~0-10", "padding":"right", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "cgrates.org", "mandatory": true},
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~30-49", "padding":"right", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "~30-49", "padding":"right", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "~52-80", "padding":"right", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "~14-30:s/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}-${2}-${3} ${4}:${5}:${6}/", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "~14-30:s/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}-${2}-${3} ${4}:${5}:${6}/", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "~127-135:s/(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}h${2}m${3}s/", "mandatory": true},
{"tag": "DisconnectCause", "field_id": "DisconnectCause", "type": "*composed", "value": "~138-139", "mandatory": true},
{"tag": "RetailAmount", "field_id": "RetailAmount", "type": "*composed", "value": "~103-111", "padding":"zeroleft"},
{"tag": "WholesaleAmount", "field_id": "RetailAmount", "type": "*composed", "value": "~115-123", "padding":"zeroleft"},
{"tag": "AccId1", "field_id": "AccId1", "type": "*composed", "value": "~3-6", "padding":"zeroleft", "mandatory": true},
{"tag": "AccId2", "field_id": "AccId2", "type": "*composed", "value": "~14-30", "padding":"right", "mandatory": true},
],
"trailer_fields": [
{"tag": "NrOfCdrs", "type": "metatag", "metatag_id":"total_cdrs", "value": "~142-150"},
{"tag": "TotalDuration", "type": "metatag", "metatag_id":"total_duration", "value": "~150-162"},
],
},
],
}