mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 21:29:52 +05:00
Diameter config template - adding flags option
This commit is contained in:
@@ -80,7 +80,6 @@ type CfgCdrField struct {
|
||||
Strip string
|
||||
Padding string
|
||||
Layout string
|
||||
Flags utils.StringMap // Various flags to influence behavior
|
||||
Mandatory bool
|
||||
}
|
||||
|
||||
|
||||
@@ -278,10 +278,11 @@ const CGRATES_CFG_JSON = `
|
||||
"product_name": "CGRateS", // diameter Product-Name AVP used in replies
|
||||
"request_processors": [
|
||||
{
|
||||
"id": "*default", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"publish_event": false, // if enabled, it will publish internal event to pubsub
|
||||
"request_filter": "Subscription-Id>Subscription-Id-Type(0)", // filter requests processed by this processor
|
||||
"id": "*default", // formal identifier of this processor
|
||||
"dry_run": false, // do not send the events to SMG, just log them
|
||||
"publish_event": false, // if enabled, it will publish internal event to pubsub
|
||||
"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
|
||||
"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},
|
||||
|
||||
@@ -441,6 +441,7 @@ func TestDiameterAgentJsonCfg(t *testing.T) {
|
||||
Dry_run: utils.BoolPointer(false),
|
||||
Publish_event: utils.BoolPointer(false),
|
||||
Request_filter: utils.StringPointer("Subscription-Id>Subscription-Id-Type(0)"),
|
||||
Flags: utils.StringSlicePointer([]string{}),
|
||||
Continue_on_success: utils.BoolPointer(false),
|
||||
CCR_fields: &[]*CdrFieldJsonCfg{
|
||||
&CdrFieldJsonCfg{Tag: utils.StringPointer("TOR"), Field_id: utils.StringPointer(utils.TOR), Type: utils.StringPointer(utils.META_COMPOSED),
|
||||
|
||||
@@ -108,6 +108,7 @@ type DARequestProcessor struct {
|
||||
DryRun bool
|
||||
PublishEvent bool
|
||||
RequestFilter utils.RSRFields
|
||||
Flags utils.StringMap // Various flags to influence behavior
|
||||
ContinueOnSuccess bool
|
||||
CCRFields []*CfgCdrField
|
||||
CCAFields []*CfgCdrField
|
||||
@@ -132,6 +133,12 @@ func (self *DARequestProcessor) loadFromJsonCfg(jsnCfg *DARequestProcessorJsnCfg
|
||||
return err
|
||||
}
|
||||
}
|
||||
if jsnCfg.Flags != nil {
|
||||
self.Flags = utils.StringMapFromSlice(*jsnCfg.Flags)
|
||||
}
|
||||
if jsnCfg.Continue_on_success != nil {
|
||||
self.ContinueOnSuccess = *jsnCfg.Continue_on_success
|
||||
}
|
||||
if jsnCfg.CCR_fields != nil {
|
||||
if self.CCRFields, err = CfgCdrFieldsFromCdrFieldsJsonCfg(*jsnCfg.CCR_fields); err != nil {
|
||||
return err
|
||||
|
||||
@@ -263,6 +263,7 @@ type DARequestProcessorJsnCfg struct {
|
||||
Dry_run *bool
|
||||
Publish_event *bool
|
||||
Request_filter *string
|
||||
Flags *[]string
|
||||
Continue_on_success *bool
|
||||
CCR_fields *[]*CdrFieldJsonCfg
|
||||
CCA_fields *[]*CdrFieldJsonCfg
|
||||
|
||||
Reference in New Issue
Block a user