From 83e8ce3adc8071680d50a92c3211eccb4a575bca Mon Sep 17 00:00:00 2001 From: arberkatellari Date: Fri, 28 Feb 2025 18:09:23 +0200 Subject: [PATCH] Add ability to modify diameter CE answer & replace go-diameter lib --- agents/agentreq_test.go | 6 +- agents/agents_caps_it_test.go | 8 +- agents/diam_empty_ce_it_test.go | 114 +++++ agents/diam_it_test.go | 22 +- agents/diamagent.go | 13 +- agents/diamagent_test.go | 2 +- agents/diambench_test.go | 8 +- agents/diamclient.go | 8 +- agents/libdiam.go | 8 +- agents/libdiam_test.go | 6 +- config/config_defaults.go | 6 + config/config_test.go | 3 + config/diametercfg.go | 15 + config/diametercfg_test.go | 13 +- config/libconfig_json.go | 1 + .../cgrates.json | 71 +++ .../diamagent_internal_supp_apps/cgrates.json | 75 +++ .../diamagent_internal_supp_apps/data.json | 377 +++++++++++++++ .../diamagent_internal_supp_apps/dryrun.json | 200 ++++++++ .../diamagent_internal_supp_apps/message.json | 91 ++++ .../diamagent_internal_supp_apps/mms.json | 91 ++++ .../diamagent_internal_supp_apps/simpa.json | 66 +++ .../diamagent_internal_supp_apps/tests.json | 116 +++++ .../diamagent_internal_supp_apps/voice.json | 438 ++++++++++++++++++ .../wrong_template.json | 103 ++++ go.mod | 4 +- go.sum | 10 +- utils/consts.go | 1 + 28 files changed, 1834 insertions(+), 42 deletions(-) create mode 100644 agents/diam_empty_ce_it_test.go create mode 100644 data/conf/samples/diamagent_internal_empty_apps/cgrates.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/cgrates.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/data.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/dryrun.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/message.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/mms.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/simpa.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/tests.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/voice.json create mode 100644 data/conf/samples/diamagent_internal_supp_apps/wrong_template.json diff --git a/agents/agentreq_test.go b/agents/agentreq_test.go index 9ebcaa0b2..5f5b5b181 100644 --- a/agents/agentreq_test.go +++ b/agents/agentreq_test.go @@ -32,10 +32,10 @@ import ( "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" "github.com/cgrates/radigo" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" "github.com/google/go-cmp/cmp" ) diff --git a/agents/agents_caps_it_test.go b/agents/agents_caps_it_test.go index 507a6c79c..efb52b43b 100644 --- a/agents/agents_caps_it_test.go +++ b/agents/agents_caps_it_test.go @@ -31,11 +31,11 @@ import ( "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" + "github.com/cgrates/go-diameter/diam/dict" "github.com/cgrates/radigo" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" - "github.com/fiorix/go-diameter/v4/diam/dict" "github.com/miekg/dns" ) diff --git a/agents/diam_empty_ce_it_test.go b/agents/diam_empty_ce_it_test.go new file mode 100644 index 000000000..98f270214 --- /dev/null +++ b/agents/diam_empty_ce_it_test.go @@ -0,0 +1,114 @@ +//go:build integration +// +build integration + +/* +Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +Copyright (C) ITsysCOM GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ + +package agents + +import ( + "path" + "testing" + + "github.com/cgrates/cgrates/config" + "github.com/cgrates/cgrates/engine" + "github.com/cgrates/cgrates/utils" +) + +var ( + daCfgPathND, diamConfigDIRND string + daCfgND *config.CGRConfig + diamClntND *DiameterClient + + sTestsDiamND = []func(t *testing.T){ + testDiamEmptyCEItInitCfg, + testDiamEmptyCEItDataDb, + testDiamEmptyCEItResetStorDb, + testDiamEmptyCEItStartEngine, + testDiamEmptyCEItConnectDiameterClient, + testDiamEmptyCEItKillEngine, + } +) + +// Test start here +func TestDiamEmptyCEItTcp(t *testing.T) { + switch *utils.DBType { + case utils.MetaInternal: + diamConfigDIRND = "diamagent_internal_empty_apps" + case utils.MetaMySQL, utils.MetaMongo, utils.MetaPostgres: + t.SkipNow() + default: + t.Fatal("Unknown Database type") + } + for _, stest := range sTestsDiamND { + t.Run(diamConfigDIRND, stest) + } +} + +func testDiamEmptyCEItInitCfg(t *testing.T) { + daCfgPathND = path.Join(*utils.DataDir, "conf", "samples", diamConfigDIRND) + // Init config first + var err error + daCfgND, err = config.NewCGRConfigFromPath(daCfgPathND) + if err != nil { + t.Fatal(err) + } + daCfgND.DataFolderPath = *utils.DataDir // Share DataFolderPath through config towards StoreDb for Flush() + rplyTimeout, _ = utils.ParseDurationWithSecs(*replyTimeout) + if isDispatcherActive { + daCfgND.ListenCfg().RPCJSONListen = ":6012" + } +} + +// Remove data in both rating and accounting db +func testDiamEmptyCEItDataDb(t *testing.T) { + if err := engine.InitDataDb(daCfgND); err != nil { + t.Fatal(err) + } +} + +// Wipe out the cdr database +func testDiamEmptyCEItResetStorDb(t *testing.T) { + if err := engine.InitStorDb(daCfgND); err != nil { + t.Fatal(err) + } +} + +// Start CGR Engine +func testDiamEmptyCEItStartEngine(t *testing.T) { + if _, err := engine.StartEngine(daCfgPathND, 500); err != nil { + t.Fatal(err) + } +} + +func testDiamEmptyCEItConnectDiameterClient(t *testing.T) { + diamClntND, err = NewDiameterClient(daCfgND.DiameterAgentCfg().Listen, + "INTEGRATION_TESTS", + daCfgND.DiameterAgentCfg().OriginRealm, daCfgND.DiameterAgentCfg().VendorID, + daCfgND.DiameterAgentCfg().ProductName, utils.DiameterFirmwareRevision, + daCfgND.DiameterAgentCfg().DictionariesPath, daCfgND.DiameterAgentCfg().ListenNet) + if err.Error() != "missing application" { + t.Fatal(err) + } +} + +func testDiamEmptyCEItKillEngine(t *testing.T) { + if err := engine.KillEngine(1000); err != nil { + t.Error(err) + } +} diff --git a/agents/diam_it_test.go b/agents/diam_it_test.go index 336bffd83..5bdf47dde 100644 --- a/agents/diam_it_test.go +++ b/agents/diam_it_test.go @@ -39,10 +39,10 @@ import ( "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" - "github.com/fiorix/go-diameter/v4/diam/dict" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" + "github.com/cgrates/go-diameter/diam/dict" ) var ( @@ -106,6 +106,20 @@ func TestDiamItTcp(t *testing.T) { } } +func TestDiamItTcpNoDefaults(t *testing.T) { + switch *utils.DBType { + case utils.MetaInternal: + diamConfigDIR = "diamagent_internal_supp_apps" + case utils.MetaMySQL, utils.MetaMongo, utils.MetaPostgres: + t.SkipNow() + default: + t.Fatal("Unknown Database type") + } + for _, stest := range sTestsDiam { + t.Run(diamConfigDIR, stest) + } +} + func TestDiamItDispatcher(t *testing.T) { if *utils.Encoding == utils.MetaGOB { t.SkipNow() diff --git a/agents/diamagent.go b/agents/diamagent.go index 50f8f9d50..870f038a8 100644 --- a/agents/diamagent.go +++ b/agents/diamagent.go @@ -32,12 +32,12 @@ import ( "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/sessions" "github.com/cgrates/cgrates/utils" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" - "github.com/fiorix/go-diameter/v4/diam/dict" - "github.com/fiorix/go-diameter/v4/diam/sm" - "github.com/fiorix/go-diameter/v4/diam/sm/smpeer" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" + "github.com/cgrates/go-diameter/diam/dict" + "github.com/cgrates/go-diameter/diam/sm" + "github.com/cgrates/go-diameter/diam/sm/smpeer" ) const ( @@ -135,6 +135,7 @@ func (da *DiameterAgent) ListenAndServe(stopChan <-chan struct{}) (err error) { // Creates the message handlers func (da *DiameterAgent) handlers() diam.Handler { settings := &sm.Settings{ + SupportedApps: da.cgrCfg.DiameterAgentCfg().CeApplications, OriginHost: datatype.DiameterIdentity(da.cgrCfg.DiameterAgentCfg().OriginHost), OriginRealm: datatype.DiameterIdentity(da.cgrCfg.DiameterAgentCfg().OriginRealm), VendorID: datatype.Unsigned32(da.cgrCfg.DiameterAgentCfg().VendorID), diff --git a/agents/diamagent_test.go b/agents/diamagent_test.go index c4f80f3c5..4daf85ad6 100644 --- a/agents/diamagent_test.go +++ b/agents/diamagent_test.go @@ -29,8 +29,8 @@ import ( "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/sessions" "github.com/cgrates/cgrates/utils" + "github.com/cgrates/go-diameter/diam" "github.com/cgrates/rpcclient" - "github.com/fiorix/go-diameter/v4/diam" ) func TestDAsSessionSClientIface(t *testing.T) { diff --git a/agents/diambench_test.go b/agents/diambench_test.go index 3dd1be0d1..297d1bc36 100644 --- a/agents/diambench_test.go +++ b/agents/diambench_test.go @@ -32,10 +32,10 @@ import ( "github.com/cgrates/birpc/context" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" - "github.com/fiorix/go-diameter/v4/diam/dict" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" + "github.com/cgrates/go-diameter/diam/dict" ) var ( diff --git a/agents/diamclient.go b/agents/diamclient.go index ac5e495c0..0733b44d9 100644 --- a/agents/diamclient.go +++ b/agents/diamclient.go @@ -26,10 +26,10 @@ import ( "time" "github.com/cgrates/cgrates/utils" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" - "github.com/fiorix/go-diameter/v4/diam/sm" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" + "github.com/cgrates/go-diameter/diam/sm" ) var dictOnce sync.Once diff --git a/agents/libdiam.go b/agents/libdiam.go index 2da8d9159..32c7bfd25 100644 --- a/agents/libdiam.go +++ b/agents/libdiam.go @@ -31,10 +31,10 @@ import ( "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" - "github.com/fiorix/go-diameter/v4/diam/dict" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" + "github.com/cgrates/go-diameter/diam/dict" ) func loadDictionaries(dictsDir, componentID string) error { diff --git a/agents/libdiam_test.go b/agents/libdiam_test.go index 62a9b1503..e0e18e01d 100644 --- a/agents/libdiam_test.go +++ b/agents/libdiam_test.go @@ -30,9 +30,9 @@ import ( "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" - "github.com/fiorix/go-diameter/v4/diam" - "github.com/fiorix/go-diameter/v4/diam/avp" - "github.com/fiorix/go-diameter/v4/diam/datatype" + "github.com/cgrates/go-diameter/diam" + "github.com/cgrates/go-diameter/diam/avp" + "github.com/cgrates/go-diameter/diam/datatype" ) func TestLibDiamDPFieldAsInterface(t *testing.T) { diff --git a/config/config_defaults.go b/config/config_defaults.go index 0eb61676f..b8805a708 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -738,6 +738,12 @@ const CGRATES_CFG_JSON = ` "listen": "127.0.0.1:3868", // address where to listen for diameter requests "listen_net": "tcp", // transport type for diameter "dictionaries_path": "/usr/share/cgrates/diameter/dict/", // path towards directory holding additional dictionaries to load + // "ce_applications": [ // list of applications in dictionaries wanted to be included in Capability-Exchange. Written as any of the four below + // "Base", // application name + // "4", // application ID + // "Cisco.4", // vandorName.appID + // "Cisco.Charging Control", // vendorName.app name + // ], "sessions_conns": ["*birpc_internal"], "origin_host": "CGR-DA", // diameter Origin-Host AVP used in replies "origin_realm": "cgrates.org", // diameter Origin-Realm AVP used in replies diff --git a/config/config_test.go b/config/config_test.go index fa42dc2e0..cd3a8d762 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -822,6 +822,9 @@ func TestCgrCfgJSONDefaultsDiameterAgentCfg(t *testing.T) { if !reflect.DeepEqual(cgrCfg.diameterAgentCfg.Listen, testDA.Listen) { t.Errorf("expecting: %+v, received: %+v", cgrCfg.diameterAgentCfg.Listen, testDA.Listen) } + if !reflect.DeepEqual(cgrCfg.diameterAgentCfg.ListenNet, testDA.ListenNet) { + t.Errorf("expecting: %+v, received: %+v", cgrCfg.diameterAgentCfg.ListenNet, testDA.ListenNet) + } if !reflect.DeepEqual(cgrCfg.diameterAgentCfg.DictionariesPath, testDA.DictionariesPath) { t.Errorf("expecting: %+v, received: %+v", cgrCfg.diameterAgentCfg.DictionariesPath, testDA.DictionariesPath) } diff --git a/config/diametercfg.go b/config/diametercfg.go index 6cff613e2..6f27c44bb 100644 --- a/config/diametercfg.go +++ b/config/diametercfg.go @@ -29,6 +29,7 @@ type DiameterAgentCfg struct { ListenNet string // sctp or tcp Listen string // address where to listen for diameter requests DictionariesPath string + CeApplications []string SessionSConns []string OriginHost string OriginRealm string @@ -57,6 +58,10 @@ func (da *DiameterAgentCfg) loadFromJSONCfg(jsnCfg *DiameterAgentJsonCfg, separa if jsnCfg.Dictionaries_path != nil { da.DictionariesPath = *jsnCfg.Dictionaries_path } + if jsnCfg.Ce_applications != nil { + da.CeApplications = make([]string, len(*jsnCfg.Ce_applications)) + copy(da.CeApplications, *jsnCfg.Ce_applications) + } if jsnCfg.Sessions_conns != nil { da.SessionSConns = make([]string, len(*jsnCfg.Sessions_conns)) for idx, attrConn := range *jsnCfg.Sessions_conns { @@ -131,6 +136,12 @@ func (da *DiameterAgentCfg) AsMapInterface(separator string) (initialMP map[stri utils.ForcedDisconnectCfg: da.ForcedDisconnect, } + if da.CeApplications != nil { + apps := make([]string, len(da.CeApplications)) + copy(apps, da.CeApplications) + initialMP[utils.CeApplicationsCfg] = apps + } + requestProcessors := make([]map[string]any, len(da.RequestProcessors)) for i, item := range da.RequestProcessors { requestProcessors[i] = item.AsMapInterface(separator) @@ -168,6 +179,10 @@ func (da DiameterAgentCfg) Clone() (cln *DiameterAgentCfg) { RARTemplate: da.RARTemplate, ForcedDisconnect: da.ForcedDisconnect, } + if da.CeApplications != nil { + cln.CeApplications = make([]string, len(da.CeApplications)) + copy(cln.CeApplications, da.CeApplications) + } if da.SessionSConns != nil { cln.SessionSConns = make([]string, len(da.SessionSConns)) copy(cln.SessionSConns, da.SessionSConns) diff --git a/config/diametercfg_test.go b/config/diametercfg_test.go index f10a369a0..2993427c7 100644 --- a/config/diametercfg_test.go +++ b/config/diametercfg_test.go @@ -30,6 +30,7 @@ func TestDiameterAgentCfgloadFromJsonCfg(t *testing.T) { Enabled: utils.BoolPointer(true), Listen_net: utils.StringPointer("tcp"), Listen: utils.StringPointer("127.0.0.1:3868"), + Ce_applications: utils.SliceStringPointer([]string{"Base"}), Dictionaries_path: utils.StringPointer("/usr/share/cgrates/diameter/dict/"), Sessions_conns: &[]string{utils.MetaInternal, "*conn1"}, Origin_host: utils.StringPointer("CGR-DA"), @@ -51,6 +52,7 @@ func TestDiameterAgentCfgloadFromJsonCfg(t *testing.T) { Enabled: true, ListenNet: "tcp", Listen: "127.0.0.1:3868", + CeApplications: []string{"Base"}, DictionariesPath: "/usr/share/cgrates/diameter/dict/", SessionSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaSessionS), "*conn1"}, OriginHost: "CGR-DA", @@ -121,6 +123,9 @@ func TestDiameterAgentCfgAsMapInterface(t *testing.T) { "enabled": false, "listen": "127.0.0.1:3868", "dictionaries_path": "/usr/share/cgrates/diameter/dict/", + "ce_applications": [ + "Base", + ], "sessions_conns": ["*birpc_internal","*internal", "*conn1"], "origin_host": "CGR-DA", "origin_realm": "cgrates.org", @@ -145,6 +150,7 @@ func TestDiameterAgentCfgAsMapInterface(t *testing.T) { }` eMap := map[string]any{ utils.ASRTemplateCfg: "", + utils.CeApplicationsCfg: []string{"Base"}, utils.DictionariesPathCfg: "/usr/share/cgrates/diameter/dict/", utils.EnabledCfg: false, utils.ForcedDisconnectCfg: "*none", @@ -199,12 +205,16 @@ func TestDiameterAgentCfgAsMapInterface1(t *testing.T) { cfgJSONStr := `{ "diameter_agent": { "enabled": true, - "dictionaries_path": "/usr/share/cgrates/diameter", + "dictionaries_path": "/usr/share/cgrates/diameter", + "ce_applications": [ + "Nokia.4", + ], "synced_conn_requests": false, }, }` eMap := map[string]any{ utils.ASRTemplateCfg: "", + utils.CeApplicationsCfg: []string{"Nokia.4"}, utils.DictionariesPathCfg: "/usr/share/cgrates/diameter", utils.EnabledCfg: true, utils.ForcedDisconnectCfg: "*none", @@ -231,6 +241,7 @@ func TestDiameterAgentCfgClone(t *testing.T) { Enabled: true, ListenNet: "tcp", Listen: "127.0.0.1:3868", + CeApplications: []string{"Base"}, DictionariesPath: "/usr/share/cgrates/diameter/dict/", SessionSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaSessionS), "*conn1"}, OriginHost: "CGR-DA", diff --git a/config/libconfig_json.go b/config/libconfig_json.go index 0255d69c4..6d776a321 100644 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -535,6 +535,7 @@ type DiameterAgentJsonCfg struct { Listen *string Listen_net *string Dictionaries_path *string + Ce_applications *[]string Sessions_conns *[]string Origin_host *string Origin_realm *string diff --git a/data/conf/samples/diamagent_internal_empty_apps/cgrates.json b/data/conf/samples/diamagent_internal_empty_apps/cgrates.json new file mode 100644 index 000000000..c59ed5408 --- /dev/null +++ b/data/conf/samples/diamagent_internal_empty_apps/cgrates.json @@ -0,0 +1,71 @@ +{ +// CGRateS Configuration file +// +// Used for cgradmin +// Starts rater, scheduler + +"general": { + "log_level": 7, + "default_tenant": "cgrates.com", +}, + +"listen": { + "rpc_json": ":2012", // RPC JSON listening address + "rpc_gob": ":2013", // RPC GOB listening address + "http": ":2080", // HTTP listening address +}, + +"data_db": { + "db_type": "*internal", +}, + + +"stor_db": { + "db_type": "*internal", +}, + +"rals": { + "enabled": true, +}, + +"schedulers": { + "enabled": true, +}, + +"cdrs": { + "enabled": true, +}, + +"attributes": { + "enabled": true, +}, + +"chargers": { + "enabled": true, + "attributes_conns": ["*internal"], +}, + + +"sessions": { + "enabled": true, + "attributes_conns": ["*localhost"], + "chargers_conns": ["*localhost"], + "rals_conns": ["*localhost"], + "cdrs_conns": ["*localhost"], +}, + +"diameter_agent": { + "enabled": true, + "ce_applications": [], + "sessions_conns": ["*bijson_localhost"], + "asr_template": "*asr", + "rar_template": "*rar", + "forced_disconnect": "*asr" // the request to send to diameter on DisconnectSession <*none|*asr|*rar> +}, + +"apiers": { + "enabled": true, + "scheduler_conns": ["*internal"], +}, + +} diff --git a/data/conf/samples/diamagent_internal_supp_apps/cgrates.json b/data/conf/samples/diamagent_internal_supp_apps/cgrates.json new file mode 100644 index 000000000..b90f19b06 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/cgrates.json @@ -0,0 +1,75 @@ +{ +// CGRateS Configuration file +// +// Used for cgradmin +// Starts rater, scheduler + +"general": { + "log_level": 7, + "default_tenant": "cgrates.com", +}, + +"listen": { + "rpc_json": ":2012", // RPC JSON listening address + "rpc_gob": ":2013", // RPC GOB listening address + "http": ":2080", // HTTP listening address +}, + +"data_db": { + "db_type": "*internal", +}, + + +"stor_db": { + "db_type": "*internal", +}, + +"rals": { + "enabled": true, +}, + +"schedulers": { + "enabled": true, +}, + +"cdrs": { + "enabled": true, +}, + +"attributes": { + "enabled": true, +}, + +"chargers": { + "enabled": true, + "attributes_conns": ["*internal"], +}, + + +"sessions": { + "enabled": true, + "attributes_conns": ["*localhost"], + "chargers_conns": ["*localhost"], + "rals_conns": ["*localhost"], + "cdrs_conns": ["*localhost"], +}, + +"diameter_agent": { + "enabled": true, + "ce_applications": [ + "Charging Control", + "1", + "Metaswitch Networks Ltd.4", + ], + "sessions_conns": ["*bijson_localhost"], + "asr_template": "*asr", + "rar_template": "*rar", + "forced_disconnect": "*asr" // the request to send to diameter on DisconnectSession <*none|*asr|*rar> +}, + +"apiers": { + "enabled": true, + "scheduler_conns": ["*internal"], +}, + +} diff --git a/data/conf/samples/diamagent_internal_supp_apps/data.json b/data/conf/samples/diamagent_internal_supp_apps/data.json new file mode 100644 index 000000000..9066f4254 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/data.json @@ -0,0 +1,377 @@ + +{ + +"diameter_agent": { + "request_processors": [ + + { + "id": "data_init", + "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": "*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": ["*notempty:~*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" + ], + "flags": ["*update", "*accounts","*continue"], + "request_fields":[ + { + "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": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "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": ["*notempty:~*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" + ], + "flags": ["*update", "*accounts"], + "request_fields":[ + { + "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": "*variable", + "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": ["*notempty:~*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" + ], + "flags": ["*terminate", "*accounts"], + "request_fields":[ + { + "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_supp_apps/dryrun.json b/data/conf/samples/diamagent_internal_supp_apps/dryrun.json new file mode 100644 index 000000000..2323e3f42 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/dryrun.json @@ -0,0 +1,200 @@ +{ + +"diameter_agent": { + "request_processors": [ + { + "id": "dryrun1", + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.Service-Context-Id:TestDiamItDryRun" + ], + "flags": ["*dryrun","*continue"], + "request_fields":[ + { + "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": "*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"}, + ], + }, + { + "id": "dryrun2", + "filters": ["*notempty:~*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": "*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": "*rep.Multiple-Services-Credit-Control.Rating-Group", + "type": "*group", + "value": "2", + "new_branch": true + }, + { + "tag": "CCTotalOctets2", + "path": "*rep.Multiple-Services-Credit-Control.Used-Service-Unit.CC-Total-Octets", + "type": "*group", + "value": "~*cgreq.UsedUnits2" + }, + ], + }, + + ], +}, + +} \ No newline at end of file diff --git a/data/conf/samples/diamagent_internal_supp_apps/message.json b/data/conf/samples/diamagent_internal_supp_apps/message.json new file mode 100644 index 000000000..784707957 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/message.json @@ -0,0 +1,91 @@ +{ + +"diameter_agent": { + "request_processors": [ + + { + "id": "message", + "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": "*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": ["*notempty:~*cgrep.Error:"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + ], + }, + + ], +}, + +} \ No newline at end of file diff --git a/data/conf/samples/diamagent_internal_supp_apps/mms.json b/data/conf/samples/diamagent_internal_supp_apps/mms.json new file mode 100644 index 000000000..4ec65e707 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/mms.json @@ -0,0 +1,91 @@ +{ + + "diameter_agent": { + "request_processors": [ + + { + "id": "mms", + "filters": [ + "*string:~*vars.*cmd:CCR", + "*prefix:~*req.Service-Context-Id:mms", + "*string:~*req.CC-Request-Type:4" + ], + "flags": ["*message", "*accounts", "*cdrs","*attributes"], + "request_fields":[ + { + "tag": "ToR", + "path": "*cgreq.ToR", + "type": "*constant", + "value": "*mms" + }, + { + "tag": "OriginID", + "path": "*cgreq.OriginID", + "type": "*variable", + "value": "~*req.Session-Id", + "mandatory": true + }, + { + "tag": "Category", + "path": "*cgreq.Category", + "type": "*constant", + "value": "mms" + }, + { + "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": ["*notempty:~*cgrep.Error:"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + ], + }, + + ], + }, + + } \ No newline at end of file diff --git a/data/conf/samples/diamagent_internal_supp_apps/simpa.json b/data/conf/samples/diamagent_internal_supp_apps/simpa.json new file mode 100644 index 000000000..7c46da38a --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/simpa.json @@ -0,0 +1,66 @@ + +{ + +"diameter_agent": { + "request_processors": [ + { + "id": "simpa_event", + "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": "*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" + }, + ], + }, + ], +}, + +} \ No newline at end of file diff --git a/data/conf/samples/diamagent_internal_supp_apps/tests.json b/data/conf/samples/diamagent_internal_supp_apps/tests.json new file mode 100644 index 000000000..40fa2cded --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/tests.json @@ -0,0 +1,116 @@ + +{ + +"diameter_agent": { + "request_processors": [ + { + "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": "*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": "*opts.*sessionsDebitInterval", + "type": "*constant", + "value": "1s" + }, + ], + "reply_fields":[ + { + "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 + }, + ], + }, + ], +}, + +} \ No newline at end of file diff --git a/data/conf/samples/diamagent_internal_supp_apps/voice.json b/data/conf/samples/diamagent_internal_supp_apps/voice.json new file mode 100644 index 000000000..7029c1d89 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/voice.json @@ -0,0 +1,438 @@ + +{ + +"diameter_agent": { + "request_processors": [ + { + "id": "VoiceInitForceDuration", + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:forceDurationVoice" + ], + "flags": ["*initiate", "*fd", "*accounts", "*attributes"], + "request_fields":[ + { + "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": "~*vars.RemoteHost", + "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": ["*notempty:~*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": "VoiceInit", + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:voice" + ], + "flags": ["*initiate", "*accounts", "*attributes", "*continue"], + "request_fields":[ + { + "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": "~*vars.RemoteHost", + "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": ["*notempty:~*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": "VoiceTerminateEmulate", + "filters": ["*string:~*vars.*cmd:CCR", "*string:~*req.CC-Request-Type:1", + "*prefix:~*req.Service-Context-Id:voice","*eq:~*cgrep.MaxUsage:0"], + "flags": ["*terminate", "*accounts", "*attributes"], + "request_fields":[ + {"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": "~*vars.RemoteHost", "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": "0s", "mandatory": true}, + {"tag": "SubscriberID", "path": "*cgreq.SubscriberId", "type": "*variable", + "value": "~*req.Subscription-Id.Subscription-Id-Data", "mandatory": true} + ], + "reply_fields":[ + {"tag": "ResultCode", "filters": ["*notempty:~*cgrep.Error:"], + "path": "*rep.Result-Code", "type": "*constant", "value": "5030", "blocker": true}, + {"tag": "ResultCode", "path": "*rep.Result-Code", "type": "*constant", "value": "2001"}, + ], + }, + { + "id": "VoiceUpdate", + "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": "*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": "~*vars.RemoteHost", + "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": ["*notempty:~*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" + ], + "flags": ["*terminate", "*accounts", "*attributes", "*cdrs"], + "request_fields":[ + { + "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": "~*vars.RemoteHost", + "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": ["*notempty:~*cgrep.Error:"], + "path": "*rep.Result-Code", + "type": "*constant", + "value": "5030", + "blocker": true + }, + { + "tag": "ResultCode", + "path": "*rep.Result-Code", + "type": "*constant", + "value": "2001" + }, + ], + }, + ], +}, + +} \ No newline at end of file diff --git a/data/conf/samples/diamagent_internal_supp_apps/wrong_template.json b/data/conf/samples/diamagent_internal_supp_apps/wrong_template.json new file mode 100644 index 000000000..8fd1b6cd7 --- /dev/null +++ b/data/conf/samples/diamagent_internal_supp_apps/wrong_template.json @@ -0,0 +1,103 @@ +{ + + +"diameter_agent": { + "request_processors": [ + { // this request proccessor is only used to test that an error message + // is sent if one is raised when proccesing the request + "id": "ErrorProcessing", + "filters": [ + "*string:~*vars.*cmd:CCR", + "*string:~*req.CC-Request-Type:4", + "*prefix:~*req.Service-Context-Id:error" + ], + "flags": ["*event", "*accounts"], + "request_fields":[ + { + "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": "CCATemplate", "type": "*template", "value": "*cca"}, + { + "tag": "GrantedUnitsError", + "path": "*rep.Granted-Service-Unit.CC-Total", // this should return a error because it expect an unsigned integer + "type": "*constant", "blocker": true, + "value": "-10" + }, + { + "tag": "ResultCode","path": "*rep.Result-Code", + "filters": ["*eq:~*cgrep.MaxUsage[*raw]:0"], + "type": "*constant", "value": "4012", + "blocker": true + }, + { + "tag": "ResultCode", "path": "*rep.Result-Code", + "filters": ["*notempty:~*cgrep.Error:"], + "type": "*constant", "value": "5030", + "blocker": true + } + ] + } + + ] +} + +} \ No newline at end of file diff --git a/go.mod b/go.mod index 1c6286f4f..7693a9458 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/cgrates/birpc v1.3.1-0.20211117095917-5b0ff29f3084 github.com/cgrates/cron v0.0.0-20201129173550-63ea3d835706 github.com/cgrates/fsock v0.0.0-20241217115946-62b079e0b9bc + github.com/cgrates/go-diameter v0.0.0-20250228104837-c21fdf924ab5 github.com/cgrates/janusgo v0.0.0-20240503152118-188a408d7e73 github.com/cgrates/kamevapi v0.0.0-20240307160311-26273f03eedf github.com/cgrates/ltcache v0.0.0-20240411152156-e673692056db @@ -33,7 +34,6 @@ require ( github.com/elastic/elastic-transport-go/v8 v8.6.0 github.com/elastic/go-elasticsearch/v8 v8.14.0 github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 - github.com/fiorix/go-diameter/v4 v4.0.4 github.com/fsnotify/fsnotify v1.7.0 github.com/go-sql-driver/mysql v1.8.1 github.com/google/go-cmp v0.6.0 @@ -111,7 +111,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect - github.com/ishidawataru/sctp v0.0.0-20190922091402-408ec287e38c // indirect + github.com/ishidawataru/sctp v0.0.0-20230406120618-7ff4192f6ff2 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/pgx/v5 v5.6.0 // indirect diff --git a/go.sum b/go.sum index 809109505..0a29c7210 100644 --- a/go.sum +++ b/go.sum @@ -79,6 +79,8 @@ github.com/cgrates/cron v0.0.0-20201129173550-63ea3d835706 h1:5HOoV63Xcbnx9q6ykn github.com/cgrates/cron v0.0.0-20201129173550-63ea3d835706/go.mod h1:I9cUDn/uzkakr0hmYTjXkQqf6wagg44L2p01gSYRRz0= github.com/cgrates/fsock v0.0.0-20241217115946-62b079e0b9bc h1:o3netbyzb+nSJh4/uDXm2mets7NATe9pWWeaqDmyfpY= github.com/cgrates/fsock v0.0.0-20241217115946-62b079e0b9bc/go.mod h1:bKByLko2HF33K+PbiiToAgevrrbr96C+7Pp3HGS6oag= +github.com/cgrates/go-diameter v0.0.0-20250228104837-c21fdf924ab5 h1:gqD+fcj7eIywXTVG0twRCYjPK+bVCC7kEx9xNBLq/4Y= +github.com/cgrates/go-diameter v0.0.0-20250228104837-c21fdf924ab5/go.mod h1:Vfjo2o1DEmpI+csUo3cYRpCzfM9DajXZ8CR73MNeNh4= github.com/cgrates/janusgo v0.0.0-20240503152118-188a408d7e73 h1:7AYhvpegrSkY9tLGCQsZgNl8yTjL5CaQOTr3/kYlPek= github.com/cgrates/janusgo v0.0.0-20240503152118-188a408d7e73/go.mod h1:XBQDDjrIn+RCS4PDApYjTWwdp51NbqYfUGAYtzSB5ag= github.com/cgrates/kamevapi v0.0.0-20240307160311-26273f03eedf h1:GbMJzvtwdX1OCEmsqSts/cRCIcIMvo8AYtC2dQExWlg= @@ -116,8 +118,6 @@ github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731 h1:R/ZjJpjQK github.com/ericlagergren/decimal v0.0.0-20240411145413-00de7ca16731/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fiorix/go-diameter/v4 v4.0.4 h1:/nw5zEmEW7pmP9YUYjOfU1GomR0LupKdYy52yd1j3NM= -github.com/fiorix/go-diameter/v4 v4.0.4/go.mod h1:Qx/+pf+c9sBUHWq1d7EH3bkdwN8U0mUpdy9BieDw6UQ= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -179,8 +179,8 @@ github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ishidawataru/sctp v0.0.0-20190922091402-408ec287e38c h1:PwVcPU2rqkJIG0Lz/UGbGcbfi/HhEbOIId+w4xkbGHQ= -github.com/ishidawataru/sctp v0.0.0-20190922091402-408ec287e38c/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= +github.com/ishidawataru/sctp v0.0.0-20230406120618-7ff4192f6ff2 h1:i2fYnDurfLlJH8AyyMOnkLHnHeP8Ff/DDpuZA/D3bPo= +github.com/ishidawataru/sctp v0.0.0-20230406120618-7ff4192f6ff2/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= @@ -325,7 +325,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -416,7 +415,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= diff --git a/utils/consts.go b/utils/consts.go index a83d9c09b..8a82ab8ba 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -2384,6 +2384,7 @@ const ( ListenersCfg = "listeners" ListenCfg = "listen" DictionariesPathCfg = "dictionaries_path" + CeApplicationsCfg = "ce_applications" OriginHostCfg = "origin_host" OriginRealmCfg = "origin_realm" VendorIDCfg = "vendor_id"