Diameter template - append_cca option

This commit is contained in:
DanB
2016-03-10 09:09:16 +01:00
parent f982112ab7
commit 31962c1a82
4 changed files with 7 additions and 0 deletions

View File

@@ -285,6 +285,7 @@ const CGRATES_CFG_JSON = `
"request_filter": "Subscription-Id>Subscription-Id-Type(0)", // filter requests processed by this processor
"flags": [], // flags to influence processing behavior
"continue_on_success": false, // continue to the next template if executed
"append_cca": false, // when continuing will append cca fields to the previous ones
"ccr_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": "*composed", "value": "^*voice", "mandatory": true},
{"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "Session-Id", "mandatory": true},

View File

@@ -443,6 +443,7 @@ func TestDiameterAgentJsonCfg(t *testing.T) {
Request_filter: utils.StringPointer("Subscription-Id>Subscription-Id-Type(0)"),
Flags: utils.StringSlicePointer([]string{}),
Continue_on_success: utils.BoolPointer(false),
Append_cca: utils.BoolPointer(false),
CCR_fields: &[]*CdrFieldJsonCfg{
&CdrFieldJsonCfg{Tag: utils.StringPointer("TOR"), Field_id: utils.StringPointer(utils.TOR), Type: utils.StringPointer(utils.META_COMPOSED),
Value: utils.StringPointer("^*voice"), Mandatory: utils.BoolPointer(true)},

View File

@@ -110,6 +110,7 @@ type DARequestProcessor struct {
RequestFilter utils.RSRFields
Flags utils.StringMap // Various flags to influence behavior
ContinueOnSuccess bool
AppendCCA bool
CCRFields []*CfgCdrField
CCAFields []*CfgCdrField
}
@@ -139,6 +140,9 @@ func (self *DARequestProcessor) loadFromJsonCfg(jsnCfg *DARequestProcessorJsnCfg
if jsnCfg.Continue_on_success != nil {
self.ContinueOnSuccess = *jsnCfg.Continue_on_success
}
if jsnCfg.Append_cca != nil {
self.AppendCCA = *jsnCfg.Append_cca
}
if jsnCfg.CCR_fields != nil {
if self.CCRFields, err = CfgCdrFieldsFromCdrFieldsJsonCfg(*jsnCfg.CCR_fields); err != nil {
return err

View File

@@ -266,6 +266,7 @@ type DARequestProcessorJsnCfg struct {
Request_filter *string
Flags *[]string
Continue_on_success *bool
Append_cca *bool
CCR_fields *[]*CdrFieldJsonCfg
CCA_fields *[]*CdrFieldJsonCfg
}