From d396051d7782aeb31a071dc61c6264bf9d83b65d Mon Sep 17 00:00:00 2001 From: TeoV Date: Wed, 5 Feb 2020 11:12:37 +0200 Subject: [PATCH] Update DiamIntegration test for all configurations --- agents/agentreq.go | 6 +- data/conf/samples/diam_tutmysql/data.json | 24 +- data/conf/samples/diam_tutmysql/sms.json | 28 +- data/conf/samples/diam_tutmysql/voice.json | 86 ++-- .../conf/samples/diamagent_internal/data.json | 413 ++++++++++++++---- .../samples/diamagent_internal/dryrun.json | 217 +++++++-- .../samples/diamagent_internal/message.json | 92 +++- .../samples/diamagent_internal/simpa.json | 64 ++- .../samples/diamagent_internal/tests.json | 126 ++++-- .../samples/diamagent_internal/voice.json | 343 ++++++++++++--- data/conf/samples/diamagent_mongo/data.json | 413 ++++++++++++++---- data/conf/samples/diamagent_mongo/dryrun.json | 217 +++++++-- .../conf/samples/diamagent_mongo/message.json | 92 +++- data/conf/samples/diamagent_mongo/simpa.json | 64 ++- data/conf/samples/diamagent_mongo/tests.json | 126 ++++-- data/conf/samples/diamagent_mongo/voice.json | 343 ++++++++++++--- .../samples/diamsctpagent_internal/data.json | 92 ++-- .../diamsctpagent_internal/dryrun.json | 52 +-- .../diamsctpagent_internal/message.json | 20 +- .../samples/diamsctpagent_internal/simpa.json | 14 +- .../samples/diamsctpagent_internal/voice.json | 78 ++-- .../samples/diamsctpagent_mongo/data.json | 92 ++-- .../samples/diamsctpagent_mongo/dryrun.json | 52 +-- .../samples/diamsctpagent_mongo/message.json | 20 +- .../samples/diamsctpagent_mongo/simpa.json | 14 +- .../samples/diamsctpagent_mongo/voice.json | 78 ++-- .../samples/diamsctpagent_mysql/data.json | 92 ++-- .../samples/diamsctpagent_mysql/dryrun.json | 52 +-- .../samples/diamsctpagent_mysql/message.json | 20 +- .../samples/diamsctpagent_mysql/simpa.json | 14 +- .../samples/diamsctpagent_mysql/voice.json | 78 ++-- .../samples/dispatchers/diamagent/data.json | 100 ++--- .../samples/dispatchers/diamagent/dryrun.json | 56 +-- .../dispatchers/diamagent/message.json | 22 +- .../samples/dispatchers/diamagent/simpa.json | 16 +- .../samples/dispatchers/diamagent/tests.json | 28 +- .../samples/dispatchers/diamagent/voice.json | 84 ++-- 37 files changed, 2609 insertions(+), 1119 deletions(-) diff --git a/agents/agentreq.go b/agents/agentreq.go index 17cd803d8..a7ba1affd 100644 --- a/agents/agentreq.go +++ b/agents/agentreq.go @@ -50,6 +50,7 @@ func NewAgentRequest(req config.DataProvider, Request: req, Vars: config.NewNavigableMap(vars), CGRRequest: config.NewNavigableMap(nil), + diamreq: config.NewNavigableMap(nil), // special case when CGRateS is building the request CGRReply: cgrRply, Reply: rply, Timezone: timezone, @@ -109,6 +110,8 @@ func (ar *AgentRequest) FieldAsInterface(fldPath []string) (val interface{}, err val, err = ar.CGRRequest.GetField(fldPath[1:]) case utils.MetaCgrep: val, err = ar.CGRReply.GetField(fldPath[1:]) + case utils.MetaDiamreq: + val, err = ar.diamreq.FieldAsInterface(fldPath[1:]) case utils.MetaRep: val, err = ar.Reply.GetField(fldPath[1:]) case utils.MetaHdr: @@ -188,9 +191,6 @@ func (ar *AgentRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { case utils.MetaRep: ar.Reply.Set(fldPath[1:], valSet, false, true) case utils.MetaDiamreq: - if ar.diamreq == nil { - ar.diamreq = config.NewNavigableMap(nil) // special case when CGRateS is building the request - } ar.diamreq.Set(fldPath[1:], valSet, false, true) } } diff --git a/data/conf/samples/diam_tutmysql/data.json b/data/conf/samples/diam_tutmysql/data.json index df49ef677..8fc0915c4 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", "path": "ToR", + "tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data" }, { - "tag": "OriginID", "path": "OriginID", + "tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Session-Id" }, { - "tag": "RequestType", "path": "RequestType", + "tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Category", "path": "Category", + "tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "data" }, { - "tag": "Account", "path": "Account", + "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(1)]" }, { - "tag": "Destination", "path": "Destination", + "tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data" }, { - "tag": "SetupTime", "path": "SetupTime", + "tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "AnswerTime", "path": "AnswerTime", + "tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "path": "Usage", + "tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048" }, ], @@ -60,7 +60,7 @@ { "tag": "ResultCodeError", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Result-Code", "blocker": true, + "path": "*rep.Result-Code", "blocker": true, "type": "*constant", "value": "5030" }, ], @@ -109,7 +109,7 @@ { "tag": "ResultCodeError", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Result-Code", "blocker": true, + "path": "*rep.Result-Code", "blocker": true, "type": "*constant", "value": "5030" }, ], @@ -178,7 +178,7 @@ { "tag": "ResultCodeError", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Result-Code", "blocker": true, + "path": "*rep.Result-Code", "blocker": true, "type": "*constant", "value": "5030" }, ], diff --git a/data/conf/samples/diam_tutmysql/sms.json b/data/conf/samples/diam_tutmysql/sms.json index b942a924f..dd20c0949 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", "path": "ToR", + "tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms" }, { - "tag": "OriginID", "path": "OriginID", + "tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Service-Identifier" }, { - "tag": "OriginHost", "path": "OriginHost", + "tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Source", "path": "Source", + "tag": "Source", "path": "*cgreq.Source", "type": "*constant", "mandatory": true, "value": "DiameterAgent" }, { - "tag": "RequestType", "path": "RequestType", + "tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Category", "path": "Category", + "tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "sms" }, { - "tag": "Account", "path": "Account", + "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, "value": "~*req.Subscription-Id.Subscription-Id-Data[~Subscription-Id-Type(0)]" }, { - "tag": "Destination", "path": "Destination", + "tag": "Destination", "path": "*cgreq.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", "path": "SetupTime", + "tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "AnswerTime", "path": "AnswerTime", + "tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "path": "Usage", + "tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Requested-Service-Unit.CC-Service-Specific-Units" }, { - "tag": "Originator-SCCP-Address", "path": "Originator-SCCP-Address", + "tag": "Originator-SCCP-Address", "path": "*cgreq.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","path": "Result-Code", + "tag": "ResultCode","path": "*rep.Result-Code", "filters": ["*eq:~*cgrep.MaxUsage:0"], "type": "*constant", "value": "4012", "blocker": true }, { - "tag": "ResultCode", "path": "Result-Code", + "tag": "ResultCode", "path": "*rep.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 a2cc3c796..a1bf9acdb 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", "path": "ToR", "type": "*constant", "value": "*voice"}, + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, { - "tag": "OriginID", "path": "OriginID", + "tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id" }, { - "tag": "OriginHost", "path": "OriginHost", + "tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "mandatory": true, "value": "~*vars.OriginHost" }, { - "tag": "Source", "path": "Source", + "tag": "Source", "path": "*cgreq.Source", "type": "*constant", "value": "DiameterAgent" }, { - "tag": "RequestType", "path": "RequestType", + "tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Account", "path": "Account", + "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" }, { - "tag": "Account", "path": "Account", + "tag": "Account", "path": "*cgreq.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", "path": "Destination", + "tag": "Destination", "path": "*cgreq.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", "path": "Destination", + "tag": "Destination", "path": "*cgreq.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", "path": "SetupTime", + "tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "SetupTime", "path": "SetupTime", + "tag": "SetupTime", "path": "*cgreq.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", "path": "Usage", + "tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "mandatory": true, "value": "10s" }, { - "tag": "IMSI", "path": "IMSI", + "tag": "IMSI", "path": "*cgreq.IMSI", "type": "*variable", "value": "~*req.User-Name" } ], @@ -80,18 +80,18 @@ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, { "tag": "GrantedUnitsError", - "path": "Granted-Service-Unit.CC-Time", + "path": "*rep.Granted-Service-Unit.CC-Time", "filters": ["*notempty:~*cgrep.Error:"], "type": "*constant", "blocker": true, "value": "0" }, { "tag": "GrantedUnitsUnlimited", - "path": "Granted-Service-Unit.CC-Time", + "path": "*rep.Granted-Service-Unit.CC-Time", "filters": ["*eq:~*cgrep.MaxUsage:-1"], "blocker": true, "type": "*constant", "value": "10"}, - {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", + {"tag": "GrantedUnits", "path": "*rep.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", "path": "OriginID", + "tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id"}, { - "tag": "OriginHost", "path": "OriginHost", + "tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Source", "path": "Source", + "tag": "Source", "path": "*cgreq.Source", "type": "*constant","value": "DiameterAgent" }, { - "tag": "RequestType", "path": "RequestType", + "tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid" }, { - "tag": "Account", "path": "Account", + "tag": "Account", "path": "*cgreq.Account", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.Calling-Party-Address[0]:s/tel:\\+(\\d+)/${1}/" }, { - "tag": "Account", "path": "Account", + "tag": "Account", "path": "*cgreq.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", "path": "Destination", + "tag": "Destination", "path": "*cgreq.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", "path": "Destination", + "tag": "Destination", "path": "*cgreq.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", "path": "SetupTime", + "tag": "SetupTime", "path": "*cgreq.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", "path": "AnswerTime", + "tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "mandatory": true, "value": "~*req.Event-Timestamp" }, { - "tag": "Usage", "path": "Usage", + "tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "10s" }, { - "tag": "IMSI", "path": "IMSI", + "tag": "IMSI", "path": "*cgreq.IMSI", "type": "*variable", "mandatory": true, "value": "~*req.User-Name" } @@ -173,17 +173,17 @@ { "tag": "GrantedUnitsError", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "0" }, { "tag": "GrantedUnitsUnlimited", "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "path": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "10" }, { - "tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", + "tag": "GrantedUnits", "path": "*rep.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", "path": "OriginID", + "tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id" }, { - "tag": "OriginHost", "path": "OriginHost", + "tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Usage", "path": "Usage", + "tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "10s" }, ], @@ -218,17 +218,17 @@ { "tag": "GrantedUnitsOnError", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "0" }, { "tag": "GrantedUnitsUnlimited", "filters": ["*eq:~*cgrep.MaxUsage:-1"], - "path": "Granted-Service-Unit.CC-Time", "blocker": true, + "path": "*rep.Granted-Service-Unit.CC-Time", "blocker": true, "type": "*constant", "value": "10" }, { - "tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", + "tag": "GrantedUnits", "path": "*rep.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", "path": "OriginID", + "tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.IMS-Information.User-Session-Id" }, { - "tag": "OriginHost", "path": "OriginHost", + "tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "value": "~*vars.OriginHost" }, { - "tag": "Usage", "path": "Usage", + "tag": "Usage", "path": "*cgreq.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", "path": "Usage", + "tag": "Usage", "path": "*cgreq.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:"], - "path": "Result-Code", "blocker": true, + "path": "*rep.Result-Code", "blocker": true, "type": "*constant", "value": "5030"}, - {"tag": "ResultCode", "path": "Result-Code", + {"tag": "ResultCode", "path": "*rep.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 11ff41c52..daa4bca47 100644 --- a/data/conf/samples/diamagent_internal/data.json +++ b/data/conf/samples/diamagent_internal/data.json @@ -9,113 +9,366 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "tag": "Category", + "path": "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 + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*constant", + "value": "2048" + }, ], "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, ], }, { "id": "data_update_grp1", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:2", + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", + "*prefix:~*req.Service-Context-Id:gprs" + ], "flags": ["*update", "*accounts","*continue"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", - "value": "~*req.Session-Id", "mandatory": true}, - {"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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"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)]"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "InitialOriginID", + "path": "*cgreq.InitialOriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*composed", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*composed", + "value": "_grp1" + }, + { + "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)]" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "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)]" + }, ], "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, ], }, { "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"], + "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" + ], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", - "value": "~*req.Session-Id", "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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"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)]"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "InitialOriginID", + "path": "*cgreq.InitialOriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "OriginID", + "type": "*composed", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*constant", + "value": "_grp2" + }, + { + "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)]" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "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)]" + }, ], "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, ], }, { "id": "data_terminate", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:3", - "*prefix:~*req.Service-Context-Id:gprs"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:3", + "*prefix:~*req.Service-Context-Id:gprs" + ], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", - "value": "~*req.Session-Id", "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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"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"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginIDPrefix", + "path": "*cgreq.OriginIDPrefix", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "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)]" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "LastUsed", + "path": "*cgreq.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 ce46a31bc..e01b360e0 100644 --- a/data/conf/samples/diamagent_internal/dryrun.json +++ b/data/conf/samples/diamagent_internal/dryrun.json @@ -4,35 +4,106 @@ "request_processors": [ { "id": "dryrun1", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.Service-Context-Id:TestDiamItDryRun" + ], "flags": ["*dryrun","*continue"], "request_fields":[ - {"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", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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", "path": "UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*sms" + }, + { + "tag": "Val1", + "path": "*cgreq.Val1", + "type": "*constant", + "value": "1" + }, + { + "tag": "Val2", + "path": "*cgreq.Val2", + "type": "*constant", + "value": "2" + }, + { + "tag": "Val3", + "path": "*cgreq.Val3", + "type": "*constant", + "value": "3" + }, + { + "tag": "OptionalField", + "path":"*cgreq.OptionalField", + "type":"*variable", + "value":"~*req.Inexistent", + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "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)]" + }, + { + "tag": "UsedUnits2", + "path": "*cgreq.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", "path": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", - "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", - "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2002" + }, + { + "tag": "RatingGroup", + "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", + "type": "*constant", + "value": "1" + }, + { + "tag": "CCTotalOctets1", + "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + "type": "*variable", + "value": "~*cgreq.UsedUnits1" + }, + { + "tag": "GrantedUsage", + "path": "*rep.Granted-Service-Unit.CC-Time", + "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], }, @@ -41,29 +112,85 @@ "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", "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", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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", "path": "UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, - + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*sms" + }, + { + "tag": "Val1", + "path": "*cgreq.Val1", + "type": "*constant", + "value": "1" + }, + { + "tag": "Val2", + "path": "*cgreq.Val2", + "type": "*constant", + "value": "2" + }, + { + "tag": "Val3", + "path": "*cgreq.Val3", + "type": "*constant", + "value": "3" + }, + { + "tag": "OptionalField", + "path":"*cgreq.OptionalField", + "type":"*variable", + "value":"~*req.Inexistent" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "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)]" + }, + { + "tag": "UsedUnits2", + "path": "*cgreq.UsedUnits2", + "type": "*variable", + "mandatory": true, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + }, ], "reply_fields":[ - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", - "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", - "type": "*variable", "value": "~*cgreq.UsedUnits2"}, + { + "tag": "RatingGroup", + "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", + "type": "*constant", + "value": "2", + "new_branch": true + }, + { + "tag": "CCTotalOctets2", + "path": "*rep.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 d87a87543..cba51bbaf 100644 --- a/data/conf/samples/diamagent_internal/message.json +++ b/data/conf/samples/diamagent_internal/message.json @@ -5,29 +5,83 @@ { "id": "message", - "filters": ["*string:~*vars.*cmd:CCR", "*prefix:~*req.Service-Context-Id:message", - "*string:~*req.CC-Request-Type:4"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*prefix:~*req.Service-Context-Id:message", + "*string:~*req.CC-Request-Type:4" + ], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "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", "path": "Destination", "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*sms" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "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)]" + }, + { + "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", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.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 0ffae6b30..7c46da38a 100644 --- a/data/conf/samples/diamagent_internal/simpa.json +++ b/data/conf/samples/diamagent_internal/simpa.json @@ -5,21 +5,59 @@ "request_processors": [ { "id": "simpa_event", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:4", - "*prefix:~*req.Service-Context-Id:simpa"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:4", + "*prefix:~*req.Service-Context-Id:simpa" + ], "flags": ["*message", "*accounts", "*log"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*generic" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "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)]" + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.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 c788d05e9..402e231f4 100644 --- a/data/conf/samples/diamagent_internal/tests.json +++ b/data/conf/samples/diamagent_internal/tests.json @@ -5,39 +5,109 @@ "request_processors": [ { "id": "TestSessionDisconnect", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", - "*prefix:~*req.Service-Context-Id:testSessionDisconnect"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:testSessionDisconnect" + ], "flags": ["*initiate", "*accounts","*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", - "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", - "type": "*constant", "value": "call"}, - {"tag": "Account", "path": "Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", - "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", - "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "path": "CGRDebitInterval", - "type": "*constant", "value": "1s"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*variable", + "value": "~*req.Origin-Host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "call" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, + { + "tag": "Subject", + "path": "*cgreq.Subject", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", + "mandatory": true + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "DebitInterval", + "path": "*cgreq.CGRDebitInterval", + "type": "*constant", + "value": "1s" + }, ], "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*notempty:~*cgrep.Error:"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "GrantedUnits", + "path": "*rep.Granted-Service-Unit.CC-Time", "filters": ["*gte:~*cgrep.MaxUsage:0s"], - "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds&*round:0}", "mandatory": true}, + "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 3ad764484..337b751f2 100644 --- a/data/conf/samples/diamagent_internal/voice.json +++ b/data/conf/samples/diamagent_internal/voice.json @@ -5,96 +5,299 @@ "request_processors": [ { "id": "VoiceInit", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", - "*prefix:~*req.Service-Context-Id:voice"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:voice" + ], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*remote_host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "call" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "SubscriberID", + "path": "*cgreq.SubscriberId", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2001" + }, + { + "tag": "GrantedUnits", + "path": "*rep.Granted-Service-Unit.CC-Time", + "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", + "mandatory": true + }, ], }, { "id": "VoiceUpdate", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*prefix:~*req.Service-Context-Id:voice"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:2", + "*prefix:~*req.Service-Context-Id:voice" + ], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", - "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*remote_host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "call" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "LastUsed", + "path": "*cgreq.LastUsed", + "type": "*variable", + "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "SubscriberID", + "path": "*cgreq.SubscriberId", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2001" + }, + { + "tag": "GrantedUnits", + "path": "*rep.Granted-Service-Unit.CC-Time", + "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", + "mandatory": true + }, ], }, { "id": "VoiceTerminate", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:3", - "*prefix:~*req.Service-Context-Id:voice"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:3", + "*prefix:~*req.Service-Context-Id:voice" + ], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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", "path": "LastUsed", "type": "*variable", - "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*remote_host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*cc_usage", + "mandatory": true, + "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m" + }, + { + "tag": "LastUsed", + "path": "*cgreq.LastUsed", + "type": "*variable", + "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "SubscriberID", + "path": "*cgreq.SubscriberId", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.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 11ff41c52..daa4bca47 100644 --- a/data/conf/samples/diamagent_mongo/data.json +++ b/data/conf/samples/diamagent_mongo/data.json @@ -9,113 +9,366 @@ "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*initiate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "tag": "Category", + "path": "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 + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*constant", + "value": "2048" + }, ], "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, ], }, { "id": "data_update_grp1", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", "*prefix:~*req.Service-Context-Id:gprs"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:2", + "*string:~*req.Multiple-Services-Credit-Control.Rating-Group:1", + "*prefix:~*req.Service-Context-Id:gprs" + ], "flags": ["*update", "*accounts","*continue"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", - "value": "~*req.Session-Id", "mandatory": true}, - {"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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"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)]"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "InitialOriginID", + "path": "*cgreq.InitialOriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*composed", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*composed", + "value": "_grp1" + }, + { + "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)]" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "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)]" + }, ], "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, ], }, { "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"], + "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" + ], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", - "value": "~*req.Session-Id", "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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"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)]"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "InitialOriginID", + "path": "*cgreq.InitialOriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "OriginID", + "type": "*composed", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*constant", + "value": "_grp2" + }, + { + "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)]" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "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)]" + }, ], "reply_fields": [ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, ], }, { "id": "data_terminate", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:3", - "*prefix:~*req.Service-Context-Id:gprs"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:3", + "*prefix:~*req.Service-Context-Id:gprs" + ], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", - "value": "~*req.Session-Id", "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", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"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"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*data" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginIDPrefix", + "path": "*cgreq.OriginIDPrefix", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "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)]" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*constant", + "value": "data" + }, + { + "tag": "SetupTime", + "path": "*cgreq.SetupTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "LastUsed", + "path": "*cgreq.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 ce46a31bc..e01b360e0 100644 --- a/data/conf/samples/diamagent_mongo/dryrun.json +++ b/data/conf/samples/diamagent_mongo/dryrun.json @@ -4,35 +4,106 @@ "request_processors": [ { "id": "dryrun1", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.Service-Context-Id:TestDiamItDryRun"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.Service-Context-Id:TestDiamItDryRun" + ], "flags": ["*dryrun","*continue"], "request_fields":[ - {"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", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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", "path": "UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*sms" + }, + { + "tag": "Val1", + "path": "*cgreq.Val1", + "type": "*constant", + "value": "1" + }, + { + "tag": "Val2", + "path": "*cgreq.Val2", + "type": "*constant", + "value": "2" + }, + { + "tag": "Val3", + "path": "*cgreq.Val3", + "type": "*constant", + "value": "3" + }, + { + "tag": "OptionalField", + "path":"*cgreq.OptionalField", + "type":"*variable", + "value":"~*req.Inexistent", + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "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)]" + }, + { + "tag": "UsedUnits2", + "path": "*cgreq.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", "path": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", - "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", - "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2002" + }, + { + "tag": "RatingGroup", + "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", + "type": "*constant", + "value": "1" + }, + { + "tag": "CCTotalOctets1", + "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + "type": "*variable", + "value": "~*cgreq.UsedUnits1" + }, + { + "tag": "GrantedUsage", + "path": "*rep.Granted-Service-Unit.CC-Time", + "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], }, @@ -41,29 +112,85 @@ "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", "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", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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", "path": "UsedUnits2", "type": "*variable", "mandatory": true, - "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, - + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*sms" + }, + { + "tag": "Val1", + "path": "*cgreq.Val1", + "type": "*constant", + "value": "1" + }, + { + "tag": "Val2", + "path": "*cgreq.Val2", + "type": "*constant", + "value": "2" + }, + { + "tag": "Val3", + "path": "*cgreq.Val3", + "type": "*constant", + "value": "3" + }, + { + "tag": "OptionalField", + "path":"*cgreq.OptionalField", + "type":"*variable", + "value":"~*req.Inexistent" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "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)]" + }, + { + "tag": "UsedUnits2", + "path": "*cgreq.UsedUnits2", + "type": "*variable", + "mandatory": true, + "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]" + }, ], "reply_fields":[ - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", - "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", - "type": "*variable", "value": "~*cgreq.UsedUnits2"}, + { + "tag": "RatingGroup", + "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", + "type": "*constant", + "value": "2", + "new_branch": true + }, + { + "tag": "CCTotalOctets2", + "path": "*rep.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 d87a87543..cba51bbaf 100644 --- a/data/conf/samples/diamagent_mongo/message.json +++ b/data/conf/samples/diamagent_mongo/message.json @@ -5,29 +5,83 @@ { "id": "message", - "filters": ["*string:~*vars.*cmd:CCR", "*prefix:~*req.Service-Context-Id:message", - "*string:~*req.CC-Request-Type:4"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*prefix:~*req.Service-Context-Id:message", + "*string:~*req.CC-Request-Type:4" + ], "flags": ["*message", "*accounts", "*cdrs","*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "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", "path": "Destination", "type": "*variable", "mandatory": true, - "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*sms" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "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)]" + }, + { + "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", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.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 0ffae6b30..7c46da38a 100644 --- a/data/conf/samples/diamagent_mongo/simpa.json +++ b/data/conf/samples/diamagent_mongo/simpa.json @@ -5,21 +5,59 @@ "request_processors": [ { "id": "simpa_event", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:4", - "*prefix:~*req.Service-Context-Id:simpa"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:4", + "*prefix:~*req.Service-Context-Id:simpa" + ], "flags": ["*message", "*accounts", "*log"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*generic" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "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)]" + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.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 c788d05e9..402e231f4 100644 --- a/data/conf/samples/diamagent_mongo/tests.json +++ b/data/conf/samples/diamagent_mongo/tests.json @@ -5,39 +5,109 @@ "request_processors": [ { "id": "TestSessionDisconnect", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", - "*prefix:~*req.Service-Context-Id:testSessionDisconnect"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:testSessionDisconnect" + ], "flags": ["*initiate", "*accounts","*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", - "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", - "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", - "type": "*constant", "value": "call"}, - {"tag": "Account", "path": "Account", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", - "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", - "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "path": "CGRDebitInterval", - "type": "*constant", "value": "1s"}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*variable", + "value": "~*req.Origin-Host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*prepaid" + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "call" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, + { + "tag": "Subject", + "path": "*cgreq.Subject", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", + "mandatory": true + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "DebitInterval", + "path": "*cgreq.CGRDebitInterval", + "type": "*constant", + "value": "1s" + }, ], "reply_fields":[ - {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, - {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", + { + "tag": "CCATemplate", + "type": "*template", + "value": "*cca" + }, + { + "tag": "ResultCode", + "filters": ["*notempty:~*cgrep.Error:"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "GrantedUnits", + "path": "*rep.Granted-Service-Unit.CC-Time", "filters": ["*gte:~*cgrep.MaxUsage:0s"], - "type": "*variable", "value": "~*cgrep.MaxUsage{*duration_seconds&*round:0}", "mandatory": true}, + "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 3ad764484..337b751f2 100644 --- a/data/conf/samples/diamagent_mongo/voice.json +++ b/data/conf/samples/diamagent_mongo/voice.json @@ -5,96 +5,299 @@ "request_processors": [ { "id": "VoiceInit", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", - "*prefix:~*req.Service-Context-Id:voice"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:voice" + ], "flags": ["*initiate", "*accounts", "*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*remote_host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "call" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "SubscriberID", + "path": "*cgreq.SubscriberId", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2001" + }, + { + "tag": "GrantedUnits", + "path": "*rep.Granted-Service-Unit.CC-Time", + "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", + "mandatory": true + }, ], }, { "id": "VoiceUpdate", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:2", - "*prefix:~*req.Service-Context-Id:voice"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:2", + "*prefix:~*req.Service-Context-Id:voice" + ], "flags": ["*update", "*accounts", "*attributes"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", - "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", - "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*remote_host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "call" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", "type": "*variable", + "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "LastUsed", + "path": "*cgreq.LastUsed", + "type": "*variable", + "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "SubscriberID", + "path": "*cgreq.SubscriberId", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2001" + }, + { + "tag": "GrantedUnits", + "path": "*rep.Granted-Service-Unit.CC-Time", + "type": "*variable", + "value": "~*cgrep.MaxUsage{*duration_seconds}", + "mandatory": true + }, ], }, { "id": "VoiceTerminate", - "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:3", - "*prefix:~*req.Service-Context-Id:voice"], + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:3", + "*prefix:~*req.Service-Context-Id:voice" + ], "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", - "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", - "mandatory": true}, - {"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", "path": "AnswerTime", "type": "*variable", - "value": "~*req.Event-Timestamp", "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", "path": "LastUsed", "type": "*variable", - "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", - "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*voice" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginHost", + "path": "*cgreq.OriginHost", + "type": "*remote_host", + "mandatory": true + }, + { + "tag": "RequestType", + "path": "*cgreq.RequestType", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Account", + "path": "*cgreq.Account", + "type": "*constant", + "value": "*attributes" + }, + { + "tag": "Destination", + "path": "*cgreq.Destination", + "type": "*variable", + "value": "~*req.Service-Information.IN-Information.Real-Called-Number", + "mandatory": true + }, + { + "tag": "AnswerTime", + "path": "*cgreq.AnswerTime", + "type": "*variable", + "value": "~*req.Event-Timestamp", + "mandatory": true + }, + { + "tag": "Usage", + "path": "*cgreq.Usage", + "type": "*cc_usage", + "mandatory": true, + "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m" + }, + { + "tag": "LastUsed", + "path": "*cgreq.LastUsed", + "type": "*variable", + "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", + "mandatory": true + }, + { + "tag": "SubscriberID", + "path": "*cgreq.SubscriberId", + "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", + "mandatory": true + }, ], "reply_fields":[ - {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + { + "tag": "ResultCode", + "filters": ["*rsr::~*cgrep.Error(!^$)"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.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 368e897c3..55f9f3e40 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", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "path": "Account", "type": "*variable", + {"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}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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","*continue"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"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", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "_grp1"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -68,29 +68,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "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, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*constant", "value": "_grp2"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -100,21 +100,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "*cgreq.OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "*cgreq.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 ce46a31bc..99b5c890d 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","*continue"], "request_fields":[ - {"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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.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", "path": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "*rep.Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], }, @@ -41,28 +41,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", "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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "*rep.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 d87a87543..62f89092b 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", "path": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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 2806ae575..4df22b605 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", "path": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.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 3ad764484..25b164ba6 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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.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 368e897c3..55f9f3e40 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", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "path": "Account", "type": "*variable", + {"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}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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","*continue"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"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", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "_grp1"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -68,29 +68,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "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, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*constant", "value": "_grp2"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -100,21 +100,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "*cgreq.OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "*cgreq.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 ce46a31bc..99b5c890d 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","*continue"], "request_fields":[ - {"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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.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", "path": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "*rep.Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], }, @@ -41,28 +41,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", "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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "*rep.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 d87a87543..62f89092b 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", "path": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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 2806ae575..4df22b605 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", "path": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.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 3ad764484..25b164ba6 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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.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 368e897c3..55f9f3e40 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", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "path": "Account", "type": "*variable", + {"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}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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","*continue"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"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", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "_grp1"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -68,29 +68,29 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "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, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*constant", "value": "_grp2"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -100,21 +100,21 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "*cgreq.OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "*cgreq.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 ce46a31bc..99b5c890d 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","*continue"], "request_fields":[ - {"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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.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", "path": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "*rep.Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], }, @@ -41,28 +41,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", "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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "*rep.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 d87a87543..62f89092b 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", "path": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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 2806ae575..4df22b605 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", "path": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*generic"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.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 3ad764484..25b164ba6 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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.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 a81ca1a1a..5e680de86 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", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", "type": "*constant", "value": "generic"}, - {"tag": "Account", "path": "Account", "type": "*variable", + {"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}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*constant", "value": "2048"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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","*continue"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "mandatory": true}, - {"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", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "_grp1"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -70,30 +70,30 @@ "*string:~*req.Multiple-Services-Credit-Control.Rating-Group[1]:2", "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*update", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "InitialOriginID", "path": "InitialOriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "InitialOriginID", "path": "*cgreq.InitialOriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginID", "path": "OriginID", "type": "*composed", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*composed", "value": "~*req.Session-Id", "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, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*constant", "value": "_grp2"}, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*constant", "value": "2048"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*sum", + {"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)]"}, ], "reply_fields": [ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, ], }, @@ -103,22 +103,22 @@ "*prefix:~*req.Service-Context-Id:gprs"], "flags": ["*terminate", "*accounts"], "request_fields":[ - {"tag": "ToR", "path": "ToR", "type": "*constant", "value": "*data"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*data"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginIDPrefix", "path": "OriginIDPrefix", "type": "*variable", + {"tag": "OriginIDPrefix", "path": "*cgreq.OriginIDPrefix", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*constant", "value": "data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*constant", "value": "data"}, + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*handler", "handler_id": "*sum", + {"tag": "LastUsed", "path": "*cgreq.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 bc3c54845..54e8a5362 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","*continue"], "request_fields":[ - {"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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.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", "path": "Result-Code", "type": "*constant", "value": "2002"}, - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2002"}, + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "1"}, - {"tag": "CCTotalOctets1", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets1", "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", "type": "*variable", "value": "~*cgreq.UsedUnits1"}, - {"tag": "GrantedUsage", "path": "Granted-Service-Unit.CC-Time", "type": "*sum", + {"tag": "GrantedUsage", "path": "*rep.Granted-Service-Unit.CC-Time", "type": "*sum", "value": "~*cgreq.Val1;~*cgreq.Val2;~*cgreq.Val3"}, ], }, @@ -42,29 +42,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", "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", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "Val1", "path": "*cgreq.Val1", "type": "*constant", "value": "1"}, + {"tag": "Val2", "path": "*cgreq.Val2", "type": "*constant", "value": "2"}, + {"tag": "Val3", "path": "*cgreq.Val3", "type": "*constant", "value": "3"}, + {"tag": "OptionalField", "path":"*cgreq.OptionalField", "type":"*variable", "value":"~*req.Inexistent", "mandatory":false}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "UsedUnits1", "path": "UsedUnits1", "type": "*variable", "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)]"}, - {"tag": "UsedUnits2", "path": "UsedUnits2", "type": "*variable", "mandatory": true, + {"tag": "UsedUnits2", "path": "*cgreq.UsedUnits2", "type": "*variable", "mandatory": true, "value": "~*req.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets[~Rating-Group(2)]"}, ], "reply_fields":[ - {"tag": "RatingGroup", "path": "Multiple-Services-Credit-Control.Rating-Group", + {"tag": "RatingGroup", "path": "*rep.Multiple-Services-Credit-Control.Rating-Group", "type": "*constant", "value": "2","new_branch": true}, - {"tag": "CCTotalOctets2", "path": "Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + {"tag": "CCTotalOctets2", "path": "*rep.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 12095fc8e..9a13cefdc 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", "path": "ToR", "type": "*constant", "value": "*sms"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*sms"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", "mandatory": true, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "mandatory": true, "value": "~*req.Service-Information.SMS-Information.Recipient-Address.Address-Data"}, - {"tag": "SetupTime", "path": "SetupTime", "type": "*variable", + {"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + "path": "*rep.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 d96a5ede2..3131f3771 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", "path": "ToR", "type": "*constant", "value": "*generic"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*generic"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "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, + {"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)]"}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*value_exponent", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.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 528cf2127..f65e9144a 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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*variable", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", "value": "~*req.Origin-Host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*prepaid"}, - {"tag": "Category", "path": "Category", + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, - {"tag": "Account", "path": "Account", "type": "*variable", + {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, - {"tag": "Subject", "path": "Subject", "type": "*variable", + {"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Calling-Party-Address", "mandatory": true}, - {"tag": "Destination", "path": "Destination", "type": "*variable", + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "DebitInterval", "path": "CGRDebitInterval", + {"tag": "DebitInterval", "path": "*cgreq.CGRDebitInterval", "type": "*constant", "value": "1s"}, ], "reply_fields":[ {"tag": "CCATemplate", "type": "*template", "value": "*cca"}, {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "GrantedUnits", "path": "Granted-Service-Unit.CC-Time", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "GrantedUnits", "path": "*rep.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 c6acd2245..fffb09720 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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"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", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Category", "path": "*cgreq.Category", "type": "*constant", "value": "call"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*variable", + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.Requested-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "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", + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + {"tag": "GrantedUnits", "path": "*rep.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", "path": "ToR", "type": "*constant", "value": "*voice"}, - {"tag": "*api_key", "path": "*api_key", "type": "*constant", "value": "ses12345"}, - {"tag": "OriginID", "path": "OriginID", "type": "*variable", + {"tag": "ToR", "path": "*cgreq.ToR", "type": "*constant", "value": "*voice"}, + {"tag": "*api_key", "path": "*cgreq.*api_key", "type": "*constant", "value": "ses12345"}, + {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "OriginHost", "type": "*remote_host", + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", "mandatory": true}, - {"tag": "RequestType", "path": "RequestType", "type": "*constant", "value": "*attributes"}, - {"tag": "Account", "path": "Account", "type": "*constant", "value": "*attributes"}, - {"tag": "Destination", "path": "Destination", "type": "*variable", + {"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*constant", "value": "*attributes"}, + {"tag": "Account", "path": "*cgreq.Account", "type": "*constant", "value": "*attributes"}, + {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.Service-Information.IN-Information.Real-Called-Number", "mandatory": true}, - {"tag": "AnswerTime", "path": "AnswerTime", "type": "*variable", + {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.Event-Timestamp", "mandatory": true}, - {"tag": "Usage", "path": "Usage", "type": "*cc_usage", "mandatory": true, + {"tag": "Usage", "path": "*cgreq.Usage", "type": "*cc_usage", "mandatory": true, "value": "~*req.CC-Request-Number;~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/;5m"}, - {"tag": "LastUsed", "path": "LastUsed", "type": "*variable", + {"tag": "LastUsed", "path": "*cgreq.LastUsed", "type": "*variable", "value": "~*req.Used-Service-Unit.CC-Time:s/(.*)/${1}s/", "mandatory": true}, - {"tag": "SubscriberID", "path": "SubscriberId", "type": "*variable", + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true}, ], "reply_fields":[ {"tag": "ResultCode", "filters": ["*rsr::~*cgrep.Error(!^$)"], - "path": "Result-Code", "type": "*constant", "value": "5030", "blocker": true}, - {"tag": "ResultCode", "path": "Result-Code", "type": "*constant", "value": "2001"}, + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, ], }, ],