Changed *composed fields into *variable in templates

This commit is contained in:
adragusin
2020-01-28 15:35:41 +02:00
committed by Dan Christian Bogos
parent e73cdd0c5e
commit da9c00d50a
59 changed files with 842 additions and 899 deletions

View File

@@ -91,19 +91,19 @@
"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", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true},
{"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "~*req.3", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra3", "field_id": "HDRExtra3", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra2", "field_id": "HDRExtra2", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra1", "field_id": "HDRExtra1", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra3", "field_id": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra2", "field_id": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra1", "field_id": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true},
],
},
{
@@ -178,20 +178,20 @@
"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", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "~*req.0", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*composed", "value": "~*req.1", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*composed", "value": "~*req.2", "mandatory": true},
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "call", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "~*req.3", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true},
{"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true},
{"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true},
{"tag": "Category", "field_id": "Category", "type": "*variable", "value": "call", "mandatory": true},
{"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true},
{"tag": "Source", "field_id": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "~*req.3", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "~*req.5", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra3", "field_id": "HDRExtra3", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra2", "field_id": "HDRExtra2", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra1", "field_id": "HDRExtra1", "type": "*composed", "value": "~*req.6", "mandatory": true},
{"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true},
{"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true},
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true},
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true},
{"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra3", "field_id": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra2", "field_id": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true},
{"tag": "HDRExtra1", "field_id": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true},
],
},
{
@@ -277,15 +277,15 @@
{"tag": "Partial", "field_id": "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", "type": "*variable", "value": "~OriginID"},
{"tag": "OrderID", "type": "*variable", "value": "~OrderID"},
{"tag": "RequestType", "type": "*variable", "value": "~RequestType"},
{"tag": "Account", "type": "*variable", "value": "~Account"},
{"tag": "Destination", "type": "*variable", "value": "~Destination"},
{"tag": "SetupTime", "type": "*variable", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "AnswerTime", "type": "*variable", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"tag": "Usage", "type": "*variable", "value": "~Usage"},
{"tag": "Cost", "type": "*variable", "value": "~Cost","rounding_decimals":5},
],
},
{
@@ -331,7 +331,7 @@
"partial_record_cache": "2s",
"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": "OriginID", "field_id": "OriginID", "type": "*variable","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},
@@ -341,7 +341,7 @@
{"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": "DisconnectCause", "field_id": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true},
{"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"}
],
}