diff --git a/agents/agentreq.go b/agents/agentreq.go index f25b94f47..fc96be678 100644 --- a/agents/agentreq.go +++ b/agents/agentreq.go @@ -156,7 +156,7 @@ func (ar *AgentRequest) AsNavigableMap(tplFlds []*config.FCTemplate) ( return nil, err } var valSet []*config.NMItem - fldPath := strings.Split(tplFld.FieldId, utils.NestingSep) + fldPath := strings.Split(tplFld.Path, utils.NestingSep) nMItm := &config.NMItem{Data: out, Path: fldPath, Config: tplFld} if nMFields, err := ar.CGRAReq.FieldAsInterface(fldPath); err != nil { diff --git a/agents/agentreq_test.go b/agents/agentreq_test.go index bfb9829f9..a21240bf8 100644 --- a/agents/agentreq_test.go +++ b/agents/agentreq_test.go @@ -65,43 +65,43 @@ func TestAgReqAsNavigableMap(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", - FieldId: utils.Tenant, Type: utils.META_COMPOSED, + Path: utils.Tenant, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Account", - FieldId: utils.Account, Type: utils.META_COMPOSED, + Path: utils.Account, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Account", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Destination", - FieldId: utils.Destination, Type: utils.META_COMPOSED, + Path: utils.Destination, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Destination", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "RequestedUsageVoice", - FieldId: "RequestedUsage", Type: utils.META_COMPOSED, + Path: "RequestedUsage", Type: utils.META_COMPOSED, Filters: []string{"*string:~*cgreq.ToR:*voice"}, Value: config.NewRSRParsersMustCompile( "~*cgreq.Usage{*duration_seconds}", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "RequestedUsageData", - FieldId: "RequestedUsage", Type: utils.META_COMPOSED, + Path: "RequestedUsage", Type: utils.META_COMPOSED, Filters: []string{"*string:~*cgreq.ToR:*data"}, Value: config.NewRSRParsersMustCompile( "~*cgreq.Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "RequestedUsageSMS", - FieldId: "RequestedUsage", Type: utils.META_COMPOSED, + Path: "RequestedUsage", Type: utils.META_COMPOSED, Filters: []string{"*string:~*cgreq.ToR:*sms"}, Value: config.NewRSRParsersMustCompile( "~*cgreq.Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "AttrPaypalAccount", - FieldId: "PaypalAccount", Type: utils.META_COMPOSED, + Path: "PaypalAccount", Type: utils.META_COMPOSED, Filters: []string{"*string:~*cgrep.Error:"}, Value: config.NewRSRParsersMustCompile( "~*cgrep.Attributes.PaypalAccount", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MaxUsage", - FieldId: "MaxUsage", Type: utils.META_COMPOSED, + Path: "MaxUsage", Type: utils.META_COMPOSED, Filters: []string{"*string:~*cgrep.Error:"}, Value: config.NewRSRParsersMustCompile( "~*cgrep.MaxUsage{*duration_seconds}", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Error", - FieldId: "Error", Type: utils.META_COMPOSED, + Path: "Error", Type: utils.META_COMPOSED, Filters: []string{"*rsr::~*cgrep.Error(!^$)"}, Value: config.NewRSRParsersMustCompile( "~*cgrep.Error", true, utils.INFIELD_SEP)}, @@ -148,7 +148,7 @@ func TestAgReqMaxCost(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "MaxUsage", - FieldId: "MaxUsage", Type: utils.META_COMPOSED, + Path: "MaxUsage", Type: utils.META_COMPOSED, Filters: []string{"*rsr::~*cgrep.MaxUsage(>0s)"}, Value: config.NewRSRParsersMustCompile( "~*cgrep.MaxUsage{*duration_seconds}", true, utils.INFIELD_SEP)}, @@ -186,15 +186,15 @@ func TestAgReqParseFieldDiameter(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "MandatoryFalse", - FieldId: "MandatoryFalse", Type: utils.META_COMPOSED, + Path: "MandatoryFalse", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryFalse", true, utils.INFIELD_SEP), Mandatory: false}, &config.FCTemplate{Tag: "MandatoryTrue", - FieldId: "MandatoryTrue", Type: utils.META_COMPOSED, + Path: "MandatoryTrue", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryTrue", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Session-Id", Filters: []string{}, - FieldId: "Session-Id", Type: utils.META_COMPOSED, + Path: "Session-Id", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -235,11 +235,11 @@ func TestAgReqParseFieldRadius(t *testing.T) { agReq := NewAgentRequest(dP, nil, nil, nil, nil, "cgrates.org", "", filterS, nil, nil) tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "MandatoryFalse", - FieldId: "MandatoryFalse", Type: utils.META_COMPOSED, + Path: "MandatoryFalse", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryFalse", true, utils.INFIELD_SEP), Mandatory: false}, &config.FCTemplate{Tag: "MandatoryTrue", - FieldId: "MandatoryTrue", Type: utils.META_COMPOSED, + Path: "MandatoryTrue", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryTrue", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -275,11 +275,11 @@ Host: api.cgrates.org agReq := NewAgentRequest(dP, nil, nil, nil, nil, "cgrates.org", "", filterS, nil, nil) tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "MandatoryFalse", - FieldId: "MandatoryFalse", Type: utils.META_COMPOSED, + Path: "MandatoryFalse", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryFalse", true, utils.INFIELD_SEP), Mandatory: false}, &config.FCTemplate{Tag: "MandatoryTrue", - FieldId: "MandatoryTrue", Type: utils.META_COMPOSED, + Path: "MandatoryTrue", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryTrue", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -347,11 +347,11 @@ func TestAgReqParseFieldHttpXml(t *testing.T) { agReq := NewAgentRequest(dP, nil, nil, nil, nil, "cgrates.org", "", filterS, nil, nil) tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "MandatoryFalse", - FieldId: "MandatoryFalse", Type: utils.META_COMPOSED, + Path: "MandatoryFalse", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryFalse", true, utils.INFIELD_SEP), Mandatory: false}, &config.FCTemplate{Tag: "MandatoryTrue", - FieldId: "MandatoryTrue", Type: utils.META_COMPOSED, + Path: "MandatoryTrue", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*req.MandatoryTrue", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -382,14 +382,14 @@ func TestAgReqEmptyFilter(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", Filters: []string{}, - FieldId: utils.Tenant, Type: utils.META_COMPOSED, + Path: utils.Tenant, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Account", Filters: []string{}, - FieldId: utils.Account, Type: utils.META_COMPOSED, + Path: utils.Account, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Account", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Destination", Filters: []string{}, - FieldId: utils.Destination, Type: utils.META_COMPOSED, + Path: utils.Destination, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Destination", true, utils.INFIELD_SEP)}, } eMp := config.NewNavigableMap(nil) @@ -421,7 +421,7 @@ func TestAgReqMetaExponent(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "TestExpo", Filters: []string{}, - FieldId: "TestExpo", Type: utils.MetaValueExponent, + Path: "TestExpo", Type: utils.MetaValueExponent, Value: config.NewRSRParsersMustCompile("~*cgreq.Value;~*cgreq.Exponent", true, utils.INFIELD_SEP)}, } eMp := config.NewNavigableMap(nil) @@ -446,16 +446,16 @@ func TestAgReqCGRActiveRequest(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Value1", Filters: []string{}, - FieldId: "Value1", Type: utils.META_CONSTANT, + Path: "Value1", Type: utils.META_CONSTANT, Value: config.NewRSRParsersMustCompile("12", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Value2", Filters: []string{}, - FieldId: "Value2", Type: utils.META_CONSTANT, + Path: "Value2", Type: utils.META_CONSTANT, Value: config.NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Value3", Filters: []string{}, - FieldId: "Value3", Type: utils.META_CONSTANT, + Path: "Value3", Type: utils.META_CONSTANT, Value: config.NewRSRParsersMustCompile("2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Diff", Filters: []string{}, - FieldId: "Diff", Type: utils.MetaDifference, + Path: "Diff", Type: utils.MetaDifference, Value: config.NewRSRParsersMustCompile("~*cgrareq.Value1;~*cgrareq.Value2;~*cgrareq.Value3", true, utils.INFIELD_SEP)}, } eMp := config.NewNavigableMap(nil) @@ -492,14 +492,14 @@ func TestAgReqFieldAsNone(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", - FieldId: utils.Tenant, Type: utils.META_COMPOSED, + Path: utils.Tenant, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Account", - FieldId: utils.Account, Type: utils.META_COMPOSED, + Path: utils.Account, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Account", true, utils.INFIELD_SEP)}, &config.FCTemplate{Type: utils.META_NONE, Blocker: true}, &config.FCTemplate{Tag: "Destination", - FieldId: utils.Destination, Type: utils.META_COMPOSED, + Path: utils.Destination, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Destination", true, utils.INFIELD_SEP)}, } eMp := config.NewNavigableMap(nil) @@ -529,14 +529,14 @@ func TestAgReqFieldAsNone2(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", - FieldId: utils.Tenant, Type: utils.META_COMPOSED, + Path: utils.Tenant, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Account", - FieldId: utils.Account, Type: utils.META_COMPOSED, + Path: utils.Account, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Account", true, utils.INFIELD_SEP)}, &config.FCTemplate{Type: utils.META_NONE}, &config.FCTemplate{Tag: "Destination", - FieldId: utils.Destination, Type: utils.META_COMPOSED, + Path: utils.Destination, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Destination", true, utils.INFIELD_SEP)}, } eMp := config.NewNavigableMap(nil) @@ -574,19 +574,19 @@ func TestAgReqAsNavigableMap2(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", - FieldId: utils.Tenant, Type: utils.META_COMPOSED, + Path: utils.Tenant, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Account", - FieldId: utils.Account, Type: utils.META_COMPOSED, + Path: utils.Account, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Account", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Destination", - FieldId: utils.Destination, Type: utils.META_COMPOSED, + Path: utils.Destination, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgreq.Destination", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Usage", - FieldId: utils.Usage, Type: utils.MetaVariable, + Path: utils.Usage, Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("30s", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "CalculatedUsage", - FieldId: "CalculatedUsage", Filters: []string{"*gt:~*cgrareq.Usage:0"}, + Path: "CalculatedUsage", Filters: []string{"*gt:~*cgrareq.Usage:0"}, Type: "*difference", Value: config.NewRSRParsersMustCompile("~*cgreq.AnswerTime;~*cgrareq.Usage", true, utils.INFIELD_SEP), }, } @@ -688,10 +688,10 @@ func TestAgReqNewARWithCGRRplyAndRply(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Fld1", - FieldId: "Fld1", Type: utils.MetaVariable, + Path: "Fld1", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~*rep.FirstLevel.SecondLevel.Fld1", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Fld2", - FieldId: "Fld2", Type: utils.MetaVariable, + Path: "Fld2", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~*cgrep.Attributes.PaypalAccount", true, utils.INFIELD_SEP)}, } @@ -731,10 +731,10 @@ func TestAgReqSetCGRReplyWithError(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Fld1", - FieldId: "Fld1", Type: utils.MetaVariable, + Path: "Fld1", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~*rep.FirstLevel.SecondLevel.Fld1", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Fld2", - FieldId: "Fld2", Type: utils.MetaVariable, + Path: "Fld2", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~*cgrep.Attributes.PaypalAccount", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -780,10 +780,10 @@ func TestAgReqSetCGRReplyWithoutError(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Fld1", - FieldId: "Fld1", Type: utils.MetaVariable, + Path: "Fld1", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~*rep.FirstLevel.SecondLevel.Fld1", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Fld2", - FieldId: "Fld2", Type: utils.MetaVariable, + Path: "Fld2", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~*cgrep.Attributes.PaypalAccount", true, utils.INFIELD_SEP)}, } @@ -823,7 +823,7 @@ func TestAgReqParseFieldMetaCCUsage(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "CCUsage", Filters: []string{}, - FieldId: "CCUsage", Type: utils.MetaCCUsage, + Path: "CCUsage", Type: utils.MetaCCUsage, Value: config.NewRSRParsersMustCompile("~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -834,7 +834,7 @@ func TestAgReqParseFieldMetaCCUsage(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "CCUsage", Filters: []string{}, - FieldId: "CCUsage", Type: utils.MetaCCUsage, + Path: "CCUsage", Type: utils.MetaCCUsage, Value: config.NewRSRParsersMustCompile("~*req.Session-Id;12s;12s", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -845,7 +845,7 @@ func TestAgReqParseFieldMetaCCUsage(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "CCUsage", Filters: []string{}, - FieldId: "CCUsage", Type: utils.MetaCCUsage, + Path: "CCUsage", Type: utils.MetaCCUsage, Value: config.NewRSRParsersMustCompile("10;~*req.Session-Id;12s", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -856,7 +856,7 @@ func TestAgReqParseFieldMetaCCUsage(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "CCUsage", Filters: []string{}, - FieldId: "CCUsage", Type: utils.MetaCCUsage, + Path: "CCUsage", Type: utils.MetaCCUsage, Value: config.NewRSRParsersMustCompile("10;12s;~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -867,7 +867,7 @@ func TestAgReqParseFieldMetaCCUsage(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "CCUsage", Filters: []string{}, - FieldId: "CCUsage", Type: utils.MetaCCUsage, + Path: "CCUsage", Type: utils.MetaCCUsage, Value: config.NewRSRParsersMustCompile("3;10s;5s", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -901,7 +901,7 @@ func TestAgReqParseFieldMetaUsageDifference(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Usage", Filters: []string{}, - FieldId: "Usage", Type: utils.META_USAGE_DIFFERENCE, + Path: "Usage", Type: utils.META_USAGE_DIFFERENCE, Value: config.NewRSRParsersMustCompile("~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -912,7 +912,7 @@ func TestAgReqParseFieldMetaUsageDifference(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "Usage", Filters: []string{}, - FieldId: "Usage", Type: utils.META_USAGE_DIFFERENCE, + Path: "Usage", Type: utils.META_USAGE_DIFFERENCE, Value: config.NewRSRParsersMustCompile("1560325161;~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -923,7 +923,7 @@ func TestAgReqParseFieldMetaUsageDifference(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "Usage", Filters: []string{}, - FieldId: "Usage", Type: utils.META_USAGE_DIFFERENCE, + Path: "Usage", Type: utils.META_USAGE_DIFFERENCE, Value: config.NewRSRParsersMustCompile("~*req.Session-Id;1560325161", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -934,7 +934,7 @@ func TestAgReqParseFieldMetaUsageDifference(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "Usage", Filters: []string{}, - FieldId: "Usage", Type: utils.META_USAGE_DIFFERENCE, + Path: "Usage", Type: utils.META_USAGE_DIFFERENCE, Value: config.NewRSRParsersMustCompile("1560325161;1560325151", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -967,7 +967,7 @@ func TestAgReqParseFieldMetaSum(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Sum", Filters: []string{}, - FieldId: "Sum", Type: utils.MetaSum, + Path: "Sum", Type: utils.MetaSum, Value: config.NewRSRParsersMustCompile("15;~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -978,7 +978,7 @@ func TestAgReqParseFieldMetaSum(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "Sum", Filters: []string{}, - FieldId: "Sum", Type: utils.MetaSum, + Path: "Sum", Type: utils.MetaSum, Value: config.NewRSRParsersMustCompile("15;15", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -1011,7 +1011,7 @@ func TestAgReqParseFieldMetaDifference(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "Diff", Filters: []string{}, - FieldId: "Diff", Type: utils.MetaDifference, + Path: "Diff", Type: utils.MetaDifference, Value: config.NewRSRParsersMustCompile("15;~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -1022,7 +1022,7 @@ func TestAgReqParseFieldMetaDifference(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "Diff", Filters: []string{}, - FieldId: "Diff", Type: utils.MetaDifference, + Path: "Diff", Type: utils.MetaDifference, Value: config.NewRSRParsersMustCompile("15;12;2", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -1055,7 +1055,7 @@ func TestAgReqParseFieldMetaValueExponent(t *testing.T) { tplFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "ValExp", Filters: []string{}, - FieldId: "ValExp", Type: utils.MetaValueExponent, + Path: "ValExp", Type: utils.MetaValueExponent, Value: config.NewRSRParsersMustCompile("~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -1066,7 +1066,7 @@ func TestAgReqParseFieldMetaValueExponent(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "ValExp", Filters: []string{}, - FieldId: "ValExp", Type: utils.MetaValueExponent, + Path: "ValExp", Type: utils.MetaValueExponent, Value: config.NewRSRParsersMustCompile("15;~*req.Session-Id", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -1077,7 +1077,7 @@ func TestAgReqParseFieldMetaValueExponent(t *testing.T) { tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "ValExp", Filters: []string{}, - FieldId: "ValExp", Type: utils.MetaValueExponent, + Path: "ValExp", Type: utils.MetaValueExponent, Value: config.NewRSRParsersMustCompile("~*req.Session-Id;15", true, utils.INFIELD_SEP), Mandatory: true}, } @@ -1087,7 +1087,7 @@ func TestAgReqParseFieldMetaValueExponent(t *testing.T) { } tplFlds = []*config.FCTemplate{ &config.FCTemplate{Tag: "ValExp", Filters: []string{}, - FieldId: "ValExp", Type: utils.MetaValueExponent, + Path: "ValExp", Type: utils.MetaValueExponent, Value: config.NewRSRParsersMustCompile("2;3", true, utils.INFIELD_SEP), Mandatory: true}, } diff --git a/agents/diamagent_test.go b/agents/diamagent_test.go index 5e89f7d65..97a6ef0c5 100644 --- a/agents/diamagent_test.go +++ b/agents/diamagent_test.go @@ -58,17 +58,17 @@ func TestProcessRequest(t *testing.T) { Tenant: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), Filters: []string{}, // empty for momment RequestFields: []*config.FCTemplate{ - &config.FCTemplate{Tag: utils.ToR, Type: utils.META_CONSTANT, FieldId: utils.ToR, Value: config.NewRSRParsersMustCompile(utils.VOICE, true, utils.INFIELD_SEP)}, - &config.FCTemplate{Tag: utils.OriginID, Type: utils.META_COMPOSED, FieldId: utils.OriginID, Value: config.NewRSRParsersMustCompile("~*req.SessionId", true, utils.INFIELD_SEP), Mandatory: true}, - &config.FCTemplate{Tag: utils.OriginHost, Type: utils.MetaRemoteHost, FieldId: utils.OriginHost, Mandatory: true}, - &config.FCTemplate{Tag: utils.Category, Type: utils.META_CONSTANT, FieldId: utils.Category, Value: config.NewRSRParsersMustCompile(utils.CALL, true, utils.INFIELD_SEP)}, - &config.FCTemplate{Tag: utils.Account, Type: utils.META_COMPOSED, FieldId: utils.Account, Value: config.NewRSRParsersMustCompile("~*req.Account", true, utils.INFIELD_SEP), Mandatory: true}, - &config.FCTemplate{Tag: utils.Destination, Type: utils.META_COMPOSED, FieldId: utils.Destination, Value: config.NewRSRParsersMustCompile("~*req.Destination", true, utils.INFIELD_SEP), Mandatory: true}, - &config.FCTemplate{Tag: utils.Usage, Type: utils.META_COMPOSED, FieldId: utils.Usage, Value: config.NewRSRParsersMustCompile("~*req.Usage", true, utils.INFIELD_SEP), Mandatory: true}, + &config.FCTemplate{Tag: utils.ToR, Type: utils.META_CONSTANT, Path: utils.ToR, Value: config.NewRSRParsersMustCompile(utils.VOICE, true, utils.INFIELD_SEP)}, + &config.FCTemplate{Tag: utils.OriginID, Type: utils.META_COMPOSED, Path: utils.OriginID, Value: config.NewRSRParsersMustCompile("~*req.SessionId", true, utils.INFIELD_SEP), Mandatory: true}, + &config.FCTemplate{Tag: utils.OriginHost, Type: utils.MetaRemoteHost, Path: utils.OriginHost, Mandatory: true}, + &config.FCTemplate{Tag: utils.Category, Type: utils.META_CONSTANT, Path: utils.Category, Value: config.NewRSRParsersMustCompile(utils.CALL, true, utils.INFIELD_SEP)}, + &config.FCTemplate{Tag: utils.Account, Type: utils.META_COMPOSED, Path: utils.Account, Value: config.NewRSRParsersMustCompile("~*req.Account", true, utils.INFIELD_SEP), Mandatory: true}, + &config.FCTemplate{Tag: utils.Destination, Type: utils.META_COMPOSED, Path: utils.Destination, Value: config.NewRSRParsersMustCompile("~*req.Destination", true, utils.INFIELD_SEP), Mandatory: true}, + &config.FCTemplate{Tag: utils.Usage, Type: utils.META_COMPOSED, Path: utils.Usage, Value: config.NewRSRParsersMustCompile("~*req.Usage", true, utils.INFIELD_SEP), Mandatory: true}, }, ReplyFields: []*config.FCTemplate{ - &config.FCTemplate{Tag: "ResultCode", Type: utils.META_CONSTANT, FieldId: "ResultCode", Value: config.NewRSRParsersMustCompile("2001", true, utils.INFIELD_SEP)}, - &config.FCTemplate{Tag: "GrantedUnits", Type: utils.META_COMPOSED, FieldId: "GrantedUnits", Value: config.NewRSRParsersMustCompile("~*cgrep.MaxUsage{*duration_seconds}", true, utils.INFIELD_SEP), Mandatory: true}, + &config.FCTemplate{Tag: "ResultCode", Type: utils.META_CONSTANT, Path: "ResultCode", Value: config.NewRSRParsersMustCompile("2001", true, utils.INFIELD_SEP)}, + &config.FCTemplate{Tag: "GrantedUnits", Type: utils.META_COMPOSED, Path: "GrantedUnits", Value: config.NewRSRParsersMustCompile("~*cgrep.MaxUsage{*duration_seconds}", true, utils.INFIELD_SEP), Mandatory: true}, }, } reqVars := map[string]interface{}{ @@ -318,7 +318,7 @@ func TestProcessRequest(t *testing.T) { } reqProcessor.Flags, _ = utils.FlagsWithParamsFromSlice([]string{utils.MetaTerminate, utils.MetaAccounts, utils.MetaAttributes, utils.MetaCDRs}) - reqProcessor.ReplyFields = []*config.FCTemplate{&config.FCTemplate{Tag: "ResultCode", Type: utils.META_CONSTANT, FieldId: "ResultCode", Value: config.NewRSRParsersMustCompile("2001", true, utils.INFIELD_SEP)}} + reqProcessor.ReplyFields = []*config.FCTemplate{&config.FCTemplate{Tag: "ResultCode", Type: utils.META_CONSTANT, Path: "ResultCode", Value: config.NewRSRParsersMustCompile("2001", true, utils.INFIELD_SEP)}} cgrRplyNM = config.NewNavigableMap(nil) rply = config.NewNavigableMap(nil) diff --git a/agents/librad.go b/agents/librad.go index bf1093361..3bc780d17 100644 --- a/agents/librad.go +++ b/agents/librad.go @@ -100,13 +100,13 @@ func radReplyAppendAttributes(reply *radigo.Packet, agReq *AgentRequest, if err != nil { return err } - if cfgFld.FieldId == MetaRadReplyCode { // Special case used to control the reply code of RADIUS reply + if cfgFld.Path == MetaRadReplyCode { // Special case used to control the reply code of RADIUS reply if err = reply.SetCodeWithName(fmtOut); err != nil { return err } continue } - attrName, vendorName := attrVendorFromPath(cfgFld.FieldId) + attrName, vendorName := attrVendorFromPath(cfgFld.Path) if err = reply.AddAVPWithName(attrName, fmtOut, vendorName); err != nil { return err } diff --git a/agents/librad_test.go b/agents/librad_test.go index 2b36f7a16..205740ee6 100644 --- a/agents/librad_test.go +++ b/agents/librad_test.go @@ -120,7 +120,7 @@ func TestRadFieldOutVal(t *testing.T) { agReq.Vars.Set([]string{MetaRadReqType}, MetaRadAcctStart, false, false) agReq.Vars.Set([]string{"Cisco"}, "CGR1", false, false) agReq.Vars.Set([]string{"User-Name"}, "flopsy", false, false) - cfgFld := &config.FCTemplate{Tag: "ComposedTest", Type: utils.META_COMPOSED, FieldId: utils.Destination, + cfgFld := &config.FCTemplate{Tag: "ComposedTest", Type: utils.META_COMPOSED, Path: utils.Destination, Value: config.NewRSRParsersMustCompile("~*vars.*radReqType;|;~*vars.User-Name;|;~*vars.Cisco", true, utils.INFIELD_SEP), Mandatory: true} if outVal, err := radFieldOutVal(pkt, agReq, cfgFld); err != nil { t.Error(err) @@ -132,9 +132,9 @@ func TestRadFieldOutVal(t *testing.T) { func TestRadReplyAppendAttributes(t *testing.T) { rply := radigo.NewPacket(radigo.AccessRequest, 2, dictRad, coder, "CGRateS.org").Reply() rplyFlds := []*config.FCTemplate{ - &config.FCTemplate{Tag: "ReplyCode", FieldId: MetaRadReplyCode, Type: utils.META_COMPOSED, + &config.FCTemplate{Tag: "ReplyCode", Path: MetaRadReplyCode, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgrep.Attributes.RadReply", true, utils.INFIELD_SEP)}, - &config.FCTemplate{Tag: "Acct-Session-Time", FieldId: "Acct-Session-Time", Type: utils.META_COMPOSED, + &config.FCTemplate{Tag: "Acct-Session-Time", Path: "Acct-Session-Time", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~*cgrep.MaxUsage{*duration_seconds}", true, utils.INFIELD_SEP)}, } agReq := NewAgentRequest(nil, nil, nil, nil, nil, "cgrates.org", "", nil, nil, nil) diff --git a/config/cdrecfg.go b/config/cdrecfg.go index 332ccb4e3..7e4537b28 100644 --- a/config/cdrecfg.go +++ b/config/cdrecfg.go @@ -28,9 +28,7 @@ type CdreCfg struct { Synchronous bool Attempts int FieldSeparator rune - HeaderFields []*FCTemplate - ContentFields []*FCTemplate - TrailerFields []*FCTemplate + Fields []*FCTemplate } func (self *CdreCfg) loadFromJsonCfg(jsnCfg *CdreJsonCfg, separator string) (err error) { @@ -65,18 +63,8 @@ func (self *CdreCfg) loadFromJsonCfg(jsnCfg *CdreJsonCfg, separator string) (err sepStr := *jsnCfg.Field_separator self.FieldSeparator = rune(sepStr[0]) } - if jsnCfg.Header_fields != nil { - if self.HeaderFields, err = FCTemplatesFromFCTemplatesJsonCfg(*jsnCfg.Header_fields, separator); err != nil { - return err - } - } - if jsnCfg.Content_fields != nil { - if self.ContentFields, err = FCTemplatesFromFCTemplatesJsonCfg(*jsnCfg.Content_fields, separator); err != nil { - return err - } - } - if jsnCfg.Trailer_fields != nil { - if self.TrailerFields, err = FCTemplatesFromFCTemplatesJsonCfg(*jsnCfg.Trailer_fields, separator); err != nil { + if jsnCfg.Fields != nil { + if self.Fields, err = FCTemplatesFromFCTemplatesJsonCfg(*jsnCfg.Fields, separator); err != nil { return err } } @@ -96,17 +84,9 @@ func (self *CdreCfg) Clone() *CdreCfg { for i, fltr := range self.Filters { clnCdre.Filters[i] = fltr } - clnCdre.HeaderFields = make([]*FCTemplate, len(self.HeaderFields)) - for idx, fld := range self.HeaderFields { - clnCdre.HeaderFields[idx] = fld.Clone() - } - clnCdre.ContentFields = make([]*FCTemplate, len(self.ContentFields)) - for idx, fld := range self.ContentFields { - clnCdre.ContentFields[idx] = fld.Clone() - } - clnCdre.TrailerFields = make([]*FCTemplate, len(self.TrailerFields)) - for idx, fld := range self.TrailerFields { - clnCdre.TrailerFields[idx] = fld.Clone() + clnCdre.Fields = make([]*FCTemplate, len(self.Fields)) + for idx, fld := range self.Fields { + clnCdre.Fields[idx] = fld.Clone() } return clnCdre } diff --git a/config/cdrecfg_test.go b/config/cdrecfg_test.go index 0019dcd97..e7dd4de33 100644 --- a/config/cdrecfg_test.go +++ b/config/cdrecfg_test.go @@ -25,18 +25,17 @@ import ( ) func TestCdreCfgClone(t *testing.T) { - cgrIdRsrs := NewRSRParsersMustCompile("cgrid", true, utils.INFIELD_SEP) - runIdRsrs := NewRSRParsersMustCompile("runid", true, utils.INFIELD_SEP) - emptyFields := []*FCTemplate{} + cgrIDRsrs := NewRSRParsersMustCompile("cgrid", true, utils.INFIELD_SEP) + runIDRsrs := NewRSRParsersMustCompile("runid", true, utils.INFIELD_SEP) initContentFlds := []*FCTemplate{ {Tag: "CgrId", - Type: utils.META_COMPOSED, - FieldId: "cgrid", - Value: cgrIdRsrs}, + Type: utils.META_COMPOSED, + Path: "cgrid", + Value: cgrIDRsrs}, {Tag: "RunId", - Type: utils.META_COMPOSED, - FieldId: "runid", - Value: runIdRsrs}, + Type: utils.META_COMPOSED, + Path: "runid", + Value: runIDRsrs}, } initCdreCfg := &CdreCfg{ ExportFormat: utils.MetaFileCSV, @@ -44,17 +43,17 @@ func TestCdreCfgClone(t *testing.T) { Synchronous: true, Attempts: 2, FieldSeparator: rune(utils.CSV_SEP), - ContentFields: initContentFlds, + Fields: initContentFlds, } eClnContentFlds := []*FCTemplate{ {Tag: "CgrId", - Type: utils.META_COMPOSED, - FieldId: "cgrid", - Value: cgrIdRsrs}, + Type: utils.META_COMPOSED, + Path: "cgrid", + Value: cgrIDRsrs}, {Tag: "RunId", - Type: utils.META_COMPOSED, - FieldId: "runid", - Value: runIdRsrs}, + Type: utils.META_COMPOSED, + Path: "runid", + Value: runIDRsrs}, } eClnCdreCfg := &CdreCfg{ ExportFormat: utils.MetaFileCSV, @@ -63,9 +62,7 @@ func TestCdreCfgClone(t *testing.T) { Attempts: 2, Filters: []string{}, FieldSeparator: rune(utils.CSV_SEP), - HeaderFields: emptyFields, - ContentFields: eClnContentFlds, - TrailerFields: emptyFields, + Fields: eClnContentFlds, } clnCdreCfg := initCdreCfg.Clone() if !reflect.DeepEqual(eClnCdreCfg, clnCdreCfg) { @@ -75,9 +72,9 @@ func TestCdreCfgClone(t *testing.T) { if !reflect.DeepEqual(eClnCdreCfg, clnCdreCfg) { // MOdifying a field after clone should not affect cloned instance t.Errorf("Cloned result: %+v", clnCdreCfg) } - clnCdreCfg.ContentFields[0].FieldId = "destination" - if initCdreCfg.ContentFields[0].FieldId != "cgrid" { - t.Error("Unexpected change of FieldId: ", initCdreCfg.ContentFields[0].FieldId) + clnCdreCfg.Fields[0].Path = "destination" + if initCdreCfg.Fields[0].Path != "cgrid" { + t.Error("Unexpected change of Path: ", initCdreCfg.Fields[0].Path) } } @@ -104,11 +101,9 @@ func TestCdreCfgloadFromJsonCfg(t *testing.T) { "synchronous": false, // block processing until export has a result "attempts": 1, // Number of attempts if not success "field_separator": ",", // used field separator in some export formats, eg: *file_csv - "header_fields": [], // template of the exported header fields - "content_fields": [ // template of the exported content fields - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, + "fields": [ // template of the exported content fields + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, ], - "trailer_fields": [], // template of the exported trailer fields }, }, }` @@ -123,13 +118,12 @@ func TestCdreCfgloadFromJsonCfg(t *testing.T) { Tenant: "cgrates.org", Attempts: 1, FieldSeparator: utils.CSV_SEP, - HeaderFields: []*FCTemplate{}, - ContentFields: []*FCTemplate{{ - Tag: "CGRID", + Fields: []*FCTemplate{{ + Path: "*exp.CGRID", + Tag: "*exp.CGRID", Type: "*composed", Value: val, }}, - TrailerFields: []*FCTemplate{}, } if jsnCfg, err := NewCgrJsonCfgFromBytes([]byte(cfgJSONStr)); err != nil { t.Error(err) diff --git a/config/config_defaults.go b/config/config_defaults.go index 45859fda4..321f396ca 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -280,24 +280,22 @@ const CGRATES_CFG_JSON = ` "attempts": 1, // export attempts "field_separator": ",", // used field separator in some export formats, eg: *file_csv "attributes_context": "", // attributes context - empty disables attributes processing - "header_fields": [], // template of the exported header fields - "content_fields": [ // template of the exported content fields - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag":"RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"TOR", "type": "*composed", "value": "~ToR"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Subject", "type": "*composed", "value": "~Subject"}, - {"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": 4}, + "fields": [ // template of the exported content fields + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.TOR", "type": "*composed", "value": "~ToR"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Subject", "type": "*composed", "value": "~Subject"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.SetupTime", "type": "*composed", "value": "~SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, ], - "trailer_fields": [], // template of the exported trailer fields }, }, @@ -319,18 +317,18 @@ const CGRATES_CFG_JSON = ` "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing - "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": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.10", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.11", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true}, + "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", "path": "ToR", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.10", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.11", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true}, ], "continue": false, // continue to the next template if executed }, @@ -419,45 +417,45 @@ const CGRATES_CFG_JSON = ` "asr_template": "", // enable AbortSession message being sent to client on DisconnectSession "templates":{ // default message templates "*err": [ - {"tag": "SessionId", "field_id": "Session-Id", "type": "*variable", + {"tag": "SessionId", "path": "Session-Id", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "Origin-Host", "type": "*variable", + {"tag": "OriginHost", "path": "Origin-Host", "type": "*variable", "value": "~*vars.OriginHost", "mandatory": true}, - {"tag": "OriginRealm", "field_id": "Origin-Realm", "type": "*variable", + {"tag": "OriginRealm", "path": "Origin-Realm", "type": "*variable", "value": "~*vars.OriginRealm", "mandatory": true}, ], "*cca": [ - {"tag": "SessionId", "field_id": "Session-Id", "type": "*variable", + {"tag": "SessionId", "path": "Session-Id", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "OriginHost", "field_id": "Origin-Host", "type": "*variable", + {"tag": "OriginHost", "path": "Origin-Host", "type": "*variable", "value": "~*vars.OriginHost", "mandatory": true}, - {"tag": "OriginRealm", "field_id": "Origin-Realm", "type": "*variable", + {"tag": "OriginRealm", "path": "Origin-Realm", "type": "*variable", "value": "~*vars.OriginRealm", "mandatory": true}, - {"tag": "AuthApplicationId", "field_id": "Auth-Application-Id", "type": "*variable", + {"tag": "AuthApplicationId", "path": "Auth-Application-Id", "type": "*variable", "value": "~*vars.*appid", "mandatory": true}, - {"tag": "CCRequestType", "field_id": "CC-Request-Type", "type": "*variable", + {"tag": "CCRequestType", "path": "CC-Request-Type", "type": "*variable", "value": "~*req.CC-Request-Type", "mandatory": true}, - {"tag": "CCRequestNumber", "field_id": "CC-Request-Number", "type": "*variable", + {"tag": "CCRequestNumber", "path": "CC-Request-Number", "type": "*variable", "value": "~*req.CC-Request-Number", "mandatory": true}, ], "*asr": [ - {"tag": "SessionId", "field_id": "Session-Id", "type": "*variable", + {"tag": "SessionId", "path": "Session-Id", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "Origin-Host", "type": "*variable", + {"tag": "OriginHost", "path": "Origin-Host", "type": "*variable", "value": "~*req.Destination-Host", "mandatory": true}, - {"tag": "OriginRealm", "field_id": "Origin-Realm", "type": "*variable", + {"tag": "OriginRealm", "path": "Origin-Realm", "type": "*variable", "value": "~*req.Destination-Realm", "mandatory": true}, - {"tag": "DestinationRealm", "field_id": "Destination-Realm", "type": "*variable", + {"tag": "DestinationRealm", "path": "Destination-Realm", "type": "*variable", "value": "~*req.Origin-Realm", "mandatory": true}, - {"tag": "DestinationHost", "field_id": "Destination-Host", "type": "*variable", + {"tag": "DestinationHost", "path": "Destination-Host", "type": "*variable", "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "AuthApplicationId", "field_id": "Auth-Application-Id", "type": "*variable", + {"tag": "AuthApplicationId", "path": "Auth-Application-Id", "type": "*variable", "value": "~*vars.*appid", "mandatory": true}, - {"tag": "UserName", "field_id": "User-Name", "type": "*variable", + {"tag": "UserName", "path": "User-Name", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "OriginStateID", "field_id": "Origin-State-Id", "type": "*constant", + {"tag": "OriginStateID", "path": "Origin-State-Id", "type": "*constant", "value": "1"}, ] }, @@ -581,147 +579,147 @@ const CGRATES_CFG_JSON = ` "type": "*attributes", // data source type "file_name": "Attributes.csv", // file name in the tp_in_dir "fields": [ - {"tag": "TenantID", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ProfileID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Contexts", "field_id": "Contexts", "type": "*variable", "value": "~2"}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~3"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~4"}, - {"tag": "AttributeFilterIDs", "field_id": "AttributeFilterIDs", "type": "*variable", "value": "~5"}, - {"tag": "Path", "field_id": "Path", "type": "*variable", "value": "~6"}, - {"tag": "Type", "field_id": "Type", "type": "*variable", "value": "~7"}, - {"tag": "Value", "field_id": "Value", "type": "*variable", "value": "~8"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~9"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~10"}, + {"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"}, + {"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~5"}, + {"tag": "Path", "path": "Path", "type": "*variable", "value": "~6"}, + {"tag": "Type", "path": "Type", "type": "*variable", "value": "~7"}, + {"tag": "Value", "path": "Value", "type": "*variable", "value": "~8"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"}, ], }, { "type": "*filters", // data source type "file_name": "Filters.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Type", "field_id": "Type", "type": "*variable", "value": "~2"}, - {"tag": "Element", "field_id": "Element", "type": "*variable", "value": "~3"}, - {"tag": "Values", "field_id": "Values", "type": "*variable", "value": "~4"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~5"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Type", "path": "Type", "type": "*variable", "value": "~2"}, + {"tag": "Element", "path": "Element", "type": "*variable", "value": "~3"}, + {"tag": "Values", "path": "Values", "type": "*variable", "value": "~4"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~5"}, ], }, { "type": "*resources", // data source type "file_name": "Resources.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "TTL", "field_id": "UsageTTL", "type": "*variable", "value": "~4"}, - {"tag": "Limit", "field_id": "Limit", "type": "*variable", "value": "~5"}, - {"tag": "AllocationMessage", "field_id": "AllocationMessage", "type": "*variable", "value": "~6"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~7"}, - {"tag": "Stored", "field_id": "Stored", "type": "*variable", "value": "~8"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~9"}, - {"tag": "ThresholdIDs", "field_id": "ThresholdIDs", "type": "*variable", "value": "~10"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "TTL", "path": "UsageTTL", "type": "*variable", "value": "~4"}, + {"tag": "Limit", "path": "Limit", "type": "*variable", "value": "~5"}, + {"tag": "AllocationMessage", "path": "AllocationMessage", "type": "*variable", "value": "~6"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"}, + {"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~8"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~9"}, + {"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~10"}, ], }, { "type": "*stats", // data source type "file_name": "Stats.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "QueueLength", "field_id": "QueueLength", "type": "*variable", "value": "~4"}, - {"tag": "TTL", "field_id": "TTL", "type": "*variable", "value": "~5"}, - {"tag": "MinItems", "field_id": "MinItems", "type": "*variable", "value": "~6"}, - {"tag": "MetricIDs", "field_id": "MetricIDs", "type": "*variable", "value": "~7"}, - {"tag": "MetricFilterIDs", "field_id": "MetricFilterIDs", "type": "*variable", "value": "~8"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~9"}, - {"tag": "Stored", "field_id": "Stored", "type": "*variable", "value": "~10"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~11"}, - {"tag": "ThresholdIDs", "field_id": "ThresholdIDs", "type": "*variable", "value": "~12"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "QueueLength", "path": "QueueLength", "type": "*variable", "value": "~4"}, + {"tag": "TTL", "path": "TTL", "type": "*variable", "value": "~5"}, + {"tag": "MinItems", "path": "MinItems", "type": "*variable", "value": "~6"}, + {"tag": "MetricIDs", "path": "MetricIDs", "type": "*variable", "value": "~7"}, + {"tag": "MetricFilterIDs", "path": "MetricFilterIDs", "type": "*variable", "value": "~8"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"}, + {"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~10"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~11"}, + {"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~12"}, ], }, { "type": "*thresholds", // data source type "file_name": "Thresholds.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "MaxHits", "field_id": "MaxHits", "type": "*variable", "value": "~4"}, - {"tag": "MinHits", "field_id": "MinHits", "type": "*variable", "value": "~5"}, - {"tag": "MinSleep", "field_id": "MinSleep", "type": "*variable", "value": "~6"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~7"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~8"}, - {"tag": "ActionIDs", "field_id": "ActionIDs", "type": "*variable", "value": "~9"}, - {"tag": "Async", "field_id": "Async", "type": "*variable", "value": "~10"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "MaxHits", "path": "MaxHits", "type": "*variable", "value": "~4"}, + {"tag": "MinHits", "path": "MinHits", "type": "*variable", "value": "~5"}, + {"tag": "MinSleep", "path": "MinSleep", "type": "*variable", "value": "~6"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~8"}, + {"tag": "ActionIDs", "path": "ActionIDs", "type": "*variable", "value": "~9"}, + {"tag": "Async", "path": "Async", "type": "*variable", "value": "~10"}, ], }, { "type": "*suppliers", // data source type "file_name": "Suppliers.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "Sorting", "field_id": "Sorting", "type": "*variable", "value": "~4"}, - {"tag": "SortingParamameters", "field_id": "SortingParamameters", "type": "*variable", "value": "~5"}, - {"tag": "SupplierID", "field_id": "SupplierID", "type": "*variable", "value": "~6"}, - {"tag": "SupplierFilterIDs", "field_id": "SupplierFilterIDs", "type": "*variable", "value": "~7"}, - {"tag": "SupplierAccountIDs", "field_id": "SupplierAccountIDs", "type": "*variable", "value": "~8"}, - {"tag": "SupplierRatingPlanIDs", "field_id": "SupplierRatingPlanIDs", "type": "*variable", "value": "~9"}, - {"tag": "SupplierResourceIDs", "field_id": "SupplierResourceIDs", "type": "*variable", "value": "~10"}, - {"tag": "SupplierStatIDs", "field_id": "SupplierStatIDs", "type": "*variable", "value": "~11"}, - {"tag": "SupplierWeight", "field_id": "SupplierWeight", "type": "*variable", "value": "~12"}, - {"tag": "SupplierBlocker", "field_id": "SupplierBlocker", "type": "*variable", "value": "~13"}, - {"tag": "SupplierParameters", "field_id": "SupplierParameters", "type": "*variable", "value": "~14"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~15"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "Sorting", "path": "Sorting", "type": "*variable", "value": "~4"}, + {"tag": "SortingParamameters", "path": "SortingParamameters", "type": "*variable", "value": "~5"}, + {"tag": "SupplierID", "path": "SupplierID", "type": "*variable", "value": "~6"}, + {"tag": "SupplierFilterIDs", "path": "SupplierFilterIDs", "type": "*variable", "value": "~7"}, + {"tag": "SupplierAccountIDs", "path": "SupplierAccountIDs", "type": "*variable", "value": "~8"}, + {"tag": "SupplierRatingPlanIDs", "path": "SupplierRatingPlanIDs", "type": "*variable", "value": "~9"}, + {"tag": "SupplierResourceIDs", "path": "SupplierResourceIDs", "type": "*variable", "value": "~10"}, + {"tag": "SupplierStatIDs", "path": "SupplierStatIDs", "type": "*variable", "value": "~11"}, + {"tag": "SupplierWeight", "path": "SupplierWeight", "type": "*variable", "value": "~12"}, + {"tag": "SupplierBlocker", "path": "SupplierBlocker", "type": "*variable", "value": "~13"}, + {"tag": "SupplierParameters", "path": "SupplierParameters", "type": "*variable", "value": "~14"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~15"}, ], }, { "type": "*chargers", // data source type "file_name": "Chargers.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "RunID", "field_id": "RunID", "type": "*variable", "value": "~4"}, - {"tag": "AttributeIDs", "field_id": "AttributeIDs", "type": "*variable", "value": "~5"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~6"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "RunID", "path": "RunID", "type": "*variable", "value": "~4"}, + {"tag": "AttributeIDs", "path": "AttributeIDs", "type": "*variable", "value": "~5"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~6"}, ], }, { "type": "*dispatchers", // data source type "file_name": "DispatcherProfiles.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Contexts", "field_id": "Contexts", "type": "*variable", "value": "~2"}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~3"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~4"}, - {"tag": "Strategy", "field_id": "Strategy", "type": "*variable", "value": "~5"}, - {"tag": "StrategyParameters", "field_id": "StrategyParameters", "type": "*variable", "value": "~6"}, - {"tag": "ConnID", "field_id": "ConnID", "type": "*variable", "value": "~7"}, - {"tag": "ConnFilterIDs", "field_id": "ConnFilterIDs", "type": "*variable", "value": "~8"}, - {"tag": "ConnWeight", "field_id": "ConnWeight", "type": "*variable", "value": "~9"}, - {"tag": "ConnBlocker", "field_id": "ConnBlocker", "type": "*variable", "value": "~10"}, - {"tag": "ConnParameters", "field_id": "ConnParameters", "type": "*variable", "value": "~11"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~12"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"}, + {"tag": "Strategy", "path": "Strategy", "type": "*variable", "value": "~5"}, + {"tag": "StrategyParameters", "path": "StrategyParameters", "type": "*variable", "value": "~6"}, + {"tag": "ConnID", "path": "ConnID", "type": "*variable", "value": "~7"}, + {"tag": "ConnFilterIDs", "path": "ConnFilterIDs", "type": "*variable", "value": "~8"}, + {"tag": "ConnWeight", "path": "ConnWeight", "type": "*variable", "value": "~9"}, + {"tag": "ConnBlocker", "path": "ConnBlocker", "type": "*variable", "value": "~10"}, + {"tag": "ConnParameters", "path": "ConnParameters", "type": "*variable", "value": "~11"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~12"}, ], }, { "type": "*dispatcher_hosts", // data source type "file_name": "DispatcherHosts.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Address", "field_id": "Address", "type": "*variable", "value": "~2"}, - {"tag": "Transport", "field_id": "Transport", "type": "*variable", "value": "~3"}, - {"tag": "TLS", "field_id": "TLS", "type": "*variable", "value": "~4"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Address", "path": "Address", "type": "*variable", "value": "~2"}, + {"tag": "Transport", "path": "Transport", "type": "*variable", "value": "~3"}, + {"tag": "TLS", "path": "TLS", "type": "*variable", "value": "~4"}, ], }, ], diff --git a/config/config_it_test.go b/config/config_it_test.go index 008926040..5cdce4aca 100644 --- a/config/config_it_test.go +++ b/config/config_it_test.go @@ -428,17 +428,17 @@ func testCGRConfigReloadERs(t *testing.T) { flags, _ := utils.FlagsWithParamsFromSlice([]string{"*dryrun"}) flagsDefault, _ := utils.FlagsWithParamsFromSlice([]string{}) content := []*FCTemplate{ - &FCTemplate{Tag: "TOR", FieldId: utils.ToR, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.OriginID, FieldId: utils.OriginID, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.RequestType, FieldId: utils.RequestType, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.Tenant, FieldId: utils.Tenant, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.Category, FieldId: utils.Category, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.Account, FieldId: utils.Account, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.Subject, FieldId: utils.Subject, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.Destination, FieldId: utils.Destination, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.SetupTime, FieldId: utils.SetupTime, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.AnswerTime, FieldId: utils.AnswerTime, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP), Mandatory: true}, - &FCTemplate{Tag: utils.Usage, FieldId: utils.Usage, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: "TOR", Path: utils.ToR, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.OriginID, Path: utils.OriginID, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.RequestType, Path: utils.RequestType, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.Tenant, Path: utils.Tenant, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.Category, Path: utils.Category, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.Account, Path: utils.Account, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.Subject, Path: utils.Subject, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.Destination, Path: utils.Destination, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.SetupTime, Path: utils.SetupTime, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.AnswerTime, Path: utils.AnswerTime, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP), Mandatory: true}, + &FCTemplate{Tag: utils.Usage, Path: utils.Usage, Type: utils.META_COMPOSED, Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true}, } expAttr := &ERsCfg{ Enabled: true, @@ -454,7 +454,6 @@ func testCGRConfigReloadERs(t *testing.T) { ProcessedPath: "/var/spool/cgrates/cdrc/out", Filters: []string{}, Flags: flagsDefault, - HeaderFields: []*FCTemplate{}, ContentFields: content, TrailerFields: []*FCTemplate{}, XmlRootPath: utils.HierarchyPath{utils.EmptyString}, @@ -468,7 +467,6 @@ func testCGRConfigReloadERs(t *testing.T) { SourcePath: "/tmp/ers/in", ProcessedPath: "/tmp/ers/out", Flags: flags, - HeaderFields: []*FCTemplate{}, ContentFields: content, TrailerFields: []*FCTemplate{}, XmlRootPath: utils.HierarchyPath{utils.EmptyString}, @@ -558,9 +556,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "ToR", + "Path": "ToR", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -584,9 +581,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "OriginID", + "Path": "OriginID", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -610,9 +606,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "RequestType", + "Path": "RequestType", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -636,9 +631,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "Tenant", + "Path": "Tenant", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -662,9 +656,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "Category", + "Path": "Category", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -688,9 +681,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "Account", + "Path": "Account", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -714,9 +706,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "Subject", + "Path": "Subject", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -740,9 +731,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "Destination", + "Path": "Destination", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -766,9 +756,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "SetupTime", + "Path": "SetupTime", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -792,9 +781,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "AnswerTime", + "Path": "AnswerTime", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -818,9 +806,8 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Blocker": false, "BreakOnSuccess": false, "CostShiftDigits": 0, - "FieldId": "Usage", + "Path": "Usage", "Filters": nil, - "HandlerId": "", "Layout": "", "Mandatory": true, "MaskDestID": "", @@ -848,11 +835,10 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "PartialRecordCache": 0, "CacheDumpFields": nil, "ConcurrentReqs": 1024, - "ContentFields": content, + "Fields": content, "FieldSep": ",", "Filters": []interface{}{}, "Flags": map[string]interface{}{}, - "HeaderFields": []interface{}{}, "FailedCallsPrefix": "", "ID": "*default", "ProcessedPath": "/var/spool/cgrates/cdrc/out", @@ -872,7 +858,6 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Flags": map[string]interface{}{ "*dryrun": []interface{}{}, }, - "HeaderFields": []interface{}{}, "FailedCallsPrefix": "", "PartialCacheExpiryAction": "", "PartialRecordCache": 0, @@ -885,7 +870,7 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "TrailerFields": []interface{}{}, "Type": "*file_csv", "XmlRootPath": []interface{}{utils.EmptyString}, - "ContentFields": content, + "Fields": content, }, }, "SessionSConns": []string{ diff --git a/config/config_json_test.go b/config/config_json_test.go index 65799f7f4..94e498c65 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -450,53 +450,80 @@ func TestDfCdrsJsonCfg(t *testing.T) { } func TestDfCdreJsonCfgs(t *testing.T) { - eFields := []*FcTemplateJsonCfg{} eContentFlds := []*FcTemplateJsonCfg{ - {Tag: utils.StringPointer("CGRID"), + { + Path: utils.StringPointer("*exp.CGRID"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.CGRID)}, - {Tag: utils.StringPointer("RunID"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.CGRID), + }, + { + Path: utils.StringPointer("*exp.RunID"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.RunID)}, - {Tag: utils.StringPointer("TOR"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.RunID), + }, + { + Path: utils.StringPointer("*exp.TOR"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.ToR)}, - {Tag: utils.StringPointer("OriginID"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.ToR), + }, + { + Path: utils.StringPointer("*exp.OriginID"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.OriginID)}, - {Tag: utils.StringPointer("RequestType"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.OriginID), + }, + { + Path: utils.StringPointer("*exp.RequestType"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.RequestType)}, - {Tag: utils.StringPointer("Tenant"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.RequestType), + }, + { + Path: utils.StringPointer("*exp.Tenant"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Tenant)}, - {Tag: utils.StringPointer("Category"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Tenant), + }, + { + Path: utils.StringPointer("*exp.Category"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Category)}, - {Tag: utils.StringPointer("Account"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Category), + }, + { + Path: utils.StringPointer("*exp.Account"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Account)}, - {Tag: utils.StringPointer("Subject"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Account), + }, + { + Path: utils.StringPointer("*exp.Subject"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Subject)}, - {Tag: utils.StringPointer("Destination"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Subject), + }, + { + Path: utils.StringPointer("*exp.Destination"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Destination)}, - {Tag: utils.StringPointer("SetupTime"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Destination), + }, + { + Path: utils.StringPointer("*exp.SetupTime"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer(utils.DynamicDataPrefix + utils.SetupTime), - Layout: utils.StringPointer("2006-01-02T15:04:05Z07:00")}, - {Tag: utils.StringPointer("AnswerTime"), + Layout: utils.StringPointer("2006-01-02T15:04:05Z07:00"), + }, + { + Path: utils.StringPointer("*exp.AnswerTime"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer(utils.DynamicDataPrefix + utils.AnswerTime), - Layout: utils.StringPointer("2006-01-02T15:04:05Z07:00")}, - {Tag: utils.StringPointer("Usage"), + Layout: utils.StringPointer("2006-01-02T15:04:05Z07:00"), + }, + { + Path: utils.StringPointer("*exp.Usage"), Type: utils.StringPointer(utils.META_COMPOSED), - Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Usage)}, - {Tag: utils.StringPointer("Cost"), + Value: utils.StringPointer(utils.DynamicDataPrefix + utils.Usage), + }, + { + Path: utils.StringPointer("*exp.Cost"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer(utils.DynamicDataPrefix + utils.COST), - Rounding_decimals: utils.IntPointer(4)}, + Rounding_decimals: utils.IntPointer(4), + }, } eCfg := map[string]*CdreJsonCfg{ utils.MetaDefault: { @@ -507,9 +534,7 @@ func TestDfCdreJsonCfgs(t *testing.T) { Tenant: utils.StringPointer(""), Attributes_context: utils.StringPointer(""), Field_separator: utils.StringPointer(","), - Header_fields: &eFields, - Content_fields: &eContentFlds, - Trailer_fields: &eFields, + Fields: &eContentFlds, Filters: &[]string{}, }, } @@ -637,97 +662,97 @@ func TestDiameterAgentJsonCfg(t *testing.T) { Templates: map[string][]*FcTemplateJsonCfg{ utils.MetaErr: { {Tag: utils.StringPointer("SessionId"), - Field_id: utils.StringPointer("Session-Id"), + Path: utils.StringPointer("Session-Id"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Session-Id"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("OriginHost"), - Field_id: utils.StringPointer("Origin-Host"), + Path: utils.StringPointer("Origin-Host"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*vars.OriginHost"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("OriginRealm"), - Field_id: utils.StringPointer("Origin-Realm"), + Path: utils.StringPointer("Origin-Realm"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*vars.OriginRealm"), Mandatory: utils.BoolPointer(true)}, }, utils.MetaCCA: { {Tag: utils.StringPointer("SessionId"), - Field_id: utils.StringPointer("Session-Id"), + Path: utils.StringPointer("Session-Id"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Session-Id"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("ResultCode"), - Field_id: utils.StringPointer("Result-Code"), - Type: utils.StringPointer(utils.META_CONSTANT), - Value: utils.StringPointer("2001")}, + Path: utils.StringPointer("Result-Code"), + Type: utils.StringPointer(utils.META_CONSTANT), + Value: utils.StringPointer("2001")}, {Tag: utils.StringPointer("OriginHost"), - Field_id: utils.StringPointer("Origin-Host"), + Path: utils.StringPointer("Origin-Host"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*vars.OriginHost"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("OriginRealm"), - Field_id: utils.StringPointer("Origin-Realm"), + Path: utils.StringPointer("Origin-Realm"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*vars.OriginRealm"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("AuthApplicationId"), - Field_id: utils.StringPointer("Auth-Application-Id"), + Path: utils.StringPointer("Auth-Application-Id"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*vars.*appid"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("CCRequestType"), - Field_id: utils.StringPointer("CC-Request-Type"), + Path: utils.StringPointer("CC-Request-Type"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.CC-Request-Type"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("CCRequestNumber"), - Field_id: utils.StringPointer("CC-Request-Number"), + Path: utils.StringPointer("CC-Request-Number"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.CC-Request-Number"), Mandatory: utils.BoolPointer(true)}, }, utils.MetaASR: { {Tag: utils.StringPointer("SessionId"), - Field_id: utils.StringPointer("Session-Id"), + Path: utils.StringPointer("Session-Id"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Session-Id"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("OriginHost"), - Field_id: utils.StringPointer("Origin-Host"), + Path: utils.StringPointer("Origin-Host"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Destination-Host"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("OriginRealm"), - Field_id: utils.StringPointer("Origin-Realm"), + Path: utils.StringPointer("Origin-Realm"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Destination-Realm"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("DestinationRealm"), - Field_id: utils.StringPointer("Destination-Realm"), + Path: utils.StringPointer("Destination-Realm"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Origin-Realm"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("DestinationHost"), - Field_id: utils.StringPointer("Destination-Host"), + Path: utils.StringPointer("Destination-Host"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.Origin-Host"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("AuthApplicationId"), - Field_id: utils.StringPointer("Auth-Application-Id"), + Path: utils.StringPointer("Auth-Application-Id"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*vars.*appid"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("UserName"), - Field_id: utils.StringPointer("User-Name"), + Path: utils.StringPointer("User-Name"), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.User-Name"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("OriginStateID"), - Field_id: utils.StringPointer("Origin-State-Id"), - Type: utils.StringPointer(utils.META_CONSTANT), - Value: utils.StringPointer("1")}, + Path: utils.StringPointer("Origin-State-Id"), + Type: utils.StringPointer(utils.META_CONSTANT), + Value: utils.StringPointer("1")}, }, }, Request_processors: &[]*ReqProcessorJsnCfg{}, @@ -921,51 +946,51 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.AttributesCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer("TenantID"), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("ProfileID"), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Contexts"), - Field_id: utils.StringPointer(utils.Contexts), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer(utils.Contexts), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer(utils.FilterIDs), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer(utils.FilterIDs), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("AttributeFilterIDs"), - Field_id: utils.StringPointer("AttributeFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("AttributeFilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("Path"), - Field_id: utils.StringPointer(utils.Path), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer(utils.Path), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, {Tag: utils.StringPointer("Type"), - Field_id: utils.StringPointer("Type"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~7")}, + Path: utils.StringPointer("Type"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~7")}, {Tag: utils.StringPointer("Value"), - Field_id: utils.StringPointer("Value"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~8")}, + Path: utils.StringPointer("Value"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~8")}, {Tag: utils.StringPointer("Blocker"), - Field_id: utils.StringPointer("Blocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~9")}, + Path: utils.StringPointer("Blocker"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~9")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer(utils.Weight), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~10")}, + Path: utils.StringPointer(utils.Weight), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~10")}, }, }, { @@ -973,31 +998,31 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.FiltersCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Type"), - Field_id: utils.StringPointer("Type"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("Type"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("Element"), - Field_id: utils.StringPointer("Element"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("Element"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("Values"), - Field_id: utils.StringPointer("Values"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("Values"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, }, }, { @@ -1005,51 +1030,51 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.ResourcesCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer("FilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("TTL"), - Field_id: utils.StringPointer("UsageTTL"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("UsageTTL"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("Limit"), - Field_id: utils.StringPointer("Limit"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("Limit"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("AllocationMessage"), - Field_id: utils.StringPointer("AllocationMessage"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer("AllocationMessage"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, {Tag: utils.StringPointer("Blocker"), - Field_id: utils.StringPointer("Blocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~7")}, + Path: utils.StringPointer("Blocker"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~7")}, {Tag: utils.StringPointer("Stored"), - Field_id: utils.StringPointer("Stored"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~8")}, + Path: utils.StringPointer("Stored"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~8")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer("Weight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~9")}, + Path: utils.StringPointer("Weight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~9")}, {Tag: utils.StringPointer("ThresholdIDs"), - Field_id: utils.StringPointer("ThresholdIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~10")}, + Path: utils.StringPointer("ThresholdIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~10")}, }, }, { @@ -1057,60 +1082,60 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.StatsCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer("FilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("QueueLength"), - Field_id: utils.StringPointer("QueueLength"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("QueueLength"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("TTL"), - Field_id: utils.StringPointer("TTL"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("TTL"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("MinItems"), - Field_id: utils.StringPointer("MinItems"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer("MinItems"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, {Tag: utils.StringPointer("MetricIDs"), - Field_id: utils.StringPointer("MetricIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~7")}, + Path: utils.StringPointer("MetricIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~7")}, {Tag: utils.StringPointer("MetricFilterIDs"), - Field_id: utils.StringPointer("MetricFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~8")}, + Path: utils.StringPointer("MetricFilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~8")}, {Tag: utils.StringPointer("Blocker"), - Field_id: utils.StringPointer("Blocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~9")}, + Path: utils.StringPointer("Blocker"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~9")}, {Tag: utils.StringPointer("Stored"), - Field_id: utils.StringPointer("Stored"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~10")}, + Path: utils.StringPointer("Stored"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~10")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer("Weight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~11")}, + Path: utils.StringPointer("Weight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~11")}, {Tag: utils.StringPointer("ThresholdIDs"), - Field_id: utils.StringPointer("ThresholdIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~12")}, + Path: utils.StringPointer("ThresholdIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~12")}, }, }, { @@ -1118,51 +1143,51 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.ThresholdsCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer("FilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("MaxHits"), - Field_id: utils.StringPointer("MaxHits"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("MaxHits"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("MinHits"), - Field_id: utils.StringPointer("MinHits"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("MinHits"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("MinSleep"), - Field_id: utils.StringPointer("MinSleep"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer("MinSleep"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, {Tag: utils.StringPointer("Blocker"), - Field_id: utils.StringPointer("Blocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~7")}, + Path: utils.StringPointer("Blocker"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~7")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer("Weight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~8")}, + Path: utils.StringPointer("Weight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~8")}, {Tag: utils.StringPointer("ActionIDs"), - Field_id: utils.StringPointer("ActionIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~9")}, + Path: utils.StringPointer("ActionIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~9")}, {Tag: utils.StringPointer("Async"), - Field_id: utils.StringPointer("Async"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~10")}, + Path: utils.StringPointer("Async"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~10")}, }, }, { @@ -1170,71 +1195,71 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.SuppliersCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer("FilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("Sorting"), - Field_id: utils.StringPointer("Sorting"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("Sorting"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("SortingParamameters"), - Field_id: utils.StringPointer("SortingParamameters"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("SortingParamameters"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("SupplierID"), - Field_id: utils.StringPointer("SupplierID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer("SupplierID"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, {Tag: utils.StringPointer("SupplierFilterIDs"), - Field_id: utils.StringPointer("SupplierFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~7")}, + Path: utils.StringPointer("SupplierFilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~7")}, {Tag: utils.StringPointer("SupplierAccountIDs"), - Field_id: utils.StringPointer("SupplierAccountIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~8")}, + Path: utils.StringPointer("SupplierAccountIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~8")}, {Tag: utils.StringPointer("SupplierRatingPlanIDs"), - Field_id: utils.StringPointer("SupplierRatingPlanIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~9")}, + Path: utils.StringPointer("SupplierRatingPlanIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~9")}, {Tag: utils.StringPointer("SupplierResourceIDs"), - Field_id: utils.StringPointer("SupplierResourceIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~10")}, + Path: utils.StringPointer("SupplierResourceIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~10")}, {Tag: utils.StringPointer("SupplierStatIDs"), - Field_id: utils.StringPointer("SupplierStatIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~11")}, + Path: utils.StringPointer("SupplierStatIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~11")}, {Tag: utils.StringPointer("SupplierWeight"), - Field_id: utils.StringPointer("SupplierWeight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~12")}, + Path: utils.StringPointer("SupplierWeight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~12")}, {Tag: utils.StringPointer("SupplierBlocker"), - Field_id: utils.StringPointer("SupplierBlocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~13")}, + Path: utils.StringPointer("SupplierBlocker"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~13")}, {Tag: utils.StringPointer("SupplierParameters"), - Field_id: utils.StringPointer("SupplierParameters"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~14")}, + Path: utils.StringPointer("SupplierParameters"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~14")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer("Weight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~15")}, + Path: utils.StringPointer("Weight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~15")}, }, }, { @@ -1242,35 +1267,35 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.ChargersCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer("FilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("RunID"), - Field_id: utils.StringPointer("RunID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("RunID"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("AttributeIDs"), - Field_id: utils.StringPointer("AttributeIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("AttributeIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer("Weight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer("Weight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, }, }, { @@ -1278,59 +1303,59 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.DispatcherProfilesCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Contexts"), - Field_id: utils.StringPointer("Contexts"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("Contexts"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("FilterIDs"), - Field_id: utils.StringPointer("FilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("ActivationInterval"), - Field_id: utils.StringPointer("ActivationInterval"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("ActivationInterval"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, {Tag: utils.StringPointer("Strategy"), - Field_id: utils.StringPointer("Strategy"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~5")}, + Path: utils.StringPointer("Strategy"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~5")}, {Tag: utils.StringPointer("StrategyParameters"), - Field_id: utils.StringPointer("StrategyParameters"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~6")}, + Path: utils.StringPointer("StrategyParameters"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~6")}, {Tag: utils.StringPointer("ConnID"), - Field_id: utils.StringPointer("ConnID"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~7")}, + Path: utils.StringPointer("ConnID"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~7")}, {Tag: utils.StringPointer("ConnFilterIDs"), - Field_id: utils.StringPointer("ConnFilterIDs"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~8")}, + Path: utils.StringPointer("ConnFilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~8")}, {Tag: utils.StringPointer("ConnWeight"), - Field_id: utils.StringPointer("ConnWeight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~9")}, + Path: utils.StringPointer("ConnWeight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~9")}, {Tag: utils.StringPointer("ConnBlocker"), - Field_id: utils.StringPointer("ConnBlocker"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~10")}, + Path: utils.StringPointer("ConnBlocker"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~10")}, {Tag: utils.StringPointer("ConnParameters"), - Field_id: utils.StringPointer("ConnParameters"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~11")}, + Path: utils.StringPointer("ConnParameters"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~11")}, {Tag: utils.StringPointer("Weight"), - Field_id: utils.StringPointer("Weight"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~12")}, + Path: utils.StringPointer("Weight"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~12")}, }, }, { @@ -1338,27 +1363,27 @@ func TestDfLoaderJsonCfg(t *testing.T) { File_name: utils.StringPointer(utils.DispatcherHostsCsv), Fields: &[]*FcTemplateJsonCfg{ {Tag: utils.StringPointer(utils.Tenant), - Field_id: utils.StringPointer(utils.Tenant), + Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~0"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer(utils.ID), - Field_id: utils.StringPointer(utils.ID), + Path: utils.StringPointer(utils.ID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~1"), Mandatory: utils.BoolPointer(true)}, {Tag: utils.StringPointer("Address"), - Field_id: utils.StringPointer("Address"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~2")}, + Path: utils.StringPointer("Address"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~2")}, {Tag: utils.StringPointer("Transport"), - Field_id: utils.StringPointer("Transport"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~3")}, + Path: utils.StringPointer("Transport"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~3")}, {Tag: utils.StringPointer("TLS"), - Field_id: utils.StringPointer("TLS"), - Type: utils.StringPointer(utils.MetaVariable), - Value: utils.StringPointer("~4")}, + Path: utils.StringPointer("TLS"), + Type: utils.StringPointer(utils.MetaVariable), + Value: utils.StringPointer("~4")}, }, }, }, @@ -1434,9 +1459,9 @@ func TestDfSureTaxJsonCfg(t *testing.T) { // t.Errorf("Expecting: %+v, received: %+v", eCfg, gCfg) // } // cdrFields := []*FcTemplateJsonCfg{ -// {Field_id: utils.StringPointer(utils.ToR), Value: utils.StringPointer("~7:s/^(voice|data|sms|mms|generic)$/*$1/")}, -// {Field_id: utils.StringPointer(utils.AnswerTime), Value: utils.StringPointer("~1")}, -// {Field_id: utils.StringPointer(utils.Usage), Value: utils.StringPointer(`~9:s/^(\d+)$/${1}s/`)}, +// {Path: utils.StringPointer(utils.ToR), Value: utils.StringPointer("~7:s/^(voice|data|sms|mms|generic)$/*$1/")}, +// {Path: utils.StringPointer(utils.AnswerTime), Value: utils.StringPointer("~1")}, +// {Path: utils.StringPointer(utils.Usage), Value: utils.StringPointer(`~9:s/^(\d+)$/${1}s/`)}, // } // eCfgCdrc := []*CdrcJsonCfg{ // { @@ -1453,7 +1478,7 @@ func TestDfSureTaxJsonCfg(t *testing.T) { // Cdr_in_path: utils.StringPointer("/tmp/cgrates/cdrc2/in"), // Cdr_out_path: utils.StringPointer("/tmp/cgrates/cdrc2/out"), // Cdr_source_id: utils.StringPointer("csv2"), -// Content_fields: &cdrFields, +// Fields: &cdrFields, // }, // } // if cfg, err := cgrJsonCfg.CdrcJsonCfg(); err != nil { @@ -1599,27 +1624,27 @@ func TestDfApierCfg(t *testing.T) { func TestDfEventReaderCfg(t *testing.T) { cdrFields := []*FcTemplateJsonCfg{ - {Tag: utils.StringPointer("TOR"), Field_id: utils.StringPointer(utils.ToR), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("TOR"), Path: utils.StringPointer(utils.ToR), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.2"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("OriginID"), Field_id: utils.StringPointer(utils.OriginID), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("OriginID"), Path: utils.StringPointer(utils.OriginID), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.3"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("RequestType"), Field_id: utils.StringPointer(utils.RequestType), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("RequestType"), Path: utils.StringPointer(utils.RequestType), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.4"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("Tenant"), Field_id: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("Tenant"), Path: utils.StringPointer(utils.Tenant), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.6"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("Category"), Field_id: utils.StringPointer(utils.Category), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("Category"), Path: utils.StringPointer(utils.Category), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.7"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("Account"), Field_id: utils.StringPointer(utils.Account), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("Account"), Path: utils.StringPointer(utils.Account), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.8"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("Subject"), Field_id: utils.StringPointer(utils.Subject), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("Subject"), Path: utils.StringPointer(utils.Subject), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.9"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("Destination"), Field_id: utils.StringPointer(utils.Destination), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("Destination"), Path: utils.StringPointer(utils.Destination), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.10"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("SetupTime"), Field_id: utils.StringPointer(utils.SetupTime), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("SetupTime"), Path: utils.StringPointer(utils.SetupTime), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.11"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("AnswerTime"), Field_id: utils.StringPointer(utils.AnswerTime), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("AnswerTime"), Path: utils.StringPointer(utils.AnswerTime), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.12"), Mandatory: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("Usage"), Field_id: utils.StringPointer(utils.Usage), Type: utils.StringPointer(utils.MetaVariable), + {Tag: utils.StringPointer("Usage"), Path: utils.StringPointer(utils.Usage), Type: utils.StringPointer(utils.MetaVariable), Value: utils.StringPointer("~*req.13"), Mandatory: utils.BoolPointer(true)}, } eCfg := &ERsJsonCfg{ diff --git a/config/config_test.go b/config/config_test.go index f6f85a6f2..322a8bc49 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -482,39 +482,94 @@ func TestCgrCfgJSONLoadCDRS(t *testing.T) { } func TestCgrCfgJSONDefaultsCdreProfiles(t *testing.T) { - eFields := []*FCTemplate{} eContentFlds := []*FCTemplate{ - {Tag: "CGRID", Type: "*composed", - Value: NewRSRParsersMustCompile("~CGRID", true, utils.INFIELD_SEP)}, - {Tag: "RunID", Type: "*composed", - Value: NewRSRParsersMustCompile("~RunID", true, utils.INFIELD_SEP)}, - {Tag: "TOR", Type: "*composed", - Value: NewRSRParsersMustCompile("~ToR", true, utils.INFIELD_SEP)}, - {Tag: "OriginID", Type: "*composed", - Value: NewRSRParsersMustCompile("~OriginID", true, utils.INFIELD_SEP)}, - {Tag: "RequestType", Type: "*composed", - Value: NewRSRParsersMustCompile("~RequestType", true, utils.INFIELD_SEP)}, - {Tag: "Tenant", Type: "*composed", - Value: NewRSRParsersMustCompile("~Tenant", true, utils.INFIELD_SEP)}, - {Tag: "Category", Type: "*composed", - Value: NewRSRParsersMustCompile("~Category", true, utils.INFIELD_SEP)}, - {Tag: "Account", Type: "*composed", - Value: NewRSRParsersMustCompile("~Account", true, utils.INFIELD_SEP)}, - {Tag: "Subject", Type: "*composed", - Value: NewRSRParsersMustCompile("~Subject", true, utils.INFIELD_SEP)}, - {Tag: "Destination", Type: "*composed", - Value: NewRSRParsersMustCompile("~Destination", true, utils.INFIELD_SEP)}, - {Tag: "SetupTime", Type: "*composed", + { + Tag: "*exp.CGRID", + Path: "*exp.CGRID", + Type: "*composed", + Value: NewRSRParsersMustCompile("~CGRID", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.RunID", + Path: "*exp.RunID", + Type: "*composed", + Value: NewRSRParsersMustCompile("~RunID", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.TOR", + Path: "*exp.TOR", + Type: "*composed", + Value: NewRSRParsersMustCompile("~ToR", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.OriginID", + Path: "*exp.OriginID", + Type: "*composed", + Value: NewRSRParsersMustCompile("~OriginID", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.RequestType", + Path: "*exp.RequestType", + Type: "*composed", + Value: NewRSRParsersMustCompile("~RequestType", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.Tenant", + Path: "*exp.Tenant", + Type: "*composed", + Value: NewRSRParsersMustCompile("~Tenant", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.Category", + Path: "*exp.Category", + Type: "*composed", + Value: NewRSRParsersMustCompile("~Category", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.Account", + Path: "*exp.Account", + Type: "*composed", + Value: NewRSRParsersMustCompile("~Account", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.Subject", + Path: "*exp.Subject", + Type: "*composed", + Value: NewRSRParsersMustCompile("~Subject", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.Destination", + Path: "*exp.Destination", + Type: "*composed", + Value: NewRSRParsersMustCompile("~Destination", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.SetupTime", + Path: "*exp.SetupTime", + Type: "*composed", Value: NewRSRParsersMustCompile("~SetupTime", true, utils.INFIELD_SEP), - Layout: "2006-01-02T15:04:05Z07:00"}, - {Tag: "AnswerTime", Type: "*composed", + Layout: "2006-01-02T15:04:05Z07:00", + }, + { + Tag: "*exp.AnswerTime", + Path: "*exp.AnswerTime", + Type: "*composed", Value: NewRSRParsersMustCompile("~AnswerTime", true, utils.INFIELD_SEP), - Layout: "2006-01-02T15:04:05Z07:00"}, - {Tag: "Usage", Type: "*composed", - Value: NewRSRParsersMustCompile("~Usage", true, utils.INFIELD_SEP)}, - {Tag: "Cost", Type: "*composed", + Layout: "2006-01-02T15:04:05Z07:00", + }, + { + Tag: "*exp.Usage", + Path: "*exp.Usage", + Type: "*composed", + Value: NewRSRParsersMustCompile("~Usage", true, utils.INFIELD_SEP), + }, + { + Tag: "*exp.Cost", + Path: "*exp.Cost", + Type: "*composed", Value: NewRSRParsersMustCompile("~Cost", true, utils.INFIELD_SEP), - RoundingDecimals: 4}, + RoundingDecimals: 4, + }, } eCdreCfg := map[string]*CdreCfg{ utils.MetaDefault: { @@ -525,9 +580,7 @@ func TestCgrCfgJSONDefaultsCdreProfiles(t *testing.T) { Attempts: 1, AttributeSContext: "", FieldSeparator: utils.CSV_SEP, - HeaderFields: eFields, - ContentFields: eContentFlds, - TrailerFields: eFields, + Fields: eContentFlds, }, } if !reflect.DeepEqual(cgrCfg.CdreProfiles, eCdreCfg) { @@ -969,51 +1022,51 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.AttributesCsv, Fields: []*FCTemplate{ {Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "Contexts", - FieldId: "Contexts", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "Contexts", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "AttributeFilterIDs", - FieldId: "AttributeFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "AttributeFilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, {Tag: "Path", - FieldId: "Path", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "Path", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, {Tag: "Type", - FieldId: "Type", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Type", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, {Tag: "Value", - FieldId: "Value", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Value", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, {Tag: "Blocker", - FieldId: "Blocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, }, }, { @@ -1021,31 +1074,31 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.FiltersCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "Type", - FieldId: "Type", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "Type", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "Element", - FieldId: "Element", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "Element", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "Values", - FieldId: "Values", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "Values", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, }, }, { @@ -1053,51 +1106,51 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.ResourcesCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "TTL", - FieldId: "UsageTTL", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "UsageTTL", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "Limit", - FieldId: "Limit", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "Limit", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, {Tag: "AllocationMessage", - FieldId: "AllocationMessage", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "AllocationMessage", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, {Tag: "Blocker", - FieldId: "Blocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, {Tag: "Stored", - FieldId: "Stored", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Stored", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, {Tag: "ThresholdIDs", - FieldId: "ThresholdIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "ThresholdIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, }, }, { @@ -1105,60 +1158,60 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.StatsCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "QueueLength", - FieldId: "QueueLength", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "QueueLength", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "TTL", - FieldId: "TTL", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "TTL", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, {Tag: "MinItems", - FieldId: "MinItems", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "MinItems", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, {Tag: "MetricIDs", - FieldId: "MetricIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "MetricIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, {Tag: "MetricFilterIDs", - FieldId: "MetricFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "MetricFilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, {Tag: "Blocker", - FieldId: "Blocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, {Tag: "Stored", - FieldId: "Stored", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Stored", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, {Tag: "ThresholdIDs", - FieldId: "ThresholdIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, + Path: "ThresholdIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, }, }, { @@ -1166,51 +1219,51 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.ThresholdsCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "MaxHits", - FieldId: "MaxHits", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "MaxHits", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "MinHits", - FieldId: "MinHits", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "MinHits", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, {Tag: "MinSleep", - FieldId: "MinSleep", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "MinSleep", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, {Tag: "Blocker", - FieldId: "Blocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, {Tag: "ActionIDs", - FieldId: "ActionIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "ActionIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, {Tag: "Async", - FieldId: "Async", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Async", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, }, }, { @@ -1218,71 +1271,71 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.SuppliersCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "Sorting", - FieldId: "Sorting", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "Sorting", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "SortingParamameters", - FieldId: "SortingParamameters", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "SortingParamameters", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, {Tag: "SupplierID", - FieldId: "SupplierID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "SupplierID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, {Tag: "SupplierFilterIDs", - FieldId: "SupplierFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "SupplierFilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, {Tag: "SupplierAccountIDs", - FieldId: "SupplierAccountIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "SupplierAccountIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, {Tag: "SupplierRatingPlanIDs", - FieldId: "SupplierRatingPlanIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "SupplierRatingPlanIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, {Tag: "SupplierResourceIDs", - FieldId: "SupplierResourceIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "SupplierResourceIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, {Tag: "SupplierStatIDs", - FieldId: "SupplierStatIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, + Path: "SupplierStatIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, {Tag: "SupplierWeight", - FieldId: "SupplierWeight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, + Path: "SupplierWeight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, {Tag: "SupplierBlocker", - FieldId: "SupplierBlocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP)}, + Path: "SupplierBlocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP)}, {Tag: "SupplierParameters", - FieldId: "SupplierParameters", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP)}, + Path: "SupplierParameters", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP)}, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP)}, }, }, { @@ -1290,35 +1343,35 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.ChargersCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, {Tag: "RunID", - FieldId: "RunID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "RunID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, {Tag: "AttributeIDs", - FieldId: "AttributeIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "AttributeIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, }, }, { @@ -1326,69 +1379,69 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.DispatcherProfilesCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "Contexts", - FieldId: "Contexts", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), + Path: "Contexts", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), }, {Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), }, {Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), }, {Tag: "Strategy", - FieldId: "Strategy", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP), + Path: "Strategy", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP), }, {Tag: "StrategyParameters", - FieldId: "StrategyParameters", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), + Path: "StrategyParameters", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), }, {Tag: "ConnID", - FieldId: "ConnID", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), + Path: "ConnID", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), }, {Tag: "ConnFilterIDs", - FieldId: "ConnFilterIDs", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), + Path: "ConnFilterIDs", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), }, {Tag: "ConnWeight", - FieldId: "ConnWeight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), + Path: "ConnWeight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), }, {Tag: "ConnBlocker", - FieldId: "ConnBlocker", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), + Path: "ConnBlocker", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), }, {Tag: "ConnParameters", - FieldId: "ConnParameters", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), + Path: "ConnParameters", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), }, {Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), + Path: "Weight", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), }, }, }, @@ -1397,29 +1450,29 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filename: utils.DispatcherHostsCsv, Fields: []*FCTemplate{ {Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, {Tag: "Address", - FieldId: "Address", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), + Path: "Address", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), }, {Tag: "Transport", - FieldId: "Transport", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), + Path: "Transport", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), }, {Tag: "TLS", - FieldId: "TLS", - Type: utils.MetaVariable, - Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), + Path: "TLS", + Type: utils.MetaVariable, + Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), }, }, }, @@ -1629,27 +1682,27 @@ func TestCgrCdfEventReader(t *testing.T) { Filters: []string{}, Flags: utils.FlagsWithParams{}, Fields: []*FCTemplate{ - {Tag: "TOR", FieldId: "ToR", Type: utils.MetaVariable, + {Tag: "TOR", Path: "ToR", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "OriginID", FieldId: "OriginID", Type: utils.MetaVariable, + {Tag: "OriginID", Path: "OriginID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "RequestType", FieldId: "RequestType", Type: utils.MetaVariable, + {Tag: "RequestType", Path: "RequestType", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Tenant", FieldId: "Tenant", Type: utils.MetaVariable, + {Tag: "Tenant", Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Category", FieldId: "Category", Type: utils.MetaVariable, + {Tag: "Category", Path: "Category", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Account", FieldId: "Account", Type: utils.MetaVariable, + {Tag: "Account", Path: "Account", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Subject", FieldId: "Subject", Type: utils.MetaVariable, + {Tag: "Subject", Path: "Subject", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Destination", FieldId: "Destination", Type: utils.MetaVariable, + {Tag: "Destination", Path: "Destination", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "SetupTime", FieldId: "SetupTime", Type: utils.MetaVariable, + {Tag: "SetupTime", Path: "SetupTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "AnswerTime", FieldId: "AnswerTime", Type: utils.MetaVariable, + {Tag: "AnswerTime", Path: "AnswerTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Usage", FieldId: "Usage", Type: utils.MetaVariable, + {Tag: "Usage", Path: "Usage", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true}, }, }, @@ -1675,27 +1728,27 @@ func TestCgrCfgEventReaderDefault(t *testing.T) { Filters: nil, Flags: utils.FlagsWithParams{}, Fields: []*FCTemplate{ - {Tag: "TOR", FieldId: "ToR", Type: utils.MetaVariable, + {Tag: "TOR", Path: "ToR", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "OriginID", FieldId: "OriginID", Type: utils.MetaVariable, + {Tag: "OriginID", Path: "OriginID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "RequestType", FieldId: "RequestType", Type: utils.MetaVariable, + {Tag: "RequestType", Path: "RequestType", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Tenant", FieldId: "Tenant", Type: utils.MetaVariable, + {Tag: "Tenant", Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Category", FieldId: "Category", Type: utils.MetaVariable, + {Tag: "Category", Path: "Category", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Account", FieldId: "Account", Type: utils.MetaVariable, + {Tag: "Account", Path: "Account", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Subject", FieldId: "Subject", Type: utils.MetaVariable, + {Tag: "Subject", Path: "Subject", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Destination", FieldId: "Destination", Type: utils.MetaVariable, + {Tag: "Destination", Path: "Destination", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "SetupTime", FieldId: "SetupTime", Type: utils.MetaVariable, + {Tag: "SetupTime", Path: "SetupTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "AnswerTime", FieldId: "AnswerTime", Type: utils.MetaVariable, + {Tag: "AnswerTime", Path: "AnswerTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Usage", FieldId: "Usage", Type: utils.MetaVariable, + {Tag: "Usage", Path: "Usage", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true}, }, CacheDumpFields: make([]*FCTemplate, 0), diff --git a/config/erscfg_test.go b/config/erscfg_test.go index 42f0eebb4..774a6f6bb 100644 --- a/config/erscfg_test.go +++ b/config/erscfg_test.go @@ -35,14 +35,14 @@ func TestEventRedearClone(t *testing.T) { Fields: []*FCTemplate{ { Tag: "TOR", - FieldId: "ToR", + Path: "ToR", Type: "*composed", Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true, }, { Tag: "RandomField", - FieldId: "RandomField", + Path: "RandomField", Type: "*composed", Value: NewRSRParsersMustCompile("Test", true, utils.INFIELD_SEP), Mandatory: true, @@ -63,14 +63,14 @@ func TestEventRedearClone(t *testing.T) { Fields: []*FCTemplate{ { Tag: "TOR", - FieldId: "ToR", + Path: "ToR", Type: "*composed", Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true, }, { Tag: "RandomField", - FieldId: "RandomField", + Path: "RandomField", Type: "*composed", Value: NewRSRParsersMustCompile("Test", true, utils.INFIELD_SEP), Mandatory: true, @@ -82,7 +82,7 @@ func TestEventRedearClone(t *testing.T) { orig.Fields = []*FCTemplate{ { Tag: "TOR", - FieldId: "ToR", + Path: "ToR", Type: "*composed", Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), Mandatory: true, @@ -112,27 +112,27 @@ func TestEventReaderLoadFromJSON(t *testing.T) { Filters: []string{}, Flags: utils.FlagsWithParams{}, Fields: []*FCTemplate{ - {Tag: "TOR", FieldId: "ToR", Type: utils.MetaVariable, + {Tag: "TOR", Path: "ToR", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "OriginID", FieldId: "OriginID", Type: utils.MetaVariable, + {Tag: "OriginID", Path: "OriginID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "RequestType", FieldId: "RequestType", Type: utils.MetaVariable, + {Tag: "RequestType", Path: "RequestType", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Tenant", FieldId: "Tenant", Type: utils.MetaVariable, + {Tag: "Tenant", Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Category", FieldId: "Category", Type: utils.MetaVariable, + {Tag: "Category", Path: "Category", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Account", FieldId: "Account", Type: utils.MetaVariable, + {Tag: "Account", Path: "Account", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Subject", FieldId: "Subject", Type: utils.MetaVariable, + {Tag: "Subject", Path: "Subject", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Destination", FieldId: "Destination", Type: utils.MetaVariable, + {Tag: "Destination", Path: "Destination", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "SetupTime", FieldId: "SetupTime", Type: utils.MetaVariable, + {Tag: "SetupTime", Path: "SetupTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "AnswerTime", FieldId: "AnswerTime", Type: utils.MetaVariable, + {Tag: "AnswerTime", Path: "AnswerTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Usage", FieldId: "Usage", Type: utils.MetaVariable, + {Tag: "Usage", Path: "Usage", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true}, }, }, @@ -150,27 +150,27 @@ func TestEventReaderLoadFromJSON(t *testing.T) { Filters: nil, Flags: utils.FlagsWithParams{}, Fields: []*FCTemplate{ - {Tag: "TOR", FieldId: "ToR", Type: utils.MetaVariable, + {Tag: "TOR", Path: "ToR", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "OriginID", FieldId: "OriginID", Type: utils.MetaVariable, + {Tag: "OriginID", Path: "OriginID", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "RequestType", FieldId: "RequestType", Type: utils.MetaVariable, + {Tag: "RequestType", Path: "RequestType", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Tenant", FieldId: "Tenant", Type: utils.MetaVariable, + {Tag: "Tenant", Path: "Tenant", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Category", FieldId: "Category", Type: utils.MetaVariable, + {Tag: "Category", Path: "Category", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Account", FieldId: "Account", Type: utils.MetaVariable, + {Tag: "Account", Path: "Account", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Subject", FieldId: "Subject", Type: utils.MetaVariable, + {Tag: "Subject", Path: "Subject", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Destination", FieldId: "Destination", Type: utils.MetaVariable, + {Tag: "Destination", Path: "Destination", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "SetupTime", FieldId: "SetupTime", Type: utils.MetaVariable, + {Tag: "SetupTime", Path: "SetupTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "AnswerTime", FieldId: "AnswerTime", Type: utils.MetaVariable, + {Tag: "AnswerTime", Path: "AnswerTime", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP), Mandatory: true}, - {Tag: "Usage", FieldId: "Usage", Type: utils.MetaVariable, + {Tag: "Usage", Path: "Usage", Type: utils.MetaVariable, Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP), Mandatory: true}, }, CacheDumpFields: make([]*FCTemplate, 0), diff --git a/config/fctemplate.go b/config/fctemplate.go index b09e87874..4efc652d3 100755 --- a/config/fctemplate.go +++ b/config/fctemplate.go @@ -30,13 +30,10 @@ func NewFCTemplateFromFCTemplateJsonCfg(jsnCfg *FcTemplateJsonCfg, separator str if jsnCfg.Type != nil { fcTmp.Type = *jsnCfg.Type } - if jsnCfg.Field_id != nil { - fcTmp.FieldId = *jsnCfg.Field_id - } if jsnCfg.Path != nil { fcTmp.Path = *jsnCfg.Path } - fcTmp.Tag = fcTmp.FieldId + fcTmp.Tag = fcTmp.Path if jsnCfg.Tag != nil { fcTmp.Tag = *jsnCfg.Tag } @@ -78,9 +75,6 @@ func NewFCTemplateFromFCTemplateJsonCfg(jsnCfg *FcTemplateJsonCfg, separator str if jsnCfg.Break_on_success != nil { fcTmp.BreakOnSuccess = *jsnCfg.Break_on_success } - if jsnCfg.Handler_id != nil { - fcTmp.HandlerId = *jsnCfg.Handler_id - } if jsnCfg.Layout != nil { fcTmp.Layout = *jsnCfg.Layout } @@ -101,9 +95,8 @@ func NewFCTemplateFromFCTemplateJsonCfg(jsnCfg *FcTemplateJsonCfg, separator str type FCTemplate struct { Tag string - Type string // Type of field - FieldId string // Field identifier - Path string + Type string // Type of field + Path string // Field identifier Filters []string // list of filter profiles Value RSRParsers Width int @@ -115,7 +108,6 @@ type FCTemplate struct { Timezone string Blocker bool BreakOnSuccess bool - HandlerId string // used by XML in CDRC Layout string // time format CostShiftDigits int // Used for CDR RoundingDecimals int @@ -170,7 +162,7 @@ func (self *FCTemplate) Clone() *FCTemplate { cln := new(FCTemplate) cln.Tag = self.Tag cln.Type = self.Type - cln.FieldId = self.FieldId + cln.Path = self.Path if len(self.Filters) != 0 { cln.Filters = make([]string, len(self.Filters)) for idx, val := range self.Filters { @@ -191,7 +183,6 @@ func (self *FCTemplate) Clone() *FCTemplate { cln.Timezone = self.Timezone cln.Blocker = self.Blocker cln.BreakOnSuccess = self.BreakOnSuccess - cln.HandlerId = self.HandlerId cln.Layout = self.Layout cln.CostShiftDigits = self.CostShiftDigits cln.RoundingDecimals = self.RoundingDecimals diff --git a/config/fctemplate_test.go b/config/fctemplate_test.go index 3b563da3b..0040fccf4 100755 --- a/config/fctemplate_test.go +++ b/config/fctemplate_test.go @@ -26,16 +26,16 @@ import ( func TestNewFCTemplateFromFCTemplateJsonCfg(t *testing.T) { jsonCfg := &FcTemplateJsonCfg{ - Tag: utils.StringPointer("Tenant"), - Type: utils.StringPointer("*composed"), - Field_id: utils.StringPointer("Tenant"), - Filters: &[]string{"Filter1", "Filter2"}, - Value: utils.StringPointer("cgrates.org"), + Tag: utils.StringPointer("Tenant"), + Type: utils.StringPointer("*composed"), + Path: utils.StringPointer("Tenant"), + Filters: &[]string{"Filter1", "Filter2"}, + Value: utils.StringPointer("cgrates.org"), } expected := &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), } @@ -49,32 +49,32 @@ func TestNewFCTemplateFromFCTemplateJsonCfg(t *testing.T) { func TestFCTemplatesFromFCTemplatesJsonCfg(t *testing.T) { jsnCfgs := []*FcTemplateJsonCfg{ &FcTemplateJsonCfg{ - Tag: utils.StringPointer("Tenant"), - Type: utils.StringPointer("*composed"), - Field_id: utils.StringPointer("Tenant"), - Filters: &[]string{"Filter1", "Filter2"}, - Value: utils.StringPointer("cgrates.org"), + Tag: utils.StringPointer("Tenant"), + Type: utils.StringPointer("*composed"), + Path: utils.StringPointer("Tenant"), + Filters: &[]string{"Filter1", "Filter2"}, + Value: utils.StringPointer("cgrates.org"), }, &FcTemplateJsonCfg{ - Tag: utils.StringPointer("RunID"), - Type: utils.StringPointer("*composed"), - Field_id: utils.StringPointer("RunID"), - Filters: &[]string{"Filter1_1", "Filter2_2"}, - Value: utils.StringPointer("SampleValue"), + Tag: utils.StringPointer("RunID"), + Type: utils.StringPointer("*composed"), + Path: utils.StringPointer("RunID"), + Filters: &[]string{"Filter1_1", "Filter2_2"}, + Value: utils.StringPointer("SampleValue"), }, } expected := []*FCTemplate{ &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "RunID", Type: "*composed", - FieldId: "RunID", + Path: "RunID", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("SampleValue", true, utils.INFIELD_SEP), }, @@ -91,14 +91,14 @@ func TestFCTemplateInflate1(t *testing.T) { &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "RunID", Type: "*composed", - FieldId: "RunID", + Path: "RunID", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("SampleValue", true, utils.INFIELD_SEP), }, @@ -114,14 +114,14 @@ func TestFCTemplateInflate1(t *testing.T) { &FCTemplate{ Tag: "Elem1", Type: "*composed", - FieldId: "Elem1", + Path: "Elem1", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("Elem1", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem2", Type: "*composed", - FieldId: "Elem2", + Path: "Elem2", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("Elem2", true, utils.INFIELD_SEP), }, @@ -130,14 +130,14 @@ func TestFCTemplateInflate1(t *testing.T) { &FCTemplate{ Tag: "Elem2.1", Type: "*composed", - FieldId: "Elem2.1", + Path: "Elem2.1", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("Elem2.1", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem2.2", Type: "*composed", - FieldId: "Elem2.2", + Path: "Elem2.2", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("Elem2.2", true, utils.INFIELD_SEP), }, @@ -147,28 +147,28 @@ func TestFCTemplateInflate1(t *testing.T) { &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "RunID", Type: "*composed", - FieldId: "RunID", + Path: "RunID", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("SampleValue", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem1", Type: "*composed", - FieldId: "Elem1", + Path: "Elem1", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("Elem1", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem2", Type: "*composed", - FieldId: "Elem2", + Path: "Elem2", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("Elem2", true, utils.INFIELD_SEP), }, @@ -185,14 +185,14 @@ func TestFCTemplateInflate2(t *testing.T) { &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "RunID", Type: "*composed", - FieldId: "RunID", + Path: "RunID", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("SampleValue", true, utils.INFIELD_SEP), }, @@ -208,14 +208,14 @@ func TestFCTemplateInflate2(t *testing.T) { &FCTemplate{ Tag: "Elem1", Type: "*composed", - FieldId: "Elem1", + Path: "Elem1", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("Elem1", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem2", Type: "*composed", - FieldId: "Elem2", + Path: "Elem2", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("Elem2", true, utils.INFIELD_SEP), }, @@ -224,14 +224,14 @@ func TestFCTemplateInflate2(t *testing.T) { &FCTemplate{ Tag: "Elem2.1", Type: "*composed", - FieldId: "Elem2.1", + Path: "Elem2.1", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("Elem2.1", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem2.2", Type: "*composed", - FieldId: "Elem2.2", + Path: "Elem2.2", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("Elem2.2", true, utils.INFIELD_SEP), }, @@ -247,14 +247,14 @@ func TestFCTemplateInflate3(t *testing.T) { &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "RunID", Type: "*composed", - FieldId: "RunID", + Path: "RunID", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("SampleValue", true, utils.INFIELD_SEP), }, @@ -271,14 +271,14 @@ func TestFCTemplateInflate3(t *testing.T) { &FCTemplate{ Tag: "Elem2.1", Type: "*composed", - FieldId: "Elem2.1", + Path: "Elem2.1", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("Elem2.1", true, utils.INFIELD_SEP), }, &FCTemplate{ Tag: "Elem2.2", Type: "*composed", - FieldId: "Elem2.2", + Path: "Elem2.2", Filters: []string{"Filter1_1", "Filter2_2"}, Value: NewRSRParsersMustCompile("Elem2.2", true, utils.INFIELD_SEP), }, @@ -294,7 +294,7 @@ func TestFCTemplateClone(t *testing.T) { smpl := &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), } @@ -305,7 +305,7 @@ func TestFCTemplateClone(t *testing.T) { initialSmpl := &FCTemplate{ Tag: "Tenant", Type: "*composed", - FieldId: "Tenant", + Path: "Tenant", Filters: []string{"Filter1", "Filter2"}, Value: NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), } diff --git a/config/httpagntcfg_test.go b/config/httpagntcfg_test.go index 8920b65ec..45c721494 100644 --- a/config/httpagntcfg_test.go +++ b/config/httpagntcfg_test.go @@ -53,7 +53,7 @@ func TestHttpAgentCfgsloadFromJsonCfg(t *testing.T) { "request_fields":[ ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, ], }, @@ -75,7 +75,7 @@ func TestHttpAgentCfgsloadFromJsonCfg(t *testing.T) { RequestFields: []*FCTemplate{}, ReplyFields: []*FCTemplate{{ Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: true, @@ -106,11 +106,11 @@ func TestHttpAgentCfgsloadFromJsonCfg(t *testing.T) { "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, ], "reply_fields":[ - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*composed", + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*composed", "value": "~*req.CDR_ID", "mandatory": true}, ], @@ -150,7 +150,7 @@ func TestHttpAgentCfgsloadFromJsonCfg(t *testing.T) { RequestFields: []*FCTemplate{}, ReplyFields: []*FCTemplate{{ Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: true, @@ -162,14 +162,14 @@ func TestHttpAgentCfgsloadFromJsonCfg(t *testing.T) { Flags: utils.FlagsWithParams{"*cdrs": []string{}}, RequestFields: []*FCTemplate{{ Tag: "RequestType", - FieldId: "RequestType", + Path: "RequestType", Type: "*constant", Value: NewRSRParsersMustCompile("*pseudoprepaid", true, utils.INFIELD_SEP), Mandatory: true, }}, ReplyFields: []*FCTemplate{{ Tag: "CDR_ID", - FieldId: "CDR_RESPONSE.CDR_ID", + Path: "CDR_RESPONSE.CDR_ID", Type: "*composed", Value: NewRSRParsersMustCompile("~*req.CDR_ID", true, utils.INFIELD_SEP), Mandatory: true, @@ -268,7 +268,7 @@ func TestHttpAgentCfgappendHttpAgntProcCfgs(t *testing.T) { RequestFields: []*FCTemplate{}, ReplyFields: []*FCTemplate{{ Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: true, @@ -283,7 +283,7 @@ func TestHttpAgentCfgappendHttpAgntProcCfgs(t *testing.T) { Request_fields: &[]*FcTemplateJsonCfg{}, Reply_fields: &[]*FcTemplateJsonCfg{{ Tag: utils.StringPointer("Allow"), - Field_id: utils.StringPointer("response.Allow"), + Path: utils.StringPointer("response.Allow"), Type: utils.StringPointer("*constant"), Value: utils.StringPointer("1"), Mandatory: utils.BoolPointer(true), @@ -296,7 +296,7 @@ func TestHttpAgentCfgappendHttpAgntProcCfgs(t *testing.T) { Request_fields: &[]*FcTemplateJsonCfg{}, Reply_fields: &[]*FcTemplateJsonCfg{{ Tag: utils.StringPointer("Allow"), - Field_id: utils.StringPointer("response.Allow"), + Path: utils.StringPointer("response.Allow"), Type: utils.StringPointer("*constant"), Value: utils.StringPointer("1"), Mandatory: utils.BoolPointer(false), @@ -317,7 +317,7 @@ func TestHttpAgentCfgappendHttpAgntProcCfgs(t *testing.T) { RequestFields: []*FCTemplate{}, ReplyFields: []*FCTemplate{{ Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: false, @@ -330,7 +330,7 @@ func TestHttpAgentCfgappendHttpAgntProcCfgs(t *testing.T) { RequestFields: []*FCTemplate{}, ReplyFields: []*FCTemplate{{ Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: true, diff --git a/config/libconfig_json.go b/config/libconfig_json.go index 005b69c68..3e6ca6a4f 100755 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -154,9 +154,7 @@ type CdreJsonCfg struct { Synchronous *bool Attempts *int Field_separator *string - Header_fields *[]*FcTemplateJsonCfg - Content_fields *[]*FcTemplateJsonCfg - Trailer_fields *[]*FcTemplateJsonCfg + Fields *[]*FcTemplateJsonCfg } // EventReaderSJsonCfg contains the configuration of EventReaderService @@ -521,7 +519,6 @@ type MigratorCfgJson struct { type FcTemplateJsonCfg struct { Tag *string Type *string - Field_id *string Path *string Attribute_id *string Filters *[]string diff --git a/config/loaderscfg_test.go b/config/loaderscfg_test.go index e35e518b1..616a7e7ef 100644 --- a/config/loaderscfg_test.go +++ b/config/loaderscfg_test.go @@ -54,7 +54,7 @@ func TestLoaderSCfgloadFromJsonCfg(t *testing.T) { "type": "*attributes", // data source type "file_name": "Attributes.csv", // file name in the tp_in_dir "fields": [ - {"tag": "TenantID", "field_id": "Tenant", "type": "*composed", "value": "~0", "mandatory": true}, + {"tag": "TenantID", "path": "Tenant", "type": "*composed", "value": "~0", "mandatory": true}, ], },] } @@ -83,7 +83,7 @@ func TestLoaderSCfgloadFromJsonCfg(t *testing.T) { Fields: []*FCTemplate{ { Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: "*composed", Value: val, Mandatory: true, diff --git a/config/multifiles_it_test.go b/config/multifiles_it_test.go index f425d9edb..27b6c6a65 100644 --- a/config/multifiles_it_test.go +++ b/config/multifiles_it_test.go @@ -61,11 +61,8 @@ func TestMfCdreDefaultInstance(t *testing.T) { if mfCgrCfg.CdreProfiles[prfl].ExportFormat != utils.MetaFileCSV { t.Error("Default instance has cdrFormat: ", mfCgrCfg.CdreProfiles[prfl].ExportFormat) } - if len(mfCgrCfg.CdreProfiles[prfl].HeaderFields) != 0 { - t.Error("Default instance has number of header fields: ", len(mfCgrCfg.CdreProfiles[prfl].HeaderFields)) - } - if len(mfCgrCfg.CdreProfiles[prfl].ContentFields) != 11 { - t.Error("Default instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].ContentFields)) + if len(mfCgrCfg.CdreProfiles[prfl].Fields) != 11 { + t.Error("Default instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].Fields)) } } @@ -74,17 +71,11 @@ func TestMfCdreExport1Instance(t *testing.T) { if mfCgrCfg.CdreProfiles[prfl].ExportFormat != utils.MetaFileCSV { t.Error("Export1 instance has cdrFormat: ", mfCgrCfg.CdreProfiles[prfl].ExportFormat) } - if len(mfCgrCfg.CdreProfiles[prfl].HeaderFields) != 2 { - t.Error("Export1 instance has number of header fields: ", len(mfCgrCfg.CdreProfiles[prfl].HeaderFields)) + if len(mfCgrCfg.CdreProfiles[prfl].Fields) != 9 { + t.Error("Export1 instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].Fields)) } - if mfCgrCfg.CdreProfiles[prfl].HeaderFields[1].Tag != "RunId" { - t.Error("Unexpected headerField value: ", mfCgrCfg.CdreProfiles[prfl].HeaderFields[1].Tag) - } - if len(mfCgrCfg.CdreProfiles[prfl].ContentFields) != 9 { - t.Error("Export1 instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].ContentFields)) - } - if mfCgrCfg.CdreProfiles[prfl].ContentFields[2].Tag != "Account" { - t.Error("Unexpected headerField value: ", mfCgrCfg.CdreProfiles[prfl].ContentFields[2].Tag) + if mfCgrCfg.CdreProfiles[prfl].Fields[2].Tag != "Account" { + t.Error("Unexpected headerField value: ", mfCgrCfg.CdreProfiles[prfl].Fields[2].Tag) } } @@ -140,7 +131,7 @@ func TestMfHttpAgentMultipleFields(t *testing.T) { RequestFields: []*FCTemplate{}, ReplyFields: []*FCTemplate{{ Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: true, @@ -155,7 +146,7 @@ func TestMfHttpAgentMultipleFields(t *testing.T) { RequestFields: []*FCTemplate{ { Tag: "RequestType", - FieldId: "RequestType", + Path: "RequestType", Type: "*constant", Value: NewRSRParsersMustCompile("*pseudoprepaid", true, utils.INFIELD_SEP), Mandatory: true, @@ -164,7 +155,7 @@ func TestMfHttpAgentMultipleFields(t *testing.T) { ReplyFields: []*FCTemplate{ { Tag: "Allow", - FieldId: "response.Allow", + Path: "response.Allow", Type: "*constant", Value: NewRSRParsersMustCompile("1", true, utils.INFIELD_SEP), Mandatory: true, @@ -178,14 +169,14 @@ func TestMfHttpAgentMultipleFields(t *testing.T) { Flags: utils.FlagsWithParams{"*cdrs": []string{}}, RequestFields: []*FCTemplate{{ Tag: "RequestType", - FieldId: "RequestType", + Path: "RequestType", Type: "*constant", Value: NewRSRParsersMustCompile("*pseudoprepaid", true, utils.INFIELD_SEP), Mandatory: true, }}, ReplyFields: []*FCTemplate{{ Tag: "CDR_ID", - FieldId: "CDR_RESPONSE.CDR_ID", + Path: "CDR_RESPONSE.CDR_ID", Type: "*composed", Value: NewRSRParsersMustCompile("~*req.CDR_ID", true, utils.INFIELD_SEP), Mandatory: true, @@ -206,7 +197,7 @@ func TestMfHttpAgentMultipleFields(t *testing.T) { RequestFields: []*FCTemplate{ { Tag: "TOR", - FieldId: "ToR", + Path: "ToR", Type: "*constant", Value: NewRSRParsersMustCompile("*data", true, utils.INFIELD_SEP), Mandatory: true, diff --git a/data/conf/samples/acc_balance_keep_internal/cgrates.json b/data/conf/samples/acc_balance_keep_internal/cgrates.json index 7a02a433a..0f87ee9e9 100644 --- a/data/conf/samples/acc_balance_keep_internal/cgrates.json +++ b/data/conf/samples/acc_balance_keep_internal/cgrates.json @@ -47,19 +47,19 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"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": 4}, - {"tag":"MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + {"path": "*exp.MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, ], }, }, diff --git a/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json b/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json index 10aafff31..ead4ea2ad 100644 --- a/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json +++ b/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json @@ -53,19 +53,19 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"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": 4}, - {"tag":"MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + {"path": "*exp.MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, ], }, }, diff --git a/data/conf/samples/acc_balance_keep_mongo/cgrates.json b/data/conf/samples/acc_balance_keep_mongo/cgrates.json index c61248a1b..5d22b29e2 100644 --- a/data/conf/samples/acc_balance_keep_mongo/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mongo/cgrates.json @@ -48,19 +48,19 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"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": 4}, - {"tag":"MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + {"path": "*exp.MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, ], }, }, diff --git a/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json b/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json index 08dd0c604..6fa3ca301 100644 --- a/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json @@ -57,19 +57,19 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"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": 4}, - {"tag":"MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + {"path": "*exp.MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, ], }, }, diff --git a/data/conf/samples/acc_balance_keep_mysql/cgrates.json b/data/conf/samples/acc_balance_keep_mysql/cgrates.json index 5c93526bc..bbefeb492 100644 --- a/data/conf/samples/acc_balance_keep_mysql/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mysql/cgrates.json @@ -47,19 +47,19 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"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": 4}, - {"tag":"MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + {"path": "*exp.MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, ], }, }, diff --git a/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json b/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json index 6d815d1d0..c7446443c 100644 --- a/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json @@ -54,19 +54,19 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"RequestType", "type": "*composed", "value": "~RequestType"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"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": 4}, - {"tag":"MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.RequestType", "type": "*composed", "value": "~RequestType"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.AnswerTime", "type": "*composed", "value": "~AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + {"path": "*exp.MatchedDestinationID", "type": "*composed", "value": "~CostDetails:s/\"MatchedDestId\":.*_(\\w{4})/${1}/:s/\"MatchedDestId\":\"INTERNAL\"/ON010/"}, ], }, }, diff --git a/data/conf/samples/cdrewithattributes/cgrates.json b/data/conf/samples/cdrewithattributes/cgrates.json index a4ede7d44..750299123 100755 --- a/data/conf/samples/cdrewithattributes/cgrates.json +++ b/data/conf/samples/cdrewithattributes/cgrates.json @@ -47,18 +47,18 @@ "export_path": "/tmp/", "attributes_context":"*cdre", "filters" :["*string:~*req.Source:test2"], - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~RunID"}, - {"tag":"Source", "type": "*composed", "value": "~Source"}, - {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, - {"tag":"Tenant", "type": "*composed", "value": "~Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~Category"}, - {"tag":"Account", "type": "*composed", "value": "~Account"}, - {"tag":"Subject", "type": "*composed", "value": "~Subject"}, - {"tag":"Destination", "type": "*composed", "value": "~Destination"}, - {"tag":"Usage", "type": "*composed", "value": "~Usage"}, - {"tag":"Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, + "fields": [ + {"path": "*exp.CGRID", "type": "*composed", "value": "~CGRID"}, + {"path": "*exp.RunID", "type": "*composed", "value": "~RunID"}, + {"path": "*exp.Source", "type": "*composed", "value": "~Source"}, + {"path": "*exp.OriginID", "type": "*composed", "value": "~OriginID"}, + {"path": "*exp.Tenant", "type": "*composed", "value": "~Tenant"}, + {"path": "*exp.Category", "type": "*composed", "value": "~Category"}, + {"path": "*exp.Account", "type": "*composed", "value": "~Account"}, + {"path": "*exp.Subject", "type": "*composed", "value": "~Subject"}, + {"path": "*exp.Destination", "type": "*composed", "value": "~Destination"}, + {"path": "*exp.Usage", "type": "*composed", "value": "~Usage"}, + {"path": "*exp.Cost", "type": "*composed", "value": "~Cost", "rounding_decimals": 4}, ], }, }, diff --git a/data/conf/samples/cdrewithfilter_internal/cgrates.json b/data/conf/samples/cdrewithfilter_internal/cgrates.json index c9ad22d2d..145f2935b 100755 --- a/data/conf/samples/cdrewithfilter_internal/cgrates.json +++ b/data/conf/samples/cdrewithfilter_internal/cgrates.json @@ -46,17 +46,17 @@ "export_format": "*file_csv", "export_path": "/tmp/", "filters" :["*string:~*req.Source:test2"], - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~*req.CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~*req.RunID"}, - {"tag":"Source", "type": "*composed", "value": "~*req.Source"}, - {"tag":"OriginID", "type": "*composed", "value": "~*req.OriginID"}, - {"tag":"Tenant", "type": "*composed", "value": "~*req.Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~*req.Category"}, - {"tag":"Account", "type": "*composed", "value": "~*req.Account"}, - {"tag":"Destination", "type": "*composed", "value": "~*req.Destination"}, - {"tag":"Usage", "type": "*composed", "value": "~*req.Usage"}, - {"tag":"Cost", "type": "*composed", "value": "~*req.Cost", "rounding_decimals": 4}, + "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.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}, ], }, }, diff --git a/data/conf/samples/cdrewithfilter_mongo/cgrates.json b/data/conf/samples/cdrewithfilter_mongo/cgrates.json index 9024383e3..d453d842f 100755 --- a/data/conf/samples/cdrewithfilter_mongo/cgrates.json +++ b/data/conf/samples/cdrewithfilter_mongo/cgrates.json @@ -50,17 +50,17 @@ "export_format": "*file_csv", "export_path": "/tmp/", "filters" :["*string:~*req.Source:test2"], - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~*req.CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~*req.RunID"}, - {"tag":"Source", "type": "*composed", "value": "~*req.Source"}, - {"tag":"OriginID", "type": "*composed", "value": "~*req.OriginID"}, - {"tag":"Tenant", "type": "*composed", "value": "~*req.Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~*req.Category"}, - {"tag":"Account", "type": "*composed", "value": "~*req.Account"}, - {"tag":"Destination", "type": "*composed", "value": "~*req.Destination"}, - {"tag":"Usage", "type": "*composed", "value": "~*req.Usage"}, - {"tag":"Cost", "type": "*composed", "value": "~*req.Cost", "rounding_decimals": 4}, + "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.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}, ], }, }, diff --git a/data/conf/samples/cdrewithfilter_mysql/cgrates.json b/data/conf/samples/cdrewithfilter_mysql/cgrates.json index 238b11e12..39ccc8fdb 100755 --- a/data/conf/samples/cdrewithfilter_mysql/cgrates.json +++ b/data/conf/samples/cdrewithfilter_mysql/cgrates.json @@ -48,17 +48,17 @@ "export_format": "*file_csv", "export_path": "/tmp/", "filters" :["*string:~*req.Source:test2"], - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~*req.CGRID"}, - {"tag": "RunID", "type": "*composed", "value": "~*req.RunID"}, - {"tag":"Source", "type": "*composed", "value": "~*req.Source"}, - {"tag":"OriginID", "type": "*composed", "value": "~*req.OriginID"}, - {"tag":"Tenant", "type": "*composed", "value": "~*req.Tenant"}, - {"tag":"Category", "type": "*composed", "value": "~*req.Category"}, - {"tag":"Account", "type": "*composed", "value": "~*req.Account"}, - {"tag":"Destination", "type": "*composed", "value": "~*req.Destination"}, - {"tag":"Usage", "type": "*composed", "value": "~*req.Usage"}, - {"tag":"Cost", "type": "*composed", "value": "~*req.Cost", "rounding_decimals": 4}, + "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.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}, ], }, }, diff --git a/data/conf/samples/cdrsv1processevent/cgrates.json b/data/conf/samples/cdrsv1processevent/cgrates.json index 75bb4190f..da769da79 100644 --- a/data/conf/samples/cdrsv1processevent/cgrates.json +++ b/data/conf/samples/cdrsv1processevent/cgrates.json @@ -33,8 +33,8 @@ "export_path": "amqps://guest:guest@localhost:256733/", "attempts": 1, // export attempts "synchronous": true, // block processing until export has a result - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"}, + "fields": [ + {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "path": "CGRID"}, ], }, }, diff --git a/data/conf/samples/cdrsv1processeventmongo/cgrates.json b/data/conf/samples/cdrsv1processeventmongo/cgrates.json index a89edad92..ce8bf1c61 100644 --- a/data/conf/samples/cdrsv1processeventmongo/cgrates.json +++ b/data/conf/samples/cdrsv1processeventmongo/cgrates.json @@ -37,8 +37,8 @@ "export_path": "amqps://guest:guest@localhost:256733/", "attempts": 1, // export attempts "synchronous": true, // block processing until export has a result - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"}, + "fields": [ + {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "path": "CGRID"}, ], }, }, diff --git a/data/conf/samples/cdrsv1processeventmysql/cgrates.json b/data/conf/samples/cdrsv1processeventmysql/cgrates.json index 237e946f9..0ccc20be5 100644 --- a/data/conf/samples/cdrsv1processeventmysql/cgrates.json +++ b/data/conf/samples/cdrsv1processeventmysql/cgrates.json @@ -34,8 +34,8 @@ "export_path": "amqps://guest:guest@localhost:256733/", "attempts": 1, // export attempts "synchronous": true, // block processing until export has a result - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"}, + "fields": [ + {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "path": "CGRID"}, ], }, }, diff --git a/data/conf/samples/cdrsv_failover_internal/cgrates.json b/data/conf/samples/cdrsv_failover_internal/cgrates.json index ce03044c4..67fa2f50c 100644 --- a/data/conf/samples/cdrsv_failover_internal/cgrates.json +++ b/data/conf/samples/cdrsv_failover_internal/cgrates.json @@ -64,8 +64,8 @@ "export_format": "*s3_json_map", // export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs" "export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs", - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"}, + "fields": [ + {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "path": "CGRID"}, ], }, }, diff --git a/data/conf/samples/cdrsv_failover_mongo/cgrates.json b/data/conf/samples/cdrsv_failover_mongo/cgrates.json index f55925986..03088e7c5 100644 --- a/data/conf/samples/cdrsv_failover_mongo/cgrates.json +++ b/data/conf/samples/cdrsv_failover_mongo/cgrates.json @@ -73,8 +73,8 @@ "export_format": "*s3_json_map", // export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs" "export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs", - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"}, + "fields": [ + {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "path": "CGRID"}, ], }, }, diff --git a/data/conf/samples/cdrsv_failover_mysql/cgrates.json b/data/conf/samples/cdrsv_failover_mysql/cgrates.json index 232eb1e76..67025209b 100644 --- a/data/conf/samples/cdrsv_failover_mysql/cgrates.json +++ b/data/conf/samples/cdrsv_failover_mysql/cgrates.json @@ -71,8 +71,8 @@ "export_format": "*s3_json_map", // export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs" "export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs", - "content_fields": [ - {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"}, + "fields": [ + {"tag": "CGRID", "type": "*composed", "value": "~CGRID", "path": "CGRID"}, ], }, }, diff --git a/data/conf/samples/diam_tutmysql/data.json b/data/conf/samples/diam_tutmysql/data.json index 2f990bf61..a4afb40a0 100644 --- a/data/conf/samples/diam_tutmysql/data.json +++ b/data/conf/samples/diam_tutmysql/data.json @@ -15,43 +15,43 @@ "flags": ["*initiate", "*accounts"], "request_fields":[ { - "tag": "TOR", "field_id": "ToR", + "tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data" }, { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "RequestType", "field_id": "RequestType", + "tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Category", "field_id": "Category", + "tag": "Category", "path": "Category", "type": "*constant", "value": "data" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "type": "*constant", "value": "data" }, { - "tag": "SetupTime", "field_id": "SetupTime", + "tag": "SetupTime", "path": "SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "AnswerTime", "field_id": "AnswerTime", + "tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048" }, ], @@ -60,7 +60,7 @@ { "tag": "ResultCodeError", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "blocker": true, + "path": "Result-Code", "blocker": true, "type": "*constant", "value": "5030" }, ], @@ -77,30 +77,30 @@ "flags": ["*update", "*accounts"], "request_fields":[ { - "tag": "TOR", "field_id": "ToR", + "tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data" }, { - "tag": "InitialOriginID", "field_id": "InitialOriginID", + "tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id;_grp1" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048" }, { - "tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + "tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]" }, ], @@ -109,7 +109,7 @@ { "tag": "ResultCodeError", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "blocker": true, + "path": "Result-Code", "blocker": true, "type": "*constant", "value": "5030" }, ], @@ -126,51 +126,51 @@ "flags": ["*update", "*accounts"], "request_fields":[ { - "tag": "TOR", "field_id": "ToR", + "tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data" }, { - "tag": "InitialOriginID", "field_id": "InitialOriginID", + "tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id;_grp2"}, { - "tag": "RequestType", "field_id": "RequestType", + "tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Category", "field_id": "Category", + "tag": "Category", "path": "Category", "type": "*constant", "value": "data" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "type": "*constant", "value": "data" }, { - "tag": "SetupTime", "field_id": "SetupTime", + "tag": "SetupTime", "path": "SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "AnswerTime", "field_id": "AnswerTime", + "tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048" }, { - "tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + "tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]" }, ], @@ -179,7 +179,7 @@ { "tag": "ResultCodeError", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "blocker": true, + "path": "Result-Code", "blocker": true, "type": "*constant", "value": "5030" }, ], @@ -195,17 +195,17 @@ "flags": ["*terminate", "*accounts", "*cdrs"], "request_fields":[ { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", + "tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "LastUsed", "field_id": "LastUsed", + "tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets" }, diff --git a/data/conf/samples/diam_tutmysql/sms.json b/data/conf/samples/diam_tutmysql/sms.json index 915955f9e..cb6989fe4 100644 --- a/data/conf/samples/diam_tutmysql/sms.json +++ b/data/conf/samples/diam_tutmysql/sms.json @@ -13,58 +13,58 @@ "flags": ["*event", "*accounts", "*cdrs"], "request_fields":[ { - "tag": "TOR", "field_id": "ToR", + "tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms" }, { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Service-Identifier" }, { - "tag": "OriginHost", "field_id": "OriginHost", + "tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Source", "field_id": "Source", + "tag": "Source", "path": "Source", "type": "*constant", "mandatory": true, "value": "DiameterAgent" }, { - "tag": "RequestType", "field_id": "RequestType", + "tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Category", "field_id": "Category", + "tag": "Category", "path": "Category", "type": "*constant", "value": "sms" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Info.Recipient-Address.Address-Data:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" }, { - "tag": "SetupTime", "field_id": "SetupTime", + "tag": "SetupTime", "path": "SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "AnswerTime", "field_id": "AnswerTime", + "tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Requested-Service-Unit.CC-Service-Specific-Units" }, { - "tag": "Originator-SCCP-Address", "field_id": "Originator-SCCP-Address", + "tag": "Originator-SCCP-Address", "path": "Originator-SCCP-Address", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Originator-SCCP-Address" }, @@ -72,13 +72,13 @@ "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, { - "tag": "ResultCode","field_id": "Result-Code", + "tag": "ResultCode","path": "Result-Code", "filters": ["*eq:~*cgrep.MaxUsage:0"], "type": "*constant", "value": "4012", "blocker": true }, { - "tag": "ResultCode", "field_id": "Result-Code", + "tag": "ResultCode", "path": "Result-Code", "filters": ["*notempty:~*cgrep.Error:"], "type": "*constant", "value": "5030", "blocker": true diff --git a/data/conf/samples/diam_tutmysql/voice.json b/data/conf/samples/diam_tutmysql/voice.json index d75531aec..16bf7a5a4 100644 --- a/data/conf/samples/diam_tutmysql/voice.json +++ b/data/conf/samples/diam_tutmysql/voice.json @@ -11,43 +11,43 @@ ], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id" }, { - "tag": "OriginHost", "field_id": "OriginHost", + "tag": "OriginHost", "path": "OriginHost", "type": "*variable", "mandatory": true, "value": "~*vars.OriginHost" }, { - "tag": "Source", "field_id": "Source", + "tag": "Source", "path": "Source", "type": "*constant", "value": "DiameterAgent" }, { - "tag": "RequestType", "field_id": "RequestType", + "tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "filters":["*string:~*req.Service-Information.IMS-Information.Role-Of-Node:2"], "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Requested-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/sip:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/49${1}/" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "filters": [ "*prefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+", "*notprefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+49" @@ -56,23 +56,23 @@ "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+(\\d+)/int${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+00${1}/" }, { - "tag": "SetupTime", "field_id": "SetupTime", + "tag": "SetupTime", "path": "SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "SetupTime", "field_id": "SetupTime", + "tag": "SetupTime", "path": "SetupTime", "type": "*variable", "mandatory": true, "filters": ["*exists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp:"], "value": "~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*constant", "mandatory": true, "value": "10s" }, { - "tag": "IMSI", "field_id": "IMSI", + "tag": "IMSI", "path": "IMSI", "type": "*variable", "value": "~*req.User-Name" } ], @@ -80,18 +80,18 @@ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, { "tag": "GrantedUnitsError", - "field_id": "Granted-Service-Unit.CC-Time", + "path": "Granted-Service-Unit.CC-Time", "filters": ["*notempty:~*cgrep.Error:"], "type": "*constant", "blocker": true, "value": "0" }, { "tag": "GrantedUnitsUnlimited", - "field_id": "Granted-Service-Unit.CC-Time", + "path": "Granted-Service-Unit.CC-Time", "filters": ["*eq:~*cgrep.MaxUsage:-1"], "blocker": true, "type": "*constant", "value": "10"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "mandatory": true, "value": "~*cgrep.MaxUsage{*duration_seconds}"} ] @@ -107,39 +107,39 @@ "flags": ["*initiate", "*accounts"], "request_fields":[ { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id"}, { - "tag": "OriginHost", "field_id": "OriginHost", + "tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Source", "field_id": "Source", + "tag": "Source", "path": "Source", "type": "*constant","value": "DiameterAgent" }, { - "tag": "RequestType", "field_id": "RequestType", + "tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" }, { - "tag": "Account", "field_id": "Account", + "tag": "Account", "path": "Account", "filters":["*string:~*req.Service-Information.IMS-Information.Role-Of-Node:2"], "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Requested-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/sip:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/49${1}/" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" }, { - "tag": "Destination", "field_id": "Destination", + "tag": "Destination", "path": "Destination", "filters": [ "*prefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+", "*notprefix:~*req.Service-Information.IMS-Information.Called-Party-Address:tel:+49" @@ -148,22 +148,22 @@ "value": "~*req.Service-Information.IMS-Information.Called-Party-Address:s/tel:(\\+?\\d+)/${1}/:s/^\\+(\\d+)/int${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+00${1}/" }, { - "tag": "SetupTime", "field_id": "SetupTime", + "tag": "SetupTime", "path": "SetupTime", "filters": ["*exists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp:"], "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Request-Timestamp" }, { - "tag": "AnswerTime", "field_id": "AnswerTime", + "tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*constant", "value": "10s" }, { - "tag": "IMSI", "field_id": "IMSI", + "tag": "IMSI", "path": "IMSI", "type": "*variable", "mandatory": true, "value": "~*req.User-Name" } @@ -173,17 +173,17 @@ { "tag": "GrantedUnitsError", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "0" }, { "tag": "GrantedUnitsUnlimited", "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "field_id": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "10" }, { - "tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + "tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "mandatory": true, "value": "~*cgrep.MaxUsage{*duration_seconds}" } @@ -200,16 +200,16 @@ "flags": ["*update", "*accounts"], "request_fields":[ { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id" }, { - "tag": "OriginHost", "field_id": "OriginHost", + "tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "type": "*constant", "value": "10s" }, ], @@ -218,17 +218,17 @@ { "tag": "GrantedUnitsOnError", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "0" }, { "tag": "GrantedUnitsUnlimited", "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "field_id": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "10" }, { - "tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + "tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "mandatory": true, "value": "~*cgrep.MaxUsage{*duration_seconds}" } @@ -244,21 +244,21 @@ "flags": ["*terminate", "*accounts", "*cdrs"], "request_fields":[ { - "tag": "OriginID", "field_id": "OriginID", + "tag": "OriginID", "path": "OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id" }, { - "tag": "OriginHost", "field_id": "OriginHost", + "tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "filters": ["*exists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Response-Timestamp:"], "type": "*usage_difference", "mandatory": true, "value": "~*req.Event-Timestamp;~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Response-Timestamp"}, { - "tag": "Usage", "field_id": "Usage", + "tag": "Usage", "path": "Usage", "filters": ["*notexists:~*req.Service-Information.IMS-Information.Time-Stamps.SIP-Response-Timestamp:"], "type": "*constant", "value": "0s" }, @@ -266,9 +266,9 @@ "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "blocker": true, + "path": "Result-Code", "blocker": true, "type": "*constant", "value": "5030"}, - {"tag": "ResultCode", "field_id": "Result-Code", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"} ] }, diff --git a/data/conf/samples/diamagent_internal/data.json b/data/conf/samples/diamagent_internal/data.json index 58f084359..bce1e853b 100644 --- a/data/conf/samples/diamagent_internal/data.json +++ b/data/conf/samples/diamagent_internal/data.json @@ -9,24 +9,24 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -36,29 +36,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -69,29 +69,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -101,21 +101,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/diamagent_internal/dryrun.json b/data/conf/samples/diamagent_internal/dryrun.json index eb38962e3..21fb70735 100644 --- a/data/conf/samples/diamagent_internal/dryrun.json +++ b/data/conf/samples/diamagent_internal/dryrun.json @@ -7,32 +7,32 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -42,28 +42,28 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/diamagent_internal/message.json b/data/conf/samples/diamagent_internal/message.json index df97f5342..a10200830 100644 --- a/data/conf/samples/diamagent_internal/message.json +++ b/data/conf/samples/diamagent_internal/message.json @@ -9,25 +9,25 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/diamagent_internal/simpa.json b/data/conf/samples/diamagent_internal/simpa.json index ea592bab1..8c8493212 100644 --- a/data/conf/samples/diamagent_internal/simpa.json +++ b/data/conf/samples/diamagent_internal/simpa.json @@ -9,16 +9,16 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts", "*log"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/diamagent_internal/tests.json b/data/conf/samples/diamagent_internal/tests.json index cd751c6b1..be855888b 100644 --- a/data/conf/samples/diamagent_internal/tests.json +++ b/data/conf/samples/diamagent_internal/tests.json @@ -9,33 +9,33 @@ "*prefix:~*req.Service-Context-Id:testSessionDisconnect"], "flags": ["*initiate", "*accounts","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*variable", + {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "field_id": "CGRDebitInterval", + {"tag": "DebitInterval", "path": "CGRDebitInterval", "type": "*constant", "value": "1s"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "filters": ["*gte:~*cgrep.MaxUsage:0s"], "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds&*round:0}", "mandatory": true}, ], diff --git a/data/conf/samples/diamagent_internal/voice.json b/data/conf/samples/diamagent_internal/voice.json index f9b5bef58..0b136e590 100644 --- a/data/conf/samples/diamagent_internal/voice.json +++ b/data/conf/samples/diamagent_internal/voice.json @@ -9,28 +9,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -40,30 +40,30 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -73,28 +73,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/diamagent_mongo/data.json b/data/conf/samples/diamagent_mongo/data.json index 58f084359..bce1e853b 100644 --- a/data/conf/samples/diamagent_mongo/data.json +++ b/data/conf/samples/diamagent_mongo/data.json @@ -9,24 +9,24 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -36,29 +36,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -69,29 +69,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -101,21 +101,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/diamagent_mongo/dryrun.json b/data/conf/samples/diamagent_mongo/dryrun.json index eb38962e3..21fb70735 100644 --- a/data/conf/samples/diamagent_mongo/dryrun.json +++ b/data/conf/samples/diamagent_mongo/dryrun.json @@ -7,32 +7,32 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -42,28 +42,28 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/diamagent_mongo/message.json b/data/conf/samples/diamagent_mongo/message.json index df97f5342..a10200830 100644 --- a/data/conf/samples/diamagent_mongo/message.json +++ b/data/conf/samples/diamagent_mongo/message.json @@ -9,25 +9,25 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/diamagent_mongo/simpa.json b/data/conf/samples/diamagent_mongo/simpa.json index ea592bab1..8c8493212 100644 --- a/data/conf/samples/diamagent_mongo/simpa.json +++ b/data/conf/samples/diamagent_mongo/simpa.json @@ -9,16 +9,16 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts", "*log"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/diamagent_mongo/tests.json b/data/conf/samples/diamagent_mongo/tests.json index cd751c6b1..be855888b 100644 --- a/data/conf/samples/diamagent_mongo/tests.json +++ b/data/conf/samples/diamagent_mongo/tests.json @@ -9,33 +9,33 @@ "*prefix:~*req.Service-Context-Id:testSessionDisconnect"], "flags": ["*initiate", "*accounts","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*variable", + {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "field_id": "CGRDebitInterval", + {"tag": "DebitInterval", "path": "CGRDebitInterval", "type": "*constant", "value": "1s"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "filters": ["*gte:~*cgrep.MaxUsage:0s"], "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds&*round:0}", "mandatory": true}, ], diff --git a/data/conf/samples/diamagent_mongo/voice.json b/data/conf/samples/diamagent_mongo/voice.json index f9b5bef58..0b136e590 100644 --- a/data/conf/samples/diamagent_mongo/voice.json +++ b/data/conf/samples/diamagent_mongo/voice.json @@ -9,28 +9,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -40,30 +40,30 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -73,28 +73,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/diamagent_mysql/data.json b/data/conf/samples/diamagent_mysql/data.json index 58f084359..bce1e853b 100644 --- a/data/conf/samples/diamagent_mysql/data.json +++ b/data/conf/samples/diamagent_mysql/data.json @@ -9,24 +9,24 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -36,29 +36,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -69,29 +69,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -101,21 +101,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/diamagent_mysql/dryrun.json b/data/conf/samples/diamagent_mysql/dryrun.json index eb38962e3..21fb70735 100644 --- a/data/conf/samples/diamagent_mysql/dryrun.json +++ b/data/conf/samples/diamagent_mysql/dryrun.json @@ -7,32 +7,32 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -42,28 +42,28 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/diamagent_mysql/message.json b/data/conf/samples/diamagent_mysql/message.json index df97f5342..a10200830 100644 --- a/data/conf/samples/diamagent_mysql/message.json +++ b/data/conf/samples/diamagent_mysql/message.json @@ -9,25 +9,25 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/diamagent_mysql/simpa.json b/data/conf/samples/diamagent_mysql/simpa.json index ea592bab1..8c8493212 100644 --- a/data/conf/samples/diamagent_mysql/simpa.json +++ b/data/conf/samples/diamagent_mysql/simpa.json @@ -9,16 +9,16 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts", "*log"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/diamagent_mysql/tests.json b/data/conf/samples/diamagent_mysql/tests.json index cd751c6b1..be855888b 100644 --- a/data/conf/samples/diamagent_mysql/tests.json +++ b/data/conf/samples/diamagent_mysql/tests.json @@ -9,33 +9,33 @@ "*prefix:~*req.Service-Context-Id:testSessionDisconnect"], "flags": ["*initiate", "*accounts","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*variable", + {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "field_id": "CGRDebitInterval", + {"tag": "DebitInterval", "path": "CGRDebitInterval", "type": "*constant", "value": "1s"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "filters": ["*gte:~*cgrep.MaxUsage:0s"], "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds&*round:0}", "mandatory": true}, ], diff --git a/data/conf/samples/diamagent_mysql/voice.json b/data/conf/samples/diamagent_mysql/voice.json index f9b5bef58..0b136e590 100644 --- a/data/conf/samples/diamagent_mysql/voice.json +++ b/data/conf/samples/diamagent_mysql/voice.json @@ -9,28 +9,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -40,30 +40,30 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -73,28 +73,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/diamsctpagent_internal/data.json b/data/conf/samples/diamsctpagent_internal/data.json index 667911987..9f5cfb23d 100755 --- a/data/conf/samples/diamsctpagent_internal/data.json +++ b/data/conf/samples/diamsctpagent_internal/data.json @@ -9,24 +9,24 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -36,29 +36,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -69,29 +69,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -101,21 +101,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/diamsctpagent_internal/dryrun.json b/data/conf/samples/diamsctpagent_internal/dryrun.json index eb38962e3..21fb70735 100755 --- a/data/conf/samples/diamsctpagent_internal/dryrun.json +++ b/data/conf/samples/diamsctpagent_internal/dryrun.json @@ -7,32 +7,32 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -42,28 +42,28 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/diamsctpagent_internal/message.json b/data/conf/samples/diamsctpagent_internal/message.json index df97f5342..a10200830 100755 --- a/data/conf/samples/diamsctpagent_internal/message.json +++ b/data/conf/samples/diamsctpagent_internal/message.json @@ -9,25 +9,25 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/diamsctpagent_internal/simpa.json b/data/conf/samples/diamsctpagent_internal/simpa.json index de72f0851..95af9a8c2 100755 --- a/data/conf/samples/diamsctpagent_internal/simpa.json +++ b/data/conf/samples/diamsctpagent_internal/simpa.json @@ -9,16 +9,16 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/diamsctpagent_internal/voice.json b/data/conf/samples/diamsctpagent_internal/voice.json index f9b5bef58..0b136e590 100755 --- a/data/conf/samples/diamsctpagent_internal/voice.json +++ b/data/conf/samples/diamsctpagent_internal/voice.json @@ -9,28 +9,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -40,30 +40,30 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -73,28 +73,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/diamsctpagent_mongo/data.json b/data/conf/samples/diamsctpagent_mongo/data.json index 667911987..9f5cfb23d 100755 --- a/data/conf/samples/diamsctpagent_mongo/data.json +++ b/data/conf/samples/diamsctpagent_mongo/data.json @@ -9,24 +9,24 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -36,29 +36,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -69,29 +69,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -101,21 +101,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/diamsctpagent_mongo/dryrun.json b/data/conf/samples/diamsctpagent_mongo/dryrun.json index eb38962e3..21fb70735 100755 --- a/data/conf/samples/diamsctpagent_mongo/dryrun.json +++ b/data/conf/samples/diamsctpagent_mongo/dryrun.json @@ -7,32 +7,32 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -42,28 +42,28 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/diamsctpagent_mongo/message.json b/data/conf/samples/diamsctpagent_mongo/message.json index df97f5342..a10200830 100755 --- a/data/conf/samples/diamsctpagent_mongo/message.json +++ b/data/conf/samples/diamsctpagent_mongo/message.json @@ -9,25 +9,25 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/diamsctpagent_mongo/simpa.json b/data/conf/samples/diamsctpagent_mongo/simpa.json index de72f0851..95af9a8c2 100755 --- a/data/conf/samples/diamsctpagent_mongo/simpa.json +++ b/data/conf/samples/diamsctpagent_mongo/simpa.json @@ -9,16 +9,16 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/diamsctpagent_mongo/voice.json b/data/conf/samples/diamsctpagent_mongo/voice.json index f9b5bef58..0b136e590 100755 --- a/data/conf/samples/diamsctpagent_mongo/voice.json +++ b/data/conf/samples/diamsctpagent_mongo/voice.json @@ -9,28 +9,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -40,30 +40,30 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -73,28 +73,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/diamsctpagent_mysql/data.json b/data/conf/samples/diamsctpagent_mysql/data.json index 667911987..9f5cfb23d 100755 --- a/data/conf/samples/diamsctpagent_mysql/data.json +++ b/data/conf/samples/diamsctpagent_mysql/data.json @@ -9,24 +9,24 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -36,29 +36,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -69,29 +69,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -101,21 +101,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/diamsctpagent_mysql/dryrun.json b/data/conf/samples/diamsctpagent_mysql/dryrun.json index eb38962e3..21fb70735 100755 --- a/data/conf/samples/diamsctpagent_mysql/dryrun.json +++ b/data/conf/samples/diamsctpagent_mysql/dryrun.json @@ -7,32 +7,32 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -42,28 +42,28 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/diamsctpagent_mysql/message.json b/data/conf/samples/diamsctpagent_mysql/message.json index df97f5342..a10200830 100755 --- a/data/conf/samples/diamsctpagent_mysql/message.json +++ b/data/conf/samples/diamsctpagent_mysql/message.json @@ -9,25 +9,25 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/diamsctpagent_mysql/simpa.json b/data/conf/samples/diamsctpagent_mysql/simpa.json index de72f0851..95af9a8c2 100755 --- a/data/conf/samples/diamsctpagent_mysql/simpa.json +++ b/data/conf/samples/diamsctpagent_mysql/simpa.json @@ -9,16 +9,16 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/diamsctpagent_mysql/voice.json b/data/conf/samples/diamsctpagent_mysql/voice.json index f9b5bef58..0b136e590 100755 --- a/data/conf/samples/diamsctpagent_mysql/voice.json +++ b/data/conf/samples/diamsctpagent_mysql/voice.json @@ -9,28 +9,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -40,30 +40,30 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -73,28 +73,28 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/dispatchers/diamagent/data.json b/data/conf/samples/dispatchers/diamagent/data.json index 9ed9c3b34..6ec2beac7 100644 --- a/data/conf/samples/dispatchers/diamagent/data.json +++ b/data/conf/samples/dispatchers/diamagent/data.json @@ -9,25 +9,25 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -37,30 +37,30 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", "value": "_grp1"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*contant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "_grp1"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*contant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(1)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], "continue": true, }, @@ -71,30 +71,30 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "InitialOriginID", "field_id": "InitialOriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*constant", "value": "_grp2"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "OriginID", "path": "OriginID", "type": "*constant", "value": "_grp2"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*sum", + {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(2)];~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets[~Rating-Group(2)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -104,22 +104,22 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "field_id": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets;~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Output-Octets"}, ], }, diff --git a/data/conf/samples/dispatchers/diamagent/dryrun.json b/data/conf/samples/dispatchers/diamagent/dryrun.json index a8c0a3003..fe77b74ec 100644 --- a/data/conf/samples/dispatchers/diamagent/dryrun.json +++ b/data/conf/samples/dispatchers/diamagent/dryrun.json @@ -7,33 +7,33 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "field_id": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], "continue": true, @@ -43,29 +43,29 @@ "filters": ["*rsr::~*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[0](!^$)"], // make sure the CC-Total-Octets was populated in the previous processor "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "Val1", "field_id": "Val1", "type": "*constant", "value": "1"}, - {"tag": "Val2", "field_id": "Val2", "type": "*constant", "value": "2"}, - {"tag": "Val3", "field_id": "Val3", "type": "*constant", "value": "3"}, - {"tag": "OptionalField", "field_id":"OptionalField", "type":"*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "Val1", "path": "Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "field_id": "UsedUnits1", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, - {"tag": "UsedUnits2", "field_id": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "field_id": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "field_id": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits2"}, ], }, diff --git a/data/conf/samples/dispatchers/diamagent/message.json b/data/conf/samples/dispatchers/diamagent/message.json index fe8ddff0d..bab456edc 100644 --- a/data/conf/samples/dispatchers/diamagent/message.json +++ b/data/conf/samples/dispatchers/diamagent/message.json @@ -9,26 +9,26 @@ "*string:~*req.CC-Request-Type:4"], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "sms"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "sms"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, diff --git a/data/conf/samples/dispatchers/diamagent/simpa.json b/data/conf/samples/dispatchers/diamagent/simpa.json index ff2a92754..ac1b8f85a 100644 --- a/data/conf/samples/dispatchers/diamagent/simpa.json +++ b/data/conf/samples/dispatchers/diamagent/simpa.json @@ -9,17 +9,17 @@ "*prefix:~*req.Service-Context-Id:simpa"], "flags": ["*message", "*accounts", "*log"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*generic"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "mandatory": true, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, + {"tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, "value": "~*req.Requested-Service-Unit.CC-Money.Unit-Value.Value-Digits;~*req.Requested-Service-Unit.CC-Money.Unit-Value.Exponent"}, ], }, diff --git a/data/conf/samples/dispatchers/diamagent/tests.json b/data/conf/samples/dispatchers/diamagent/tests.json index 1cf9cd445..95460e14a 100644 --- a/data/conf/samples/dispatchers/diamagent/tests.json +++ b/data/conf/samples/dispatchers/diamagent/tests.json @@ -9,34 +9,34 @@ "*prefix:~*req.Service-Context-Id:testSessionDisconnect"], "flags": ["*initiate", "*accounts","*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*variable", + {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "field_id": "Category", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "field_id": "CGRDebitInterval", + {"tag": "DebitInterval", "path": "CGRDebitInterval", "type": "*constant", "value": "1s"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "filters": ["*gte:~*cgrep.MaxUsage:0s"], "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds&*round:0}", "mandatory": true}, ], diff --git a/data/conf/samples/dispatchers/diamagent/voice.json b/data/conf/samples/dispatchers/diamagent/voice.json index 47fee708a..52b642e45 100644 --- a/data/conf/samples/dispatchers/diamagent/voice.json +++ b/data/conf/samples/dispatchers/diamagent/voice.json @@ -9,29 +9,29 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -41,31 +41,31 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, - {"tag": "GrantedUnits", "field_id": "Granted-Service-Unit.CC-Time", "type": "*variable", + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -75,29 +75,29 @@ "*prefix:~*req.Service-Context-Id:voice"], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "field_id": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "field_id": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "field_id": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "field_id": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, ], }, ], diff --git a/data/conf/samples/dispatchers/radagent/cgrates.json b/data/conf/samples/dispatchers/radagent/cgrates.json index 9f3bb91ae..cf1e89cd8 100644 --- a/data/conf/samples/dispatchers/radagent/cgrates.json +++ b/data/conf/samples/dispatchers/radagent/cgrates.json @@ -60,25 +60,25 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts","*dispatchers"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - // {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + // {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -87,25 +87,25 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts","*dispatchers"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - // {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + // {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -114,27 +114,27 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs","*dispatchers"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - // {"tag": "*api_key", "field_id": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + // {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/dnsagent_internal/attributes.json b/data/conf/samples/dnsagent_internal/attributes.json index 78f9449e1..0f44c82c3 100644 --- a/data/conf/samples/dnsagent_internal/attributes.json +++ b/data/conf/samples/dnsagent_internal/attributes.json @@ -7,21 +7,21 @@ "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174964"], "flags": ["*auth", "*attributes"], "request_fields":[ - {"tag": "E164Address", "field_id": "E164Address", + {"tag": "E164Address", "path": "E164Address", "type": "*constant", "value": "4986517174964"}, - {"tag": "NAPTRAddress", "field_id": "NAPTRAddress", + {"tag": "NAPTRAddress", "path": "NAPTRAddress", "type": "*constant", "value": "*attributes"} ], "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegex", "field_id": "Regexp", + {"tag": "NAPTRRegex", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Attributes.NAPTRAddress"}, ], }, diff --git a/data/conf/samples/dnsagent_internal/dryrun.json b/data/conf/samples/dnsagent_internal/dryrun.json index e485a7997..14206d31c 100644 --- a/data/conf/samples/dnsagent_internal/dryrun.json +++ b/data/conf/samples/dnsagent_internal/dryrun.json @@ -7,15 +7,15 @@ "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174963"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, ], "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", "type": "*constant", "value": "."}, + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"}, + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], }, ], diff --git a/data/conf/samples/dnsagent_internal/suppliers.json b/data/conf/samples/dnsagent_internal/suppliers.json index b531e99f1..66d54ffaf 100644 --- a/data/conf/samples/dnsagent_internal/suppliers.json +++ b/data/conf/samples/dnsagent_internal/suppliers.json @@ -8,7 +8,7 @@ "*string:~*vars.E164Address:4986517174965"], "flags": ["*message", "*suppliers"], "request_fields":[ - {"tag": "TOR", "field_id": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile + {"tag": "TOR", "path": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile ], "reply_fields":[ {"tag": "DispatchReply", "type": "*none", @@ -23,17 +23,17 @@ "*gte:~*cgrep.Suppliers.Count:1"], "flags": ["*none"], // do not send request to CGRateS "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*variable", + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], "continue": true, @@ -46,16 +46,16 @@ "flags": ["*none"], "reply_fields":[ {"tag": "NAPTROrder", "type": "*constant", "new_branch": true, - "field_id": "Order", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + "path": "Order", "value": "100"}, + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*variable", + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], "continue": true, diff --git a/data/conf/samples/dnsagent_mongo/attributes.json b/data/conf/samples/dnsagent_mongo/attributes.json index 78f9449e1..0f44c82c3 100644 --- a/data/conf/samples/dnsagent_mongo/attributes.json +++ b/data/conf/samples/dnsagent_mongo/attributes.json @@ -7,21 +7,21 @@ "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174964"], "flags": ["*auth", "*attributes"], "request_fields":[ - {"tag": "E164Address", "field_id": "E164Address", + {"tag": "E164Address", "path": "E164Address", "type": "*constant", "value": "4986517174964"}, - {"tag": "NAPTRAddress", "field_id": "NAPTRAddress", + {"tag": "NAPTRAddress", "path": "NAPTRAddress", "type": "*constant", "value": "*attributes"} ], "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegex", "field_id": "Regexp", + {"tag": "NAPTRRegex", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Attributes.NAPTRAddress"}, ], }, diff --git a/data/conf/samples/dnsagent_mongo/dryrun.json b/data/conf/samples/dnsagent_mongo/dryrun.json index e485a7997..14206d31c 100644 --- a/data/conf/samples/dnsagent_mongo/dryrun.json +++ b/data/conf/samples/dnsagent_mongo/dryrun.json @@ -7,15 +7,15 @@ "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174963"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, ], "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", "type": "*constant", "value": "."}, + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"}, + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], }, ], diff --git a/data/conf/samples/dnsagent_mongo/suppliers.json b/data/conf/samples/dnsagent_mongo/suppliers.json index b531e99f1..66d54ffaf 100644 --- a/data/conf/samples/dnsagent_mongo/suppliers.json +++ b/data/conf/samples/dnsagent_mongo/suppliers.json @@ -8,7 +8,7 @@ "*string:~*vars.E164Address:4986517174965"], "flags": ["*message", "*suppliers"], "request_fields":[ - {"tag": "TOR", "field_id": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile + {"tag": "TOR", "path": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile ], "reply_fields":[ {"tag": "DispatchReply", "type": "*none", @@ -23,17 +23,17 @@ "*gte:~*cgrep.Suppliers.Count:1"], "flags": ["*none"], // do not send request to CGRateS "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*variable", + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], "continue": true, @@ -46,16 +46,16 @@ "flags": ["*none"], "reply_fields":[ {"tag": "NAPTROrder", "type": "*constant", "new_branch": true, - "field_id": "Order", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + "path": "Order", "value": "100"}, + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*variable", + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], "continue": true, diff --git a/data/conf/samples/dnsagent_mysql/attributes.json b/data/conf/samples/dnsagent_mysql/attributes.json index 78f9449e1..0f44c82c3 100644 --- a/data/conf/samples/dnsagent_mysql/attributes.json +++ b/data/conf/samples/dnsagent_mysql/attributes.json @@ -7,21 +7,21 @@ "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174964"], "flags": ["*auth", "*attributes"], "request_fields":[ - {"tag": "E164Address", "field_id": "E164Address", + {"tag": "E164Address", "path": "E164Address", "type": "*constant", "value": "4986517174964"}, - {"tag": "NAPTRAddress", "field_id": "NAPTRAddress", + {"tag": "NAPTRAddress", "path": "NAPTRAddress", "type": "*constant", "value": "*attributes"} ], "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegex", "field_id": "Regexp", + {"tag": "NAPTRRegex", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Attributes.NAPTRAddress"}, ], }, diff --git a/data/conf/samples/dnsagent_mysql/dryrun.json b/data/conf/samples/dnsagent_mysql/dryrun.json index e485a7997..14206d31c 100644 --- a/data/conf/samples/dnsagent_mysql/dryrun.json +++ b/data/conf/samples/dnsagent_mysql/dryrun.json @@ -7,15 +7,15 @@ "filters": ["*string:~*vars.QueryType:NAPTR", "*string:~*vars.E164Address:4986517174963"], "flags": ["*dryrun"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*sms"}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*sms"}, ], "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", "type": "*constant", "value": "."}, + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*constant", "value": "!^(.*)$!sip:\\1@172.16.1.10.!"}, + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], }, ], diff --git a/data/conf/samples/dnsagent_mysql/suppliers.json b/data/conf/samples/dnsagent_mysql/suppliers.json index b531e99f1..66d54ffaf 100644 --- a/data/conf/samples/dnsagent_mysql/suppliers.json +++ b/data/conf/samples/dnsagent_mysql/suppliers.json @@ -8,7 +8,7 @@ "*string:~*vars.E164Address:4986517174965"], "flags": ["*message", "*suppliers"], "request_fields":[ - {"tag": "TOR", "field_id": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile + {"tag": "TOR", "path": "Account", "type": "*constant", "value": "1001"}, // so we can match the supplier profile ], "reply_fields":[ {"tag": "DispatchReply", "type": "*none", @@ -23,17 +23,17 @@ "*gte:~*cgrep.Suppliers.Count:1"], "flags": ["*none"], // do not send request to CGRateS "reply_fields":[ - {"tag": "NAPTROrder", "field_id": "Order", + {"tag": "NAPTROrder", "path": "Order", "type": "*constant", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*variable", + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Suppliers.SortedSuppliers[0].SupplierParameters"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], "continue": true, @@ -46,16 +46,16 @@ "flags": ["*none"], "reply_fields":[ {"tag": "NAPTROrder", "type": "*constant", "new_branch": true, - "field_id": "Order", "value": "100"}, - {"tag": "NAPTRPreference", "field_id": "Preference", + "path": "Order", "value": "100"}, + {"tag": "NAPTRPreference", "path": "Preference", "type": "*constant", "value": "10"}, - {"tag": "NAPTRFlags", "field_id": "Flags", + {"tag": "NAPTRFlags", "path": "Flags", "type": "*constant", "value": "U"}, - {"tag": "NAPTRService", "field_id": "Service", + {"tag": "NAPTRService", "path": "Service", "type": "*constant", "value": "E2U+SIP"}, - {"tag": "NAPTRRegexp", "field_id": "Regexp", "type": "*variable", + {"tag": "NAPTRRegexp", "path": "Regexp", "type": "*variable", "value": "~*cgrep.Suppliers.SortedSuppliers[1].SupplierParameters"}, - {"tag": "NAPTRReplacement", "field_id": "Replacement", + {"tag": "NAPTRReplacement", "path": "Replacement", "type": "*constant", "value": "."}, ], "continue": true, diff --git a/data/conf/samples/ers_example/cgrates.json b/data/conf/samples/ers_example/cgrates.json index b13580bc1..493d28e67 100644 --- a/data/conf/samples/ers_example/cgrates.json +++ b/data/conf/samples/ers_example/cgrates.json @@ -76,17 +76,17 @@ "source_path": "/tmp/ers/in", "processed_path": "/tmp/ers/out", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.10", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.11", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.10", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.11", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true}, ], }, ], diff --git a/data/conf/samples/ers_internal/cgrates.json b/data/conf/samples/ers_internal/cgrates.json index 10bc0dff3..07a6eb3f0 100644 --- a/data/conf/samples/ers_internal/cgrates.json +++ b/data/conf/samples/ers_internal/cgrates.json @@ -93,20 +93,20 @@ "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -117,18 +117,18 @@ "source_path": "/tmp/init_session/in", "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/out", - "fields":[ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + "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": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -139,11 +139,11 @@ "source_path": "/tmp/terminate_session/in", "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/out", - "fields":[ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + "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": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -154,20 +154,20 @@ "source_path": "/tmp/cdrs/in", "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/out", - "fields":[ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "field_id": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "field_id": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + "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": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -180,21 +180,21 @@ "flags": ["*cdrs","*log"], "filters":["*string:~*req.3:1002"], "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -206,16 +206,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -226,28 +226,28 @@ "flags": ["*cdrs"], "processed_path": "/tmp/fwvErs/out", "fields": [ - {"tag": "FileName", "field_id": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "field_id": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "0.0.0.0", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "field_id": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "field_id":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "field_id":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, + {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.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", "path": "AnswerTime", "type": "*variable", "value": "~*req.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", "path": "Usage", "type": "*variable", "value": "~*req.127-135:s/(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}h${2}m${3}s/", "mandatory": true}, + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -261,23 +261,23 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, @@ -302,23 +302,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -333,19 +333,19 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"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": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} ], } ], diff --git a/data/conf/samples/ers_mongo/cgrates.json b/data/conf/samples/ers_mongo/cgrates.json index 123aa7951..c83b2b339 100644 --- a/data/conf/samples/ers_mongo/cgrates.json +++ b/data/conf/samples/ers_mongo/cgrates.json @@ -74,7 +74,6 @@ "attributes_conns": ["*internal"], }, - "ers": { "enabled": true, "sessions_conns": ["*internal"], @@ -96,20 +95,20 @@ "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -121,17 +120,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -143,10 +142,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -158,19 +157,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "field_id": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "field_id": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -183,21 +182,21 @@ "flags": ["*cdrs","*log"], "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": "*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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -209,16 +208,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -229,28 +228,28 @@ "flags": ["*cdrs"], "processed_path": "/tmp/fwvErs/out", "fields": [ - {"tag": "FileName", "field_id": "CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "field_id": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "0.0.0.0", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "field_id": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "field_id":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "field_id":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, + {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.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", "path": "AnswerTime", "type": "*variable", "value": "~*req.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", "path": "Usage", "type": "*variable", "value": "~*req.127-135:s/(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}h${2}m${3}s/", "mandatory": true}, + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -264,23 +263,23 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, @@ -305,23 +304,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -336,19 +335,19 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"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": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} ], } ], diff --git a/data/conf/samples/ers_mysql/cgrates.json b/data/conf/samples/ers_mysql/cgrates.json index 24723f226..9dfdbe936 100644 --- a/data/conf/samples/ers_mysql/cgrates.json +++ b/data/conf/samples/ers_mysql/cgrates.json @@ -71,7 +71,6 @@ "attributes_conns": ["*internal"], }, - "ers": { "enabled": true, "sessions_conns": ["*internal"], @@ -93,20 +92,20 @@ "flags": ["*dryrun"], "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": "*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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -118,17 +117,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -140,10 +139,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -155,19 +154,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "field_id": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "field_id": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -180,21 +179,21 @@ "flags": ["*cdrs","*log"], "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": "*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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -206,16 +205,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -226,30 +225,29 @@ "flags": ["*cdrs"], "processed_path": "/tmp/fwvErs/out", "fields": [ - {"tag": "FileName", "field_id": "CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "field_id": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "0.0.0.0", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "field_id": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "field_id":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "field_id":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, + {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.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", "path": "AnswerTime", "type": "*variable", "value": "~*req.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", "path": "Usage", "type": "*variable", "value": "~*req.127-135:s/(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}h${2}m${3}s/", "mandatory": true}, + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} ], - }, { "id": "PartialCSV1", @@ -262,23 +260,23 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, @@ -303,23 +301,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -334,19 +332,19 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"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": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} ], } ], diff --git a/data/conf/samples/ers_postgres/cgrates.json b/data/conf/samples/ers_postgres/cgrates.json index 211a25ed8..c679b074e 100644 --- a/data/conf/samples/ers_postgres/cgrates.json +++ b/data/conf/samples/ers_postgres/cgrates.json @@ -68,7 +68,6 @@ "attributes_conns": ["*internal"], }, - "ers": { "enabled": true, "sessions_conns": ["*internal"], @@ -90,20 +89,20 @@ "flags": ["*dryrun"], "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": "*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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -115,17 +114,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -137,10 +136,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -152,19 +151,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "field_id": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "field_id": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -177,21 +176,21 @@ "flags": ["*cdrs","*log"], "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": "*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": "*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}, + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "Source", "type": "*constant", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -203,16 +202,16 @@ "processed_path": "/tmp/xmlErs/out", "xml_root_path": "broadWorksCDR.cdrData", "fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.localCallId", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userId:s/.*@(.*)/${1}/", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.userNumber", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.calledNumber", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.startTime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.broadWorksCDR.cdrData.basicModule.releaseTime;~*req.broadWorksCDR.cdrData.basicModule.answerTime", "mandatory": true} ], }, { @@ -223,28 +222,28 @@ "flags": ["*cdrs"], "processed_path": "/tmp/fwvErs/out", "fields": [ - {"tag": "FileName", "field_id": "CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, - {"tag": "FileSeqNr", "field_id": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "0.0.0.0", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.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": "*variable", "value": "~*req.138-139", "mandatory": true}, - {"tag": "RetailAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, - {"tag": "WholesaleAmount", "field_id": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, - {"tag": "AccId1", "field_id": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, - {"tag": "AccId2", "field_id": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, - {"tag": "NrOfCdrs", "type": "*variable", "field_id":"NrOfCdrs", "value": "~*trl.142-150"}, - {"tag": "TotalDuration", "type": "*variable", "field_id":"TotalDuration", "value": "~*trl.150-162"} + {"tag": "FileName", "path": "*cgreq.CdrFileName", "type": "*variable", "value": "~*hdr.95-135", "padding":"right"}, + {"tag": "FileSeqNr", "path": "FileSeqNr", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*hdr.135-141", "padding":"zeroleft"}, + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "rated", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0-10", "padding":"right", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "0.0.0.0", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.30-49", "padding":"right", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.52-80", "padding":"right", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.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", "path": "AnswerTime", "type": "*variable", "value": "~*req.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", "path": "Usage", "type": "*variable", "value": "~*req.127-135:s/(\\d{2})(\\d{2})(\\d{2})(\\d{2})/${1}h${2}m${3}s/", "mandatory": true}, + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.138-139", "mandatory": true}, + {"tag": "RetailAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.103-111", "padding":"zeroleft"}, + {"tag": "WholesaleAmount", "path": "RetailAmount", "type": "*variable", "value": "~*req.115-123", "padding":"zeroleft"}, + {"tag": "AccId1", "path": "AccId1", "type": "*variable", "value": "~*req.3-6", "padding":"zeroleft", "mandatory": true}, + {"tag": "AccId2", "path": "AccId2", "type": "*variable", "value": "~*req.14-30", "padding":"right", "mandatory": true}, + {"tag": "NrOfCdrs", "type": "*variable", "path":"NrOfCdrs", "value": "~*trl.142-150"}, + {"tag": "TotalDuration", "type": "*variable", "path":"TotalDuration", "value": "~*trl.150-162"} ], }, { @@ -258,23 +257,23 @@ "partial_record_cache": "2s", "partial_cache_expiry_action": "*dump_to_file", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]}, ], "cache_dump_fields": [ {"tag": "OriginID", "type": "*composed", "value": "~OriginID"}, @@ -299,23 +298,23 @@ "partial_record_cache": "1s", "partial_cache_expiry_action": "*post_cdr", "fields":[ - {"tag": "ToR", "field_id": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, - {"tag": "AccId1", "field_id": "OriginID", "type": "*composed", "value": "~*req.0"}, - {"tag": "AccId2", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId3", "field_id": "OriginID", "type": "*composed", "value": "~*req.1"}, - {"tag": "AccId4", "field_id": "OriginID", "type": "*composed", "value": "_"}, - {"tag": "AccId5", "field_id": "OriginID", "type": "*composed", "value": "~*req.4"}, - {"tag": "OrderID", "field_id": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", "value": "*rated", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, - {"tag": "Partial", "field_id": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} + {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "AccId1", "path": "OriginID", "type": "*composed", "value": "~*req.0"}, + {"tag": "AccId2", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId3", "path": "OriginID", "type": "*composed", "value": "~*req.1"}, + {"tag": "AccId4", "path": "OriginID", "type": "*composed", "value": "_"}, + {"tag": "AccId5", "path": "OriginID", "type": "*composed", "value": "~*req.4"}, + {"tag": "OrderID", "path": "OrderID", "type": "*unix_timestamp", "value": "~*req.3"}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*constant", "value": "127.0.0.1", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*rated", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.0:s/^49([1-9]\\d+)$/0$1/", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.1:s/^00(\\d+)$/+$1/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6:s/^(\\d+)$/${1}s/", "mandatory": true}, + {"tag": "Partial", "path": "Partial", "type": "*constant", "value": "true", "filters":["*string:~*req.10:partial"]} ], }, { @@ -330,19 +329,19 @@ "flags": ["*cdrs"], "partial_record_cache": "2s", "fields":[ - {"tag": "Tor", "field_id": "ToR", "type": "*constant", "value": "*voice", "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}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"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": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, - {"tag": "DialogId", "field_id": "DialogId", "type": "*variable", "value": "~*req.11"} + {"tag": "Tor", "path": "ToR", "type": "*constant", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable","value":"~*req.3;~*req.1;~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*constant", "value": "cgrates.org", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "mandatory": true}, // Value for Usage is composed based on record + {"tag": "DisconnectCause", "path": "DisconnectCause", "type": "*variable", "value": "~*req.4; ;~*req.5", "mandatory": true}, + {"tag": "DialogId", "path": "DialogId", "type": "*variable", "value": "~*req.11"} ], } ], diff --git a/data/conf/samples/ers_reload/first_reload/cgrates.json b/data/conf/samples/ers_reload/first_reload/cgrates.json index 15346b2ed..32161de99 100644 --- a/data/conf/samples/ers_reload/first_reload/cgrates.json +++ b/data/conf/samples/ers_reload/first_reload/cgrates.json @@ -85,20 +85,20 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/ers2/out", "content_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": "*variable", "value": "*voice", "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": "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}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, ], diff --git a/data/conf/samples/ers_reload/internal/cgrates.json b/data/conf/samples/ers_reload/internal/cgrates.json index f178b5ce0..f43061fe7 100644 --- a/data/conf/samples/ers_reload/internal/cgrates.json +++ b/data/conf/samples/ers_reload/internal/cgrates.json @@ -76,17 +76,17 @@ "source_path": "/tmp/ers/in", "processed_path": "/tmp/ers/out", "content_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": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.10", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.11", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.10", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.11", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.12", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.13", "mandatory": true}, ], }, ], diff --git a/data/conf/samples/ers_reload/second_reload/cgrates.json b/data/conf/samples/ers_reload/second_reload/cgrates.json index 7379c7e71..94b7d7c5c 100644 --- a/data/conf/samples/ers_reload/second_reload/cgrates.json +++ b/data/conf/samples/ers_reload/second_reload/cgrates.json @@ -85,20 +85,20 @@ "flags": ["*dryrun"], "processed_path": "/tmp/ers2/out", "content_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": "*variable", "value": "*voice", "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": "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}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, { @@ -110,17 +110,17 @@ "flags": ["*initiate","*accounts","*resources","*attributes","*log"], "processed_path": "/tmp/init_session/out", "content_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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*variable", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -132,10 +132,10 @@ "flags": ["*terminate","*accounts","*resources","*log"], "processed_path": "/tmp/terminate_session/out", "content_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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, ], }, { @@ -147,19 +147,19 @@ "flags": ["*cdrs","*log"], "processed_path": "/tmp/cdrs/out", "content_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": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, - {"tag": "TOR", "field_id": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, - {"tag": "Category", "field_id": "Category", "type": "*variable", "value": "call", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, - {"tag": "ExtraInfo1", "field_id": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, - {"tag": "ExtraInfo2", "field_id": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.4", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.7", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.8", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.9", "mandatory": true}, + {"tag": "ExtraInfo1", "path": "ExtraInfo1", "type": "*constant", "value": "ExtraInfo1", "mandatory": true}, + {"tag": "ExtraInfo2", "path": "ExtraInfo2", "type": "*constant", "value": "ExtraInfo2", "mandatory": true}, ], }, { @@ -173,21 +173,21 @@ "flags": ["*cdrs","*log"], "filters":["*string:~*req.3:1002"], "content_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": "*variable", "value": "*voice", "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": "*variable", "value": "ers_csv", "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}, + {"tag": "TOR", "path": "ToR", "type": "*variable", "value": "*voice", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*variable", "value": "~*req.1", "mandatory": true}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.2", "mandatory": true}, + {"tag": "Category", "path": "Category", "type": "*variable", "value": "call", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Source", "path": "Source", "type": "*variable", "value": "ers_csv", "mandatory": true}, + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra3", "path": "HDRExtra3", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra2", "path": "HDRExtra2", "type": "*variable", "value": "~*req.6", "mandatory": true}, + {"tag": "HDRExtra1", "path": "HDRExtra1", "type": "*variable", "value": "~*req.6", "mandatory": true}, ], }, ], diff --git a/data/conf/samples/httpagent_internal/httpagent.json b/data/conf/samples/httpagent_internal/httpagent.json index 2a3af6db1..38fc4717e 100644 --- a/data/conf/samples/httpagent_internal/httpagent.json +++ b/data/conf/samples/httpagent_internal/httpagent.json @@ -17,15 +17,15 @@ "request_fields":[ ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", + {"tag": "Unused", "path": "response.Unused", "type": "*constant", "value": "0"}, ], }, @@ -35,22 +35,22 @@ "tenant": "cgrates.org", "flags": [ "*auth", "*accounts", "*attributes"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", "value": "*now", "mandatory": true}, ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -60,29 +60,29 @@ "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.leg_duration;s", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", "value": "1", "mandatory": true}, ], } @@ -100,21 +100,21 @@ "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, ], "reply_fields":[], @@ -136,15 +136,15 @@ "request_fields":[ ], "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", + {"tag": "Field1", "path": "Variable1", "type": "*variable", "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", + {"tag": "Field2", "path": "Variable2", "type": "*variable", "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", + {"tag": "Field5", "path": "Item1.1", "type": "*variable", "value": "Val1", "mandatory": true}, ], "continue": true, @@ -156,7 +156,7 @@ "flags": ["*dryrun"], "request_fields":[], "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", + {"tag": "Field1", "path": "Item1.1", "type": "*variable", "value": "Val2", "mandatory": true}, ], }, diff --git a/data/conf/samples/httpagent_internal_gob/httpagent.json b/data/conf/samples/httpagent_internal_gob/httpagent.json index 1a347a29c..4796c68ac 100644 --- a/data/conf/samples/httpagent_internal_gob/httpagent.json +++ b/data/conf/samples/httpagent_internal_gob/httpagent.json @@ -1,168 +1,168 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["conn1"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagent_mongo/httpagent.json b/data/conf/samples/httpagent_mongo/httpagent.json index 2a3af6db1..4796c68ac 100644 --- a/data/conf/samples/httpagent_mongo/httpagent.json +++ b/data/conf/samples/httpagent_mongo/httpagent.json @@ -1,168 +1,168 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["*localhost"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagent_mongo_gob/httpagent.json b/data/conf/samples/httpagent_mongo_gob/httpagent.json index 1a347a29c..4796c68ac 100644 --- a/data/conf/samples/httpagent_mongo_gob/httpagent.json +++ b/data/conf/samples/httpagent_mongo_gob/httpagent.json @@ -1,168 +1,168 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["conn1"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagent_mysql/httpagent.json b/data/conf/samples/httpagent_mysql/httpagent.json index 2a3af6db1..4796c68ac 100644 --- a/data/conf/samples/httpagent_mysql/httpagent.json +++ b/data/conf/samples/httpagent_mysql/httpagent.json @@ -1,168 +1,168 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["*localhost"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagent_mysql_gob/httpagent.json b/data/conf/samples/httpagent_mysql_gob/httpagent.json index 1a347a29c..4796c68ac 100644 --- a/data/conf/samples/httpagent_mysql_gob/httpagent.json +++ b/data/conf/samples/httpagent_mysql_gob/httpagent.json @@ -1,168 +1,168 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["conn1"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagenttls_internal/httpagent.json b/data/conf/samples/httpagenttls_internal/httpagent.json index 447fa298b..bc1d75216 100755 --- a/data/conf/samples/httpagenttls_internal/httpagent.json +++ b/data/conf/samples/httpagenttls_internal/httpagent.json @@ -17,15 +17,15 @@ "request_fields":[ ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", + {"tag": "Unused", "path": "response.Unused", "type": "*constant", "value": "0"}, ], }, @@ -35,22 +35,22 @@ "tenant": "cgrates.org", "flags": [ "*auth", "*accounts", "*attributes"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", "value": "*now", "mandatory": true}, ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -60,29 +60,29 @@ "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.leg_duration;s", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", "value": "1", "mandatory": true}, ], } @@ -100,21 +100,21 @@ "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "OriginID", "type": "*variable", "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", + {"tag": "Account", "path": "Account", "type": "*variable", "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", + {"tag": "Destination", "path": "Destination", "type": "*variable", "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", + {"tag": "Usage", "path": "Usage", "type": "*variable", "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, ], "reply_fields":[], @@ -136,15 +136,15 @@ "request_fields":[ ], "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", + {"tag": "Field1", "path": "Variable1", "type": "*variable", "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", + {"tag": "Field2", "path": "Variable2", "type": "*variable", "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", + {"tag": "Field5", "path": "Item1.1", "type": "*variable", "value": "Val1", "mandatory": true}, ], "continue": true, @@ -157,7 +157,7 @@ "request_fields":[ ], "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", + {"tag": "Field1", "path": "Item1.1", "type": "*variable", "value": "Val2", "mandatory": true}, ], }, diff --git a/data/conf/samples/httpagenttls_internal_gob/httpagent.json b/data/conf/samples/httpagenttls_internal_gob/httpagent.json index 32640dfe2..3edb7e4f1 100755 --- a/data/conf/samples/httpagenttls_internal_gob/httpagent.json +++ b/data/conf/samples/httpagenttls_internal_gob/httpagent.json @@ -1,169 +1,169 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["conn1"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagenttls_mongo/httpagent.json b/data/conf/samples/httpagenttls_mongo/httpagent.json index 447fa298b..3edb7e4f1 100755 --- a/data/conf/samples/httpagenttls_mongo/httpagent.json +++ b/data/conf/samples/httpagenttls_mongo/httpagent.json @@ -1,169 +1,169 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["*localhost"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagenttls_mongo_gob/httpagent.json b/data/conf/samples/httpagenttls_mongo_gob/httpagent.json index 32640dfe2..3edb7e4f1 100755 --- a/data/conf/samples/httpagenttls_mongo_gob/httpagent.json +++ b/data/conf/samples/httpagenttls_mongo_gob/httpagent.json @@ -1,169 +1,169 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["conn1"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagenttls_mysql/httpagent.json b/data/conf/samples/httpagenttls_mysql/httpagent.json index 447fa298b..3edb7e4f1 100755 --- a/data/conf/samples/httpagenttls_mysql/httpagent.json +++ b/data/conf/samples/httpagenttls_mysql/httpagent.json @@ -1,169 +1,169 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["*localhost"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["*localhost"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/httpagenttls_mysql_gob/httpagent.json b/data/conf/samples/httpagenttls_mysql_gob/httpagent.json index 32640dfe2..3edb7e4f1 100755 --- a/data/conf/samples/httpagenttls_mysql_gob/httpagent.json +++ b/data/conf/samples/httpagenttls_mysql_gob/httpagent.json @@ -1,169 +1,169 @@ { -"http_agent": [ - { - "id": "conecto1", - "url": "/conecto", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "OutboundAUTHDryRun", - "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "Concatenated1", "field_id": "response.Concatenated", "type": "*composed", - "value": "~*req.MCC;/", "mandatory": true}, - {"tag": "Concatenated2", "field_id": "response.Concatenated", "type": "*composed", - "value": "Val1"}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*constant", - "value": "1200", "blocker": true}, - {"tag": "Unused", "field_id": "response.Unused", "type": "*constant", - "value": "0"}, - ], - }, - { - "id": "OutboundAUTH", - "filters": ["*string:~*req.request_type:OutboundAUTH"], - "tenant": "cgrates.org", - "flags": [ "*auth", "*accounts", "*attributes"], - "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CallID", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.Msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.Destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*constant", - "value": "*now", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", - "value": "1", "mandatory": true}, - {"tag": "MaxDuration", "field_id": "response.MaxDuration", "type": "*variable", - "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, - ], - }, - { - "id": "mtcall_cdr", - "filters": ["*string:~*req.request_type:MTCALL_CDR"], - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.msisdn", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.destination", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.timestamp", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.leg_duration;s", "mandatory": true}, - ], - "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "field_id": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*variable", - "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "CDR_STATUS", "field_id": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", - "value": "1", "mandatory": true}, - ], - } - ], - }, - { - "id": "conecto_xml", - "url": "/conecto_xml", - "sessions_conns": ["conn1"], - "request_payload": "*xml", - "reply_payload": "*xml", - "request_processors": [ - { - "id": "cdr_from_xml", - "tenant": "cgrates.org", - "flags": ["*cdrs"], - "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", - "value": "*data", "mandatory": true}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", - "value": "*pseudoprepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*variable", - "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*variable", - "value": "~*req.complete-datasession-notification.username", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*variable", - "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*variable", - "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*variable", - "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, - ], - "reply_fields":[], - } - ], - }, - { - "id": "textplain", - "url": "/textplain", - "sessions_conns": ["conn1"], - "request_payload": "*url", - "reply_payload": "*text_plain", - "request_processors": [ - { - "id": "TextPlainDryRun", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Variable1", "type": "*variable", - "value": "Hola1", "mandatory": true}, - {"tag": "Field2", "field_id": "Variable2", "type": "*variable", - "value": "Hola2", "mandatory": true}, - {"tag": "Field3", "field_id": "ComposedVar", "type": "*composed", - "value": "Test", "mandatory": true}, - {"tag": "Field4", "field_id": "ComposedVar", "type": "*composed", - "value": "Composed", "mandatory": true}, - {"tag": "Field5", "field_id": "Item1.1", "type": "*variable", - "value": "Val1", "mandatory": true}, - ], - "continue": true, - }, - { - "id": "TextPlainDryRun2", - "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], - "tenant": "cgrates.org", - "flags": ["*dryrun"], - "request_fields":[ - ], - "reply_fields":[ - {"tag": "Field1", "field_id": "Item1.1", "type": "*variable", - "value": "Val2", "mandatory": true}, - ], - }, - ], - }, -], - - -} \ No newline at end of file + "http_agent": [ + { + "id": "conecto1", + "url": "/conecto", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "OutboundAUTHDryRun", + "filters": ["*string:~*req.request_type:OutboundAUTH","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "Concatenated1", "path": "response.Concatenated", "type": "*composed", + "value": "~*req.MCC;/", "mandatory": true}, + {"tag": "Concatenated2", "path": "response.Concatenated", "type": "*composed", + "value": "Val1"}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*constant", + "value": "1200", "blocker": true}, + {"tag": "Unused", "path": "response.Unused", "type": "*constant", + "value": "0"}, + ], + }, + { + "id": "OutboundAUTH", + "filters": ["*string:~*req.request_type:OutboundAUTH"], + "tenant": "cgrates.org", + "flags": [ "*auth", "*accounts", "*attributes"], + "request_fields":[ + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CallID", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.Msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.Destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*constant", + "value": "*now", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "Allow", "path": "response.Allow", "type": "*constant", + "value": "1", "mandatory": true}, + {"tag": "MaxDuration", "path": "response.MaxDuration", "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, + ], + }, + { + "id": "mtcall_cdr", + "filters": ["*string:~*req.request_type:MTCALL_CDR"], + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.msisdn", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.destination", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.timestamp", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.leg_duration;s", "mandatory": true}, + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "CDR_RESPONSE.RESULT_CODE", "type": "*variable", "value": "~*cgrep.Error", "blocker": true}, + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*variable", + "value": "~*req.CDR_ID", "mandatory": true}, + {"tag": "CDR_STATUS", "path": "CDR_RESPONSE.CDR_STATUS", "type": "*constant", + "value": "1", "mandatory": true}, + ], + } + ], + }, + { + "id": "conecto_xml", + "url": "/conecto_xml", + "sessions_conns": ["*localhost"], + "request_payload": "*xml", + "reply_payload": "*xml", + "request_processors": [ + { + "id": "cdr_from_xml", + "tenant": "cgrates.org", + "flags": ["*cdrs"], + "request_fields":[ + {"tag": "TOR", "path": "ToR", "type": "*constant", + "value": "*data", "mandatory": true}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", + "value": "*pseudoprepaid", "mandatory": true}, + {"tag": "OriginID", "path": "OriginID", "type": "*variable", + "value": "~*req.complete-datasession-notification.customerid", "mandatory": true}, + {"tag": "Account", "path": "Account", "type": "*variable", + "value": "~*req.complete-datasession-notification.username", "mandatory": true}, + {"tag": "Destination", "path": "Destination", "type": "*variable", + "value": "~*req.complete-datasession-notification.userid", "mandatory": true}, + {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + "value": "~*req.complete-datasession-notification.createtime", "mandatory": true}, + {"tag": "Usage", "path": "Usage", "type": "*variable", + "value": "~*req.complete-datasession-notification.callleg.bytes", "mandatory": true}, + ], + "reply_fields":[], + } + ], + }, + { + "id": "textplain", + "url": "/textplain", + "sessions_conns": ["*localhost"], + "request_payload": "*url", + "reply_payload": "*text_plain", + "request_processors": [ + { + "id": "TextPlainDryRun", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Variable1", "type": "*variable", + "value": "Hola1", "mandatory": true}, + {"tag": "Field2", "path": "Variable2", "type": "*variable", + "value": "Hola2", "mandatory": true}, + {"tag": "Field3", "path": "ComposedVar", "type": "*composed", + "value": "Test", "mandatory": true}, + {"tag": "Field4", "path": "ComposedVar", "type": "*composed", + "value": "Composed", "mandatory": true}, + {"tag": "Field5", "path": "Item1.1", "type": "*variable", + "value": "Val1", "mandatory": true}, + ], + "continue": true, + }, + { + "id": "TextPlainDryRun2", + "filters": ["*string:~*req.request_type:TextPlainDryRun","*string:~*req.Msisdn:497700056231"], + "tenant": "cgrates.org", + "flags": ["*dryrun"], + "request_fields":[ + ], + "reply_fields":[ + {"tag": "Field1", "path": "Item1.1", "type": "*variable", + "value": "Val2", "mandatory": true}, + ], + }, + ], + }, + ], + + + } \ No newline at end of file diff --git a/data/conf/samples/loaders/tutmongo/cgrates.json b/data/conf/samples/loaders/tutmongo/cgrates.json index 65988421f..57a4fd456 100644 --- a/data/conf/samples/loaders/tutmongo/cgrates.json +++ b/data/conf/samples/loaders/tutmongo/cgrates.json @@ -48,7 +48,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, @@ -120,17 +120,17 @@ "type": "*attributes", // data source type "file_name": "Attributes.csv", // file name in the tp_in_dir "fields": [ - {"tag": "TenantID", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ProfileID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Contexts", "field_id": "Contexts", "type": "*variable", "value": "~2"}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~3"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~4"}, - {"tag": "AttributeFilterIDs", "field_id": "AttributeFilterIDs", "type": "*variable", "value": "~5"}, - {"tag": "Path", "field_id": "Path", "type": "*variable", "value": "~6"}, - {"tag": "Type", "field_id": "Type", "type": "*variable", "value": "~7"}, - {"tag": "Value", "field_id": "Value", "type": "*variable", "value": "~8"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~9"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~10"}, + {"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"}, + {"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~5"}, + {"tag": "Path", "path": "Path", "type": "*variable", "value": "~6"}, + {"tag": "Type", "path": "Type", "type": "*variable", "value": "~7"}, + {"tag": "Value", "path": "Value", "type": "*variable", "value": "~8"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"}, ], }, ], diff --git a/data/conf/samples/loaders/tutmysql/cgrates.json b/data/conf/samples/loaders/tutmysql/cgrates.json index 057adfdeb..617e79e39 100644 --- a/data/conf/samples/loaders/tutmysql/cgrates.json +++ b/data/conf/samples/loaders/tutmysql/cgrates.json @@ -46,7 +46,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, @@ -80,17 +80,17 @@ "type": "*attributes", // data source type "file_name": "Attributes.csv", // file name in the tp_in_dir "fields": [ - {"tag": "TenantID", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ProfileID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Contexts", "field_id": "Contexts", "type": "*variable", "value": "~2"}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~3"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~4"}, - {"tag": "AttributeFilterIDs", "field_id": "AttributeFilterIDs", "type": "*variable", "value": "~5"}, - {"tag": "Path", "field_id": "Path", "type": "*variable", "value": "~6"}, - {"tag": "Type", "field_id": "Type", "type": "*variable", "value": "~7"}, - {"tag": "Value", "field_id": "Value", "type": "*variable", "value": "~8"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~9"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~10"}, + {"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"}, + {"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~5"}, + {"tag": "Path", "path": "Path", "type": "*variable", "value": "~6"}, + {"tag": "Type", "path": "Type", "type": "*variable", "value": "~7"}, + {"tag": "Value", "path": "Value", "type": "*variable", "value": "~8"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"}, ], }, ], diff --git a/data/conf/samples/mongoatlas/cgrates.json b/data/conf/samples/mongoatlas/cgrates.json index d988e5e64..df1d65162 100755 --- a/data/conf/samples/mongoatlas/cgrates.json +++ b/data/conf/samples/mongoatlas/cgrates.json @@ -81,7 +81,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/mongoreplica/cgrates.json b/data/conf/samples/mongoreplica/cgrates.json index 5e008e014..9e73c8382 100755 --- a/data/conf/samples/mongoreplica/cgrates.json +++ b/data/conf/samples/mongoreplica/cgrates.json @@ -53,7 +53,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/multifiles/a.json b/data/conf/samples/multifiles/a.json index c6525227b..9a853c9ae 100644 --- a/data/conf/samples/multifiles/a.json +++ b/data/conf/samples/multifiles/a.json @@ -9,7 +9,7 @@ "cdre": { "*default": { - "content_fields": [ // template of the exported content fields + "fields": [ // template of the exported content fields {"tag":"AccId", "cdr_field_id": "accid", "type": "cdrfield", "value": "accid"}, {"tag":"ReqType", "cdr_field_id": "reqtype", "type": "cdrfield", "value": "reqtype"}, {"tag":"Tenant", "cdr_field_id": "tenant", "type": "cdrfield", "value": "tenant"}, @@ -41,7 +41,7 @@ "request_fields":[ ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, ], }, @@ -51,11 +51,11 @@ "tenant": "cgrates.org", "flags": ["*auth", "*accounts", "*attributes"], "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, ], "reply_fields":[ - {"tag": "Allow", "field_id": "response.Allow", "type": "*constant", + {"tag": "Allow", "path": "response.Allow", "type": "*constant", "value": "1", "mandatory": true}, ], }, diff --git a/data/conf/samples/multifiles/b/b.json b/data/conf/samples/multifiles/b/b.json index 7310471c0..4fb0ef95a 100644 --- a/data/conf/samples/multifiles/b/b.json +++ b/data/conf/samples/multifiles/b/b.json @@ -12,7 +12,7 @@ "export_path": "/tmp/cgrates/cdre", // path where the exported CDRs will be placed }, "export1": { - "header_fields": [ + "fields": [ {"tag": "CgrId", "cdr_field_id": "cgrid", "type": "cdrfield", "value": "cgrid"}, {"tag":"RunId", "cdr_field_id": "mediation_runid", "type": "cdrfield", "value": "mediation_runid"}, ], // template of the exported header fields @@ -33,11 +33,11 @@ "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*pseudoprepaid", "mandatory": true}, ], "reply_fields":[ - {"tag": "CDR_ID", "field_id": "CDR_RESPONSE.CDR_ID", "type": "*composed", + {"tag": "CDR_ID", "path": "CDR_RESPONSE.CDR_ID", "type": "*composed", "value": "~*req.CDR_ID", "mandatory": true}, ], } diff --git a/data/conf/samples/multifiles/c.json b/data/conf/samples/multifiles/c.json index 6616a3b5f..c1eeca440 100644 --- a/data/conf/samples/multifiles/c.json +++ b/data/conf/samples/multifiles/c.json @@ -6,7 +6,7 @@ "cdre": { "export1": { "cost_rounding_decimals": 3, // rounding decimals for Cost values. -1 to disable rounding - "content_fields": [ // template of the exported content fields + "fields": [ // template of the exported content fields {"tag":"Tenant", "cdr_field_id": "tenant", "type": "cdrfield", "value": "tenant"}, {"tag":"Category", "cdr_field_id": "category", "type": "cdrfield", "value": "category"}, {"tag":"Account", "cdr_field_id": "account", "type": "cdrfield", "value": "account"}, @@ -33,7 +33,7 @@ "tenant": "cgrates.org", "flags": ["*cdrs"], "request_fields":[ - {"tag": "TOR", "field_id": "ToR", "type": "*constant", + {"tag": "TOR", "path": "ToR", "type": "*constant", "value": "*data", "mandatory": true}, ], "reply_fields":[], diff --git a/data/conf/samples/radagent_internal/cgrates.json b/data/conf/samples/radagent_internal/cgrates.json index 8a35386ec..740da0691 100644 --- a/data/conf/samples/radagent_internal/cgrates.json +++ b/data/conf/samples/radagent_internal/cgrates.json @@ -72,24 +72,24 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -98,24 +98,24 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -124,26 +124,26 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_internal_gob/cgrates.json b/data/conf/samples/radagent_internal_gob/cgrates.json index 174c50b6f..2307ecf69 100644 --- a/data/conf/samples/radagent_internal_gob/cgrates.json +++ b/data/conf/samples/radagent_internal_gob/cgrates.json @@ -80,24 +80,24 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -106,24 +106,24 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -132,26 +132,26 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mongo/cgrates.json b/data/conf/samples/radagent_mongo/cgrates.json index 00332c125..4a31fde99 100644 --- a/data/conf/samples/radagent_mongo/cgrates.json +++ b/data/conf/samples/radagent_mongo/cgrates.json @@ -75,24 +75,24 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -101,24 +101,24 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -127,26 +127,26 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mongo_gob/cgrates.json b/data/conf/samples/radagent_mongo_gob/cgrates.json index 16cc61a81..0a92fbdc9 100644 --- a/data/conf/samples/radagent_mongo_gob/cgrates.json +++ b/data/conf/samples/radagent_mongo_gob/cgrates.json @@ -83,24 +83,24 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -109,24 +109,24 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -135,26 +135,26 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mysql/cgrates.json b/data/conf/samples/radagent_mysql/cgrates.json index 830618383..0079e46fe 100644 --- a/data/conf/samples/radagent_mysql/cgrates.json +++ b/data/conf/samples/radagent_mysql/cgrates.json @@ -71,24 +71,24 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -97,24 +97,24 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -123,26 +123,26 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mysql_gob/cgrates.json b/data/conf/samples/radagent_mysql_gob/cgrates.json index a2f2e9162..0f03294e8 100644 --- a/data/conf/samples/radagent_mysql_gob/cgrates.json +++ b/data/conf/samples/radagent_mysql_gob/cgrates.json @@ -78,24 +78,24 @@ "filters": ["*string:~*vars.*radReqType:*radAuth"], "flags": ["*auth", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Event-Timestamp", "mandatory": true}, ], "reply_fields":[ - {"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed", + {"tag": "MaxUsage", "path": "SIP-AVP", "type": "*composed", "value": "session_max_time#;~*cgrep.MaxUsage{*duration_seconds}", "mandatory": true}, ], }, @@ -104,24 +104,24 @@ "filters": ["*string:~*req.Acct-Status-Type:Start"], "flags": ["*initiate", "*attributes", "*resources", "*accounts"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, @@ -130,26 +130,26 @@ "filters": ["*string:~*req.Acct-Status-Type:Stop"], "flags": ["*terminate", "*resources", "*accounts", "*cdrs"], "request_fields":[ - {"tag": "Category", "field_id": "Category", "type": "*constant", "value": "call"}, - {"tag": "RequestType", "field_id": "RequestType", "type": "*constant", + {"tag": "Category", "path": "Category", "type": "*constant", "value": "call"}, + {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid", "mandatory": true}, - {"tag": "OriginID", "field_id": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "OriginID", "type": "*composed", "value": "~*req.Acct-Session-Id;-;~*req.Sip-From-Tag;-;~*req.Sip-To-Tag", "mandatory": true}, - {"tag": "OriginHost", "field_id": "OriginHost", "type": "*composed", + {"tag": "OriginHost", "path": "OriginHost", "type": "*composed", "value": "~*req.NAS-IP-Address", "mandatory": true}, - {"tag": "Account", "field_id": "Account", "type": "*composed", + {"tag": "Account", "path": "Account", "type": "*composed", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Subject", "field_id": "Subject", "type": "*variable", + {"tag": "Subject", "path": "Subject", "type": "*variable", "value": "~*req.User-Name", "mandatory": true}, - {"tag": "Destination", "field_id": "Destination", "type": "*composed", + {"tag": "Destination", "path": "Destination", "type": "*composed", "value": "~*req.Called-Station-Id", "mandatory": true}, - {"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", + {"tag": "SetupTime", "path": "SetupTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", + {"tag": "AnswerTime", "path": "AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "Usage", "field_id": "Usage", "type": "*usage_difference", + {"tag": "Usage", "path": "Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "field_id": "RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "RemoteAddr", "type": "*remote_host"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/tutinternal_new/cgrates.json b/data/conf/samples/tutinternal_new/cgrates.json index bb1565d35..bed8dccec 100644 --- a/data/conf/samples/tutinternal_new/cgrates.json +++ b/data/conf/samples/tutinternal_new/cgrates.json @@ -41,7 +41,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/tutmongo/cgrates.json b/data/conf/samples/tutmongo/cgrates.json index ecf68f12f..5fd7e0bf4 100644 --- a/data/conf/samples/tutmongo/cgrates.json +++ b/data/conf/samples/tutmongo/cgrates.json @@ -49,7 +49,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/tutmongo2/cgrates.json b/data/conf/samples/tutmongo2/cgrates.json index 3811fe4bb..a472a3aa0 100644 --- a/data/conf/samples/tutmongo2/cgrates.json +++ b/data/conf/samples/tutmongo2/cgrates.json @@ -55,24 +55,24 @@ "amqp_localhost": { "export_format": "*amqp_json_map", "export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs", - "content_fields": [ - {"field_id": "CGRID", "type": "*variable", "value": "~CGRID"}, - {"field_id": "RunID", "type": "*variable", "value": "~RunID"}, - {"field_id": "ToR", "type": "*variable", "value": "~ToR"}, - {"field_id": "OriginID", "type": "*variable", "value": "~OriginID"}, - {"field_id": "OriginHost", "type": "*variable", "value": "~OriginHost"}, - {"field_id": "RequestType", "type": "*variable", "value": "~RequestType", }, - {"field_id": "Tenant", "type": "*variable", "value": "~Tenant"}, - {"field_id": "Category", "type": "*variable", "value": "~Category"}, - {"field_id": "Account", "type": "*variable", "value": "~Account"}, - {"field_id": "Destination", "type": "*variable", "value": "~Destination"}, - {"field_id": "SetupTime", "type": "*variable", "value": "~SetupTime"}, - {"field_id": "AnswerTime", "type": "*variable", "value": "~AnswerTime"}, - {"field_id": "Usage", "type": "*variable", "value": "~Usage"}, - {"field_id": "Cost", "type": "*variable", "value": "~Cost"}, - {"field_id": "PayPalAccount", "type": "*variable", "value": "~PayPalAccount"}, - {"field_id": "LCRProfile", "type": "*variable", "value": "~LCRProfile", }, - {"field_id": "ResourceID", "type": "*variable", "value": "~ResourceID", }, + "fields": [ + {"path": "CGRID", "type": "*variable", "value": "~CGRID"}, + {"path": "RunID", "type": "*variable", "value": "~RunID"}, + {"path": "ToR", "type": "*variable", "value": "~ToR"}, + {"path": "OriginID", "type": "*variable", "value": "~OriginID"}, + {"path": "OriginHost", "type": "*variable", "value": "~OriginHost"}, + {"path": "RequestType", "type": "*variable", "value": "~RequestType", }, + {"path": "Tenant", "type": "*variable", "value": "~Tenant"}, + {"path": "Category", "type": "*variable", "value": "~Category"}, + {"path": "Account", "type": "*variable", "value": "~Account"}, + {"path": "Destination", "type": "*variable", "value": "~Destination"}, + {"path": "SetupTime", "type": "*variable", "value": "~SetupTime"}, + {"path": "AnswerTime", "type": "*variable", "value": "~AnswerTime"}, + {"path": "Usage", "type": "*variable", "value": "~Usage"}, + {"path": "Cost", "type": "*variable", "value": "~Cost"}, + {"path": "PayPalAccount", "type": "*variable", "value": "~PayPalAccount"}, + {"path": "LCRProfile", "type": "*variable", "value": "~LCRProfile", }, + {"path": "ResourceID", "type": "*variable", "value": "~ResourceID", }, ], }, }, diff --git a/data/conf/samples/tutmongo2_gob/cgrates.json b/data/conf/samples/tutmongo2_gob/cgrates.json index b3525523b..74a8fdf93 100644 --- a/data/conf/samples/tutmongo2_gob/cgrates.json +++ b/data/conf/samples/tutmongo2_gob/cgrates.json @@ -62,24 +62,24 @@ "amqp_localhost": { "export_format": "*amqp_json_map", "export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs", - "content_fields": [ - {"field_id": "CGRID", "type": "*variable", "value": "~CGRID"}, - {"field_id": "RunID", "type": "*variable", "value": "~RunID"}, - {"field_id": "ToR", "type": "*variable", "value": "~ToR"}, - {"field_id": "OriginID", "type": "*variable", "value": "~OriginID"}, - {"field_id": "OriginHost", "type": "*variable", "value": "~OriginHost"}, - {"field_id": "RequestType", "type": "*variable", "value": "~RequestType", }, - {"field_id": "Tenant", "type": "*variable", "value": "~Tenant"}, - {"field_id": "Category", "type": "*variable", "value": "~Category"}, - {"field_id": "Account", "type": "*variable", "value": "~Account"}, - {"field_id": "Destination", "type": "*variable", "value": "~Destination"}, - {"field_id": "SetupTime", "type": "*variable", "value": "~SetupTime"}, - {"field_id": "AnswerTime", "type": "*variable", "value": "~AnswerTime"}, - {"field_id": "Usage", "type": "*variable", "value": "~Usage"}, - {"field_id": "Cost", "type": "*variable", "value": "~Cost"}, - {"field_id": "PayPalAccount", "type": "*variable", "value": "~PayPalAccount"}, - {"field_id": "LCRProfile", "type": "*variable", "value": "~LCRProfile", }, - {"field_id": "ResourceID", "type": "*variable", "value": "~ResourceID", }, + "fields": [ + {"path": "CGRID", "type": "*variable", "value": "~CGRID"}, + {"path": "RunID", "type": "*variable", "value": "~RunID"}, + {"path": "ToR", "type": "*variable", "value": "~ToR"}, + {"path": "OriginID", "type": "*variable", "value": "~OriginID"}, + {"path": "OriginHost", "type": "*variable", "value": "~OriginHost"}, + {"path": "RequestType", "type": "*variable", "value": "~RequestType", }, + {"path": "Tenant", "type": "*variable", "value": "~Tenant"}, + {"path": "Category", "type": "*variable", "value": "~Category"}, + {"path": "Account", "type": "*variable", "value": "~Account"}, + {"path": "Destination", "type": "*variable", "value": "~Destination"}, + {"path": "SetupTime", "type": "*variable", "value": "~SetupTime"}, + {"path": "AnswerTime", "type": "*variable", "value": "~AnswerTime"}, + {"path": "Usage", "type": "*variable", "value": "~Usage"}, + {"path": "Cost", "type": "*variable", "value": "~Cost"}, + {"path": "PayPalAccount", "type": "*variable", "value": "~PayPalAccount"}, + {"path": "LCRProfile", "type": "*variable", "value": "~LCRProfile", }, + {"path": "ResourceID", "type": "*variable", "value": "~ResourceID", }, ], }, }, diff --git a/data/conf/samples/tutmongo_gob/cgrates.json b/data/conf/samples/tutmongo_gob/cgrates.json index 2df9ca520..29494322e 100644 --- a/data/conf/samples/tutmongo_gob/cgrates.json +++ b/data/conf/samples/tutmongo_gob/cgrates.json @@ -56,7 +56,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/tutmongonew/cgrates.json b/data/conf/samples/tutmongonew/cgrates.json index f8597d417..fac1b67b3 100644 --- a/data/conf/samples/tutmongonew/cgrates.json +++ b/data/conf/samples/tutmongonew/cgrates.json @@ -48,7 +48,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/tutmysql/cgrates.json b/data/conf/samples/tutmysql/cgrates.json index b498f79b8..3d07e4f21 100644 --- a/data/conf/samples/tutmysql/cgrates.json +++ b/data/conf/samples/tutmysql/cgrates.json @@ -47,7 +47,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, diff --git a/data/conf/samples/tutmysql_internal/cgrates.json b/data/conf/samples/tutmysql_internal/cgrates.json index cd8ff7450..5c76e5d1d 100644 --- a/data/conf/samples/tutmysql_internal/cgrates.json +++ b/data/conf/samples/tutmysql_internal/cgrates.json @@ -45,7 +45,7 @@ "cdre": { "TestTutITExportCDR": { - "content_fields": [ + "fields": [ {"tag": "CGRID", "type": "*composed", "value": "~CGRID"}, {"tag": "RunID", "type": "*composed", "value": "~RunID"}, {"tag":"OriginID", "type": "*composed", "value": "~OriginID"}, @@ -78,75 +78,75 @@ "type": "*resources", // data source type "file_name": "Resources.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "TTL", "field_id": "UsageTTL", "type": "*variable", "value": "~4"}, - {"tag": "Limit", "field_id": "Limit", "type": "*variable", "value": "~5"}, - {"tag": "AllocationMessage", "field_id": "AllocationMessage", "type": "*variable", "value": "~6"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~7"}, - {"tag": "Stored", "field_id": "Stored", "type": "*variable", "value": "~8"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~9"}, - {"tag": "ThresholdIDs", "field_id": "ThresholdIDs", "type": "*variable", "value": "~10"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "TTL", "path": "UsageTTL", "type": "*variable", "value": "~4"}, + {"tag": "Limit", "path": "Limit", "type": "*variable", "value": "~5"}, + {"tag": "AllocationMessage", "path": "AllocationMessage", "type": "*variable", "value": "~6"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"}, + {"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~8"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~9"}, + {"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~10"}, ], }, { "type": "*stats", // data source type "file_name": "Stats.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "QueueLength", "field_id": "QueueLength", "type": "*variable", "value": "~4"}, - {"tag": "TTL", "field_id": "TTL", "type": "*variable", "value": "~5"}, - {"tag": "Metrics", "field_id": "Metrics", "type": "*variable", "value": "~6"}, - {"tag": "MetricParams", "field_id": "Parameters", "type": "*variable", "value": "~7"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~8"}, - {"tag": "Stored", "field_id": "Stored", "type": "*variable", "value": "~9"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~10"}, - {"tag": "MinItems", "field_id": "MinItems", "type": "*variable", "value": "~11"}, - {"tag": "ThresholdIDs", "field_id": "ThresholdIDs", "type": "*variable", "value": "~12"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "QueueLength", "path": "QueueLength", "type": "*variable", "value": "~4"}, + {"tag": "TTL", "path": "TTL", "type": "*variable", "value": "~5"}, + {"tag": "Metrics", "path": "Metrics", "type": "*variable", "value": "~6"}, + {"tag": "MetricParams", "path": "Parameters", "type": "*variable", "value": "~7"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~8"}, + {"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~9"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"}, + {"tag": "MinItems", "path": "MinItems", "type": "*variable", "value": "~11"}, + {"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~12"}, ], }, { "type": "*thresholds", // data source type "file_name": "Thresholds.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "MaxHits", "field_id": "MaxHits", "type": "*variable", "value": "~4"}, - {"tag": "MinHits", "field_id": "MinHits", "type": "*variable", "value": "~5"}, - {"tag": "MinSleep", "field_id": "MinSleep", "type": "*variable", "value": "~6"}, - {"tag": "Blocker", "field_id": "Blocker", "type": "*variable", "value": "~7"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~8"}, - {"tag": "ActionIDs", "field_id": "ActionIDs", "type": "*variable", "value": "~9"}, - {"tag": "Async", "field_id": "Async", "type": "*variable", "value": "~10"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "MaxHits", "path": "MaxHits", "type": "*variable", "value": "~4"}, + {"tag": "MinHits", "path": "MinHits", "type": "*variable", "value": "~5"}, + {"tag": "MinSleep", "path": "MinSleep", "type": "*variable", "value": "~6"}, + {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~8"}, + {"tag": "ActionIDs", "path": "ActionIDs", "type": "*variable", "value": "~9"}, + {"tag": "Async", "path": "Async", "type": "*variable", "value": "~10"}, ], }, { "type": "*suppliers", // data source type "file_name": "Suppliers.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "FilterIDs", "field_id": "FilterIDs", "type": "*variable", "value": "~2"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~3"}, - {"tag": "Sorting", "field_id": "Sorting", "type": "*variable", "value": "~4"}, - {"tag": "SortingParamameters", "field_id": "SortingParamameters", "type": "*variable", "value": "~5"}, - {"tag": "SupplierID", "field_id": "SupplierID", "type": "*variable", "value": "~6"}, - {"tag": "SupplierFilterIDs", "field_id": "SupplierFilterIDs", "type": "*variable", "value": "~7"}, - {"tag": "SupplierAccountIDs", "field_id": "SupplierAccountIDs", "type": "*variable", "value": "~8"}, - {"tag": "SupplierRatingPlanIDs", "field_id": "SupplierRatingPlanIDs", "type": "*variable", "value": "~9"}, - {"tag": "SupplierResourceIDs", "field_id": "SupplierResourceIDs", "type": "*variable", "value": "~10"}, - {"tag": "SupplierStatIDs", "field_id": "SupplierStatIDs", "type": "*variable", "value": "~11"}, - {"tag": "SupplierWeight", "field_id": "SupplierWeight", "type": "*variable", "value": "~12"}, - {"tag": "SupplierBlocker", "field_id": "SupplierBlocker", "type": "*variable", "value": "~13"}, - {"tag": "SupplierParameters", "field_id": "SupplierParameters", "type": "*variable", "value": "~14"}, - {"tag": "Weight", "field_id": "Weight", "type": "*variable", "value": "~15"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, + {"tag": "Sorting", "path": "Sorting", "type": "*variable", "value": "~4"}, + {"tag": "SortingParamameters", "path": "SortingParamameters", "type": "*variable", "value": "~5"}, + {"tag": "SupplierID", "path": "SupplierID", "type": "*variable", "value": "~6"}, + {"tag": "SupplierFilterIDs", "path": "SupplierFilterIDs", "type": "*variable", "value": "~7"}, + {"tag": "SupplierAccountIDs", "path": "SupplierAccountIDs", "type": "*variable", "value": "~8"}, + {"tag": "SupplierRatingPlanIDs", "path": "SupplierRatingPlanIDs", "type": "*variable", "value": "~9"}, + {"tag": "SupplierResourceIDs", "path": "SupplierResourceIDs", "type": "*variable", "value": "~10"}, + {"tag": "SupplierStatIDs", "path": "SupplierStatIDs", "type": "*variable", "value": "~11"}, + {"tag": "SupplierWeight", "path": "SupplierWeight", "type": "*variable", "value": "~12"}, + {"tag": "SupplierBlocker", "path": "SupplierBlocker", "type": "*variable", "value": "~13"}, + {"tag": "SupplierParameters", "path": "SupplierParameters", "type": "*variable", "value": "~14"}, + {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~15"}, ], }, ], @@ -166,12 +166,12 @@ "type": "*filters", // data source type "file_name": "Filters.csv", // file name in the tp_in_dir "fields": [ - {"tag": "Tenant", "field_id": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, - {"tag": "ID", "field_id": "ID", "type": "*variable", "value": "~1", "mandatory": true}, - {"tag": "Type", "field_id": "Type", "type": "*variable", "value": "~2"}, - {"tag": "Element", "field_id": "Element", "type": "*variable", "value": "~3"}, - {"tag": "Values", "field_id": "Values", "type": "*variable", "value": "~4"}, - {"tag": "ActivationInterval", "field_id": "ActivationInterval", "type": "*variable", "value": "~5"}, + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, + {"tag": "Type", "path": "Type", "type": "*variable", "value": "~2"}, + {"tag": "Element", "path": "Element", "type": "*variable", "value": "~3"}, + {"tag": "Values", "path": "Values", "type": "*variable", "value": "~4"}, + {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~5"}, ], }, ], diff --git a/docs/cdrclient.rst b/docs/cdrclient.rst index 95952a2b5..24f728684 100644 --- a/docs/cdrclient.rst +++ b/docs/cdrclient.rst @@ -32,7 +32,7 @@ CGR-RSR Regexp Rule Format: :: - ~field_id:s/regexp_search_and_capture_rule/output_teplate/ + ~path:s/regexp_search_and_capture_rule/output_teplate/ Example of usage: :: @@ -55,7 +55,7 @@ CGR-RSR Static Rule Format: :: - ^field_id:static_value + ^path:static_value Example of usage: :: diff --git a/docs/cdrexporter.rst b/docs/cdrexporter.rst index af3f83b35..6c62aefaf 100644 --- a/docs/cdrexporter.rst +++ b/docs/cdrexporter.rst @@ -18,7 +18,7 @@ CGR-RSR Regexp Rule Format: :: - ~field_id:s/regexp_search_and_capture_rule/output_teplate/ + ~path:s/regexp_search_and_capture_rule/output_teplate/ Example of usage: :: @@ -41,7 +41,7 @@ CGR-RSR Static Rule Format: :: - ^field_id:static_value + ^path:static_value Example of usage: :: diff --git a/docs/diamagent.rst b/docs/diamagent.rst index 0d1669cc9..949b4f1b6 100644 --- a/docs/diamagent.rst +++ b/docs/diamagent.rst @@ -44,100 +44,100 @@ With explanations in the comments: "templates":{ // message templates which can be injected within request/replies "*err": [ // *err is used mostly in automatic diameter replies with errors { - "tag": "SessionId", "field_id": "Session-Id", + "tag": "SessionId", "path": "Session-Id", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "OriginHost", "field_id": "Origin-Host", + "tag": "OriginHost", "path": "Origin-Host", "type": "*variable", "mandatory": true, "value": "~*vars.OriginHost" }, { - "tag": "OriginRealm", "field_id": "Origin-Realm", + "tag": "OriginRealm", "path": "Origin-Realm", "type": "*variable", "mandatory": true, "value": "~*vars.OriginRealm" }, ], "*cca": [ // *cca is used into CallControlAnswer messages { - "tag": "SessionId", "field_id": "Session-Id", + "tag": "SessionId", "path": "Session-Id", "type": "*composed", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "ResultCode", "field_id": "Result-Code", + "tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, { - "tag": "OriginHost", "field_id": "Origin-Host", + "tag": "OriginHost", "path": "Origin-Host", "type": "*variable", "mandatory": true, "value": "~*vars.OriginHost" }, { - "tag": "OriginRealm", "field_id": "Origin-Realm", + "tag": "OriginRealm", "path": "Origin-Realm", "type": "*variable", "mandatory": true, "value": "~*vars.OriginRealm" }, { "tag": "AuthApplicationId", - "field_id": "Auth-Application-Id", + "path": "Auth-Application-Id", "type": "*variable", "mandatory": true, "value": "~*vars.*appid" }, { "tag": "CCRequestType", - "field_id": "CC-Request-Type", + "path": "CC-Request-Type", "type": "*variable", "mandatory": true, "value": "~*req.CC-Request-Type" }, { "tag": "CCRequestNumber", - "field_id": "CC-Request-Number", + "path": "CC-Request-Number", "type": "*variable", "mandatory": true, "value": "~*req.CC-Request-Number" }, ], "*asr": [ // *asr is used to build AbortSessionRequest { - "tag": "SessionId", "field_id": "Session-Id", + "tag": "SessionId", "path": "Session-Id", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "OriginHost", "field_id": "Origin-Host", + "tag": "OriginHost", "path": "Origin-Host", "type": "*variable", "mandatory": true, "value": "~*req.Destination-Host" }, { - "tag": "OriginRealm", "field_id": "Origin-Realm", + "tag": "OriginRealm", "path": "Origin-Realm", "type": "*variable", "mandatory": true, "value": "~*req.Destination-Realm" }, { "tag": "DestinationRealm", - "field_id": "Destination-Realm", + "path": "Destination-Realm", "type": "*variable", "mandatory": true, "value": "~*req.Origin-Realm" }, { "tag": "DestinationHost", - "field_id": "Destination-Host", + "path": "Destination-Host", "type": "*variable", "mandatory": true, "value": "~*req.Origin-Host" }, { "tag": "AuthApplicationId", - "field_id": "Auth-Application-Id", + "path": "Auth-Application-Id", "type": "*variable", "mandatory": true, "value": "~*vars.*appid" }, { - "tag": "UserName", "field_id": "User-Name", + "tag": "UserName", "path": "User-Name", "type": "*variable", "mandatory": true, "value": "~*req.User-Name" }, { - "tag": "OriginStateID", "field_id": "Origin-State-Id", + "tag": "OriginStateID", "path": "Origin-State-Id", "type": "*constant", "value": "1" } ] @@ -154,52 +154,52 @@ With explanations in the comments: "request_fields":[ // data exchanged between Diameter and CGRateS { "tag": "TOR", // tag is used in debug, - "field_id": "ToR", // field_id is the field on CGRateS side + "path": "ToR", // path is the field on CGRateS side "type": "*constant", // type defines the method to provide the value "value": "*sms"} { "tag": "OriginID", // OriginID will identify uniquely - "field_id": "OriginID", // the session on CGRateS side + "path": "OriginID", // the session on CGRateS side "type": "*variable", // it's value will be taken from Diameter AVP: "mandatory": true, // Multiple-Services-Credit-Control.Service-Identifier "value": "~*req.Multiple-Services-Credit-Control.Service-Identifier" }, { "tag": "OriginHost", // OriginHost combined with OriginID - "field_id": "OriginHost", // is used by CGRateS to build the CGRID + "path": "OriginHost", // is used by CGRateS to build the CGRID "mandatory": true, "type": "*variable", // have the value out of special variable: *vars "value": "*vars.OriginHost" }, { "tag": "RequestType", // RequestType instructs SessionS - "field_id": "RequestType", // about charging type to apply for the event + "path": "RequestType", // about charging type to apply for the event "type": "*constant", "value": "*prepaid" }, { "tag": "Category", // Category serves for ataching Account - "field_id": "Category", // and RatingProfile to the request + "path": "Category", // and RatingProfile to the request "type": "*constant", "value": "sms" }, { "tag": "Account", // Account is required by charging - "field_id": "Account", + "path": "Account", "type": "*variable", // value is taken dynamically from a group AVP "mandatory": true, // where Subscription-Id-Type is 0 "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" }, { "tag": "Destination", // Destination is used for charging - "field_id": "Destination", // value from Diameter will be mediated before sent to CGRateS + "path": "Destination", // value from Diameter will be mediated before sent to CGRateS "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Info.Recipient-Address.Address-Data:s/^\\+49(\\d+)/int${1}/:s/^0049(\\d+)/int${1}/:s/^49(\\d+)/int${1}/:s/^00(\\d+)/+${1}/:s/^[\\+]?(\\d+)/int${1}/:s/int(\\d+)/+49${1}/" }, { "tag": "Destination", // Second Destination will overwrite the first if filter matches - "field_id": "Destination", + "path": "Destination", "filters":[ // Only overwrite when filters are matching "*notprefix:~*req.Service-Information.SMS-Information.Recipient-Info.Recipient-Address.Address-Data:49", "*notprefix:~*req.Service-Information.SMS-Information.Recipient-Info.Recipient-Address.Address-Data:3312" @@ -210,28 +210,28 @@ With explanations in the comments: }, { "tag": "SetupTime", // SetupTime is used by charging - "field_id": "SetupTime", + "path": "SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true }, { "tag": "AnswerTime", // AnswerTime is used by charging - "field_id": "AnswerTime", + "path": "AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { "tag": "Usage", // Usage is used by charging - "field_id": "Usage", + "path": "Usage", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Requested-Service-Unit.CC-Service-Specific-Units" }, { "tag": "Originator-SCCP-Address", // Originator-SCCP-Address is an extra field which we want in CDR - "field_id": "Originator-SCCP-Address", // not used by CGRateS + "path": "Originator-SCCP-Address", // not used by CGRateS "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Originator-SCCP-Address" }, @@ -245,13 +245,13 @@ With explanations in the comments: { "tag": "ResultCode", // Change the ResultCode if the reply received from CGRateS contains a 0 MaxUsage "filters": ["*eq:~*cgrep.MaxUsage:0"], - "field_id": "Result-Code", + "path": "Result-Code", "blocker": true, // do not consider further fields if this one is processed "type": "*constant", "value": "4012"}, {"tag": "ResultCode", // Change the ResultCode AVP if there was an error received from CGRateS "filters": ["*notempty:~*cgrep.Error:"], - "field_id": "Result-Code", + "path": "Result-Code", "blocker": true, "type": "*constant", "value": "5030"} diff --git a/docs/ers.rst b/docs/ers.rst index 5f119ef06..d7fda3509 100644 --- a/docs/ers.rst +++ b/docs/ers.rst @@ -48,63 +48,63 @@ With explanations in the comments: "content_fields":[ // mapping definition between line index in the file and CGRateS field { "tag": "OriginID", // OriginID together with OriginHost will - "field_id": "OriginID", // uniquely identify the session on CGRateS side + "path": "OriginID", // uniquely identify the session on CGRateS side "type": "*variable", "value": "~*req.0",q // take the content from line index 0 "mandatory": true // in the request file }, { "tag": "RequestType", // RequestType instructs SessionS - "field_id": "RequestType", // about charging type to apply for the event + "path": "RequestType", // about charging type to apply for the event "type": "*variable", "value": "~*req.1", "mandatory": true }, { "tag": "Category", // Category serves for ataching Account - "field_id": "Category", // and RatingProfile to the request + "path": "Category", // and RatingProfile to the request "type": "*constant", "value": "call", "mandatory": true }, { "tag": "Account", // Account is required by charging - "field_id": "Account", + "path": "Account", "type": "*variable", "value": "~*req.3", "mandatory": true }, { "tag": "Subject", // Subject is required by charging - "field_id": "Subject", + "path": "Subject", "type": "*variable", "value": "~*req.3", "mandatory": true }, { "tag": "Destination", // Destination is required by charging - "field_id": "Destination", + "path": "Destination", "type": "*variable", "value": "~*req.4:s/0([1-9]\\d+)/+49${1}/", "mandatory": true // Additional mediation is performed on number format }, { "tag": "AnswerTime", // AnswerTime is required by charging - "field_id": "AnswerTime", + "path": "AnswerTime", "type": "*variable", "value": "~*req.5", "mandatory": true }, { "tag": "Usage", // Usage is required by charging - "field_id": "Usage", + "path": "Usage", "type": "*variable", "value": "~*req.6", "mandatory": true }, { "tag": "HDRExtra1", // HDRExtra1 is transparently stored into CDR - "field_id": "HDRExtra1", // as extra field not used by CGRateS + "path": "HDRExtra1", // as extra field not used by CGRateS "type": "*composed", "value": "~*req.6", "mandatory": true diff --git a/engine/cdr.go b/engine/cdr.go index 565324063..171c540f4 100644 --- a/engine/cdr.go +++ b/engine/cdr.go @@ -458,6 +458,9 @@ func (cdr *CDR) AsExportRecord(exportFields []*config.FCTemplate, nM := config.NewNavigableMap(nil) nM.Set([]string{utils.MetaReq}, cdr.AsMapStringIface(), false, false) for _, cfgFld := range exportFields { + if !strings.HasPrefix(cfgFld.Path, utils.MetaExp) { + continue + } if pass, err := filterS.Pass(cdr.Tenant, cfgFld.Filters, nM); err != nil { return []string{}, err @@ -495,7 +498,7 @@ func (cdr *CDR) AsExportMap(exportFields []*config.FCTemplate, httpSkipTLSCheck err.Error(), utils.ToJSON(cfgFld), utils.ToJSON(cdr))) return nil, err } - expMap[cfgFld.FieldId] += fmtOut + expMap[cfgFld.Path] += fmtOut } return } diff --git a/engine/cdr_test.go b/engine/cdr_test.go index c8d76ed08..099b97422 100644 --- a/engine/cdr_test.go +++ b/engine/cdr_test.go @@ -674,8 +674,13 @@ func TestCDRAsExportRecord(t *testing.T) { } prsr := config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Destination, true, utils.INFIELD_SEP) - cfgCdrFld := &config.FCTemplate{Tag: "destination", Type: utils.META_COMPOSED, - FieldId: utils.Destination, Value: prsr, Timezone: "UTC"} + cfgCdrFld := &config.FCTemplate{ + Tag: "destination", + Path: "*exp.Destination", + Type: utils.META_COMPOSED, + Value: prsr, + Timezone: "UTC", + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) } else if expRecord[0] != cdr.Destination { @@ -686,8 +691,14 @@ func TestCDRAsExportRecord(t *testing.T) { t.Error(err) } - cfgCdrFld = &config.FCTemplate{Tag: "Destination", Type: utils.META_COMPOSED, - FieldId: utils.Destination, Value: prsr, MaskDestID: "MASKED_DESTINATIONS", MaskLen: 3} + cfgCdrFld = &config.FCTemplate{ + Tag: "Destination", + Path: "*exp.Destination", + Type: utils.META_COMPOSED, + Value: prsr, + MaskDestID: "MASKED_DESTINATIONS", + MaskLen: 3, + } eDst := "+4986517174***" if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) @@ -695,8 +706,13 @@ func TestCDRAsExportRecord(t *testing.T) { t.Errorf("Expecting:\n%s\nReceived:\n%s", eDst, expRecord[0]) } - cfgCdrFld = &config.FCTemplate{Tag: "MaskedDest", Type: utils.MetaMaskedDestination, - Value: prsr, MaskDestID: "MASKED_DESTINATIONS"} + cfgCdrFld = &config.FCTemplate{ + Tag: "MaskedDest", + Path: "*exp.MaskedDest", + Type: utils.MetaMaskedDestination, + Value: prsr, + MaskDestID: "MASKED_DESTINATIONS", + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) } else if expRecord[0] != "1" { @@ -705,8 +721,14 @@ func TestCDRAsExportRecord(t *testing.T) { defaultCfg, _ := config.NewDefaultCGRConfig() data := NewInternalDB(nil, nil, true, defaultCfg.DataDbCfg().Items) dmForCDR := NewDataManager(data, config.CgrConfig().CacheCfg(), nil) - cfgCdrFld = &config.FCTemplate{Tag: "destination", Type: utils.META_COMPOSED, - FieldId: utils.Destination, Value: prsr, Filters: []string{"*string:~*req.Tenant:itsyscom.com"}, Timezone: "UTC"} + cfgCdrFld = &config.FCTemplate{ + Tag: "destination", + Path: "*exp.Destination", + Type: utils.META_COMPOSED, + Value: prsr, + Filters: []string{"*string:~*req.Tenant:itsyscom.com"}, + Timezone: "UTC", + } if rcrd, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, &FilterS{dm: dmForCDR, cfg: defaultCfg}); err != nil { t.Error(err) } else if len(rcrd) != 0 { @@ -716,8 +738,14 @@ func TestCDRAsExportRecord(t *testing.T) { // Test MetaDateTime prsr = config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"stop_time", true, utils.INFIELD_SEP) layout := "2006-01-02 15:04:05" - cfgCdrFld = &config.FCTemplate{Tag: "stop_time", Type: utils.MetaDateTime, - FieldId: "stop_time", Value: prsr, Layout: layout, Timezone: "UTC"} + cfgCdrFld = &config.FCTemplate{ + Tag: "stop_time", + Type: utils.MetaDateTime, + Path: "*exp.stop_time", + Value: prsr, + Layout: layout, + Timezone: "UTC", + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, &FilterS{dm: dmForCDR, cfg: defaultCfg}); err != nil { t.Error(err) } else if expRecord[0] != "2014-06-11 19:19:00" { @@ -725,9 +753,15 @@ func TestCDRAsExportRecord(t *testing.T) { } // Test filter - cfgCdrFld = &config.FCTemplate{Tag: "stop_time", Type: utils.MetaDateTime, - FieldId: "stop_time", Value: prsr, Filters: []string{"*string:~*req.Tenant:itsyscom.com"}, - Layout: layout, Timezone: "UTC"} + cfgCdrFld = &config.FCTemplate{ + Tag: "stop_time", + Type: utils.MetaDateTime, + Path: "*exp.stop_time", + Value: prsr, + Filters: []string{"*string:~*req.Tenant:itsyscom.com"}, + Layout: layout, + Timezone: "UTC", + } if rcrd, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, &FilterS{dm: dmForCDR, cfg: defaultCfg}); err != nil { t.Error(err) } else if len(rcrd) != 0 { @@ -735,24 +769,37 @@ func TestCDRAsExportRecord(t *testing.T) { } prsr = config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"fieldextr2", true, utils.INFIELD_SEP) - cfgCdrFld = &config.FCTemplate{Tag: "stop_time", Type: utils.MetaDateTime, - FieldId: "stop_time", Value: prsr, Layout: layout, Timezone: "UTC"} + cfgCdrFld = &config.FCTemplate{ + Tag: "stop_time", + Type: utils.MetaDateTime, + Path: "*exp.stop_time", + Value: prsr, + Layout: layout, + Timezone: "UTC"} // Test time parse error if _, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err == nil { t.Error("Should give error here, got none.") } prsr = config.NewRSRParsersMustCompile("~CostDetails.CGRID", true, utils.INFIELD_SEP) - cfgCdrFld = &config.FCTemplate{Tag: "CGRIDFromCostDetails", Type: utils.META_COMPOSED, - FieldId: "CGRIDFromCostDetails", Value: prsr} + cfgCdrFld = &config.FCTemplate{ + Tag: "CGRIDFromCostDetails", + Type: utils.META_COMPOSED, + Path: "*exp.CGRIDFromCostDetails", + Value: prsr, + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) } else if expRecord[0] != cdr.CostDetails.CGRID { t.Errorf("Expecting:\n%s\nReceived:\n%s", cdr.CostDetails.CGRID, expRecord) } prsr = config.NewRSRParsersMustCompile("~CostDetails.AccountSummary.ID", true, utils.INFIELD_SEP) - cfgCdrFld = &config.FCTemplate{Tag: "AccountID", Type: utils.META_COMPOSED, - FieldId: "CustomAccountID", Value: prsr} + cfgCdrFld = &config.FCTemplate{ + Tag: "AccountID", + Type: utils.META_COMPOSED, + Path: "*exp.CustomAccountID", + Value: prsr, + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) } else if expRecord[0] != cdr.CostDetails.AccountSummary.ID { @@ -761,8 +808,12 @@ func TestCDRAsExportRecord(t *testing.T) { expected := `{"3d99c91":{"DestinationID":"CustomDestination","DestinationPrefix":"26377","RatingPlanID":"RP_ZW_v1"}}` prsr = config.NewRSRParsersMustCompile("~CostDetails.RatingFilters", true, utils.INFIELD_SEP) - cfgCdrFld = &config.FCTemplate{Tag: "DestinationID", Type: utils.META_COMPOSED, - FieldId: "CustomDestinationID", Value: prsr} + cfgCdrFld = &config.FCTemplate{ + Tag: "DestinationID", + Type: utils.META_COMPOSED, + Path: "*exp.CustomDestinationID", + Value: prsr, + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) } else if expRecord[0] != expected { @@ -771,8 +822,12 @@ func TestCDRAsExportRecord(t *testing.T) { expected = "RP_ZW_v1" prsr = config.NewRSRParsersMustCompile("~CostDetails.RatingFilters:s/RatingPlanID\"\\s?\\:\\s?\"([^\"]*)\".*/$1/", true, utils.INFIELD_SEP) - cfgCdrFld = &config.FCTemplate{Tag: "DestinationID", Type: utils.META_COMPOSED, - FieldId: "CustomDestinationID", Value: prsr} + cfgCdrFld = &config.FCTemplate{ + Tag: "DestinationID", + Type: utils.META_COMPOSED, + Path: "*exp.CustomDestinationID", + Value: prsr, + } if expRecord, err := cdr.AsExportRecord([]*config.FCTemplate{cfgCdrFld}, false, nil, nil); err != nil { t.Error(err) } else if expRecord[0] != expected { @@ -798,11 +853,11 @@ func TestCDRAsExportMap(t *testing.T) { "FieldExtra1": "val_extr1", } expFlds := []*config.FCTemplate{ - &config.FCTemplate{FieldId: utils.CGRID, Type: utils.META_COMPOSED, + &config.FCTemplate{Path: utils.CGRID, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.CGRID, true, utils.INFIELD_SEP)}, - &config.FCTemplate{FieldId: utils.Destination, Type: utils.META_COMPOSED, + &config.FCTemplate{Path: utils.Destination, Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~Destination:s/^\\+(\\d+)$/00${1}/", true, utils.INFIELD_SEP)}, - &config.FCTemplate{FieldId: "FieldExtra1", Type: utils.META_COMPOSED, + &config.FCTemplate{Path: "FieldExtra1", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"field_extr1", true, utils.INFIELD_SEP)}, } if cdrMp, err := cdr.AsExportMap(expFlds, false, nil, nil); err != nil { diff --git a/engine/cdre.go b/engine/cdre.go index 601be40fe..0ced37348 100644 --- a/engine/cdre.go +++ b/engine/cdre.go @@ -29,6 +29,7 @@ import ( "path" "path/filepath" "strconv" + "strings" "sync" "time" @@ -143,7 +144,10 @@ func (cdre *CDRExporter) metaHandler(tag, arg string) (string, error) { // Compose and cache the header func (cdre *CDRExporter) composeHeader() (err error) { - for _, cfgFld := range cdre.exportTemplate.HeaderFields { + for _, cfgFld := range cdre.exportTemplate.Fields { + if !strings.HasPrefix(cfgFld.Path, utils.MetaHdr) { + continue + } if len(cfgFld.Filters) != 0 { //check filter if pass } @@ -189,7 +193,10 @@ func (cdre *CDRExporter) composeHeader() (err error) { // Compose and cache the trailer func (cdre *CDRExporter) composeTrailer() (err error) { - for _, cfgFld := range cdre.exportTemplate.TrailerFields { + for _, cfgFld := range cdre.exportTemplate.Fields { + if !strings.HasPrefix(cfgFld.Path, utils.MetaTrl) { + continue + } if len(cfgFld.Filters) != 0 { //check filter if pass } @@ -242,7 +249,7 @@ func (cdre *CDRExporter) postCdr(cdr *CDR) (err error) { } case utils.MetaHTTPjsonMap, utils.MetaAMQPjsonMap, utils.MetaAMQPV1jsonMap, utils.MetaSQSjsonMap, utils.MetaKafkajsonMap, utils.MetaS3jsonMap: var expMp map[string]string - if expMp, err = cdr.AsExportMap(cdre.exportTemplate.ContentFields, cdre.httpSkipTLSCheck, nil, cdre.filterS); err != nil { + if expMp, err = cdr.AsExportMap(cdre.exportTemplate.Fields, cdre.httpSkipTLSCheck, nil, cdre.filterS); err != nil { return } if body, err = json.Marshal(expMp); err != nil { @@ -250,7 +257,7 @@ func (cdre *CDRExporter) postCdr(cdr *CDR) (err error) { } case utils.MetaHTTPPost: var expMp map[string]string - if expMp, err = cdr.AsExportMap(cdre.exportTemplate.ContentFields, cdre.httpSkipTLSCheck, nil, cdre.filterS); err != nil { + if expMp, err = cdr.AsExportMap(cdre.exportTemplate.Fields, cdre.httpSkipTLSCheck, nil, cdre.filterS); err != nil { return } vals := url.Values{} @@ -321,7 +328,7 @@ func (cdre *CDRExporter) processCDR(cdr *CDR) (err error) { switch cdre.exportFormat { case utils.MetaFileFWV, utils.MetaFileCSV: var cdrRow []string - cdrRow, err = cdr.AsExportRecord(cdre.exportTemplate.ContentFields, cdre.httpSkipTLSCheck, cdre.cdrs, cdre.filterS) + cdrRow, err = cdr.AsExportRecord(cdre.exportTemplate.Fields, cdre.httpSkipTLSCheck, cdre.cdrs, cdre.filterS) if len(cdrRow) == 0 && err == nil { // No CDR data, most likely no configuration fields defined return } @@ -373,25 +380,23 @@ func (cdre *CDRExporter) processCDR(cdr *CDR) (err error) { return } -// Builds header, content and trailers +// processCDRs proccess every cdr func (cdre *CDRExporter) processCDRs() (err error) { var wg sync.WaitGroup + isSync := cdre.exportTemplate.Synchronous || + utils.SliceHasMember([]string{utils.MetaFileCSV, utils.MetaFileFWV}, cdre.exportTemplate.ExportFormat) for _, cdr := range cdre.cdrs { if cdr == nil || len(cdr.CGRID) == 0 { // CDR needs to exist and it's CGRID needs to be populated continue } if len(cdre.exportTemplate.Filters) != 0 { - if cdre.exportTemplate.Tenant == "" { - cdre.exportTemplate.Tenant = config.CgrConfig().GeneralCfg().DefaultTenant - } cgrDp := config.NewNavigableMap(map[string]interface{}{utils.MetaReq: cdr.AsMapStringIface()}) if pass, err := cdre.filterS.Pass(cdre.exportTemplate.Tenant, cdre.exportTemplate.Filters, cgrDp); err != nil || !pass { continue // Not passes filters, ignore this CDR } } - if cdre.synchronous || - utils.SliceHasMember([]string{utils.MetaFileCSV, utils.MetaFileFWV}, cdre.exportFormat) { + if isSync { wg.Add(1) // wait for synchronous or file ones since these need to be done before continuing } go func(cdre *CDRExporter, cdr *CDR) { @@ -404,24 +409,12 @@ func (cdre *CDRExporter) processCDRs() (err error) { cdre.positiveExports = append(cdre.positiveExports, cdr.CGRID) cdre.Unlock() } - if cdre.synchronous || - utils.SliceHasMember([]string{utils.MetaFileCSV, utils.MetaFileFWV}, cdre.exportFormat) { + if isSync { wg.Done() } }(cdre, cdr) } wg.Wait() - // Process header and trailer after processing cdrs since the metatag functions can access stats out of built cdrs - if cdre.exportTemplate.HeaderFields != nil { - if err = cdre.composeHeader(); err != nil { - return - } - } - if cdre.exportTemplate.TrailerFields != nil { - if err = cdre.composeTrailer(); err != nil { - return - } - } return } @@ -489,6 +482,12 @@ func (cdre *CDRExporter) ExportCDRs() (err error) { if contLen == 0 { return } + if err = cdre.composeHeader(); err != nil { + return + } + if err = cdre.composeTrailer(); err != nil { + return + } var expFormat string switch cdre.exportFormat { case utils.MetaFileFWV: diff --git a/engine/cdrecsv_test.go b/engine/cdrecsv_test.go index b16be3574..d627f0960 100644 --- a/engine/cdrecsv_test.go +++ b/engine/cdrecsv_test.go @@ -52,6 +52,12 @@ func TestCsvCdrWriter(t *testing.T) { if err = cdre.processCDRs(); err != nil { t.Error(err) } + if err = cdre.composeHeader(); err != nil { + t.Error(err) + } + if err = cdre.composeTrailer(); err != nil { + t.Error(err) + } csvWriter := csv.NewWriter(writer) if err := cdre.writeCsv(csvWriter); err != nil { t.Error("Unexpected error: ", err) @@ -90,6 +96,12 @@ func TestAlternativeFieldSeparator(t *testing.T) { if err = cdre.processCDRs(); err != nil { t.Error(err) } + if err = cdre.composeHeader(); err != nil { + t.Error(err) + } + if err = cdre.composeTrailer(); err != nil { + t.Error(err) + } csvWriter := csv.NewWriter(writer) if err := cdre.writeCsv(csvWriter); err != nil { t.Error("Unexpected error: ", err) @@ -108,7 +120,7 @@ func TestExportVoiceWithConvert(t *testing.T) { writer := &bytes.Buffer{} cfg, _ := config.NewDefaultCGRConfig() cdreCfg := cfg.CdreProfiles[utils.MetaDefault] - cdreCfg.ContentFields = []*config.FCTemplate{ + cdreCfg.Fields = []*config.FCTemplate{ {Tag: "ToR", Type: "*composed", Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"ToR", true, utils.INFIELD_SEP)}, {Tag: "OriginID", Type: "*composed", @@ -205,7 +217,7 @@ func TestExportWithFilter(t *testing.T) { cfg, _ := config.NewDefaultCGRConfig() cdreCfg := cfg.CdreProfiles[utils.MetaDefault] cdreCfg.Filters = []string{"*string:~*req.Tenant:cgrates.org"} - cdreCfg.ContentFields = []*config.FCTemplate{ + cdreCfg.Fields = []*config.FCTemplate{ {Tag: "ToR", Type: "*composed", Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"ToR", true, utils.INFIELD_SEP)}, {Tag: "OriginID", Type: "*composed", @@ -301,7 +313,7 @@ func TestExportWithFilter2(t *testing.T) { cfg, _ := config.NewDefaultCGRConfig() cdreCfg := cfg.CdreProfiles[utils.MetaDefault] cdreCfg.Filters = []string{"*string:~*req.Tenant:cgrates.org", "*lte:~*req.Cost:0.5"} - cdreCfg.ContentFields = []*config.FCTemplate{ + cdreCfg.Fields = []*config.FCTemplate{ {Tag: "ToR", Type: "*composed", Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"ToR", true, utils.INFIELD_SEP)}, {Tag: "OriginID", Type: "*composed", diff --git a/engine/cdrefwv_test.go b/engine/cdrefwv_test.go index 884edd5cf..f8e8272bd 100644 --- a/engine/cdrefwv_test.go +++ b/engine/cdrefwv_test.go @@ -27,23 +27,27 @@ import ( "github.com/cgrates/cgrates/utils" ) -var hdrJsnCfgFlds = []*config.FcTemplateJsonCfg{ +var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ { Tag: utils.StringPointer("TypeOfRecord"), + Path: utils.StringPointer("*hdr.TypeOfRecord"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("10"), Width: utils.IntPointer(2)}, { Tag: utils.StringPointer("Filler1"), + Path: utils.StringPointer("*hdr.Filler1"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(3)}, { Tag: utils.StringPointer("DistributorCode"), + Path: utils.StringPointer("*hdr.DistributorCode"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("VOI"), Width: utils.IntPointer(3)}, { Tag: utils.StringPointer("FileSeqNr"), + Path: utils.StringPointer("*hdr.FileSeqNr"), Type: utils.StringPointer(utils.META_HANDLER), Value: utils.StringPointer(metaExportID), Width: utils.IntPointer(5), @@ -51,35 +55,38 @@ var hdrJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("zeroleft")}, { Tag: utils.StringPointer("LastCdr"), + Path: utils.StringPointer("*hdr.LastCdr"), Type: utils.StringPointer(utils.META_HANDLER), Width: utils.IntPointer(12), Value: utils.StringPointer(metaLastCDRAtime), Layout: utils.StringPointer("020106150400")}, { Tag: utils.StringPointer("FileCreationfTime"), + Path: utils.StringPointer("*hdr.FileCreationfTime"), Type: utils.StringPointer(utils.META_HANDLER), Value: utils.StringPointer(metaTimeNow), Width: utils.IntPointer(12), Layout: utils.StringPointer("020106150400")}, { Tag: utils.StringPointer("FileVersion"), + Path: utils.StringPointer("*hdr.FileVersion"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("01"), Width: utils.IntPointer(2)}, { Tag: utils.StringPointer("Filler2"), + Path: utils.StringPointer("*hdr.Filler2"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(105)}, -} - -var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ { Tag: utils.StringPointer("TypeOfRecord"), + Path: utils.StringPointer("*exp.TypeOfRecord"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("20"), Width: utils.IntPointer(2)}, { Tag: utils.StringPointer("Account"), + Path: utils.StringPointer("*exp.Account"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~" + utils.Account), Width: utils.IntPointer(12), @@ -87,6 +94,7 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("Subject"), + Path: utils.StringPointer("*exp.Subject"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~" + utils.Subject), Width: utils.IntPointer(5), @@ -94,6 +102,7 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("CLI"), + Path: utils.StringPointer("*exp.CLI"), Type: utils.StringPointer(utils.META_COMPOSED), Width: utils.IntPointer(15), Value: utils.StringPointer("cli"), @@ -101,6 +110,7 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("Destination"), + Path: utils.StringPointer("*exp.Destination"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~" + utils.Destination), Width: utils.IntPointer(24), @@ -108,17 +118,20 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("ToR"), + Path: utils.StringPointer("*exp.ToR"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("02"), Width: utils.IntPointer(2)}, { Tag: utils.StringPointer("SubtypeTOR"), + Path: utils.StringPointer("*exp.SubtypeTOR"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("11"), Padding: utils.StringPointer("right"), Width: utils.IntPointer(4)}, { Tag: utils.StringPointer("SetupTime"), + Path: utils.StringPointer("*exp.SetupTime"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~" + utils.SetupTime), Width: utils.IntPointer(12), @@ -127,6 +140,7 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Layout: utils.StringPointer("020106150400")}, { Tag: utils.StringPointer("Duration"), + Path: utils.StringPointer("*exp.Duration"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~" + utils.Usage), Width: utils.IntPointer(6), @@ -135,15 +149,18 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Layout: utils.StringPointer(utils.SECONDS)}, { Tag: utils.StringPointer("DataVolume"), + Path: utils.StringPointer("*exp.DataVolume"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(6)}, { Tag: utils.StringPointer("TaxCode"), + Path: utils.StringPointer("*exp.TaxCode"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("1"), Width: utils.IntPointer(1)}, { Tag: utils.StringPointer("OperatorCode"), + Path: utils.StringPointer("*exp.OperatorCode"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("opercode"), Width: utils.IntPointer(2), @@ -151,6 +168,7 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("ProductId"), + Path: utils.StringPointer("*exp.ProductId"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~productid"), Width: utils.IntPointer(5), @@ -158,25 +176,30 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("NetworkId"), + Path: utils.StringPointer("*exp.NetworkId"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("3"), Width: utils.IntPointer(1)}, { Tag: utils.StringPointer("CallId"), + Path: utils.StringPointer("*exp.CallId"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~" + utils.OriginID), Width: utils.IntPointer(16), Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("Filler"), + Path: utils.StringPointer("*exp.Filler"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(8)}, { Tag: utils.StringPointer("Filler"), + Path: utils.StringPointer("*exp.Filler"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(8)}, { Tag: utils.StringPointer("TerminationCode"), + Path: utils.StringPointer("*exp.TerminationCode"), Type: utils.StringPointer(utils.META_COMPOSED), Value: utils.StringPointer("~operator;~product"), Width: utils.IntPointer(5), @@ -184,6 +207,7 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("right")}, { Tag: utils.StringPointer("Cost"), + Path: utils.StringPointer("*exp.Cost"), Type: utils.StringPointer(utils.META_COMPOSED), Width: utils.IntPointer(9), Value: utils.StringPointer("~" + utils.COST), @@ -191,27 +215,29 @@ var contentJsnCfgFlds = []*config.FcTemplateJsonCfg{ Rounding_decimals: utils.IntPointer(5)}, { Tag: utils.StringPointer("DestinationPrivacy"), + Path: utils.StringPointer("*exp.DestinationPrivacy"), Type: utils.StringPointer(utils.MetaMaskedDestination), Width: utils.IntPointer(1)}, -} - -var trailerJsnCfgFlds = []*config.FcTemplateJsonCfg{ { Tag: utils.StringPointer("TypeOfRecord"), + Path: utils.StringPointer("*trl.TypeOfRecord"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("90"), Width: utils.IntPointer(2)}, { Tag: utils.StringPointer("Filler1"), + Path: utils.StringPointer("*trl.Filler1"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(3)}, { Tag: utils.StringPointer("DistributorCode"), + Path: utils.StringPointer("*trl.DistributorCode"), Type: utils.StringPointer(utils.META_CONSTANT), Value: utils.StringPointer("VOI"), Width: utils.IntPointer(3)}, { Tag: utils.StringPointer("FileSeqNr"), + Path: utils.StringPointer("*trl.FileSeqNr"), Type: utils.StringPointer(utils.META_HANDLER), Value: utils.StringPointer(metaExportID), Width: utils.IntPointer(5), @@ -219,12 +245,14 @@ var trailerJsnCfgFlds = []*config.FcTemplateJsonCfg{ Padding: utils.StringPointer("zeroleft")}, { Tag: utils.StringPointer("NumberOfRecords"), + Path: utils.StringPointer("*trl.NumberOfRecords"), Type: utils.StringPointer(utils.META_HANDLER), Value: utils.StringPointer(metaNrCDRs), Width: utils.IntPointer(6), Padding: utils.StringPointer("zeroleft")}, { Tag: utils.StringPointer("CdrsDuration"), + Path: utils.StringPointer("*trl.CdrsDuration"), Type: utils.StringPointer(utils.META_HANDLER), Value: utils.StringPointer(metaDurCDRs), Width: utils.IntPointer(8), @@ -232,43 +260,38 @@ var trailerJsnCfgFlds = []*config.FcTemplateJsonCfg{ Layout: utils.StringPointer(utils.SECONDS)}, { Tag: utils.StringPointer("FirstCdrTime"), + Path: utils.StringPointer("*trl.FirstCdrTime"), Type: utils.StringPointer(utils.META_HANDLER), Width: utils.IntPointer(12), Value: utils.StringPointer(metaFirstCDRAtime), Layout: utils.StringPointer("020106150400")}, { Tag: utils.StringPointer("LastCdrTime"), + Path: utils.StringPointer("*trl.LastCdrTime"), Type: utils.StringPointer(utils.META_HANDLER), Width: utils.IntPointer(12), Value: utils.StringPointer(metaLastCDRAtime), Layout: utils.StringPointer("020106150400")}, { Tag: utils.StringPointer("Filler2"), + Path: utils.StringPointer("*trl.Filler2"), Type: utils.StringPointer(utils.META_FILLER), Width: utils.IntPointer(93)}, } -var hdrCfgFlds, contentCfgFlds, trailerCfgFlds []*config.FCTemplate +var contentCfgFlds []*config.FCTemplate // Write one CDR and test it's results only for content buffer func TestWriteCdr(t *testing.T) { var err error wrBuf := &bytes.Buffer{} cfg, _ := config.NewDefaultCGRConfig() - if hdrCfgFlds, err = config.FCTemplatesFromFCTemplatesJsonCfg(hdrJsnCfgFlds, utils.INFIELD_SEP); err != nil { - t.Error(err) - } if contentCfgFlds, err = config.FCTemplatesFromFCTemplatesJsonCfg(contentJsnCfgFlds, utils.INFIELD_SEP); err != nil { t.Error(err) } - if trailerCfgFlds, err = config.FCTemplatesFromFCTemplatesJsonCfg(trailerJsnCfgFlds, utils.INFIELD_SEP); err != nil { - t.Error(err) - } cdreCfg := &config.CdreCfg{ - ExportFormat: utils.MetaFileFWV, - HeaderFields: hdrCfgFlds, - ContentFields: contentCfgFlds, - TrailerFields: trailerCfgFlds, + ExportFormat: utils.MetaFileFWV, + Fields: contentCfgFlds, } cdr := &CDR{ CGRID: utils.Sha1("dsafdsaf", time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC).String()), @@ -290,6 +313,12 @@ func TestWriteCdr(t *testing.T) { if err = cdre.processCDRs(); err != nil { t.Error(err) } + if err = cdre.composeHeader(); err != nil { + t.Error(err) + } + if err = cdre.composeTrailer(); err != nil { + t.Error(err) + } eHeader := "10 VOIfwv_107111308420018011511340001 \n" eContentOut := "201001 1001 1002 0211 07111308420010 1 3dsafdsaf 0002.34570\n" eTrailer := "90 VOIfwv_100000100000010071113084200071113084200 \n" @@ -332,10 +361,8 @@ func TestWriteCdr(t *testing.T) { func TestWriteCdrs(t *testing.T) { wrBuf := &bytes.Buffer{} cdreCfg := &config.CdreCfg{ - ExportFormat: utils.MetaFileFWV, - HeaderFields: hdrCfgFlds, - ContentFields: contentCfgFlds, - TrailerFields: trailerCfgFlds, + ExportFormat: utils.MetaFileFWV, + Fields: contentCfgFlds, } cdr1 := &CDR{CGRID: utils.Sha1("aaa1", time.Date(2013, 11, 7, 8, 42, 20, 0, time.UTC).String()), ToR: utils.VOICE, OrderID: 2, OriginID: "aaa1", OriginHost: "192.168.1.1", diff --git a/ers/flatstore.go b/ers/flatstore.go index 20896c7a6..2f95b9d78 100644 --- a/ers/flatstore.go +++ b/ers/flatstore.go @@ -175,9 +175,9 @@ func (rdr *FlatstoreER) processFile(fPath, fName string) (err error) { } // build Usage from contentFields based on record lenght - for i, cntFld := range rdr.Config().Fields { - if cntFld.FieldId == utils.Usage { - rdr.Config().Fields[i].Value = config.NewRSRParsersMustCompile("~*req."+strconv.Itoa(len(record)-1), true, utils.INFIELD_SEP) // in case of flatstore, last element will be the duration computed by us + for i, cntFld := range rdr.Config().ContentFields { + if cntFld.Path == utils.Usage { + rdr.Config().ContentFields[i].Value = config.NewRSRParsersMustCompile("~*req."+strconv.Itoa(len(record)-1), true, utils.INFIELD_SEP) // in case of flatstore, last element will be the duration computed by us } } rowNr++ // increment the rowNr after checking if it's not the end of file diff --git a/ers/kafka_it_test.go b/ers/kafka_it_test.go index 341a01cf9..c97673064 100644 --- a/ers/kafka_it_test.go +++ b/ers/kafka_it_test.go @@ -55,11 +55,9 @@ func TestKafkaER(t *testing.T) { "tenant": "cgrates.org", // tenant used by import "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing - // "header_fields": [], // template of the import header fields "content_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": "CGRID", "type": "*composed", "value": "~*req.CGRID", "field_id": "CGRID"}, + {"tag": "CGRID", "type": "*composed", "value": "~*req.CGRID", "path": "CGRID"}, ], - // "trailer_fields": [], // template of the import trailer fields }, ], }, diff --git a/ers/sql_it_test.go b/ers/sql_it_test.go index 966ace851..2378fcc1a 100644 --- a/ers/sql_it_test.go +++ b/ers/sql_it_test.go @@ -84,11 +84,9 @@ func testSQLInitConfig(t *testing.T) { "tenant": "cgrates.org", // tenant used by import "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing - // "header_fields": [], // template of the import header fields "content_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": "CGRID", "type": "*composed", "value": "~*req.cgrid", "field_id": "CGRID"}, + {"tag": "CGRID", "type": "*composed", "value": "~*req.cgrid", "path": "CGRID"}, ], - // "trailer_fields": [], // template of the import trailer fields }, ], }, diff --git a/loaders/libloader.go b/loaders/libloader.go index 3f51ab5cc..1bbca6ced 100644 --- a/loaders/libloader.go +++ b/loaders/libloader.go @@ -66,17 +66,17 @@ func (ld LoaderData) UpdateFromCSV(fileName string, record []string, } switch cfgFld.Type { case utils.META_COMPOSED: - if _, has := ld[cfgFld.FieldId]; !has { - ld[cfgFld.FieldId] = out - } else if valOrig, canCast := ld[cfgFld.FieldId].(string); canCast { + if _, has := ld[cfgFld.Path]; !has { + ld[cfgFld.Path] = out + } else if valOrig, canCast := ld[cfgFld.Path].(string); canCast { valOrig += out - ld[cfgFld.FieldId] = valOrig + ld[cfgFld.Path] = valOrig } case utils.MetaVariable: - ld[cfgFld.FieldId] = out + ld[cfgFld.Path] = out case utils.MetaString: - if _, has := ld[cfgFld.FieldId]; !has { - ld[cfgFld.FieldId] = out + if _, has := ld[cfgFld.Path]; !has { + ld[cfgFld.Path] = out } } } diff --git a/loaders/libloader_test.go b/loaders/libloader_test.go index f0ec4c68e..0546825d4 100644 --- a/loaders/libloader_test.go +++ b/loaders/libloader_test.go @@ -29,47 +29,47 @@ import ( func TestDataUpdateFromCSVOneFile(t *testing.T) { attrSFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Contexts", - FieldId: "Contexts", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "Contexts", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Path", - FieldId: "Path", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "Path", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Initial", - FieldId: "Initial", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "Initial", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Substitute", - FieldId: "Substitute", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Substitute", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Append", - FieldId: "Append", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Append", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, } rows := [][]string{ @@ -119,47 +119,47 @@ func TestDataUpdateFromCSVOneFile(t *testing.T) { func TestDataUpdateFromCSVOneFile2(t *testing.T) { attrSFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.MetaVariable, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Contexts", - FieldId: "Contexts", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "Contexts", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Path", - FieldId: "Path", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "Path", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Initial", - FieldId: "Initial", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "Initial", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Substitute", - FieldId: "Substitute", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Substitute", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Append", - FieldId: "Append", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Append", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaVariable, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaVariable, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, } rows := [][]string{ @@ -209,39 +209,39 @@ func TestDataUpdateFromCSVOneFile2(t *testing.T) { func TestDataUpdateFromCSVMultiFiles(t *testing.T) { attrSFlds := []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaString, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~File2.csv:1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Contexts", - FieldId: "Contexts", - Type: utils.MetaString, - Value: config.NewRSRParsersMustCompile("*any", true, utils.INFIELD_SEP)}, + Path: "Contexts", + Type: utils.MetaString, + Value: config.NewRSRParsersMustCompile("*any", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Path", - FieldId: "Path", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~File1.csv:5", true, utils.INFIELD_SEP)}, + Path: "Path", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~File1.csv:5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Initial", - FieldId: "Initial", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~File1.csv:6", true, utils.INFIELD_SEP)}, + Path: "Initial", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~File1.csv:6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Substitute", - FieldId: "Substitute", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~File1.csv:7", true, utils.INFIELD_SEP)}, + Path: "Substitute", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~File1.csv:7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Append", - FieldId: "Append", - Type: utils.MetaString, - Value: config.NewRSRParsersMustCompile("true", true, utils.INFIELD_SEP)}, + Path: "Append", + Type: utils.MetaString, + Value: config.NewRSRParsersMustCompile("true", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaString, - Value: config.NewRSRParsersMustCompile("10", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaString, + Value: config.NewRSRParsersMustCompile("10", true, utils.INFIELD_SEP)}, } loadRun1 := map[string][]string{ diff --git a/loaders/loader_test.go b/loaders/loader_test.go index 8496c6e12..a55901883 100644 --- a/loaders/loader_test.go +++ b/loaders/loader_test.go @@ -43,51 +43,51 @@ func TestLoaderProcessContentSingleFile(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaAttributes: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Contexts", - FieldId: "Contexts", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "Contexts", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "AttributeFilterIDs", - FieldId: "AttributeFilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "AttributeFilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Path", - FieldId: "Path", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "Path", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Type", - FieldId: "Type", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Type", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Value", - FieldId: "Value", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Value", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Blocker", - FieldId: "Blocker", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.AttributesCSVContent)) @@ -149,31 +149,31 @@ func TestLoaderProcessContentMultiFiles(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaAttributes: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.MetaString, Value: config.NewRSRParsersMustCompile("cgrates.org", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~File2.csv:1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Contexts", - FieldId: "Contexts", - Type: utils.MetaString, - Value: config.NewRSRParsersMustCompile("*any", true, utils.INFIELD_SEP)}, + Path: "Contexts", + Type: utils.MetaString, + Value: config.NewRSRParsersMustCompile("*any", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Path", - FieldId: "Path", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~File1.csv:6", true, utils.INFIELD_SEP)}, + Path: "Path", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~File1.csv:6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Value", - FieldId: "Value", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~File1.csv:7", true, utils.INFIELD_SEP)}, + Path: "Value", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~File1.csv:7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.MetaString, - Value: config.NewRSRParsersMustCompile("10", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.MetaString, + Value: config.NewRSRParsersMustCompile("10", true, utils.INFIELD_SEP)}, }, } rdr1 := ioutil.NopCloser(strings.NewReader(file1CSV)) @@ -227,51 +227,51 @@ func TestLoaderProcessResource(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaResources: []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "TTL", - FieldId: "UsageTTL", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "UsageTTL", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Limit", - FieldId: "Limit", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "Limit", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "AllocationMessage", - FieldId: "AllocationMessage", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "AllocationMessage", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Blocker", - FieldId: "Blocker", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Stored", - FieldId: "Stored", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Stored", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Thresholds", - FieldId: "Thresholds", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Thresholds", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.ResourcesCSVContent)) @@ -345,31 +345,31 @@ func TestLoaderProcessFilters(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaFilters: []*config.FCTemplate{ &config.FCTemplate{Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "Type", - FieldId: "Type", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "Type", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Element", - FieldId: "Element", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "Element", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Values", - FieldId: "Values", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "Values", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.FiltersCSVContent)) @@ -456,51 +456,51 @@ func TestLoaderProcessThresholds(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaThresholds: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MaxHits", - FieldId: "MaxHits", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "MaxHits", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MinHits", - FieldId: "MinHits", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "MinHits", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MinSleep", - FieldId: "MinSleep", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "MinSleep", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Blocker", - FieldId: "Blocker", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActionIDs", - FieldId: "ActionIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "ActionIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Async", - FieldId: "Async", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Async", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.ThresholdsCSVContent)) @@ -554,60 +554,60 @@ func TestLoaderProcessStats(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaStats: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "QueueLength", - FieldId: "QueueLength", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "QueueLength", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "TTL", - FieldId: "TTL", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "TTL", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MinItems", - FieldId: "MinItems", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "MinItems", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MetricIDs", - FieldId: "MetricIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "MetricIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "MetricFilterIDs", - FieldId: "MetricFilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "MetricFilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Blocker", - FieldId: "Blocker", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "Blocker", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Stored", - FieldId: "Stored", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "Stored", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ThresholdIDs", - FieldId: "ThresholdIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, + Path: "ThresholdIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.StatsCSVContent)) @@ -676,71 +676,71 @@ func TestLoaderProcessSuppliers(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaSuppliers: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Sorting", - FieldId: "Sorting", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "Sorting", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SortingParamameters", - FieldId: "SortingParamameters", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "SortingParamameters", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierID", - FieldId: "SupplierID", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "SupplierID", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierFilterIDs", - FieldId: "SupplierFilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, + Path: "SupplierFilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierAccountIDs", - FieldId: "SupplierAccountIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, + Path: "SupplierAccountIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierRatingPlanIDs", - FieldId: "SupplierRatingplanIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, + Path: "SupplierRatingplanIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierResourceIDs", - FieldId: "SupplierResourceIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, + Path: "SupplierResourceIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierStatIDs", - FieldId: "SupplierStatIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, + Path: "SupplierStatIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierWeight", - FieldId: "SupplierWeight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, + Path: "SupplierWeight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierBlocker", - FieldId: "SupplierBlocker", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP)}, + Path: "SupplierBlocker", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "SupplierParameters", - FieldId: "SupplierParameters", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP)}, + Path: "SupplierParameters", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.SuppliersCSVContent)) @@ -803,35 +803,35 @@ func TestLoaderProcessChargers(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaChargers: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "RunID", - FieldId: "RunID", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, + Path: "RunID", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "AttributeIDs", - FieldId: "AttributeIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, + Path: "AttributeIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)}, &config.FCTemplate{Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)}, }, } rdr := ioutil.NopCloser(strings.NewReader(engine.ChargersCSVContent)) @@ -882,83 +882,83 @@ func TestLoaderProcessDispatches(t *testing.T) { utils.MetaDispatchers: []*config.FCTemplate{ &config.FCTemplate{ Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true, }, &config.FCTemplate{ Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true, }, &config.FCTemplate{ - Tag: "Subsystems", - FieldId: "Subsystems", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), + Tag: "Subsystems", + Path: "Subsystems", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "FilterIDs", - FieldId: "FilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), + Tag: "FilterIDs", + Path: "FilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "ActivationInterval", - FieldId: "ActivationInterval", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), + Tag: "ActivationInterval", + Path: "ActivationInterval", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "Strategy", - FieldId: "Strategy", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP), + Tag: "Strategy", + Path: "Strategy", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "StrategyParameters", - FieldId: "StrategyParameters", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), + Tag: "StrategyParameters", + Path: "StrategyParameters", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "ConnID", - FieldId: "ConnID", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), + Tag: "ConnID", + Path: "ConnID", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "ConnFilterIDs", - FieldId: "ConnFilterIDs", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), + Tag: "ConnFilterIDs", + Path: "ConnFilterIDs", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "ConnWeight", - FieldId: "ConnWeight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), + Tag: "ConnWeight", + Path: "ConnWeight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "ConnBlocker", - FieldId: "ConnBlocker", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), + Tag: "ConnBlocker", + Path: "ConnBlocker", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "ConnParameters", - FieldId: "ConnParameters", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), + Tag: "ConnParameters", + Path: "ConnParameters", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "Weight", - FieldId: "Weight", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), + Tag: "Weight", + Path: "Weight", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), }, }, } @@ -1034,35 +1034,35 @@ func TestLoaderProcessDispatcheHosts(t *testing.T) { utils.MetaDispatcherHosts: []*config.FCTemplate{ &config.FCTemplate{ Tag: "Tenant", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true, }, &config.FCTemplate{ Tag: "ID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true, }, &config.FCTemplate{ - Tag: "Address", - FieldId: "Address", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), + Tag: "Address", + Path: "Address", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "Transport", - FieldId: "Transport", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), + Tag: "Transport", + Path: "Transport", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), }, &config.FCTemplate{ - Tag: "TLS", - FieldId: "TLS", - Type: utils.META_COMPOSED, - Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), + Tag: "TLS", + Path: "TLS", + Type: utils.META_COMPOSED, + Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), }, }, } @@ -1121,12 +1121,12 @@ func TestLoaderRemoveContentSingleFile(t *testing.T) { ldr.dataTpls = map[string][]*config.FCTemplate{ utils.MetaAttributes: []*config.FCTemplate{ &config.FCTemplate{Tag: "TenantID", - FieldId: "Tenant", + Path: "Tenant", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP), Mandatory: true}, &config.FCTemplate{Tag: "ProfileID", - FieldId: "ID", + Path: "ID", Type: utils.META_COMPOSED, Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP), Mandatory: true}, diff --git a/utils/consts.go b/utils/consts.go index caed04700..be8bd0b65 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -517,6 +517,7 @@ const ( MetaReq = "*req" MetaVars = "*vars" MetaRep = "*rep" + MetaExp = "*exp" MetaHdr = "*hdr" MetaTrl = "*trl" CGROriginHost = "cgr_originhost"