Added MetaVariable in cdr formatField

This commit is contained in:
adragusin
2020-01-30 18:00:04 +02:00
committed by Dan Christian Bogos
parent 3eaf3232a1
commit 37c79315a1
2 changed files with 12 additions and 12 deletions

View File

@@ -48,17 +48,17 @@
"attributes_context":"*cdre",
"filters" :["*string:~*req.Source:test2"],
"fields": [
{"path": "*exp.CGRID", "type": "*composed", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*composed", "value": "~*req.RunID"},
{"path": "*exp.Source", "type": "*composed", "value": "~*req.Source"},
{"path": "*exp.OriginID", "type": "*composed", "value": "~*req.OriginID"},
{"path": "*exp.Tenant", "type": "*composed", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*composed", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*composed", "value": "~*req.Account"},
{"path": "*exp.Subject", "type": "*composed", "value": "~*req.Subject"},
{"path": "*exp.Destination", "type": "*composed", "value": "~*req.Destination"},
{"path": "*exp.Usage", "type": "*composed", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*composed", "value": "~*req.Cost", "rounding_decimals": 4},
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.Source", "type": "*variable", "value": "~*req.Source"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost", "rounding_decimals": 4},
],
},
},

View File

@@ -383,7 +383,7 @@ func (cdr *CDR) formatField(cfgFld *config.FCTemplate, httpSkipTLSCheck bool,
}
case utils.META_COMBIMED:
outVal, err = cdr.combimedCdrFieldVal(cfgFld, groupedCDRs, filterS)
case utils.META_COMPOSED:
case utils.META_COMPOSED, utils.MetaVariable:
outVal, err = cdr.exportFieldValue(cfgFld, filterS)
case utils.MetaMaskedDestination:
if len(cfgFld.MaskDestID) != 0 && CachedDestHasPrefix(cfgFld.MaskDestID, cdr.Destination) {