From a436718fc8f46e38d79f27059a2d6aca7775a60e Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 22 May 2020 17:51:02 +0300 Subject: [PATCH] Updated diameter filter --- agents/agentreq.go | 11 +- agents/libdiam.go | 4 +- agents/libdiam_test.go | 6 +- data/conf/samples/diam_tutmysql/data.json | 12 +- data/conf/samples/diam_tutmysql/sms.json | 2 +- data/conf/samples/diam_tutmysql/voice.json | 4 +- .../conf/samples/diamagent_internal/data.json | 14 +- .../samples/diamagent_internal/dryrun.json | 8 +- .../samples/diamagent_internal/message.json | 2 +- data/conf/samples/diamagent_internal/mms.json | 2 +- .../samples/diamagent_internal/simpa.json | 2 +- .../diamagent_internal/wrong_template.json | 2 +- data/conf/samples/diamagent_mongo/data.json | 14 +- data/conf/samples/diamagent_mongo/dryrun.json | 8 +- .../conf/samples/diamagent_mongo/message.json | 2 +- data/conf/samples/diamagent_mongo/mms.json | 2 +- data/conf/samples/diamagent_mongo/simpa.json | 2 +- .../diamagent_mongo/wrong_template.json | 2 +- data/conf/samples/diamagent_mysql/data.json | 14 +- data/conf/samples/diamagent_mysql/dryrun.json | 8 +- .../conf/samples/diamagent_mysql/message.json | 2 +- data/conf/samples/diamagent_mysql/mms.json | 2 +- data/conf/samples/diamagent_mysql/simpa.json | 2 +- .../diamagent_mysql/wrong_template.json | 2 +- .../samples/diamsctpagent_internal/data.json | 14 +- .../diamsctpagent_internal/dryrun.json | 8 +- .../diamsctpagent_internal/message.json | 2 +- .../samples/diamsctpagent_internal/mms.json | 2 +- .../samples/diamsctpagent_internal/simpa.json | 2 +- .../samples/diamsctpagent_mongo/data.json | 14 +- .../samples/diamsctpagent_mongo/dryrun.json | 8 +- .../samples/diamsctpagent_mongo/message.json | 2 +- .../conf/samples/diamsctpagent_mongo/mms.json | 2 +- .../samples/diamsctpagent_mongo/simpa.json | 2 +- .../samples/diamsctpagent_mysql/data.json | 14 +- .../samples/diamsctpagent_mysql/dryrun.json | 8 +- .../samples/diamsctpagent_mysql/message.json | 2 +- .../conf/samples/diamsctpagent_mysql/mms.json | 2 +- .../samples/diamsctpagent_mysql/simpa.json | 2 +- .../samples/dispatchers/diamagent/data.json | 14 +- .../samples/dispatchers/diamagent/dryrun.json | 8 +- .../dispatchers/diamagent/message.json | 2 +- .../samples/dispatchers/diamagent/mms.json | 2 +- .../samples/dispatchers/diamagent/simpa.json | 2 +- docs/diamagent.rst | 8 +- utils/dynamicdataprovider.go | 77 ++++++++- utils/dynamicdataprovider_test.go | 149 ++++++++++++++++++ 47 files changed, 352 insertions(+), 123 deletions(-) diff --git a/agents/agentreq.go b/agents/agentreq.go index fd649bf7b..bf4f1c7de 100644 --- a/agents/agentreq.go +++ b/agents/agentreq.go @@ -216,9 +216,14 @@ func (ar *AgentRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { } return } - fullPath := &utils.FullPath{ - PathItems: tplFld.GetPathItems().Clone(), // need to clone so me do not modify the template - Path: tplFld.Path, + var fullPath *utils.FullPath + if fullPath, err = ar.dynamicProvider.GetFullFieldPath(tplFld.Path); err != nil { + return + } else if fullPath == nil { // no dynamic path + fullPath = &utils.FullPath{ + PathItems: tplFld.GetPathItems().Clone(), // need to clone so me do not modify the template + Path: tplFld.Path, + } } nMItm := &config.NMItem{Data: out, Path: tplFld.GetPathSlice()[1:], Config: tplFld} diff --git a/agents/libdiam.go b/agents/libdiam.go index e73ca5fd7..1b0e8885a 100644 --- a/agents/libdiam.go +++ b/agents/libdiam.go @@ -335,9 +335,9 @@ func (dP *diameterDP) FieldAsInterface(fldPath []string) (data interface{}, err // lastPath can contain selector inside lastPath := fldPath[len(fldPath)-1] var slctrStr string - if splt := strings.Split(lastPath, "["); len(splt) != 1 { + if splt := strings.Split(lastPath, "<"); len(splt) != 1 { lastPath = splt[0] - if splt[1][len(splt[1])-1:] != "]" { + if splt[1][len(splt[1])-1:] != ">" { return nil, fmt.Errorf("filter rule <%s> needs to end in ]", splt[1]) } slctrStr = splt[1][:len(splt[1])-1] // also strip the last ] diff --git a/agents/libdiam_test.go b/agents/libdiam_test.go index d1777e1e6..c0128372d 100644 --- a/agents/libdiam_test.go +++ b/agents/libdiam_test.go @@ -84,20 +84,20 @@ func TestDPFieldAsInterface(t *testing.T) { } eOut = interface{}("208708000003") // with filter on second group item if out, err := dP.FieldAsInterface([]string{"Subscription-Id", - "Subscription-Id-Data[1]"}); err != nil { // on index + "Subscription-Id-Data<1>"}); err != nil { // on index t.Error(err) } else if eOut != out { t.Errorf("Expecting: %v, received: %v", eOut, out) } if out, err := dP.FieldAsInterface([]string{"Subscription-Id", - "Subscription-Id-Data[~Subscription-Id-Type(1)]"}); err != nil { // on filter + "Subscription-Id-Data<~Subscription-Id-Type(1)>"}); err != nil { // on filter t.Error(err) } else if out != eOut { // can be any result since both entries are matching single filter t.Errorf("expecting: %v, received: %v", eOut, out) } eOut = interface{}("208708000004") if out, err := dP.FieldAsInterface([]string{"Subscription-Id", - "Subscription-Id-Data[~Subscription-Id-Type(2)|~Value-Digits(20000)]"}); err != nil { // on multiple filter + "Subscription-Id-Data<~Subscription-Id-Type(2)|~Value-Digits(20000)>"}); err != nil { // on multiple filter t.Error(err) } else if eOut != out { t.Errorf("Expecting: %v, received: %v", eOut, out) diff --git a/data/conf/samples/diam_tutmysql/data.json b/data/conf/samples/diam_tutmysql/data.json index 8fc0915c4..c1474863a 100644 --- a/data/conf/samples/diam_tutmysql/data.json +++ b/data/conf/samples/diam_tutmysql/data.json @@ -34,7 +34,7 @@ { "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>" }, { "tag": "Destination", "path": "*cgreq.Destination", @@ -93,7 +93,7 @@ { "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Usage", "path": "Usage", @@ -101,7 +101,7 @@ }, { "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)]" + "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": [ @@ -119,7 +119,7 @@ "id": "data_update_grp2", "filters": [ "*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs" ], "flags": ["*update", "*accounts"], @@ -148,7 +148,7 @@ { "tag": "Account", "path": "Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", "path": "Destination", @@ -170,7 +170,7 @@ }, { "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)]" + "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": [ diff --git a/data/conf/samples/diam_tutmysql/sms.json b/data/conf/samples/diam_tutmysql/sms.json index dd20c0949..1e82f07ff 100644 --- a/data/conf/samples/diam_tutmysql/sms.json +++ b/data/conf/samples/diam_tutmysql/sms.json @@ -41,7 +41,7 @@ { "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", "path": "*cgreq.Destination", diff --git a/data/conf/samples/diam_tutmysql/voice.json b/data/conf/samples/diam_tutmysql/voice.json index 8ffa6e80f..3c79ed198 100644 --- a/data/conf/samples/diam_tutmysql/voice.json +++ b/data/conf/samples/diam_tutmysql/voice.json @@ -33,7 +33,7 @@ { "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" + "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address<0>:s/tel:\\+(\\d+)/${1}/" }, { "tag": "Account", "path": "*cgreq.Account", @@ -125,7 +125,7 @@ { "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" + "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address<0>:s/tel:\\+(\\d+)/${1}/" }, { "tag": "Account", "path": "*cgreq.Account", diff --git a/data/conf/samples/diamagent_internal/data.json b/data/conf/samples/diamagent_internal/data.json index 9066f4254..13df967be 100644 --- a/data/conf/samples/diamagent_internal/data.json +++ b/data/conf/samples/diamagent_internal/data.json @@ -38,7 +38,7 @@ "tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true }, { @@ -137,7 +137,7 @@ "tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", @@ -169,7 +169,7 @@ "tag": "LastUsed", "path": "*cgreq.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)]" + "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": [ @@ -194,7 +194,7 @@ "filters": [ "*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs" ], "flags": ["*update", "*accounts"], @@ -242,7 +242,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", @@ -274,7 +274,7 @@ "tag": "LastUsed", "path": "*cgreq.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)]" + "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": [ @@ -340,7 +340,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_internal/dryrun.json b/data/conf/samples/diamagent_internal/dryrun.json index 2323e3f42..62570e1e5 100644 --- a/data/conf/samples/diamagent_internal/dryrun.json +++ b/data/conf/samples/diamagent_internal/dryrun.json @@ -65,14 +65,14 @@ "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>" }, { "tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>" }, ], @@ -167,14 +167,14 @@ "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>" }, { "tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>" }, ], "reply_fields":[ diff --git a/data/conf/samples/diamagent_internal/message.json b/data/conf/samples/diamagent_internal/message.json index 784707957..f5299746c 100644 --- a/data/conf/samples/diamagent_internal/message.json +++ b/data/conf/samples/diamagent_internal/message.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_internal/mms.json b/data/conf/samples/diamagent_internal/mms.json index 4ec65e707..74f4641de 100644 --- a/data/conf/samples/diamagent_internal/mms.json +++ b/data/conf/samples/diamagent_internal/mms.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_internal/simpa.json b/data/conf/samples/diamagent_internal/simpa.json index 7c46da38a..31b2b5cfb 100644 --- a/data/conf/samples/diamagent_internal/simpa.json +++ b/data/conf/samples/diamagent_internal/simpa.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "AnswerTime", diff --git a/data/conf/samples/diamagent_internal/wrong_template.json b/data/conf/samples/diamagent_internal/wrong_template.json index 391411dd3..37a57ad2c 100644 --- a/data/conf/samples/diamagent_internal/wrong_template.json +++ b/data/conf/samples/diamagent_internal/wrong_template.json @@ -43,7 +43,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mongo/data.json b/data/conf/samples/diamagent_mongo/data.json index 9066f4254..13df967be 100644 --- a/data/conf/samples/diamagent_mongo/data.json +++ b/data/conf/samples/diamagent_mongo/data.json @@ -38,7 +38,7 @@ "tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true }, { @@ -137,7 +137,7 @@ "tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", @@ -169,7 +169,7 @@ "tag": "LastUsed", "path": "*cgreq.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)]" + "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": [ @@ -194,7 +194,7 @@ "filters": [ "*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs" ], "flags": ["*update", "*accounts"], @@ -242,7 +242,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", @@ -274,7 +274,7 @@ "tag": "LastUsed", "path": "*cgreq.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)]" + "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": [ @@ -340,7 +340,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mongo/dryrun.json b/data/conf/samples/diamagent_mongo/dryrun.json index 2323e3f42..62570e1e5 100644 --- a/data/conf/samples/diamagent_mongo/dryrun.json +++ b/data/conf/samples/diamagent_mongo/dryrun.json @@ -65,14 +65,14 @@ "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>" }, { "tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>" }, ], @@ -167,14 +167,14 @@ "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>" }, { "tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>" }, ], "reply_fields":[ diff --git a/data/conf/samples/diamagent_mongo/message.json b/data/conf/samples/diamagent_mongo/message.json index 784707957..f5299746c 100644 --- a/data/conf/samples/diamagent_mongo/message.json +++ b/data/conf/samples/diamagent_mongo/message.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mongo/mms.json b/data/conf/samples/diamagent_mongo/mms.json index 4ec65e707..74f4641de 100644 --- a/data/conf/samples/diamagent_mongo/mms.json +++ b/data/conf/samples/diamagent_mongo/mms.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mongo/simpa.json b/data/conf/samples/diamagent_mongo/simpa.json index 7c46da38a..31b2b5cfb 100644 --- a/data/conf/samples/diamagent_mongo/simpa.json +++ b/data/conf/samples/diamagent_mongo/simpa.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "AnswerTime", diff --git a/data/conf/samples/diamagent_mongo/wrong_template.json b/data/conf/samples/diamagent_mongo/wrong_template.json index 391411dd3..37a57ad2c 100644 --- a/data/conf/samples/diamagent_mongo/wrong_template.json +++ b/data/conf/samples/diamagent_mongo/wrong_template.json @@ -43,7 +43,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mysql/data.json b/data/conf/samples/diamagent_mysql/data.json index 59e80982d..3f60f3d23 100644 --- a/data/conf/samples/diamagent_mysql/data.json +++ b/data/conf/samples/diamagent_mysql/data.json @@ -38,7 +38,7 @@ "tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true }, { @@ -137,7 +137,7 @@ "tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", @@ -169,7 +169,7 @@ "tag": "LastUsed", "path": "*cgreq.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)]" + "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": [ @@ -194,7 +194,7 @@ "filters": [ "*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs" ], "flags": ["*update", "*accounts"], @@ -242,7 +242,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", @@ -274,7 +274,7 @@ "tag": "LastUsed", "path": "*cgreq.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)]" + "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": [ @@ -340,7 +340,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mysql/dryrun.json b/data/conf/samples/diamagent_mysql/dryrun.json index 6b384af11..22be79f93 100644 --- a/data/conf/samples/diamagent_mysql/dryrun.json +++ b/data/conf/samples/diamagent_mysql/dryrun.json @@ -65,14 +65,14 @@ "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>" }, { "tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>" }, ], @@ -167,14 +167,14 @@ "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>" }, { "tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>" }, ], "reply_fields":[ diff --git a/data/conf/samples/diamagent_mysql/message.json b/data/conf/samples/diamagent_mysql/message.json index 784707957..f5299746c 100644 --- a/data/conf/samples/diamagent_mysql/message.json +++ b/data/conf/samples/diamagent_mysql/message.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mysql/mms.json b/data/conf/samples/diamagent_mysql/mms.json index 4ec65e707..74f4641de 100644 --- a/data/conf/samples/diamagent_mysql/mms.json +++ b/data/conf/samples/diamagent_mysql/mms.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamagent_mysql/simpa.json b/data/conf/samples/diamagent_mysql/simpa.json index 7c46da38a..31b2b5cfb 100644 --- a/data/conf/samples/diamagent_mysql/simpa.json +++ b/data/conf/samples/diamagent_mysql/simpa.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "AnswerTime", diff --git a/data/conf/samples/diamagent_mysql/wrong_template.json b/data/conf/samples/diamagent_mysql/wrong_template.json index 391411dd3..37a57ad2c 100644 --- a/data/conf/samples/diamagent_mysql/wrong_template.json +++ b/data/conf/samples/diamagent_mysql/wrong_template.json @@ -43,7 +43,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamsctpagent_internal/data.json b/data/conf/samples/diamsctpagent_internal/data.json index a67c877b8..f22cd3481 100755 --- a/data/conf/samples/diamsctpagent_internal/data.json +++ b/data/conf/samples/diamsctpagent_internal/data.json @@ -15,7 +15,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -45,7 +45,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*contant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -53,7 +53,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -65,7 +65,7 @@ { "id": "data_update_grp2", "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, @@ -77,7 +77,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -85,7 +85,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -108,7 +108,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, diff --git a/data/conf/samples/diamsctpagent_internal/dryrun.json b/data/conf/samples/diamsctpagent_internal/dryrun.json index c64413e4b..77e473738 100755 --- a/data/conf/samples/diamsctpagent_internal/dryrun.json +++ b/data/conf/samples/diamsctpagent_internal/dryrun.json @@ -20,9 +20,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ @@ -54,9 +54,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ diff --git a/data/conf/samples/diamsctpagent_internal/message.json b/data/conf/samples/diamsctpagent_internal/message.json index c45b0eba4..702f45954 100755 --- a/data/conf/samples/diamsctpagent_internal/message.json +++ b/data/conf/samples/diamsctpagent_internal/message.json @@ -15,7 +15,7 @@ {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "sms"}, {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", diff --git a/data/conf/samples/diamsctpagent_internal/mms.json b/data/conf/samples/diamsctpagent_internal/mms.json index 4ec65e707..74f4641de 100644 --- a/data/conf/samples/diamsctpagent_internal/mms.json +++ b/data/conf/samples/diamsctpagent_internal/mms.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamsctpagent_internal/simpa.json b/data/conf/samples/diamsctpagent_internal/simpa.json index 4df22b605..df26b954e 100755 --- a/data/conf/samples/diamsctpagent_internal/simpa.json +++ b/data/conf/samples/diamsctpagent_internal/simpa.json @@ -15,7 +15,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*value_exponent", "mandatory": true, diff --git a/data/conf/samples/diamsctpagent_mongo/data.json b/data/conf/samples/diamsctpagent_mongo/data.json index a67c877b8..f22cd3481 100755 --- a/data/conf/samples/diamsctpagent_mongo/data.json +++ b/data/conf/samples/diamsctpagent_mongo/data.json @@ -15,7 +15,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -45,7 +45,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*contant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -53,7 +53,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -65,7 +65,7 @@ { "id": "data_update_grp2", "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, @@ -77,7 +77,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -85,7 +85,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -108,7 +108,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, diff --git a/data/conf/samples/diamsctpagent_mongo/dryrun.json b/data/conf/samples/diamsctpagent_mongo/dryrun.json index c64413e4b..77e473738 100755 --- a/data/conf/samples/diamsctpagent_mongo/dryrun.json +++ b/data/conf/samples/diamsctpagent_mongo/dryrun.json @@ -20,9 +20,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ @@ -54,9 +54,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ diff --git a/data/conf/samples/diamsctpagent_mongo/message.json b/data/conf/samples/diamsctpagent_mongo/message.json index c45b0eba4..702f45954 100755 --- a/data/conf/samples/diamsctpagent_mongo/message.json +++ b/data/conf/samples/diamsctpagent_mongo/message.json @@ -15,7 +15,7 @@ {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "sms"}, {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", diff --git a/data/conf/samples/diamsctpagent_mongo/mms.json b/data/conf/samples/diamsctpagent_mongo/mms.json index 4ec65e707..74f4641de 100644 --- a/data/conf/samples/diamsctpagent_mongo/mms.json +++ b/data/conf/samples/diamsctpagent_mongo/mms.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamsctpagent_mongo/simpa.json b/data/conf/samples/diamsctpagent_mongo/simpa.json index 4df22b605..df26b954e 100755 --- a/data/conf/samples/diamsctpagent_mongo/simpa.json +++ b/data/conf/samples/diamsctpagent_mongo/simpa.json @@ -15,7 +15,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*value_exponent", "mandatory": true, diff --git a/data/conf/samples/diamsctpagent_mysql/data.json b/data/conf/samples/diamsctpagent_mysql/data.json index a67c877b8..f22cd3481 100755 --- a/data/conf/samples/diamsctpagent_mysql/data.json +++ b/data/conf/samples/diamsctpagent_mysql/data.json @@ -15,7 +15,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -45,7 +45,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*contant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -53,7 +53,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -65,7 +65,7 @@ { "id": "data_update_grp2", "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, @@ -77,7 +77,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -85,7 +85,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -108,7 +108,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, diff --git a/data/conf/samples/diamsctpagent_mysql/dryrun.json b/data/conf/samples/diamsctpagent_mysql/dryrun.json index c64413e4b..77e473738 100755 --- a/data/conf/samples/diamsctpagent_mysql/dryrun.json +++ b/data/conf/samples/diamsctpagent_mysql/dryrun.json @@ -20,9 +20,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ @@ -54,9 +54,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ diff --git a/data/conf/samples/diamsctpagent_mysql/message.json b/data/conf/samples/diamsctpagent_mysql/message.json index c45b0eba4..702f45954 100755 --- a/data/conf/samples/diamsctpagent_mysql/message.json +++ b/data/conf/samples/diamsctpagent_mysql/message.json @@ -15,7 +15,7 @@ {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "sms"}, {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", diff --git a/data/conf/samples/diamsctpagent_mysql/mms.json b/data/conf/samples/diamsctpagent_mysql/mms.json index 4ec65e707..74f4641de 100644 --- a/data/conf/samples/diamsctpagent_mysql/mms.json +++ b/data/conf/samples/diamsctpagent_mysql/mms.json @@ -42,7 +42,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/diamsctpagent_mysql/simpa.json b/data/conf/samples/diamsctpagent_mysql/simpa.json index 4df22b605..df26b954e 100755 --- a/data/conf/samples/diamsctpagent_mysql/simpa.json +++ b/data/conf/samples/diamsctpagent_mysql/simpa.json @@ -15,7 +15,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*value_exponent", "mandatory": true, diff --git a/data/conf/samples/dispatchers/diamagent/data.json b/data/conf/samples/dispatchers/diamagent/data.json index 35f92df17..c3ad9b264 100644 --- a/data/conf/samples/dispatchers/diamagent/data.json +++ b/data/conf/samples/dispatchers/diamagent/data.json @@ -16,7 +16,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]", "mandatory": true}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(1)>", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -47,7 +47,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*contant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -55,7 +55,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -67,7 +67,7 @@ { "id": "data_update_grp2", "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group<1>:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, @@ -80,7 +80,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, @@ -88,7 +88,7 @@ "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, {"tag": "LastUsed", "path": "*cgreq.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)]"}, + "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"}, @@ -112,7 +112,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, diff --git a/data/conf/samples/dispatchers/diamagent/dryrun.json b/data/conf/samples/dispatchers/diamagent/dryrun.json index 86f6a6764..2ec1e267e 100644 --- a/data/conf/samples/dispatchers/diamagent/dryrun.json +++ b/data/conf/samples/dispatchers/diamagent/dryrun.json @@ -21,9 +21,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ @@ -56,9 +56,9 @@ {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "UsedUnits1", "path": "*cgreq.UsedUnits1", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(1)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(1)>"}, {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets<~Rating-Group(2)>"}, ], "reply_fields":[ diff --git a/data/conf/samples/dispatchers/diamagent/message.json b/data/conf/samples/dispatchers/diamagent/message.json index d4c954001..1b3bee6bc 100644 --- a/data/conf/samples/dispatchers/diamagent/message.json +++ b/data/conf/samples/dispatchers/diamagent/message.json @@ -16,7 +16,7 @@ {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "sms"}, {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", diff --git a/data/conf/samples/dispatchers/diamagent/mms.json b/data/conf/samples/dispatchers/diamagent/mms.json index c78caf338..e2c9c2983 100644 --- a/data/conf/samples/dispatchers/diamagent/mms.json +++ b/data/conf/samples/dispatchers/diamagent/mms.json @@ -47,7 +47,7 @@ "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", diff --git a/data/conf/samples/dispatchers/diamagent/simpa.json b/data/conf/samples/dispatchers/diamagent/simpa.json index 0856fd257..5ece23225 100644 --- a/data/conf/samples/dispatchers/diamagent/simpa.json +++ b/data/conf/samples/dispatchers/diamagent/simpa.json @@ -16,7 +16,7 @@ {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "generic"}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, - "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]"}, + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>"}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*value_exponent", "mandatory": true, diff --git a/docs/diamagent.rst b/docs/diamagent.rst index 53493bc58..3de460fcf 100644 --- a/docs/diamagent.rst +++ b/docs/diamagent.rst @@ -188,7 +188,7 @@ With explanations in the comments: "path": "*cgreq.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)]" + "value": "~*req.Subscription-Id.Subscription-Id-Data<~Subscription-Id-Type(0)>" }, { "tag": "Destination", // Destination is used for charging @@ -324,10 +324,10 @@ filters **\*req** Diameter request as it comes from the *DiameterClient*. - Special selector format defined in case of groups *\*req.Path.To.Attribute[$groupIndex]* or *\*req.Absolute.Path.To.Attribute[~AnotherAttributeRelativePath($valueAnotherAttribute)]*. + Special selector format defined in case of groups *\*req.Path.To.Attribute[$groupIndex]* or *\*req.Absolute.Path.To.Attribute<~AnotherAttributeRelativePath($valueAnotherAttribute)>*. - Example 1: *~\*req.Multiple-Services-Credit-Control.Rating-Group[1]* translates to: value of the group attribute at path Multiple-Services-Credit-Control.Rating-Group which is located in the second group (groups start at index 0). - Example 2: *~\*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets[~Rating-Group(1)]* which translates to: value of the group attribute at path: *Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets* where Multiple-Services-Credit-Control.Used-Service-Unit.Rating-Group has value of "1". + Example 1: *~\*req.Multiple-Services-Credit-Control.Rating-Group<1>* translates to: value of the group attribute at path Multiple-Services-Credit-Control.Rating-Group which is located in the second group (groups start at index 0). + Example 2: *~\*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets<~Rating-Group(1)>* which translates to: value of the group attribute at path: *Multiple-Services-Credit-Control.Used-Service-Unit.CC-Input-Octets* where Multiple-Services-Credit-Control.Used-Service-Unit.Rating-Group has value of "1". **\*rep** Diameter reply going to *DiameterClient*. diff --git a/utils/dynamicdataprovider.go b/utils/dynamicdataprovider.go index d2e1fe0db..877100c54 100644 --- a/utils/dynamicdataprovider.go +++ b/utils/dynamicdataprovider.go @@ -115,13 +115,14 @@ func (ddp *DynamicDataProvider) proccesFieldPath(fldPath string) (newPath string // GetFullFieldPath returns the full path for the func (ddp *DynamicDataProvider) GetFullFieldPath(fldPath string) (fpath *FullPath, err error) { var newPath string - if newPath, err = ddp.proccesFieldPath(fldPath); err != nil || newPath == EmptyString { + if newPath, err = ddp.proccesFieldPathForSet(fldPath); err != nil || newPath == EmptyString { return } fpath = &FullPath{ PathItems: NewPathItems(strings.Split(newPath, NestingSep)), Path: newPath, } + return } @@ -133,3 +134,77 @@ func (ddp DynamicDataProvider) FieldAsString(fldPath []string) (str string, err } return IfaceAsString(val), nil } + +// does the same thing as ... but replaces [ with . if the value between [] is dynamic +func (ddp *DynamicDataProvider) proccesFieldPathForSet(fldPath string) (newPath string, err error) { + idx := strings.Index(fldPath, IdxStart) + if idx == -1 { + return // no proccessing requred + } + var hasDyn bool // to be able to determine if the path has selector + newPath = fldPath[:idx] // add the first path of the path without the "[" + for idx != -1 { // stop when we do not find any "[" + fldPath = fldPath[idx+1:] // move the path to the begining of the index + nextBeginIdx := strings.Index(fldPath, IdxStart) // get the next "[" if any + nextEndIdx := strings.Index(fldPath, IdxEnd) // get the next "]" if any + if nextEndIdx == -1 { // no end index found so return error + err = ErrWrongPath + newPath = EmptyString + return + } + + // parse the rest of the field path until we match the [ ] + bIdx, eIdx := nextBeginIdx, nextEndIdx + for nextBeginIdx != -1 && nextBeginIdx < nextEndIdx { // do this until no new [ is found or the next begining [ is after the end ] + nextBeginIdx = strings.Index(fldPath[bIdx+1:], IdxStart) // get the next "[" if any + nextEndIdx = strings.Index(fldPath[eIdx+1:], IdxEnd) // get the next "]" if any + if nextEndIdx == -1 { // no end index found so return error + err = ErrWrongPath + newPath = EmptyString + return + } + if nextBeginIdx == -1 { // if no index found do not increment but replace it + bIdx = -1 + } else { + bIdx += nextBeginIdx + 1 + } + // increment the indexes + eIdx += nextEndIdx + 1 + } + var val string + var isDyn bool + for _, path := range strings.Split(fldPath[:eIdx], PipeSep) { // proccess the found path + var iface interface{} + if strings.HasPrefix(path, DynamicDataPrefix) { + isDyn = true + path2 := strings.TrimPrefix(path, DynamicDataPrefix) + if iface, err = ddp.FieldAsInterface(strings.Split(path2, NestingSep)); err != nil { + newPath = EmptyString + return + } + val += IfaceAsString(iface) // compose the value + } else { + + val += IfaceAsString(path) // compose the value + } + } + if isDyn { + hasDyn = true + val = NestingSep + val + } else { + val = IdxStart + val + IdxEnd + } + + if bIdx == -1 { // if is the last ocurence add the rest of the path and exit + newPath += val + fldPath[eIdx+1:] + } else { + // else just add until the next [ + newPath += val + fldPath[eIdx+1:bIdx] + } + idx = bIdx + } + if !hasDyn { // the path doesn't have dynamic selector + newPath = EmptyString + } + return +} diff --git a/utils/dynamicdataprovider_test.go b/utils/dynamicdataprovider_test.go index 30c668b0c..aa8d37ca0 100644 --- a/utils/dynamicdataprovider_test.go +++ b/utils/dynamicdataprovider_test.go @@ -141,3 +141,152 @@ func TestDynamicDataProviderFieldAsInterface2(t *testing.T) { t.Errorf("Expected error %s received %v", ErrWrongPath, err) } } + +func TestDynamicDataProviderProccesFieldPath2(t *testing.T) { + dp := MapStorage{ + MetaCgrep: MapStorage{ + "Stir": MapStorage{ + "CHRG_ROUTE1_END": "Identity1", + "CHRG_ROUTE2_END": "Identity2", + "CHRG_ROUTE3_END": "Identity3", + "CHRG_ROUTE4_END": "Identity4", + }, + "Routes": MapStorage{ + "SortedRoutes": []MapStorage{ + {"ID": "ROUTE1"}, + {"ID": "ROUTE2"}, + {"ID": "ROUTE3"}, + {"ID": "ROUTE4"}, + }, + }, + "BestRoute": 0, + }, + } + ddp := NewDynamicDataProvider(dp) + newpath, err := ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]") + if err != nil { + t.Fatal(err) + } + expectedPath := "~*cgrep.Stir.CHRG_ROUTE2_END.Something.CHRG_ROUTE1_END" + if newpath != expectedPath { + t.Errorf("Expected: %q,received %q", expectedPath, newpath) + } + _, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END") + if err != ErrWrongPath { + t.Errorf("Expected error %s received %v", ErrWrongPath, err) + } + + _, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_") + if err != ErrWrongPath { + t.Errorf("Expected error %s received %v", ErrWrongPath, err) + } + + _, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID2|_END]") + if err != ErrNotFound { + t.Errorf("Expected error %s received %v", ErrNotFound, err) + } + newpath, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[1]") + if err != nil { + t.Fatal(err) + } + if newpath != EmptyString { + t.Errorf("Expected: %q,received %q", EmptyString, newpath) + } +} + +func TestDynamicDataProviderFieldAsString(t *testing.T) { + dp := MapStorage{ + MetaCgrep: MapStorage{ + "Stir": map[string]interface{}{ + "CHRG_ROUTE1_END": "Identity1", + "CHRG_ROUTE2_END": "Identity2", + "CHRG_ROUTE3_END": "Identity3", + "CHRG_ROUTE4_END": "Identity4", + }, + "Routes": map[string]interface{}{ + "SortedRoutes": []map[string]interface{}{ + {"ID": "ROUTE1"}, + {"ID": "ROUTE2"}, + {"ID": "ROUTE3"}, + {"ID": "ROUTE4"}, + }, + }, + "BestRoute": 0, + }, + } + ddp := NewDynamicDataProvider(dp) + path := "*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]" + out, err := ddp.FieldAsString(strings.Split(path, NestingSep)) + if err != nil { + t.Fatal(err) + } + expected := "Identity1" + if out != expected { + t.Errorf("Expected: %q,received %q", expected, out) + } + path = "*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END" + _, err = ddp.FieldAsString(strings.Split(path, NestingSep)) + if err != ErrWrongPath { + t.Errorf("Expected error %s received %v", ErrWrongPath, err) + } +} + +func TestDynamicDataProviderGetFullFieldPath(t *testing.T) { + dp := MapStorage{ + MetaCgrep: MapStorage{ + "Stir": MapStorage{ + "CHRG_ROUTE1_END": "Identity1", + "CHRG_ROUTE2_END": "Identity2", + "CHRG_ROUTE3_END": "Identity3", + "CHRG_ROUTE4_END": "Identity4", + }, + "Routes": MapStorage{ + "SortedRoutes": []MapStorage{ + {"ID": "ROUTE1"}, + {"ID": "ROUTE2"}, + {"ID": "ROUTE3"}, + {"ID": "ROUTE4"}, + }, + }, + "BestRoute": 0, + }, + } + ddp := NewDynamicDataProvider(dp) + newpath, err := ddp.GetFullFieldPath("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]") + if err != nil { + t.Fatal(err) + } + expectedPath := "~*cgrep.Stir.CHRG_ROUTE2_END.Something.CHRG_ROUTE1_END" + if newpath.Path != expectedPath { + t.Errorf("Expected: %q,received %q", expectedPath, newpath) + } + _, err = ddp.GetFullFieldPath("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END") + if err != ErrWrongPath { + t.Errorf("Expected error %s received %v", ErrWrongPath, err) + } + + _, err = ddp.GetFullFieldPath("~*cgrep.Stir[CHRG_") + if err != ErrWrongPath { + t.Errorf("Expected error %s received %v", ErrWrongPath, err) + } + + _, err = ddp.GetFullFieldPath("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID2|_END]") + if err != ErrNotFound { + t.Errorf("Expected error %s received %v", ErrNotFound, err) + } + newpath, err = ddp.GetFullFieldPath("~*cgrep.Stir[1]") + if err != nil { + t.Fatal(err) + } + if newpath != nil { + t.Errorf("Expected: %v,received %q", nil, newpath) + } + + newpath, err = ddp.GetFullFieldPath("~*cgrep.Stir") + if err != nil { + t.Fatal(err) + } + if newpath != nil { + t.Errorf("Expected: %v,received %q", nil, newpath) + } +}