From faf1fba125d502cabb82ae16d8f92dafc1bf7604 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 5 Jul 2021 17:20:34 +0300 Subject: [PATCH] Refactored EventRequest --- agents/agentreq.go | 6 -- agents/diamagent_test.go | 4 +- agents/libdiam.go | 5 - agents/libdns.go | 6 -- agents/libhttpagent.go | 11 --- agents/librad.go | 7 -- apier/v1/config_it_test.go | 1 - config/config.go | 2 +- config/config_defaults.go | 1 - config/config_json_test.go | 1 - config/config_test.go | 8 +- config/eescfg.go | 8 -- config/eescfg_test.go | 35 ------- config/fwvdp.go | 6 -- config/fwvdp_test.go | 8 -- config/libconfig_json.go | 1 - config/objdp.go | 6 -- config/objdp_test.go | 13 --- config/slicedp.go | 6 -- config/slicedp_test.go | 8 -- config/xmldp.go | 6 -- config/xmldp_test.go | 8 -- data/conf/cgrates/cgrates.json | 1 - .../samples/actions_internal/cgradmin.json | 5 - .../actions_internal_gob/cgradmin.json | 5 - data/conf/samples/actions_mongo/cgradmin.json | 5 - .../samples/actions_mongo_gob/cgradmin.json | 5 - data/conf/samples/actions_mysql/cgradmin.json | 5 - .../samples/actions_mysql_gob/cgradmin.json | 5 - .../samples/cdrsexport_internal/cgrates.json | 6 -- .../samples/cdrsexport_mongo/cgrates.json | 6 -- .../samples/cdrsexport_mysql/cgrates.json | 6 -- .../cdrsreplicationmaster.json | 5 - .../cdrsreplicationmaster.json | 5 - .../samples/cdrsv1processevent/cgrates.json | 1 - .../cdrsv1processeventmongo/cgrates.json | 1 - .../cdrsv1processeventmysql/cgrates.json | 1 - .../cdrsv_failover_internal/cgrates.json | 1 - .../samples/cdrsv_failover_mongo/cgrates.json | 1 - .../samples/cdrsv_failover_mysql/cgrates.json | 1 - .../samples/diamagent_internal/voice.json | 16 +-- .../diamagent_internal_gobbirpc/voice.json | 16 +-- .../diamagent_internal_jsonbirpc/voice.json | 16 +-- data/conf/samples/diamagent_mongo/voice.json | 16 +-- .../diamagent_mongo_gobbirpc/voice.json | 16 +-- .../diamagent_mongo_jsonbirpc/voice.json | 16 +-- data/conf/samples/diamagent_mysql/voice.json | 16 +-- .../diamagent_mysql_gobbirpc/voice.json | 16 +-- .../diamagent_mysql_jsonbirpc/voice.json | 16 +-- .../samples/diamsctpagent_internal/voice.json | 19 ++-- .../samples/diamsctpagent_mongo/voice.json | 19 ++-- .../samples/diamsctpagent_mysql/voice.json | 19 ++-- .../samples/dispatchers/diamagent/voice.json | 19 ++-- .../dispatchers/radagent/accounting.json | 6 +- data/conf/samples/ees/cgrates.json | 15 --- data/conf/samples/ees_internal/cgrates.json | 3 - data/conf/samples/ees_mongo/cgrates.json | 3 - data/conf/samples/ees_mysql/cgrates.json | 3 - .../samples/httpagent_internal/httpagent.json | 4 +- .../httpagent_internal_gob/httpagent.json | 4 +- .../samples/httpagent_mongo/httpagent.json | 4 +- .../httpagent_mongo_gob/httpagent.json | 4 +- .../samples/httpagent_mysql/httpagent.json | 4 +- .../httpagent_mysql_gob/httpagent.json | 4 +- .../httpagent_mysql_test/httpagent.json | 4 +- .../httpagenttls_internal/httpagent.json | 4 +- .../httpagenttls_internal_gob/httpagent.json | 4 +- .../samples/httpagenttls_mongo/httpagent.json | 4 +- .../httpagenttls_mongo_gob/httpagent.json | 4 +- .../samples/httpagenttls_mysql/httpagent.json | 4 +- .../httpagenttls_mysql_gob/httpagent.json | 4 +- .../samples/radagent_internal/accounting.json | 6 +- .../radagent_internal_gob/accounting.json | 6 +- .../samples/radagent_mongo/accounting.json | 6 +- .../radagent_mongo_gob/accounting.json | 6 +- .../samples/radagent_mysql/accounting.json | 6 +- .../radagent_mysql_gob/accounting.json | 6 +- data/conf/samples/tutmongo2/cgrates.json | 1 - data/conf/samples/tutmongo2_gob/cgrates.json | 1 - docs/diamagent.rst | 3 - docs/ers.rst | 3 - ees/ees.go | 3 - ees/ees_test.go | 1 - ees/elastic.go | 16 +-- ees/filecsv.go | 36 ++++--- ees/filefwv.go | 36 ++++--- ees/httpjsonmap.go | 31 +++--- ees/httppost.go | 29 +++--- ees/posterjsonmap.go | 16 +-- ees/sql.go | 16 +-- ees/virtualee.go | 12 +-- engine/account.go | 6 -- engine/action.go | 6 -- engine/attributes.go | 2 - engine/calldesc.go | 6 -- engine/caps.go | 2 - engine/caps_test.go | 3 - engine/dynamicdp.go | 9 -- engine/eventcost.go | 6 -- engine/eventcost_test.go | 7 -- engine/eventrequest.go | 99 ++++++++----------- engine/eventrequest_test.go | 46 ++------- engine/mapevent.go | 5 - engine/mapevent_test.go | 7 -- engine/safevent.go | 8 -- engine/safevent_test.go | 7 -- engine/task.go | 6 -- engine/task_test.go | 10 -- ers/ers.go | 11 ++- loaders/libloader.go | 6 -- loaders/libloader_test.go | 12 --- utils/consts.go | 2 - utils/dataprovider.go | 2 - utils/mapstorage.go | 6 -- utils/mapstorage_test.go | 8 -- utils/orderednavigablemap.go | 6 -- utils/orderednavigablemap_test.go | 8 -- 117 files changed, 339 insertions(+), 721 deletions(-) diff --git a/agents/agentreq.go b/agents/agentreq.go index 327540bfd..cd818066b 100644 --- a/agents/agentreq.go +++ b/agents/agentreq.go @@ -20,7 +20,6 @@ package agents import ( "fmt" - "net" "strings" "github.com/cgrates/cgrates/config" @@ -96,11 +95,6 @@ func (ar *AgentRequest) String() string { return utils.ToIJSON(ar) } -// RemoteHost implements utils.DataProvider -func (ar *AgentRequest) RemoteHost() net.Addr { - return ar.Request.RemoteHost() -} - // FieldAsInterface implements utils.DataProvider func (ar *AgentRequest) FieldAsInterface(fldPath []string) (val interface{}, err error) { switch fldPath[0] { diff --git a/agents/diamagent_test.go b/agents/diamagent_test.go index 4f26b140d..b86255607 100644 --- a/agents/diamagent_test.go +++ b/agents/diamagent_test.go @@ -81,7 +81,8 @@ func TestProcessRequest(t *testing.T) { Type: utils.MetaComposed, Path: utils.MetaCgreq + utils.NestingSep + utils.OriginID, Value: config.NewRSRParsersMustCompile("~*req.SessionId", utils.InfieldSep), Mandatory: true}, {Tag: utils.OriginHost, - Type: utils.MetaRemoteHost, Path: utils.MetaCgreq + utils.NestingSep + utils.OriginHost, Mandatory: true}, + Type: utils.MetaVariable, Path: utils.MetaCgreq + utils.NestingSep + utils.OriginHost, + Value: config.NewRSRParsersMustCompile("~*vars.RemoteHost", utils.InfieldSep), Mandatory: true}, {Tag: utils.Category, Type: utils.MetaConstant, Path: utils.MetaCgreq + utils.NestingSep + utils.Category, Value: config.NewRSRParsersMustCompile(utils.Call, utils.InfieldSep)}, @@ -118,6 +119,7 @@ func TestProcessRequest(t *testing.T) { utils.MetaApp: utils.NewLeafNode("appName"), utils.MetaAppID: utils.NewLeafNode("appID"), utils.MetaCmd: utils.NewLeafNode("cmdR"), + utils.RemoteHost: utils.NewLeafNode(utils.LocalAddr().String()), }} sS := &testMockSessionConn{calls: map[string]func(arg interface{}, rply interface{}) error{ diff --git a/agents/libdiam.go b/agents/libdiam.go index 54207246d..66cee7f80 100644 --- a/agents/libdiam.go +++ b/agents/libdiam.go @@ -317,11 +317,6 @@ func (dP *diameterDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of utils.DataProvider interface -func (dP *diameterDP) RemoteHost() net.Addr { - return utils.NewNetAddr(dP.c.RemoteAddr().Network(), dP.c.RemoteAddr().String()) -} - // FieldAsInterface is part of utils.DataProvider interface func (dP *diameterDP) FieldAsInterface(fldPath []string) (data interface{}, err error) { if data, err = dP.cache.FieldAsInterface(fldPath); err != nil { diff --git a/agents/libdns.go b/agents/libdns.go index 3fc9932c1..4c73b95a0 100644 --- a/agents/libdns.go +++ b/agents/libdns.go @@ -21,7 +21,6 @@ package agents import ( "errors" "fmt" - "net" "strings" "github.com/cgrates/cgrates/utils" @@ -88,11 +87,6 @@ func (dP *dnsDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of utils.DataProvider interface -func (dP *dnsDP) RemoteHost() net.Addr { - return utils.NewNetAddr(dP.w.RemoteAddr().Network(), dP.w.RemoteAddr().String()) -} - // FieldAsInterface is part of utils.DataProvider interface func (dP *dnsDP) FieldAsInterface(fldPath []string) (data interface{}, err error) { if data, err = dP.cache.FieldAsInterface(fldPath); err != nil { diff --git a/agents/libhttpagent.go b/agents/libhttpagent.go index 7bbc8ef63..69b40a321 100644 --- a/agents/libhttpagent.go +++ b/agents/libhttpagent.go @@ -22,7 +22,6 @@ import ( "encoding/xml" "fmt" "io" - "net" "net/http" "net/http/httputil" "strconv" @@ -93,11 +92,6 @@ func (hU *httpUrlDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of utils.DataProvider interface -func (hU *httpUrlDP) RemoteHost() net.Addr { - return utils.NewNetAddr("TCP", hU.req.RemoteAddr) -} - func newHTTPXmlDP(req *http.Request) (dP utils.DataProvider, err error) { byteData, err := io.ReadAll(req.Body) if err != nil { @@ -179,11 +173,6 @@ func (hU *httpXmlDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of utils.DataProvider interface -func (hU *httpXmlDP) RemoteHost() net.Addr { - return utils.NewNetAddr("TCP", hU.addr) -} - // httpAgentReplyEncoder will encode []*engine.NMElement // and write content to http writer type httpAgentReplyEncoder interface { diff --git a/agents/librad.go b/agents/librad.go index 1956394ff..564e8409c 100644 --- a/agents/librad.go +++ b/agents/librad.go @@ -19,8 +19,6 @@ along with this program. If not, see package agents import ( - "net" - "github.com/cgrates/cgrates/utils" "github.com/cgrates/radigo" ) @@ -100,11 +98,6 @@ func (pk *radiusDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of utils.DataProvider interface -func (pk *radiusDP) RemoteHost() net.Addr { - return utils.NewNetAddr(pk.req.RemoteAddr().Network(), pk.req.RemoteAddr().String()) -} - //radauthReq is used to authorize a request based on flags func radauthReq(flags utils.FlagsWithParams, req *radigo.Packet, aReq *AgentRequest, rpl *radigo.Packet) (bool, error) { // try to get UserPassword from Vars as slice of NMItems diff --git a/apier/v1/config_it_test.go b/apier/v1/config_it_test.go index a119db97c..976ac9da6 100644 --- a/apier/v1/config_it_test.go +++ b/apier/v1/config_it_test.go @@ -380,7 +380,6 @@ func testConfigSSetConfigEEs(t *testing.T) { "flags": []interface{}{}, "id": "*default", "synchronous": false, - "tenant": "", "timezone": "", "type": "*none", "opts": map[string]interface{}{}, diff --git a/config/config.go b/config/config.go index da6f8192e..d8469b78b 100644 --- a/config/config.go +++ b/config/config.go @@ -1963,7 +1963,7 @@ func (cfg *CGRConfig) reloadDPCache(sections ...string) { } // GetDataProvider returns the config as a data provider interface -func (cfg *CGRConfig) GetDataProvider() utils.DataProvider { +func (cfg *CGRConfig) GetDataProvider() utils.MapStorage { cfg.cacheDPMux.RLock() val, has := cfg.cacheDP[utils.MetaAll] cfg.cacheDPMux.RUnlock() diff --git a/config/config_defaults.go b/config/config_defaults.go index c536597e9..b1db0ca2b 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -554,7 +554,6 @@ const CGRATES_CFG_JSON = ` // "natsClientCertificate": "", // the path to a client certificate( used by tls) // "natsClientKey": "", // the path to a client key( used by tls) }, // extra options for exporter - "tenant": "", // tenant used in filterS.Pass "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing diff --git a/config/config_json_test.go b/config/config_json_test.go index 41dd55d75..56c4d5b7e 100644 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -1842,7 +1842,6 @@ func TestDfEventExporterCfg(t *testing.T) { Type: utils.StringPointer(utils.MetaNone), Export_path: utils.StringPointer("/var/spool/cgrates/ees"), Attribute_context: utils.StringPointer(utils.EmptyString), - Tenant: utils.StringPointer(utils.EmptyString), Timezone: utils.StringPointer(utils.EmptyString), Filters: &[]string{}, Attribute_ids: &[]string{}, diff --git a/config/config_test.go b/config/config_test.go index b22fa4649..2f6206994 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -2397,7 +2397,6 @@ func TestEEsNoLksConfig(t *testing.T) { { ID: utils.MetaDefault, Type: utils.MetaNone, - Tenant: nil, ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, @@ -4320,7 +4319,6 @@ func TestV1GetConfigSectionEES(t *testing.T) { utils.TypeCfg: utils.MetaNone, utils.ExportPathCfg: "/var/spool/cgrates/ees", utils.OptsCfg: map[string]interface{}{}, - utils.TenantCfg: utils.EmptyString, utils.TimezoneCfg: utils.EmptyString, utils.FiltersCfg: []string{}, utils.FlagsCfg: []string{}, @@ -5021,7 +5019,7 @@ func TestV1GetConfigAsJSONApierS(t *testing.T) { func TestV1GetConfigAsJSONCfgEES(t *testing.T) { var reply string - expected := `{"ees":{"attributes_conns":[],"cache":{"*file_csv":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"export_path":"/var/spool/cgrates/ees","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"tenant":"","timezone":"","type":"*none"}]}}` + expected := `{"ees":{"attributes_conns":[],"cache":{"*file_csv":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"export_path":"/var/spool/cgrates/ees","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"timezone":"","type":"*none"}]}}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(&SectionWithAPIOpts{Section: EEsJson}, &reply); err != nil { t.Error(err) @@ -5200,7 +5198,7 @@ func TestV1GetConfigAsJSONAllConfig(t *testing.T) { } }` var reply string - expected := `{"analyzers":{"cleanup_interval":"1h0m0s","db_path":"/var/spool/cgrates/analyzers","enabled":false,"index_type":"*scorch","ttl":"24h0m0s"},"apiban":{"enabled":false,"keys":[]},"apiers":{"attributes_conns":[],"caches_conns":["*internal"],"ees_conns":[],"enabled":false,"scheduler_conns":[]},"asterisk_agent":{"asterisk_conns":[{"address":"127.0.0.1:8088","alias":"","connect_attempts":3,"password":"CGRateS.org","reconnects":5,"user":"cgrates"}],"create_cdr":false,"enabled":false,"sessions_conns":["*birpc_internal"]},"attributes":{"any_context":true,"apiers_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"process_runs":1,"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"caches":{"partitions":{"*account_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*apiban":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2m0s"},"*attribute_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*attribute_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*caps_events":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*cdr_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10m0s"},"*cdrs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*closed_sessions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*diameter_messages":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*dispatcher_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_loads":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*event_charges":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*event_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*load_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*replication_hosts":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_connections":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_responses":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2s"},"*session_costs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stat_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueue_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueues":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stir":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*threshold_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*threshold_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_account_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destination_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*uch":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*versions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""}},"replication_conns":[]},"cdrs":{"attributes_conns":[],"chargers_conns":[],"ees_conns":[],"enabled":false,"extra_fields":[],"online_cdr_exports":[],"rals_conns":[],"scheduler_conns":[],"session_cost_retries":5,"stats_conns":[],"store_cdrs":true,"thresholds_conns":[]},"chargers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"configs":{"enabled":false,"root_dir":"/var/spool/cgrates/configs","url":"/configs/"},"cores":{"caps":0,"caps_stats_interval":"0","caps_strategy":"*busy","shutdown_timeout":"1s"},"data_db":{"db_host":"127.0.0.1","db_name":"10","db_password":"","db_port":6379,"db_type":"*redis","db_user":"cgrates","items":{"*account_action_plans":{"remote":false,"replicate":false},"*accounts":{"remote":false,"replicate":false},"*action_plans":{"remote":false,"replicate":false},"*action_triggers":{"remote":false,"replicate":false},"*actions":{"remote":false,"replicate":false},"*attribute_profiles":{"remote":false,"replicate":false},"*charger_profiles":{"remote":false,"replicate":false},"*destinations":{"remote":false,"replicate":false},"*dispatcher_hosts":{"remote":false,"replicate":false},"*dispatcher_profiles":{"remote":false,"replicate":false},"*filters":{"remote":false,"replicate":false},"*indexes":{"remote":false,"replicate":false},"*load_ids":{"remote":false,"replicate":false},"*rating_plans":{"remote":false,"replicate":false},"*rating_profiles":{"remote":false,"replicate":false},"*resource_profiles":{"remote":false,"replicate":false},"*resources":{"remote":false,"replicate":false},"*reverse_destinations":{"remote":false,"replicate":false},"*route_profiles":{"remote":false,"replicate":false},"*shared_groups":{"remote":false,"replicate":false},"*statqueue_profiles":{"remote":false,"replicate":false},"*statqueues":{"remote":false,"replicate":false},"*threshold_profiles":{"remote":false,"replicate":false},"*thresholds":{"remote":false,"replicate":false},"*timings":{"remote":false,"replicate":false}},"opts":{"mongoQueryTimeout":"10s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0","redisClusterSync":"5s","redisSentinel":"","redisTLS":false},"remote_conn_id":"","remote_conns":[],"replication_cache":"","replication_conns":[],"replication_filtered":false},"diameter_agent":{"asr_template":"","concurrent_requests":-1,"dictionaries_path":"/usr/share/cgrates/diameter/dict/","enabled":false,"forced_disconnect":"*none","listen":"127.0.0.1:3868","listen_net":"tcp","origin_host":"CGR-DA","origin_realm":"cgrates.org","product_name":"CGRateS","rar_template":"","request_processors":[],"sessions_conns":["*birpc_internal"],"synced_conn_requests":false,"vendor_id":0},"dispatchers":{"any_subsystem":true,"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"dns_agent":{"enabled":false,"listen":"127.0.0.1:2053","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"],"timezone":""},"ees":{"attributes_conns":[],"cache":{"*file_csv":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"export_path":"/var/spool/cgrates/ees","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"tenant":"","timezone":"","type":"*none"}]},"ers":{"enabled":false,"partial_cache_action":"*none","partial_cache_ttl":"1s","partial_path":"","readers":[{"cache_dump_fields":[],"concurrent_requests":1024,"fields":[{"mandatory":true,"path":"*cgreq.ToR","tag":"ToR","type":"*variable","value":"~*req.2"},{"mandatory":true,"path":"*cgreq.OriginID","tag":"OriginID","type":"*variable","value":"~*req.3"},{"mandatory":true,"path":"*cgreq.RequestType","tag":"RequestType","type":"*variable","value":"~*req.4"},{"mandatory":true,"path":"*cgreq.Tenant","tag":"Tenant","type":"*variable","value":"~*req.6"},{"mandatory":true,"path":"*cgreq.Category","tag":"Category","type":"*variable","value":"~*req.7"},{"mandatory":true,"path":"*cgreq.Account","tag":"Account","type":"*variable","value":"~*req.8"},{"mandatory":true,"path":"*cgreq.Subject","tag":"Subject","type":"*variable","value":"~*req.9"},{"mandatory":true,"path":"*cgreq.Destination","tag":"Destination","type":"*variable","value":"~*req.10"},{"mandatory":true,"path":"*cgreq.SetupTime","tag":"SetupTime","type":"*variable","value":"~*req.11"},{"mandatory":true,"path":"*cgreq.AnswerTime","tag":"AnswerTime","type":"*variable","value":"~*req.12"},{"mandatory":true,"path":"*cgreq.Usage","tag":"Usage","type":"*variable","value":"~*req.13"}],"filters":[],"flags":[],"id":"*default","opts":{"csvFieldSeparator":",","csvHeaderDefineChar":":","csvRowLength":0,"natsSubject":"cgrates_cdrs","partialOrderField":"~*req.AnswerTime","xmlRootPath":""},"partial_commit_fields":[],"processed_path":"/var/spool/cgrates/ers/out","run_delay":"0","source_path":"/var/spool/cgrates/ers/in","tenant":"","timezone":"","type":"*none"}],"sessions_conns":["*internal"]},"filters":{"apiers_conns":[],"resources_conns":[],"stats_conns":[]},"freeswitch_agent":{"create_cdr":false,"empty_balance_ann_file":"","empty_balance_context":"","enabled":false,"event_socket_conns":[{"address":"127.0.0.1:8021","alias":"127.0.0.1:8021","password":"ClueCon","reconnects":5}],"extra_fields":"","low_balance_ann_file":"","max_wait_connection":"2s","sessions_conns":["*birpc_internal"],"subscribe_park":true},"general":{"connect_attempts":5,"connect_timeout":"1s","dbdata_encoding":"*msgpack","default_caching":"*reload","default_category":"call","default_request_type":"*rated","default_tenant":"cgrates.org","default_timezone":"Local","digest_equal":":","digest_separator":",","failed_posts_dir":"/var/spool/cgrates/failed_posts","failed_posts_ttl":"5s","locking_timeout":"0","log_level":6,"logger":"*syslog","max_parallel_conns":100,"node_id":"ENGINE1","poster_attempts":3,"reconnects":-1,"reply_timeout":"2s","rounding_decimals":5,"rsr_separator":";","tpexport_dir":"/var/spool/cgrates/tpe"},"http":{"auth_users":{},"client_opts":{"dialFallbackDelay":"300ms","dialKeepAlive":"30s","dialTimeout":"30s","disableCompression":false,"disableKeepAlives":false,"expectContinueTimeout":"0","forceAttemptHttp2":true,"idleConnTimeout":"90s","maxConnsPerHost":0,"maxIdleConns":100,"maxIdleConnsPerHost":2,"responseHeaderTimeout":"0","skipTlsVerify":false,"tlsHandshakeTimeout":"10s"},"freeswitch_cdrs_url":"/freeswitch_json","http_cdrs":"/cdr_http","json_rpc_url":"/jsonrpc","registrars_url":"/registrar","use_basic_auth":false,"ws_url":"/ws"},"http_agent":[],"kamailio_agent":{"create_cdr":false,"enabled":false,"evapi_conns":[{"address":"127.0.0.1:8448","alias":"","reconnects":5}],"sessions_conns":["*birpc_internal"],"timezone":""},"listen":{"http":"127.0.0.1:2080","http_tls":"127.0.0.1:2280","rpc_gob":"127.0.0.1:2013","rpc_gob_tls":"127.0.0.1:2023","rpc_json":"127.0.0.1:2012","rpc_json_tls":"127.0.0.1:2022"},"loader":{"caches_conns":["*localhost"],"data_path":"./","disable_reverse":false,"field_separator":",","gapi_credentials":".gapi/credentials.json","gapi_token":".gapi/token.json","scheduler_conns":["*localhost"],"tpid":""},"loaders":[{"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.6"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.7"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.10"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Values","tag":"Values","type":"*variable","value":"~*req.4"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.5"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.9"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.10"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.6"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"MetricFilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.11"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.8"},{"path":"ActionIDs","tag":"ActionIDs","type":"*variable","value":"~*req.9"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"path":"RouteID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"RouteFilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"RouteAccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"RouteRatingPlanIDs","tag":"RouteRatingPlanIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeight","tag":"RouteWeight","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.5"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.6"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.7"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.9"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.10"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.11"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.12"}],"file_name":"DispatcherProfiles.csv","flags":null,"type":"*dispatchers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Address","tag":"Address","type":"*variable","value":"~*req.2"},{"path":"Transport","tag":"Transport","type":"*variable","value":"~*req.3"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.4"}],"file_name":"DispatcherHosts.csv","flags":null,"type":"*dispatcher_hosts"}],"dry_run":false,"enabled":false,"field_separator":",","id":"*default","lock_filename":".cgr.lck","run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}],"mailer":{"auth_password":"CGRateS.org","auth_user":"cgrates","from_address":"cgr-mailer@localhost.localdomain","server":"localhost"},"migrator":{"out_datadb_encoding":"msgpack","out_datadb_host":"127.0.0.1","out_datadb_name":"10","out_datadb_opts":{"redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0","redisClusterSync":"5s","redisSentinel":"","redisTLS":false},"out_datadb_password":"","out_datadb_port":"6379","out_datadb_type":"redis","out_datadb_user":"cgrates","out_stordb_host":"127.0.0.1","out_stordb_name":"cgrates","out_stordb_opts":{},"out_stordb_password":"","out_stordb_port":"3306","out_stordb_type":"mysql","out_stordb_user":"cgrates","users_filters":[]},"radius_agent":{"client_dictionaries":{"*default":"/usr/share/cgrates/radius/dict/"},"client_secrets":{"*default":"CGRateS.org"},"enabled":false,"listen_acct":"127.0.0.1:1813","listen_auth":"127.0.0.1:1812","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"]},"rals":{"balance_rating_subject":{"*any":"*zero1ns","*voice":"*zero1s"},"enabled":false,"max_computed_usage":{"*any":"189h0m0s","*data":"107374182400","*mms":"10000","*sms":"10000","*voice":"72h0m0s"},"max_increments":1000000,"remove_expired":true,"rp_subject_prefix_matching":false,"stats_conns":[],"thresholds_conns":[]},"registrarc":{"dispatchers":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]},"rpc":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]}},"resources":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"attributes_conns":[],"default_ratio":1,"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rals_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"rpc_conns":{"*bijson_localhost":{"conns":[{"address":"127.0.0.1:2014","transport":"*birpc_json"}],"poolSize":0,"strategy":"*first"},"*birpc_internal":{"conns":[{"address":"*birpc_internal","transport":""}],"poolSize":0,"strategy":"*first"},"*internal":{"conns":[{"address":"*internal","transport":""}],"poolSize":0,"strategy":"*first"},"*localhost":{"conns":[{"address":"127.0.0.1:2012","transport":"*json"}],"poolSize":0,"strategy":"*first"}},"schedulers":{"cdrs_conns":[],"dynaprepaid_actionplans":[],"enabled":false,"filters":[],"stats_conns":[],"thresholds_conns":[]},"sessions":{"alterable_fields":[],"attributes_conns":[],"cdrs_conns":[],"channel_sync_interval":"0","chargers_conns":[],"client_protocol":1,"debit_interval":"0","default_usage":{"*any":"3h0m0s","*data":"1048576","*sms":"1","*voice":"3h0m0s"},"enabled":false,"listen_bigob":"","listen_bijson":"127.0.0.1:2014","min_dur_low_balance":"0","rals_conns":[],"replication_conns":[],"resources_conns":[],"routes_conns":[],"scheduler_conns":[],"session_indexes":[],"session_ttl":"0","stats_conns":[],"stir":{"allowed_attest":["*any"],"default_attest":"A","payload_maxduration":"-1","privatekey_path":"","publickey_path":""},"store_session_costs":false,"terminate_attempts":5,"thresholds_conns":[]},"sip_agent":{"enabled":false,"listen":"127.0.0.1:5060","listen_net":"udp","request_processors":[],"retransmission_timer":1000000000,"sessions_conns":["*internal"],"timezone":""},"stats":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","store_uncompressed_limit":0,"suffix_indexed_fields":[],"thresholds_conns":[]},"stor_db":{"db_host":"127.0.0.1","db_name":"cgrates","db_password":"","db_port":3306,"db_type":"*mysql","db_user":"cgrates","items":{"*cdrs":{"remote":false,"replicate":false},"*session_costs":{"remote":false,"replicate":false},"*tp_account_actions":{"remote":false,"replicate":false},"*tp_action_plans":{"remote":false,"replicate":false},"*tp_action_triggers":{"remote":false,"replicate":false},"*tp_actions":{"remote":false,"replicate":false},"*tp_attributes":{"remote":false,"replicate":false},"*tp_chargers":{"remote":false,"replicate":false},"*tp_destination_rates":{"remote":false,"replicate":false},"*tp_destinations":{"remote":false,"replicate":false},"*tp_dispatcher_hosts":{"remote":false,"replicate":false},"*tp_dispatcher_profiles":{"remote":false,"replicate":false},"*tp_filters":{"remote":false,"replicate":false},"*tp_rates":{"remote":false,"replicate":false},"*tp_rating_plans":{"remote":false,"replicate":false},"*tp_rating_profiles":{"remote":false,"replicate":false},"*tp_resources":{"remote":false,"replicate":false},"*tp_routes":{"remote":false,"replicate":false},"*tp_shared_groups":{"remote":false,"replicate":false},"*tp_stats":{"remote":false,"replicate":false},"*tp_thresholds":{"remote":false,"replicate":false},"*tp_timings":{"remote":false,"replicate":false},"*versions":{"remote":false,"replicate":false}},"opts":{"mongoQueryTimeout":"10s","mysqlLocation":"Local","postgresSSLMode":"disable","sqlConnMaxLifetime":0,"sqlMaxIdleConns":10,"sqlMaxOpenConns":100},"prefix_indexed_fields":[],"remote_conns":null,"replication_conns":null,"string_indexed_fields":[]},"suretax":{"bill_to_number":"","business_unit":"","client_number":"","client_tracking":"~*req.CGRID","customer_number":"~*req.Subject","include_local_cost":false,"orig_number":"~*req.Subject","p2pplus4":"","p2pzipcode":"","plus4":"","regulatory_code":"03","response_group":"03","response_type":"D4","return_file_code":"0","sales_type_code":"R","tax_exemption_code_list":"","tax_included":"0","tax_situs_rule":"04","term_number":"~*req.Destination","timezone":"UTC","trans_type_code":"010101","unit_type":"00","units":"1","url":"","validation_key":"","zipcode":""},"templates":{"*asr":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"}],"*cca":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"path":"*rep.Result-Code","tag":"ResultCode","type":"*constant","value":"2001"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"},{"mandatory":true,"path":"*rep.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"mandatory":true,"path":"*rep.CC-Request-Type","tag":"CCRequestType","type":"*variable","value":"~*req.CC-Request-Type"},{"mandatory":true,"path":"*rep.CC-Request-Number","tag":"CCRequestNumber","type":"*variable","value":"~*req.CC-Request-Number"}],"*cdrLog":[{"mandatory":true,"path":"*cdr.ToR","tag":"ToR","type":"*variable","value":"~*req.BalanceType"},{"mandatory":true,"path":"*cdr.OriginHost","tag":"OriginHost","type":"*constant","value":"127.0.0.1"},{"mandatory":true,"path":"*cdr.RequestType","tag":"RequestType","type":"*constant","value":"*none"},{"mandatory":true,"path":"*cdr.Tenant","tag":"Tenant","type":"*variable","value":"~*req.Tenant"},{"mandatory":true,"path":"*cdr.Account","tag":"Account","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Subject","tag":"Subject","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Cost","tag":"Cost","type":"*variable","value":"~*req.Cost"},{"mandatory":true,"path":"*cdr.Source","tag":"Source","type":"*constant","value":"*cdrLog"},{"mandatory":true,"path":"*cdr.Usage","tag":"Usage","type":"*constant","value":"1"},{"mandatory":true,"path":"*cdr.RunID","tag":"RunID","type":"*variable","value":"~*req.ActionType"},{"mandatory":true,"path":"*cdr.SetupTime","tag":"SetupTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.AnswerTime","tag":"AnswerTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.PreRated","tag":"PreRated","type":"*constant","value":"true"}],"*err":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"}],"*errSip":[{"mandatory":true,"path":"*rep.Request","tag":"Request","type":"*constant","value":"SIP/2.0 500 Internal Server Error"}],"*rar":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"path":"*diamreq.Re-Auth-Request-Type","tag":"ReAuthRequestType","type":"*constant","value":"0"}]},"thresholds":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[]},"tls":{"ca_certificate":"","client_certificate":"","client_key":"","server_certificate":"","server_key":"","server_name":"","server_policy":4}}` + expected := `{"analyzers":{"cleanup_interval":"1h0m0s","db_path":"/var/spool/cgrates/analyzers","enabled":false,"index_type":"*scorch","ttl":"24h0m0s"},"apiban":{"enabled":false,"keys":[]},"apiers":{"attributes_conns":[],"caches_conns":["*internal"],"ees_conns":[],"enabled":false,"scheduler_conns":[]},"asterisk_agent":{"asterisk_conns":[{"address":"127.0.0.1:8088","alias":"","connect_attempts":3,"password":"CGRateS.org","reconnects":5,"user":"cgrates"}],"create_cdr":false,"enabled":false,"sessions_conns":["*birpc_internal"]},"attributes":{"any_context":true,"apiers_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"process_runs":1,"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"caches":{"partitions":{"*account_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*accounts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*apiban":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2m0s"},"*attribute_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*attribute_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*caps_events":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*cdr_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10m0s"},"*cdrs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*charger_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*closed_sessions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*diameter_messages":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*dispatcher_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_loads":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatcher_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*dispatchers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*event_charges":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"10s"},"*event_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*load_ids":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*replication_hosts":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resource_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*reverse_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*route_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_connections":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*rpc_responses":{"limit":0,"precache":false,"replicate":false,"static_ttl":false,"ttl":"2s"},"*session_costs":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stat_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueue_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*statqueues":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*stir":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*threshold_filter_indexes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*threshold_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_account_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_action_triggers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_actions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_attributes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_chargers":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destination_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_destinations":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_hosts":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_dispatcher_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_filters":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rates":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_plans":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_rating_profiles":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_resources":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_routes":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_shared_groups":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_stats":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_thresholds":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*tp_timings":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""},"*uch":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"3h0m0s"},"*versions":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":""}},"replication_conns":[]},"cdrs":{"attributes_conns":[],"chargers_conns":[],"ees_conns":[],"enabled":false,"extra_fields":[],"online_cdr_exports":[],"rals_conns":[],"scheduler_conns":[],"session_cost_retries":5,"stats_conns":[],"store_cdrs":true,"thresholds_conns":[]},"chargers":{"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"configs":{"enabled":false,"root_dir":"/var/spool/cgrates/configs","url":"/configs/"},"cores":{"caps":0,"caps_stats_interval":"0","caps_strategy":"*busy","shutdown_timeout":"1s"},"data_db":{"db_host":"127.0.0.1","db_name":"10","db_password":"","db_port":6379,"db_type":"*redis","db_user":"cgrates","items":{"*account_action_plans":{"remote":false,"replicate":false},"*accounts":{"remote":false,"replicate":false},"*action_plans":{"remote":false,"replicate":false},"*action_triggers":{"remote":false,"replicate":false},"*actions":{"remote":false,"replicate":false},"*attribute_profiles":{"remote":false,"replicate":false},"*charger_profiles":{"remote":false,"replicate":false},"*destinations":{"remote":false,"replicate":false},"*dispatcher_hosts":{"remote":false,"replicate":false},"*dispatcher_profiles":{"remote":false,"replicate":false},"*filters":{"remote":false,"replicate":false},"*indexes":{"remote":false,"replicate":false},"*load_ids":{"remote":false,"replicate":false},"*rating_plans":{"remote":false,"replicate":false},"*rating_profiles":{"remote":false,"replicate":false},"*resource_profiles":{"remote":false,"replicate":false},"*resources":{"remote":false,"replicate":false},"*reverse_destinations":{"remote":false,"replicate":false},"*route_profiles":{"remote":false,"replicate":false},"*shared_groups":{"remote":false,"replicate":false},"*statqueue_profiles":{"remote":false,"replicate":false},"*statqueues":{"remote":false,"replicate":false},"*threshold_profiles":{"remote":false,"replicate":false},"*thresholds":{"remote":false,"replicate":false},"*timings":{"remote":false,"replicate":false}},"opts":{"mongoQueryTimeout":"10s","redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0","redisClusterSync":"5s","redisSentinel":"","redisTLS":false},"remote_conn_id":"","remote_conns":[],"replication_cache":"","replication_conns":[],"replication_filtered":false},"diameter_agent":{"asr_template":"","concurrent_requests":-1,"dictionaries_path":"/usr/share/cgrates/diameter/dict/","enabled":false,"forced_disconnect":"*none","listen":"127.0.0.1:3868","listen_net":"tcp","origin_host":"CGR-DA","origin_realm":"cgrates.org","product_name":"CGRateS","rar_template":"","request_processors":[],"sessions_conns":["*birpc_internal"],"synced_conn_requests":false,"vendor_id":0},"dispatchers":{"any_subsystem":true,"attributes_conns":[],"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"suffix_indexed_fields":[]},"dns_agent":{"enabled":false,"listen":"127.0.0.1:2053","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"],"timezone":""},"ees":{"attributes_conns":[],"cache":{"*file_csv":{"limit":-1,"precache":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"enabled":false,"exporters":[{"attempts":1,"attribute_context":"","attribute_ids":[],"export_path":"/var/spool/cgrates/ees","fields":[],"filters":[],"flags":[],"id":"*default","opts":{},"synchronous":false,"timezone":"","type":"*none"}]},"ers":{"enabled":false,"partial_cache_action":"*none","partial_cache_ttl":"1s","partial_path":"","readers":[{"cache_dump_fields":[],"concurrent_requests":1024,"fields":[{"mandatory":true,"path":"*cgreq.ToR","tag":"ToR","type":"*variable","value":"~*req.2"},{"mandatory":true,"path":"*cgreq.OriginID","tag":"OriginID","type":"*variable","value":"~*req.3"},{"mandatory":true,"path":"*cgreq.RequestType","tag":"RequestType","type":"*variable","value":"~*req.4"},{"mandatory":true,"path":"*cgreq.Tenant","tag":"Tenant","type":"*variable","value":"~*req.6"},{"mandatory":true,"path":"*cgreq.Category","tag":"Category","type":"*variable","value":"~*req.7"},{"mandatory":true,"path":"*cgreq.Account","tag":"Account","type":"*variable","value":"~*req.8"},{"mandatory":true,"path":"*cgreq.Subject","tag":"Subject","type":"*variable","value":"~*req.9"},{"mandatory":true,"path":"*cgreq.Destination","tag":"Destination","type":"*variable","value":"~*req.10"},{"mandatory":true,"path":"*cgreq.SetupTime","tag":"SetupTime","type":"*variable","value":"~*req.11"},{"mandatory":true,"path":"*cgreq.AnswerTime","tag":"AnswerTime","type":"*variable","value":"~*req.12"},{"mandatory":true,"path":"*cgreq.Usage","tag":"Usage","type":"*variable","value":"~*req.13"}],"filters":[],"flags":[],"id":"*default","opts":{"csvFieldSeparator":",","csvHeaderDefineChar":":","csvRowLength":0,"natsSubject":"cgrates_cdrs","partialOrderField":"~*req.AnswerTime","xmlRootPath":""},"partial_commit_fields":[],"processed_path":"/var/spool/cgrates/ers/out","run_delay":"0","source_path":"/var/spool/cgrates/ers/in","tenant":"","timezone":"","type":"*none"}],"sessions_conns":["*internal"]},"filters":{"apiers_conns":[],"resources_conns":[],"stats_conns":[]},"freeswitch_agent":{"create_cdr":false,"empty_balance_ann_file":"","empty_balance_context":"","enabled":false,"event_socket_conns":[{"address":"127.0.0.1:8021","alias":"127.0.0.1:8021","password":"ClueCon","reconnects":5}],"extra_fields":"","low_balance_ann_file":"","max_wait_connection":"2s","sessions_conns":["*birpc_internal"],"subscribe_park":true},"general":{"connect_attempts":5,"connect_timeout":"1s","dbdata_encoding":"*msgpack","default_caching":"*reload","default_category":"call","default_request_type":"*rated","default_tenant":"cgrates.org","default_timezone":"Local","digest_equal":":","digest_separator":",","failed_posts_dir":"/var/spool/cgrates/failed_posts","failed_posts_ttl":"5s","locking_timeout":"0","log_level":6,"logger":"*syslog","max_parallel_conns":100,"node_id":"ENGINE1","poster_attempts":3,"reconnects":-1,"reply_timeout":"2s","rounding_decimals":5,"rsr_separator":";","tpexport_dir":"/var/spool/cgrates/tpe"},"http":{"auth_users":{},"client_opts":{"dialFallbackDelay":"300ms","dialKeepAlive":"30s","dialTimeout":"30s","disableCompression":false,"disableKeepAlives":false,"expectContinueTimeout":"0","forceAttemptHttp2":true,"idleConnTimeout":"90s","maxConnsPerHost":0,"maxIdleConns":100,"maxIdleConnsPerHost":2,"responseHeaderTimeout":"0","skipTlsVerify":false,"tlsHandshakeTimeout":"10s"},"freeswitch_cdrs_url":"/freeswitch_json","http_cdrs":"/cdr_http","json_rpc_url":"/jsonrpc","registrars_url":"/registrar","use_basic_auth":false,"ws_url":"/ws"},"http_agent":[],"kamailio_agent":{"create_cdr":false,"enabled":false,"evapi_conns":[{"address":"127.0.0.1:8448","alias":"","reconnects":5}],"sessions_conns":["*birpc_internal"],"timezone":""},"listen":{"http":"127.0.0.1:2080","http_tls":"127.0.0.1:2280","rpc_gob":"127.0.0.1:2013","rpc_gob_tls":"127.0.0.1:2023","rpc_json":"127.0.0.1:2012","rpc_json_tls":"127.0.0.1:2022"},"loader":{"caches_conns":["*localhost"],"data_path":"./","disable_reverse":false,"field_separator":",","gapi_credentials":".gapi/credentials.json","gapi_token":".gapi/token.json","scheduler_conns":["*localhost"],"tpid":""},"loaders":[{"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"AttributeFilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Path","tag":"Path","type":"*variable","value":"~*req.6"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.7"},{"path":"Value","tag":"Value","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.10"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Values","tag":"Values","type":"*variable","value":"~*req.4"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.5"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.9"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.10"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.6"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.7"},{"path":"MetricFilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.11"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.8"},{"path":"ActionIDs","tag":"ActionIDs","type":"*variable","value":"~*req.9"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.4"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.5"},{"path":"RouteID","tag":"RouteID","type":"*variable","value":"~*req.6"},{"path":"RouteFilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.7"},{"path":"RouteAccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.8"},{"path":"RouteRatingPlanIDs","tag":"RouteRatingPlanIDs","type":"*variable","value":"~*req.9"},{"path":"RouteResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.10"},{"path":"RouteStatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.11"},{"path":"RouteWeight","tag":"RouteWeight","type":"*variable","value":"~*req.12"},{"path":"RouteBlocker","tag":"RouteBlocker","type":"*variable","value":"~*req.13"},{"path":"RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.14"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.3"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.4"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.5"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Contexts","tag":"Contexts","type":"*variable","value":"~*req.2"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.3"},{"path":"ActivationInterval","tag":"ActivationInterval","type":"*variable","value":"~*req.4"},{"path":"Strategy","tag":"Strategy","type":"*variable","value":"~*req.5"},{"path":"StrategyParameters","tag":"StrategyParameters","type":"*variable","value":"~*req.6"},{"path":"ConnID","tag":"ConnID","type":"*variable","value":"~*req.7"},{"path":"ConnFilterIDs","tag":"ConnFilterIDs","type":"*variable","value":"~*req.8"},{"path":"ConnWeight","tag":"ConnWeight","type":"*variable","value":"~*req.9"},{"path":"ConnBlocker","tag":"ConnBlocker","type":"*variable","value":"~*req.10"},{"path":"ConnParameters","tag":"ConnParameters","type":"*variable","value":"~*req.11"},{"path":"Weight","tag":"Weight","type":"*variable","value":"~*req.12"}],"file_name":"DispatcherProfiles.csv","flags":null,"type":"*dispatchers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Address","tag":"Address","type":"*variable","value":"~*req.2"},{"path":"Transport","tag":"Transport","type":"*variable","value":"~*req.3"},{"path":"TLS","tag":"TLS","type":"*variable","value":"~*req.4"}],"file_name":"DispatcherHosts.csv","flags":null,"type":"*dispatcher_hosts"}],"dry_run":false,"enabled":false,"field_separator":",","id":"*default","lock_filename":".cgr.lck","run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}],"mailer":{"auth_password":"CGRateS.org","auth_user":"cgrates","from_address":"cgr-mailer@localhost.localdomain","server":"localhost"},"migrator":{"out_datadb_encoding":"msgpack","out_datadb_host":"127.0.0.1","out_datadb_name":"10","out_datadb_opts":{"redisCACertificate":"","redisClientCertificate":"","redisClientKey":"","redisCluster":false,"redisClusterOndownDelay":"0","redisClusterSync":"5s","redisSentinel":"","redisTLS":false},"out_datadb_password":"","out_datadb_port":"6379","out_datadb_type":"redis","out_datadb_user":"cgrates","out_stordb_host":"127.0.0.1","out_stordb_name":"cgrates","out_stordb_opts":{},"out_stordb_password":"","out_stordb_port":"3306","out_stordb_type":"mysql","out_stordb_user":"cgrates","users_filters":[]},"radius_agent":{"client_dictionaries":{"*default":"/usr/share/cgrates/radius/dict/"},"client_secrets":{"*default":"CGRateS.org"},"enabled":false,"listen_acct":"127.0.0.1:1813","listen_auth":"127.0.0.1:1812","listen_net":"udp","request_processors":[],"sessions_conns":["*internal"]},"rals":{"balance_rating_subject":{"*any":"*zero1ns","*voice":"*zero1s"},"enabled":false,"max_computed_usage":{"*any":"189h0m0s","*data":"107374182400","*mms":"10000","*sms":"10000","*voice":"72h0m0s"},"max_increments":1000000,"remove_expired":true,"rp_subject_prefix_matching":false,"stats_conns":[],"thresholds_conns":[]},"registrarc":{"dispatchers":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]},"rpc":{"hosts":[],"refresh_interval":"5m0s","registrars_conns":[]}},"resources":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[],"thresholds_conns":[]},"routes":{"attributes_conns":[],"default_ratio":1,"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"rals_conns":[],"resources_conns":[],"stats_conns":[],"suffix_indexed_fields":[]},"rpc_conns":{"*bijson_localhost":{"conns":[{"address":"127.0.0.1:2014","transport":"*birpc_json"}],"poolSize":0,"strategy":"*first"},"*birpc_internal":{"conns":[{"address":"*birpc_internal","transport":""}],"poolSize":0,"strategy":"*first"},"*internal":{"conns":[{"address":"*internal","transport":""}],"poolSize":0,"strategy":"*first"},"*localhost":{"conns":[{"address":"127.0.0.1:2012","transport":"*json"}],"poolSize":0,"strategy":"*first"}},"schedulers":{"cdrs_conns":[],"dynaprepaid_actionplans":[],"enabled":false,"filters":[],"stats_conns":[],"thresholds_conns":[]},"sessions":{"alterable_fields":[],"attributes_conns":[],"cdrs_conns":[],"channel_sync_interval":"0","chargers_conns":[],"client_protocol":1,"debit_interval":"0","default_usage":{"*any":"3h0m0s","*data":"1048576","*sms":"1","*voice":"3h0m0s"},"enabled":false,"listen_bigob":"","listen_bijson":"127.0.0.1:2014","min_dur_low_balance":"0","rals_conns":[],"replication_conns":[],"resources_conns":[],"routes_conns":[],"scheduler_conns":[],"session_indexes":[],"session_ttl":"0","stats_conns":[],"stir":{"allowed_attest":["*any"],"default_attest":"A","payload_maxduration":"-1","privatekey_path":"","publickey_path":""},"store_session_costs":false,"terminate_attempts":5,"thresholds_conns":[]},"sip_agent":{"enabled":false,"listen":"127.0.0.1:5060","listen_net":"udp","request_processors":[],"retransmission_timer":1000000000,"sessions_conns":["*internal"],"timezone":""},"stats":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","store_uncompressed_limit":0,"suffix_indexed_fields":[],"thresholds_conns":[]},"stor_db":{"db_host":"127.0.0.1","db_name":"cgrates","db_password":"","db_port":3306,"db_type":"*mysql","db_user":"cgrates","items":{"*cdrs":{"remote":false,"replicate":false},"*session_costs":{"remote":false,"replicate":false},"*tp_account_actions":{"remote":false,"replicate":false},"*tp_action_plans":{"remote":false,"replicate":false},"*tp_action_triggers":{"remote":false,"replicate":false},"*tp_actions":{"remote":false,"replicate":false},"*tp_attributes":{"remote":false,"replicate":false},"*tp_chargers":{"remote":false,"replicate":false},"*tp_destination_rates":{"remote":false,"replicate":false},"*tp_destinations":{"remote":false,"replicate":false},"*tp_dispatcher_hosts":{"remote":false,"replicate":false},"*tp_dispatcher_profiles":{"remote":false,"replicate":false},"*tp_filters":{"remote":false,"replicate":false},"*tp_rates":{"remote":false,"replicate":false},"*tp_rating_plans":{"remote":false,"replicate":false},"*tp_rating_profiles":{"remote":false,"replicate":false},"*tp_resources":{"remote":false,"replicate":false},"*tp_routes":{"remote":false,"replicate":false},"*tp_shared_groups":{"remote":false,"replicate":false},"*tp_stats":{"remote":false,"replicate":false},"*tp_thresholds":{"remote":false,"replicate":false},"*tp_timings":{"remote":false,"replicate":false},"*versions":{"remote":false,"replicate":false}},"opts":{"mongoQueryTimeout":"10s","mysqlLocation":"Local","postgresSSLMode":"disable","sqlConnMaxLifetime":0,"sqlMaxIdleConns":10,"sqlMaxOpenConns":100},"prefix_indexed_fields":[],"remote_conns":null,"replication_conns":null,"string_indexed_fields":[]},"suretax":{"bill_to_number":"","business_unit":"","client_number":"","client_tracking":"~*req.CGRID","customer_number":"~*req.Subject","include_local_cost":false,"orig_number":"~*req.Subject","p2pplus4":"","p2pzipcode":"","plus4":"","regulatory_code":"03","response_group":"03","response_type":"D4","return_file_code":"0","sales_type_code":"R","tax_exemption_code_list":"","tax_included":"0","tax_situs_rule":"04","term_number":"~*req.Destination","timezone":"UTC","trans_type_code":"010101","unit_type":"00","units":"1","url":"","validation_key":"","zipcode":""},"templates":{"*asr":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"}],"*cca":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"path":"*rep.Result-Code","tag":"ResultCode","type":"*constant","value":"2001"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"},{"mandatory":true,"path":"*rep.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"mandatory":true,"path":"*rep.CC-Request-Type","tag":"CCRequestType","type":"*variable","value":"~*req.CC-Request-Type"},{"mandatory":true,"path":"*rep.CC-Request-Number","tag":"CCRequestNumber","type":"*variable","value":"~*req.CC-Request-Number"}],"*cdrLog":[{"mandatory":true,"path":"*cdr.ToR","tag":"ToR","type":"*variable","value":"~*req.BalanceType"},{"mandatory":true,"path":"*cdr.OriginHost","tag":"OriginHost","type":"*constant","value":"127.0.0.1"},{"mandatory":true,"path":"*cdr.RequestType","tag":"RequestType","type":"*constant","value":"*none"},{"mandatory":true,"path":"*cdr.Tenant","tag":"Tenant","type":"*variable","value":"~*req.Tenant"},{"mandatory":true,"path":"*cdr.Account","tag":"Account","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Subject","tag":"Subject","type":"*variable","value":"~*req.Account"},{"mandatory":true,"path":"*cdr.Cost","tag":"Cost","type":"*variable","value":"~*req.Cost"},{"mandatory":true,"path":"*cdr.Source","tag":"Source","type":"*constant","value":"*cdrLog"},{"mandatory":true,"path":"*cdr.Usage","tag":"Usage","type":"*constant","value":"1"},{"mandatory":true,"path":"*cdr.RunID","tag":"RunID","type":"*variable","value":"~*req.ActionType"},{"mandatory":true,"path":"*cdr.SetupTime","tag":"SetupTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.AnswerTime","tag":"AnswerTime","type":"*constant","value":"*now"},{"mandatory":true,"path":"*cdr.PreRated","tag":"PreRated","type":"*constant","value":"true"}],"*err":[{"mandatory":true,"path":"*rep.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*rep.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*vars.OriginHost"},{"mandatory":true,"path":"*rep.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*vars.OriginRealm"}],"*errSip":[{"mandatory":true,"path":"*rep.Request","tag":"Request","type":"*constant","value":"SIP/2.0 500 Internal Server Error"}],"*rar":[{"mandatory":true,"path":"*diamreq.Session-Id","tag":"SessionId","type":"*variable","value":"~*req.Session-Id"},{"mandatory":true,"path":"*diamreq.Origin-Host","tag":"OriginHost","type":"*variable","value":"~*req.Destination-Host"},{"mandatory":true,"path":"*diamreq.Origin-Realm","tag":"OriginRealm","type":"*variable","value":"~*req.Destination-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Realm","tag":"DestinationRealm","type":"*variable","value":"~*req.Origin-Realm"},{"mandatory":true,"path":"*diamreq.Destination-Host","tag":"DestinationHost","type":"*variable","value":"~*req.Origin-Host"},{"mandatory":true,"path":"*diamreq.Auth-Application-Id","tag":"AuthApplicationId","type":"*variable","value":"~*vars.*appid"},{"path":"*diamreq.Re-Auth-Request-Type","tag":"ReAuthRequestType","type":"*constant","value":"0"}]},"thresholds":{"enabled":false,"indexed_selects":true,"nested_fields":false,"prefix_indexed_fields":[],"store_interval":"","suffix_indexed_fields":[]},"tls":{"ca_certificate":"","client_certificate":"","client_key":"","server_certificate":"","server_key":"","server_name":"","server_policy":4}}` cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSON) if err != nil { t.Fatal(err) @@ -5323,7 +5321,6 @@ func TestCgrCdfEventExporter(t *testing.T) { { ID: utils.MetaDefault, Type: utils.MetaNone, - Tenant: nil, ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, @@ -5403,7 +5400,6 @@ func TestCgrCfgEventExporterDefault(t *testing.T) { eCfg := &EventExporterCfg{ ID: utils.MetaDefault, Type: utils.MetaNone, - Tenant: nil, ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, diff --git a/config/eescfg.go b/config/eescfg.go index 255ce325a..a15b398df 100644 --- a/config/eescfg.go +++ b/config/eescfg.go @@ -157,7 +157,6 @@ type EventExporterCfg struct { Type string ExportPath string Opts map[string]interface{} - Tenant RSRParsers Timezone string Filters []string Flags utils.FlagsWithParams @@ -184,11 +183,6 @@ func (eeC *EventExporterCfg) loadFromJSONCfg(jsnEec *EventExporterJsonCfg, msgTe if jsnEec.Export_path != nil { eeC.ExportPath = *jsnEec.Export_path } - if jsnEec.Tenant != nil { - if eeC.Tenant, err = NewRSRParsers(*jsnEec.Tenant, separator); err != nil { - return err - } - } if jsnEec.Timezone != nil { eeC.Timezone = *jsnEec.Timezone } @@ -275,7 +269,6 @@ func (eeC EventExporterCfg) Clone() (cln *EventExporterCfg) { ID: eeC.ID, Type: eeC.Type, ExportPath: eeC.ExportPath, - Tenant: eeC.Tenant.Clone(), Timezone: eeC.Timezone, Flags: eeC.Flags.Clone(), AttributeSCtx: eeC.AttributeSCtx, @@ -329,7 +322,6 @@ func (eeC *EventExporterCfg) AsMapInterface(separator string) (initialMP map[str utils.IDCfg: eeC.ID, utils.TypeCfg: eeC.Type, utils.ExportPathCfg: eeC.ExportPath, - utils.TenantCfg: eeC.Tenant.GetRule(separator), utils.TimezoneCfg: eeC.Timezone, utils.FiltersCfg: eeC.Filters, utils.FlagsCfg: flgs, diff --git a/config/eescfg_test.go b/config/eescfg_test.go index d10d7660d..6562bc318 100644 --- a/config/eescfg_test.go +++ b/config/eescfg_test.go @@ -42,7 +42,6 @@ func TestEESClone(t *testing.T) { "opts": { "*default": "randomVal" }, - "tenant": "~*req.Destination1", "timezone": "local", "filters": ["randomFiletrs"], "flags": [], @@ -78,7 +77,6 @@ func TestEESClone(t *testing.T) { ID: utils.MetaDefault, Type: utils.MetaNone, Synchronous: false, - Tenant: NewRSRParsersMustCompile("", utils.InfieldSep), ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, @@ -96,7 +94,6 @@ func TestEESClone(t *testing.T) { ID: utils.CGRateSLwr, Type: utils.MetaNone, Synchronous: false, - Tenant: NewRSRParsersMustCompile("~*req.Destination1", utils.InfieldSep), ExportPath: "/var/spool/cgrates/ees", Attempts: 2, Timezone: "local", @@ -259,28 +256,6 @@ func TestEESCacheloadFromJsonCfg(t *testing.T) { } } -func TestEESExportersloadFromJsonCfg(t *testing.T) { - eesCfg := &EEsJsonCfg{ - Exporters: &[]*EventExporterJsonCfg{ - { - Tenant: utils.StringPointer("a{*"), - }, - }, - } - expected := "invalid converter terminator in rule: " - jsonCfg := NewDefaultCGRConfig() - if err = jsonCfg.eesCfg.loadFromJSONCfg(eesCfg, jsonCfg.templates, jsonCfg.generalCfg.RSRSep, jsonCfg.dfltEvExp); err == nil || err.Error() != expected { - t.Errorf("Expected %+v, received %+v", expected, err) - } - eesCfgExporter := &EEsJsonCfg{ - Exporters: nil, - } - jsonCfg = NewDefaultCGRConfig() - if err = jsonCfg.eesCfg.loadFromJSONCfg(eesCfgExporter, jsonCfg.templates, jsonCfg.generalCfg.RSRSep, jsonCfg.dfltEvExp); err != nil { - t.Error(err) - } -} - func TestEventExporterSameID(t *testing.T) { expectedEEsCfg := &EEsCfg{ Enabled: true, @@ -296,7 +271,6 @@ func TestEventExporterSameID(t *testing.T) { { ID: utils.MetaDefault, Type: utils.MetaNone, - Tenant: nil, ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, @@ -312,7 +286,6 @@ func TestEventExporterSameID(t *testing.T) { { ID: "file_exporter1", Type: utils.MetaFileCSV, - Tenant: nil, Timezone: utils.EmptyString, Filters: []string{}, AttributeSIDs: []string{}, @@ -389,7 +362,6 @@ func TestEEsCfgloadFromJsonCfgCase1(t *testing.T) { Attribute_ids: &[]string{}, Flags: &[]string{"*dryrun"}, Export_path: utils.StringPointer("/tmp/testCSV"), - Tenant: nil, Timezone: utils.StringPointer("UTC"), Synchronous: utils.BoolPointer(true), Attempts: utils.IntPointer(1), @@ -418,7 +390,6 @@ func TestEEsCfgloadFromJsonCfgCase1(t *testing.T) { { ID: utils.MetaDefault, Type: utils.MetaNone, - Tenant: nil, ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, @@ -438,7 +409,6 @@ func TestEEsCfgloadFromJsonCfgCase1(t *testing.T) { AttributeSIDs: []string{}, Flags: utils.FlagsWithParamsFromSlice([]string{utils.MetaDryRun}), ExportPath: "/tmp/testCSV", - Tenant: nil, Timezone: "UTC", Synchronous: true, Attempts: 1, @@ -497,7 +467,6 @@ func TestEEsCfgloadFromJsonCfgCase2(t *testing.T) { Attribute_ids: &[]string{}, Flags: &[]string{"*dryrun"}, Export_path: utils.StringPointer("/tmp/testCSV"), - Tenant: nil, Timezone: utils.StringPointer("UTC"), Synchronous: utils.BoolPointer(true), Attempts: utils.IntPointer(1), @@ -532,7 +501,6 @@ func TestEEsCfgloadFromJsonCfgCase2(t *testing.T) { { ID: utils.MetaDefault, Type: utils.MetaNone, - Tenant: nil, ExportPath: "/var/spool/cgrates/ees", Attempts: 1, Timezone: utils.EmptyString, @@ -552,7 +520,6 @@ func TestEEsCfgloadFromJsonCfgCase2(t *testing.T) { AttributeSIDs: []string{}, Flags: utils.FlagsWithParamsFromSlice([]string{utils.MetaDryRun}), ExportPath: "/tmp/testCSV", - Tenant: nil, Timezone: "UTC", Synchronous: true, Attempts: 1, @@ -633,7 +600,6 @@ func TestEEsCfgAsMapInterface(t *testing.T) { "opts": { "kafkaGroupID": "test", }, - "tenant": "~*req.Destination1", "timezone": "UTC", "filters": [], "flags": ["randomFlag"], @@ -668,7 +634,6 @@ func TestEEsCfgAsMapInterface(t *testing.T) { utils.OptsCfg: map[string]interface{}{ utils.KafkaGroupID: "test", }, - utils.TenantCfg: "~*req.Destination1", utils.TimezoneCfg: "UTC", utils.FiltersCfg: []string{}, utils.FlagsCfg: []string{"randomFlag"}, diff --git a/config/fwvdp.go b/config/fwvdp.go index 804ac6272..bc53bf10e 100644 --- a/config/fwvdp.go +++ b/config/fwvdp.go @@ -20,7 +20,6 @@ package config import ( "fmt" - "net" "strconv" "strings" @@ -91,8 +90,3 @@ func (fP *FWVProvider) FieldAsString(fldPath []string) (data string, err error) } return utils.IfaceAsString(valIface), nil } - -// RemoteHost is part of engine.utils.DataProvider interface -func (fP *FWVProvider) RemoteHost() net.Addr { - return utils.LocalAddr() -} diff --git a/config/fwvdp_test.go b/config/fwvdp_test.go index c985d3ff6..4aa0eff45 100644 --- a/config/fwvdp_test.go +++ b/config/fwvdp_test.go @@ -48,14 +48,6 @@ func TestStringReqFWV(t *testing.T) { } } -func TestRemoteHostFWV(t *testing.T) { - dP := new(FWVProvider) - expected := utils.LocalAddr() - if received := dP.RemoteHost(); !reflect.DeepEqual(expected, received) { - t.Errorf("Expected %+v, received %+v", expected, received) - } -} - func TestFieldAsInterfaceFWV(t *testing.T) { pth := []string{"1-12"} record := `"cgrates.org", "ATTR_1"` diff --git a/config/libconfig_json.go b/config/libconfig_json.go index 63203900f..2951427b8 100644 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -195,7 +195,6 @@ type EventExporterJsonCfg struct { Type *string Export_path *string Opts map[string]interface{} - Tenant *string Timezone *string Filters *[]string Flags *[]string diff --git a/config/objdp.go b/config/objdp.go index 2e320832a..fa8aefc67 100644 --- a/config/objdp.go +++ b/config/objdp.go @@ -20,7 +20,6 @@ package config import ( "fmt" - "net" "strings" "github.com/cgrates/cgrates/utils" @@ -126,8 +125,3 @@ func (objDP *ObjectDP) FieldAsString(fldPath []string) (data string, err error) } return utils.IfaceAsString(valIface), nil } - -// RemoteHost is part of engine.utils.DataProvider interface -func (objDP *ObjectDP) RemoteHost() net.Addr { - return utils.LocalAddr() -} diff --git a/config/objdp_test.go b/config/objdp_test.go index 1a8821955..ee02cc0f7 100644 --- a/config/objdp_test.go +++ b/config/objdp_test.go @@ -21,8 +21,6 @@ package config import ( "reflect" "testing" - - "github.com/cgrates/cgrates/utils" ) func TestNewObjectDP(t *testing.T) { @@ -36,17 +34,6 @@ func TestNewObjectDP(t *testing.T) { } } -func TestRemoteHostObjDP(t *testing.T) { - expected := utils.LocalAddr() - objDp := &ObjectDP{ - obj: "cgrates.org", - cache: make(map[string]interface{}), - } - if received := objDp.RemoteHost(); !reflect.DeepEqual(expected, received) { - t.Errorf("Expected %+v, received %+v", expected, received) - } -} - func TestStringObjDP(t *testing.T) { objDp := &ObjectDP{ obj: "cgrates.org", diff --git a/config/slicedp.go b/config/slicedp.go index 9d2cc499d..5c6d378fd 100644 --- a/config/slicedp.go +++ b/config/slicedp.go @@ -20,7 +20,6 @@ package config import ( "fmt" - "net" "strconv" "github.com/cgrates/cgrates/utils" @@ -83,11 +82,6 @@ func (cP *SliceDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of engine.utils.DataProvider interface -func (cP *SliceDP) RemoteHost() net.Addr { - return utils.LocalAddr() -} - // getIndex returns the index from index alias map or if not found try to convert it to int func (cP *SliceDP) getIndex(idx string) (fieldIdx int, err error) { if cP.idxAls != nil { diff --git a/config/slicedp_test.go b/config/slicedp_test.go index 0a366d584..eb152d6de 100644 --- a/config/slicedp_test.go +++ b/config/slicedp_test.go @@ -103,14 +103,6 @@ func TestGetIndexValueKey(t *testing.T) { } } -func TestRemoteHostSliceDP(t *testing.T) { - expected := utils.LocalAddr() - sliceDP := new(SliceDP) - if received := sliceDP.RemoteHost(); !reflect.DeepEqual(expected, received) { - t.Errorf("Expected %+v, received %+v", expected, received) - } -} - func TestStringReqSliceDP(t *testing.T) { record := []string{"cgrates.org", "ATTR_1", "*sessions;*cdrs", "*string:~*req.Account:1007", "2014-01-14T00:00:00Z", "*req.Account", "*constant", "1001", "false", "10"} sliceDP := &SliceDP{ diff --git a/config/xmldp.go b/config/xmldp.go index b5f82ede5..2f7e31f3a 100644 --- a/config/xmldp.go +++ b/config/xmldp.go @@ -20,7 +20,6 @@ package config import ( "fmt" - "net" "strconv" "strings" @@ -95,11 +94,6 @@ func (xP *XMLProvider) FieldAsString(fldPath []string) (data string, err error) return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of engine.utils.DataProvider interface -func (xP *XMLProvider) RemoteHost() net.Addr { - return utils.LocalAddr() -} - // ElementText will process the node to extract the elementName's text out of it (only first one found) // returns utils.ErrNotFound if the element is not found in the node // Make the method exportable until we remove the ers diff --git a/config/xmldp_test.go b/config/xmldp_test.go index 3c72f743f..d6331c24c 100644 --- a/config/xmldp_test.go +++ b/config/xmldp_test.go @@ -453,14 +453,6 @@ func TestFieldAsStringXMLEmptyPath(t *testing.T) { } } -func TestRemoteHostXML(t *testing.T) { - expected := utils.LocalAddr() - dp := new(XMLProvider) - if received := dp.RemoteHost(); !reflect.DeepEqual(expected, received) { - t.Errorf("Expected %+v, received %+v", expected, received) - } -} - func TestStringXML(t *testing.T) { doc, err := xmlquery.Parse(strings.NewReader(xmlMultipleIndex)) if err != nil { diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index 2eac33566..6ffef33ed 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -506,7 +506,6 @@ // // "s3FolderPath": "", // S3FolderPath // }, // extra options for exporter -// "tenant": "", // tenant used in filterS.Pass // "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> // "filters": [], // limit parsing based on the filters // "flags": [], // flags to influence the event processing diff --git a/data/conf/samples/actions_internal/cgradmin.json b/data/conf/samples/actions_internal/cgradmin.json index f2023176c..920c41f54 100644 --- a/data/conf/samples/actions_internal/cgradmin.json +++ b/data/conf/samples/actions_internal/cgradmin.json @@ -65,7 +65,6 @@ "type": "*sqs_json_map", // export_path for sqs: "endpoint" "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -75,7 +74,6 @@ "id": "kafka_fail", "type": "*kafka_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -85,7 +83,6 @@ "id": "amqp_fail", "type": "*amqp_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -95,7 +92,6 @@ "id": "s3_fail", "type": "*s3_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -105,7 +101,6 @@ "id": "aws_fail", "type": "*amqpv1_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, diff --git a/data/conf/samples/actions_internal_gob/cgradmin.json b/data/conf/samples/actions_internal_gob/cgradmin.json index fa1d8f5c7..89d523679 100644 --- a/data/conf/samples/actions_internal_gob/cgradmin.json +++ b/data/conf/samples/actions_internal_gob/cgradmin.json @@ -74,7 +74,6 @@ "type": "*sqs_json_map", // export_path for sqs: "endpoint" "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -84,7 +83,6 @@ "id": "kafka_fail", "type": "*kafka_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -94,7 +92,6 @@ "id": "amqp_fail", "type": "*amqp_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -104,7 +101,6 @@ "id": "s3_fail", "type": "*s3_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -114,7 +110,6 @@ "id": "aws_fail", "type": "*amqpv1_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, diff --git a/data/conf/samples/actions_mongo/cgradmin.json b/data/conf/samples/actions_mongo/cgradmin.json index ac0067c10..bce96ac53 100644 --- a/data/conf/samples/actions_mongo/cgradmin.json +++ b/data/conf/samples/actions_mongo/cgradmin.json @@ -70,7 +70,6 @@ "type": "*sqs_json_map", // export_path for sqs: "endpoint" "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -80,7 +79,6 @@ "id": "kafka_fail", "type": "*kafka_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -90,7 +88,6 @@ "id": "amqp_fail", "type": "*amqp_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -100,7 +97,6 @@ "id": "s3_fail", "type": "*s3_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -110,7 +106,6 @@ "id": "aws_fail", "type": "*amqpv1_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, diff --git a/data/conf/samples/actions_mongo_gob/cgradmin.json b/data/conf/samples/actions_mongo_gob/cgradmin.json index 7e3bbe9e5..bc639c84b 100644 --- a/data/conf/samples/actions_mongo_gob/cgradmin.json +++ b/data/conf/samples/actions_mongo_gob/cgradmin.json @@ -71,7 +71,6 @@ "type": "*sqs_json_map", // export_path for sqs: "endpoint" "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -81,7 +80,6 @@ "id": "kafka_fail", "type": "*kafka_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -91,7 +89,6 @@ "id": "amqp_fail", "type": "*amqp_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -101,7 +98,6 @@ "id": "s3_fail", "type": "*s3_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -111,7 +107,6 @@ "id": "aws_fail", "type": "*amqpv1_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, diff --git a/data/conf/samples/actions_mysql/cgradmin.json b/data/conf/samples/actions_mysql/cgradmin.json index c2d86acf9..928f5b3f3 100644 --- a/data/conf/samples/actions_mysql/cgradmin.json +++ b/data/conf/samples/actions_mysql/cgradmin.json @@ -67,7 +67,6 @@ "type": "*sqs_json_map", // export_path for sqs: "endpoint" "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -77,7 +76,6 @@ "id": "kafka_fail", "type": "*kafka_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -87,7 +85,6 @@ "id": "amqp_fail", "type": "*amqp_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -97,7 +94,6 @@ "id": "s3_fail", "type": "*s3_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -107,7 +103,6 @@ "id": "aws_fail", "type": "*amqpv1_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, diff --git a/data/conf/samples/actions_mysql_gob/cgradmin.json b/data/conf/samples/actions_mysql_gob/cgradmin.json index 525dcbaa3..38a70898f 100644 --- a/data/conf/samples/actions_mysql_gob/cgradmin.json +++ b/data/conf/samples/actions_mysql_gob/cgradmin.json @@ -73,7 +73,6 @@ "type": "*sqs_json_map", // export_path for sqs: "endpoint" "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -83,7 +82,6 @@ "id": "kafka_fail", "type": "*kafka_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -93,7 +91,6 @@ "id": "amqp_fail", "type": "*amqp_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -103,7 +100,6 @@ "id": "s3_fail", "type": "*s3_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, @@ -113,7 +109,6 @@ "id": "aws_fail", "type": "*amqpv1_json_map", "export_path": "notAValidURL", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, diff --git a/data/conf/samples/cdrsexport_internal/cgrates.json b/data/conf/samples/cdrsexport_internal/cgrates.json index 9c7595c8f..0bc2e1b47 100644 --- a/data/conf/samples/cdrsexport_internal/cgrates.json +++ b/data/conf/samples/cdrsexport_internal/cgrates.json @@ -53,7 +53,6 @@ "id": "http_localhost", "type": "*http_post", "export_path": "http://127.0.0.1:12081/cdr_http", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} @@ -69,7 +68,6 @@ "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, - "tenant": "cgrates.org", "attempts": 20, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} @@ -82,7 +80,6 @@ "opts": { "amqpQueueID": "cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} @@ -100,7 +97,6 @@ "awsSecret": "testsecret", "sqsQueueID": "cgrates-cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} @@ -113,7 +109,6 @@ "opts":{ "kafkaTopic": "cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 10, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} @@ -131,7 +126,6 @@ "awsSecret": "testsecret", "s3BucketID": "cgrates-cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"} diff --git a/data/conf/samples/cdrsexport_mongo/cgrates.json b/data/conf/samples/cdrsexport_mongo/cgrates.json index 930a48e7e..7fe9e348a 100644 --- a/data/conf/samples/cdrsexport_mongo/cgrates.json +++ b/data/conf/samples/cdrsexport_mongo/cgrates.json @@ -58,7 +58,6 @@ "id": "http_localhost", "type": "*http_post", "export_path": "http://127.0.0.1:12081/cdr_http", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -74,7 +73,6 @@ "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, - "tenant": "cgrates.org", "attempts": 20, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -87,7 +85,6 @@ "opts": { "amqpQueueID": "cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -105,7 +102,6 @@ "awsSecret": "testsecret", "sqsQueueID": "cgrates-cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -118,7 +114,6 @@ "opts":{ "kafkaTopic": "cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 10, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -136,7 +131,6 @@ "awsSecret": "testsecret", "s3BucketID": "cgrates-cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, diff --git a/data/conf/samples/cdrsexport_mysql/cgrates.json b/data/conf/samples/cdrsexport_mysql/cgrates.json index eb624ee16..0192335e4 100644 --- a/data/conf/samples/cdrsexport_mysql/cgrates.json +++ b/data/conf/samples/cdrsexport_mysql/cgrates.json @@ -55,7 +55,6 @@ "id": "http_localhost", "type": "*http_post", "export_path": "http://127.0.0.1:12081/cdr_http", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -71,7 +70,6 @@ "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, - "tenant": "cgrates.org", "attempts": 20, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -84,7 +82,6 @@ "opts": { "amqpQueueID": "cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -101,7 +98,6 @@ "awsSecret": "testsecret", "sqsQueueID": "cgrates-cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -114,7 +110,6 @@ "opts": { "kafkaTopic": "cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 10, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, @@ -131,7 +126,6 @@ "awsSecret": "testsecret", "s3BucketID": "cgrates-cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, diff --git a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json index 594b3bbdd..af5dc0bf4 100644 --- a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json @@ -52,7 +52,6 @@ "id": "http_localhost", "type": "*http_post", "export_path": "http://127.0.0.1:12080/cdr_http", - "tenant": "cgrates.org", "synchronous": true, "attempts": 1, "filters":["*string:~*opts.ExporterID:http_localhost"], @@ -83,7 +82,6 @@ "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, - "tenant": "cgrates.org", "attempts": 3, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, @@ -106,7 +104,6 @@ "id": "http_test_file", "type": "*http_post", "export_path": "http://127.0.0.1:12080/invalid", - "tenant": "cgrates.org", "synchronous": true, "attempts": 1, "fields":[ @@ -120,7 +117,6 @@ "opts": { "kafkaTopic": "cgrates_cdrs", }, - "tenant": "cgrates.org", "synchronous": true, "attempts": 1, "fields":[ @@ -134,7 +130,6 @@ "opts": { "amqpQueueID": "cgrates_cdrs", }, - "tenant": "cgrates.org", "filters":["*string:~*ec.Cost:100"], "synchronous": true, "attempts": 1, diff --git a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json index 4481bce3b..1f6f00f50 100644 --- a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json @@ -50,7 +50,6 @@ "id": "http_localhost", "type": "*http_post", "export_path": "http://127.0.0.1:12080/cdr_http", - "tenant": "cgrates.org", "synchronous": true, "attempts": 1, "filters":["*string:~*opts.ExporterID:http_localhost"], @@ -81,7 +80,6 @@ "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, - "tenant": "cgrates.org", "attempts": 3, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, @@ -104,7 +102,6 @@ "id": "http_test_file", "type": "*http_post", "export_path": "http://127.0.0.1:12080/invalid", - "tenant": "cgrates.org", "synchronous": true, "attempts": 1, "fields":[ @@ -118,7 +115,6 @@ "opts": { "kafkaTopic": "cgrates_cdrs", }, - "tenant": "cgrates.org", "synchronous": true, "attempts": 1, "fields":[ @@ -132,7 +128,6 @@ "opts": { "amqpQueueID": "cgrates_cdrs", }, - "tenant": "cgrates.org", "filters":["*string:~*ec.Cost:100"], "synchronous": true, "attempts": 1, diff --git a/data/conf/samples/cdrsv1processevent/cgrates.json b/data/conf/samples/cdrsv1processevent/cgrates.json index 9145991b3..9994ec40b 100644 --- a/data/conf/samples/cdrsv1processevent/cgrates.json +++ b/data/conf/samples/cdrsv1processevent/cgrates.json @@ -36,7 +36,6 @@ "id": "amqp_test_file", "type": "*amqp_json_map", "export_path": "amqps://guest:guest@localhost:256733/", - "tenant": "cgrates.org", "attempts": 1, "synchronous": true, "fields":[ diff --git a/data/conf/samples/cdrsv1processeventmongo/cgrates.json b/data/conf/samples/cdrsv1processeventmongo/cgrates.json index b4a30fb86..63fa92162 100644 --- a/data/conf/samples/cdrsv1processeventmongo/cgrates.json +++ b/data/conf/samples/cdrsv1processeventmongo/cgrates.json @@ -39,7 +39,6 @@ "id": "amqp_test_file", "type": "*amqp_json_map", "export_path": "amqps://guest:guest@localhost:256733/", - "tenant": "cgrates.org", "attempts": 1, "synchronous": true, "fields":[ diff --git a/data/conf/samples/cdrsv1processeventmysql/cgrates.json b/data/conf/samples/cdrsv1processeventmysql/cgrates.json index 9d1370568..8da4253ed 100644 --- a/data/conf/samples/cdrsv1processeventmysql/cgrates.json +++ b/data/conf/samples/cdrsv1processeventmysql/cgrates.json @@ -36,7 +36,6 @@ "id": "amqp_test_file", "type": "*amqp_json_map", "export_path": "amqps://guest:guest@localhost:256733/", - "tenant": "cgrates.org", "attempts": 1, "synchronous": true, "fields":[ diff --git a/data/conf/samples/cdrsv_failover_internal/cgrates.json b/data/conf/samples/cdrsv_failover_internal/cgrates.json index 5a7b7eae7..7be04a355 100644 --- a/data/conf/samples/cdrsv_failover_internal/cgrates.json +++ b/data/conf/samples/cdrsv_failover_internal/cgrates.json @@ -79,7 +79,6 @@ "s3BucketID": "cgrates-cdrs", // "awsToken": "sessionToken", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, diff --git a/data/conf/samples/cdrsv_failover_mongo/cgrates.json b/data/conf/samples/cdrsv_failover_mongo/cgrates.json index 1cd5d3acd..563e86a3c 100644 --- a/data/conf/samples/cdrsv_failover_mongo/cgrates.json +++ b/data/conf/samples/cdrsv_failover_mongo/cgrates.json @@ -88,7 +88,6 @@ "s3BucketID": "cgrates-cdrs", // "awsToken": "sessionToken", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, diff --git a/data/conf/samples/cdrsv_failover_mysql/cgrates.json b/data/conf/samples/cdrsv_failover_mysql/cgrates.json index ba50d399e..288460921 100644 --- a/data/conf/samples/cdrsv_failover_mysql/cgrates.json +++ b/data/conf/samples/cdrsv_failover_mysql/cgrates.json @@ -85,7 +85,6 @@ "s3BucketID": "cgrates-cdrs", // "awsToken": "sessionToken", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, diff --git a/data/conf/samples/diamagent_internal/voice.json b/data/conf/samples/diamagent_internal/voice.json index 1c7201894..7029c1d89 100644 --- a/data/conf/samples/diamagent_internal/voice.json +++ b/data/conf/samples/diamagent_internal/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_internal_gobbirpc/voice.json b/data/conf/samples/diamagent_internal_gobbirpc/voice.json index 1c7201894..78d50b303 100644 --- a/data/conf/samples/diamagent_internal_gobbirpc/voice.json +++ b/data/conf/samples/diamagent_internal_gobbirpc/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_internal_jsonbirpc/voice.json b/data/conf/samples/diamagent_internal_jsonbirpc/voice.json index 1c7201894..619e27677 100644 --- a/data/conf/samples/diamagent_internal_jsonbirpc/voice.json +++ b/data/conf/samples/diamagent_internal_jsonbirpc/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_mongo/voice.json b/data/conf/samples/diamagent_mongo/voice.json index 1110de3cf..3e3bd4b44 100644 --- a/data/conf/samples/diamagent_mongo/voice.json +++ b/data/conf/samples/diamagent_mongo/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_mongo_gobbirpc/voice.json b/data/conf/samples/diamagent_mongo_gobbirpc/voice.json index 1110de3cf..3e3bd4b44 100644 --- a/data/conf/samples/diamagent_mongo_gobbirpc/voice.json +++ b/data/conf/samples/diamagent_mongo_gobbirpc/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_mongo_jsonbirpc/voice.json b/data/conf/samples/diamagent_mongo_jsonbirpc/voice.json index 1110de3cf..3e3bd4b44 100644 --- a/data/conf/samples/diamagent_mongo_jsonbirpc/voice.json +++ b/data/conf/samples/diamagent_mongo_jsonbirpc/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_mysql/voice.json b/data/conf/samples/diamagent_mysql/voice.json index 1c7201894..78d50b303 100644 --- a/data/conf/samples/diamagent_mysql/voice.json +++ b/data/conf/samples/diamagent_mysql/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_mysql_gobbirpc/voice.json b/data/conf/samples/diamagent_mysql_gobbirpc/voice.json index 1c7201894..78d50b303 100644 --- a/data/conf/samples/diamagent_mysql_gobbirpc/voice.json +++ b/data/conf/samples/diamagent_mysql_gobbirpc/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamagent_mysql_jsonbirpc/voice.json b/data/conf/samples/diamagent_mysql_jsonbirpc/voice.json index 1c7201894..78d50b303 100644 --- a/data/conf/samples/diamagent_mysql_jsonbirpc/voice.json +++ b/data/conf/samples/diamagent_mysql_jsonbirpc/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -127,7 +128,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -210,8 +212,8 @@ {"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": "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"}, @@ -255,7 +257,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -360,7 +363,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { diff --git a/data/conf/samples/diamsctpagent_internal/voice.json b/data/conf/samples/diamsctpagent_internal/voice.json index 4c707886d..9cc462769 100755 --- a/data/conf/samples/diamsctpagent_internal/voice.json +++ b/data/conf/samples/diamsctpagent_internal/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -111,8 +112,8 @@ {"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": "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"}, @@ -142,8 +143,8 @@ {"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": "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"}, @@ -171,8 +172,8 @@ {"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": "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"}, @@ -204,8 +205,8 @@ {"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": "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", diff --git a/data/conf/samples/diamsctpagent_mongo/voice.json b/data/conf/samples/diamsctpagent_mongo/voice.json index 468ec852d..b2cea75be 100755 --- a/data/conf/samples/diamsctpagent_mongo/voice.json +++ b/data/conf/samples/diamsctpagent_mongo/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -111,8 +112,8 @@ {"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": "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"}, @@ -142,8 +143,8 @@ {"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": "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"}, @@ -171,8 +172,8 @@ {"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": "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"}, @@ -204,8 +205,8 @@ {"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": "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", diff --git a/data/conf/samples/diamsctpagent_mysql/voice.json b/data/conf/samples/diamsctpagent_mysql/voice.json index 4c707886d..9cc462769 100755 --- a/data/conf/samples/diamsctpagent_mysql/voice.json +++ b/data/conf/samples/diamsctpagent_mysql/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -111,8 +112,8 @@ {"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": "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"}, @@ -142,8 +143,8 @@ {"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": "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"}, @@ -171,8 +172,8 @@ {"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": "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"}, @@ -204,8 +205,8 @@ {"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": "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", diff --git a/data/conf/samples/dispatchers/diamagent/voice.json b/data/conf/samples/dispatchers/diamagent/voice.json index 762842679..028d465f3 100644 --- a/data/conf/samples/dispatchers/diamagent/voice.json +++ b/data/conf/samples/dispatchers/diamagent/voice.json @@ -28,7 +28,8 @@ { "tag": "OriginHost", "path": "*cgreq.OriginHost", - "type": "*remote_host", + "type": "*variable", + "value": "~*vars.RemoteHost", "mandatory": true }, { @@ -112,8 +113,8 @@ {"tag": "APIKey", "path": "*opts.*apiKey", "type": "*constant", "value": "ses12345"}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "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"}, @@ -144,8 +145,8 @@ {"tag": "APIKey", "path": "*opts.*apiKey", "type": "*constant", "value": "ses12345"}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "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"}, @@ -174,8 +175,8 @@ {"tag": "APIKey", "path": "*opts.*apiKey", "type": "*constant", "value": "ses12345"}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "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"}, @@ -208,8 +209,8 @@ {"tag": "APIKey", "path": "*opts.*apiKey", "type": "*constant", "value": "ses12345"}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.Session-Id", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "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", diff --git a/data/conf/samples/dispatchers/radagent/accounting.json b/data/conf/samples/dispatchers/radagent/accounting.json index 90c6e18ad..b6dd99a4f 100644 --- a/data/conf/samples/dispatchers/radagent/accounting.json +++ b/data/conf/samples/dispatchers/radagent/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/ees/cgrates.json b/data/conf/samples/ees/cgrates.json index a6c424123..f814c73c8 100644 --- a/data/conf/samples/ees/cgrates.json +++ b/data/conf/samples/ees/cgrates.json @@ -66,7 +66,6 @@ "id": "CSVExporter", "type": "*file_csv", "export_path": "/tmp/testCSV", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -76,7 +75,6 @@ "id": "CSVExporterComposed", "type": "*file_csv", "export_path": "/tmp/testComposedCSV", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -125,7 +123,6 @@ "id": "FwvExporter", "type": "*file_fwv", "export_path": "/tmp/testFWV", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -199,7 +196,6 @@ "id": "HTTPPostExporter", "type": "*http_post", "export_path": "http://127.0.0.1:12080/event_http", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -225,7 +221,6 @@ "id": "HTTPJsonMapExporter", "type": "*http_json_map", "export_path": "http://127.0.0.1:12081/event_json_map_http", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -252,7 +247,6 @@ "id": "CSVMaskedDestination", "type": "*file_csv", "export_path": "/tmp/testCSVMasked", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -278,7 +272,6 @@ { "id": "RouteExporter", // this exporter will set the Cost Account and RunID in cache so we can use it in other exports "type": "*virt", - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "Cost", "path": "*uch.<~*req.CGRID;~*req.RunID;-Cost>", "type": "*variable", @@ -293,7 +286,6 @@ "id": "CSVExporterFromVirt", "type": "*file_csv", "export_path": "/tmp/testCSVfromVirt", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -317,7 +309,6 @@ "id": "CSVExporterWIthTemplate", "type": "*file_csv", "export_path": "/tmp/testCSVExpTemp", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -330,7 +321,6 @@ "id": "ElasticsearchExporter", "type": "*els", "export_path": "http://localhost:9200", - "tenant": "cgrates.org", "attempts": 1, "opts": { "elsIndex": "cdrs", @@ -366,7 +356,6 @@ "id": "HTTPJsonMapExporterWithNoFields", "type": "*http_json_map", "export_path": "http://127.0.0.1:12081/event_json_map_http", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -375,14 +364,12 @@ "id": "ElasticExporterWithNoFields", "type": "*els", "export_path": "http://localhost:9200", - "tenant": "cgrates.org", "attempts": 1, }, { "id": "HTTPPostExporterWithNoFields", "type": "*http_post", "export_path": "http://127.0.0.1:12080/event_http", - "tenant": "cgrates.org", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, @@ -390,7 +377,6 @@ { "id": "SQLExporterFull", "type": "*sql", - "tenant": "cgrates.org", "export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306", "attempts": 1, "opts": { @@ -411,7 +397,6 @@ { "id": "SQLExporterPartial", "type": "*sql", - "tenant": "cgrates.org", "export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306", "attempts": 1, "opts": { diff --git a/data/conf/samples/ees_internal/cgrates.json b/data/conf/samples/ees_internal/cgrates.json index aece68ee5..9e4e8e626 100644 --- a/data/conf/samples/ees_internal/cgrates.json +++ b/data/conf/samples/ees_internal/cgrates.json @@ -64,7 +64,6 @@ "id": "CSVExporter", "type": "*file_csv", "export_path": "/tmp/testCSV", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": true, "attempts": 1, @@ -90,7 +89,6 @@ "id": "CSVExporter2", "type": "*file_csv", "export_path": "/tmp/testCSV2", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": true, "attempts": 1, @@ -117,7 +115,6 @@ "id": "CSVExporter3", "type": "*file_csv", "export_path": "/tmp/testCSV3", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": false, "attempts": 1, diff --git a/data/conf/samples/ees_mongo/cgrates.json b/data/conf/samples/ees_mongo/cgrates.json index 1f9461669..af597fcf0 100644 --- a/data/conf/samples/ees_mongo/cgrates.json +++ b/data/conf/samples/ees_mongo/cgrates.json @@ -68,7 +68,6 @@ "id": "CSVExporter", "type": "*file_csv", "export_path": "/tmp/testCSV", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": true, "attempts": 1, @@ -94,7 +93,6 @@ "id": "CSVExporter2", "type": "*file_csv", "export_path": "/tmp/testCSV2", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": true, "attempts": 1, @@ -121,7 +119,6 @@ "id": "CSVExporter3", "type": "*file_csv", "export_path": "/tmp/testCSV3", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": false, "attempts": 1, diff --git a/data/conf/samples/ees_mysql/cgrates.json b/data/conf/samples/ees_mysql/cgrates.json index 4dd815444..a30719a63 100644 --- a/data/conf/samples/ees_mysql/cgrates.json +++ b/data/conf/samples/ees_mysql/cgrates.json @@ -66,7 +66,6 @@ "id": "CSVExporter", "type": "*file_csv", "export_path": "/tmp/testCSV", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": true, "attempts": 1, @@ -92,7 +91,6 @@ "id": "CSVExporter2", "type": "*file_csv", "export_path": "/tmp/testCSV2", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": true, "attempts": 1, @@ -119,7 +117,6 @@ "id": "CSVExporter3", "type": "*file_csv", "export_path": "/tmp/testCSV3", - "tenant": "cgrates.org", "timezone": "UTC", "synchronous": false, "attempts": 1, diff --git a/data/conf/samples/httpagent_internal/httpagent.json b/data/conf/samples/httpagent_internal/httpagent.json index 19cbce3a4..45850c13d 100644 --- a/data/conf/samples/httpagent_internal/httpagent.json +++ b/data/conf/samples/httpagent_internal/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost","type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagent_internal_gob/httpagent.json b/data/conf/samples/httpagent_internal_gob/httpagent.json index 19cbce3a4..45850c13d 100644 --- a/data/conf/samples/httpagent_internal_gob/httpagent.json +++ b/data/conf/samples/httpagent_internal_gob/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost","type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagent_mongo/httpagent.json b/data/conf/samples/httpagent_mongo/httpagent.json index 19cbce3a4..45850c13d 100644 --- a/data/conf/samples/httpagent_mongo/httpagent.json +++ b/data/conf/samples/httpagent_mongo/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost","type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagent_mongo_gob/httpagent.json b/data/conf/samples/httpagent_mongo_gob/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagent_mongo_gob/httpagent.json +++ b/data/conf/samples/httpagent_mongo_gob/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagent_mysql/httpagent.json b/data/conf/samples/httpagent_mysql/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagent_mysql/httpagent.json +++ b/data/conf/samples/httpagent_mysql/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagent_mysql_gob/httpagent.json b/data/conf/samples/httpagent_mysql_gob/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagent_mysql_gob/httpagent.json +++ b/data/conf/samples/httpagent_mysql_gob/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagent_mysql_test/httpagent.json b/data/conf/samples/httpagent_mysql_test/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagent_mysql_test/httpagent.json +++ b/data/conf/samples/httpagent_mysql_test/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagenttls_internal/httpagent.json b/data/conf/samples/httpagenttls_internal/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagenttls_internal/httpagent.json +++ b/data/conf/samples/httpagenttls_internal/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagenttls_internal_gob/httpagent.json b/data/conf/samples/httpagenttls_internal_gob/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagenttls_internal_gob/httpagent.json +++ b/data/conf/samples/httpagenttls_internal_gob/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagenttls_mongo/httpagent.json b/data/conf/samples/httpagenttls_mongo/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagenttls_mongo/httpagent.json +++ b/data/conf/samples/httpagenttls_mongo/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagenttls_mongo_gob/httpagent.json b/data/conf/samples/httpagenttls_mongo_gob/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagenttls_mongo_gob/httpagent.json +++ b/data/conf/samples/httpagenttls_mongo_gob/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagenttls_mysql/httpagent.json b/data/conf/samples/httpagenttls_mysql/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagenttls_mysql/httpagent.json +++ b/data/conf/samples/httpagenttls_mysql/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/httpagenttls_mysql_gob/httpagent.json b/data/conf/samples/httpagenttls_mysql_gob/httpagent.json index 19cbce3a4..dfa90785b 100644 --- a/data/conf/samples/httpagenttls_mysql_gob/httpagent.json +++ b/data/conf/samples/httpagenttls_mysql_gob/httpagent.json @@ -64,8 +64,8 @@ "value": "*pseudoprepaid", "mandatory": true}, {"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.CDR_ID", "mandatory": true}, - {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*remote_host", - "mandatory": true}, + {"tag": "OriginHost", "path": "*cgreq.OriginHost", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/", "mandatory": true}, {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.msisdn", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", diff --git a/data/conf/samples/radagent_internal/accounting.json b/data/conf/samples/radagent_internal/accounting.json index 90c6e18ad..b6dd99a4f 100644 --- a/data/conf/samples/radagent_internal/accounting.json +++ b/data/conf/samples/radagent_internal/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_internal_gob/accounting.json b/data/conf/samples/radagent_internal_gob/accounting.json index 90c6e18ad..b6dd99a4f 100644 --- a/data/conf/samples/radagent_internal_gob/accounting.json +++ b/data/conf/samples/radagent_internal_gob/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mongo/accounting.json b/data/conf/samples/radagent_mongo/accounting.json index 90c6e18ad..b6dd99a4f 100644 --- a/data/conf/samples/radagent_mongo/accounting.json +++ b/data/conf/samples/radagent_mongo/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mongo_gob/accounting.json b/data/conf/samples/radagent_mongo_gob/accounting.json index 90c6e18ad..34c5c57c8 100644 --- a/data/conf/samples/radagent_mongo_gob/accounting.json +++ b/data/conf/samples/radagent_mongo_gob/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.{*sipuri_host}"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.{*sipuri_host}"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mysql/accounting.json b/data/conf/samples/radagent_mysql/accounting.json index 90c6e18ad..b6dd99a4f 100644 --- a/data/conf/samples/radagent_mysql/accounting.json +++ b/data/conf/samples/radagent_mysql/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/radagent_mysql_gob/accounting.json b/data/conf/samples/radagent_mysql_gob/accounting.json index 90c6e18ad..b6dd99a4f 100644 --- a/data/conf/samples/radagent_mysql_gob/accounting.json +++ b/data/conf/samples/radagent_mysql_gob/accounting.json @@ -24,7 +24,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*composed", "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, @@ -52,7 +53,8 @@ "value": "~*req.Ascend-User-Acct-Time", "mandatory": true}, {"tag": "Usage", "path": "*cgreq.Usage", "type": "*usage_difference", "value": "~*req.Event-Timestamp;~*req.Ascend-User-Acct-Time", "mandatory": true}, - {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*remote_host"}, + {"tag": "RemoteAddr" , "path": "*cgreq.RemoteAddr", "type": "*variable", + "value": "~*vars.RemoteHost:s/(.*):\\d+/${1}/"}, ], "reply_fields":[], }, diff --git a/data/conf/samples/tutmongo2/cgrates.json b/data/conf/samples/tutmongo2/cgrates.json index 85ffe6905..74add3b0f 100644 --- a/data/conf/samples/tutmongo2/cgrates.json +++ b/data/conf/samples/tutmongo2/cgrates.json @@ -63,7 +63,6 @@ "opts": { "amqpQueueID":"cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, diff --git a/data/conf/samples/tutmongo2_gob/cgrates.json b/data/conf/samples/tutmongo2_gob/cgrates.json index 11ee54b4f..833d25f35 100644 --- a/data/conf/samples/tutmongo2_gob/cgrates.json +++ b/data/conf/samples/tutmongo2_gob/cgrates.json @@ -70,7 +70,6 @@ "opts": { "amqpQueueID":"cgrates_cdrs", }, - "tenant": "cgrates.org", "attempts": 1, "fields":[ {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}, diff --git a/docs/diamagent.rst b/docs/diamagent.rst index f8ebc5494..6cac69ac3 100644 --- a/docs/diamagent.rst +++ b/docs/diamagent.rst @@ -323,9 +323,6 @@ type **\*constant** Writes out a constant - **\*remote_host** - Writes out the Address of the remote *DiameterClient* sending us the request - **\*variable** Writes out the variable value, overwriting previous one set diff --git a/docs/ers.rst b/docs/ers.rst index 321addf2c..b4e33e642 100644 --- a/docs/ers.rst +++ b/docs/ers.rst @@ -266,9 +266,6 @@ type **\*constant** Writes out a constant - **\*remote_host** - Writes out the Address of the remote host sending us the Event - **\*variable** Writes out the variable value, overwriting previous one set diff --git a/ees/ees.go b/ees/ees.go index 6b90874fa..f96195477 100644 --- a/ees/ees.go +++ b/ees/ees.go @@ -159,9 +159,6 @@ func (eeS *EventExporterS) V1ProcessEvent(cgrEv *utils.CGREventWithEeIDs, rply * if len(eeCfg.Filters) != 0 { tnt := utils.FirstNonEmpty(cgrEv.Tenant, eeS.cfg.GeneralCfg().DefaultTenant) - if eeTnt, errTnt := eeCfg.Tenant.ParseDataProvider(cgrDp); errTnt == nil && eeTnt != utils.EmptyString { - tnt = eeTnt - } if pass, errPass := eeS.filterS.Pass(tnt, eeCfg.Filters, cgrDp); errPass != nil { return errPass diff --git a/ees/ees_test.go b/ees/ees_test.go index 191055ef9..df4be3671 100644 --- a/ees/ees_test.go +++ b/ees/ees_test.go @@ -219,7 +219,6 @@ func TestV1ProcessEvent2(t *testing.T) { cgrCfg.EEsCfg().Exporters[0].Type = "*file_csv" cgrCfg.EEsCfg().Exporters[0].ID = "SQLExporterFull" cgrCfg.EEsCfg().Exporters[0].Filters = []string{"*prefix:~*req.Subject:20"} - cgrCfg.EEsCfg().Exporters[0].Tenant = config.NewRSRParsersMustCompile("cgrates.org", utils.InfieldSep) newIDb := engine.NewInternalDB(nil, nil, true) newDM := engine.NewDataManager(newIDb, cgrCfg.CacheCfg(), nil) filterS := engine.NewFilterS(cgrCfg, nil, newDM) diff --git a/ees/elastic.go b/ees/elastic.go index e43b28b41..1bf0ecebe 100644 --- a/ees/elastic.go +++ b/ees/elastic.go @@ -140,19 +140,19 @@ func (eEe *ElasticEe) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - req := utils.MapStorage(cgrEv.Event) - eeReq := engine.NewEventRequest(req, eEe.dc, cgrEv.APIOpts, - eEe.cgrCfg.EEsCfg().Exporters[eEe.cfgIdx].Tenant, - eEe.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(eEe.cgrCfg.EEsCfg().Exporters[eEe.cfgIdx].Timezone, - eEe.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: eEe.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: eEe.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, eEe.cgrCfg.GeneralCfg().DefaultTenant), eEe.filterS, oNm) if err = eeReq.SetFields(eEe.cgrCfg.EEsCfg().Exporters[eEe.cfgIdx].ContentFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { + for el := eeReq.ExpData[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { path := el.Value - nmIt, _ := eeReq.OrdNavMP[utils.MetaExp].Field(path) + nmIt, _ := eeReq.ExpData[utils.MetaExp].Field(path) path = path[:len(path)-1] // remove the last index valMp[strings.Join(path, utils.NestingSep)] = nmIt.String() } diff --git a/ees/filecsv.go b/ees/filecsv.go index 1233c1138..173f3d05f 100644 --- a/ees/filecsv.go +++ b/ees/filecsv.go @@ -113,18 +113,18 @@ func (fCsv *FileCSVee) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - req := utils.MapStorage(cgrEv.Event) - eeReq := engine.NewEventRequest(req, fCsv.dc, cgrEv.APIOpts, - fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Tenant, - fCsv.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Timezone, - fCsv.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: fCsv.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: fCsv.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, fCsv.cgrCfg.GeneralCfg().DefaultTenant), fCsv.filterS, oNm) if err = eeReq.SetFields(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].ContentFields()); err != nil { return } - csvRecord = eeReq.OrdNavMP[utils.MetaExp].OrderedFieldsAsStrings() + csvRecord = eeReq.ExpData[utils.MetaExp].OrderedFieldsAsStrings() } updateEEMetrics(fCsv.dc, cgrEv.Event, utils.FirstNonEmpty(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Timezone, @@ -140,16 +140,15 @@ func (fCsv *FileCSVee) composeHeader() (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaHdr: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(nil, fCsv.dc, nil, - fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Tenant, - fCsv.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Timezone, - fCsv.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaDC: fCsv.dc, + utils.MetaCfg: fCsv.cgrCfg.GetDataProvider(), + }, fCsv.cgrCfg.GeneralCfg().DefaultTenant, fCsv.filterS, oNm) if err = eeReq.SetFields(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].HeaderFields()); err != nil { return } - return fCsv.csvWriter.Write(eeReq.OrdNavMP[utils.MetaHdr].OrderedFieldsAsStrings()) + return fCsv.csvWriter.Write(eeReq.ExpData[utils.MetaHdr].OrderedFieldsAsStrings()) } // Compose and cache the trailer @@ -160,17 +159,16 @@ func (fCsv *FileCSVee) composeTrailer() (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaTrl: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(nil, fCsv.dc, nil, - fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Tenant, - fCsv.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Timezone, - fCsv.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaDC: fCsv.dc, + utils.MetaCfg: fCsv.cgrCfg.GetDataProvider(), + }, fCsv.cgrCfg.GeneralCfg().DefaultTenant, fCsv.filterS, oNm) if err = eeReq.SetFields(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].TrailerFields()); err != nil { return } - return fCsv.csvWriter.Write(eeReq.OrdNavMP[utils.MetaTrl].OrderedFieldsAsStrings()) + return fCsv.csvWriter.Write(eeReq.ExpData[utils.MetaTrl].OrderedFieldsAsStrings()) } func (fCsv *FileCSVee) GetMetrics() utils.MapStorage { diff --git a/ees/filefwv.go b/ees/filefwv.go index cd989b64f..788891fed 100644 --- a/ees/filefwv.go +++ b/ees/filefwv.go @@ -102,18 +102,18 @@ func (fFwv *FileFWVee) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - req := utils.MapStorage(cgrEv.Event) - eeReq := engine.NewEventRequest(req, fFwv.dc, cgrEv.APIOpts, - fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Tenant, - fFwv.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Timezone, - fFwv.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: fFwv.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: fFwv.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, fFwv.cgrCfg.GeneralCfg().DefaultTenant), fFwv.filterS, oNm) if err = eeReq.SetFields(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].ContentFields()); err != nil { return } - records = eeReq.OrdNavMP[utils.MetaExp].OrderedFieldsAsStrings() + records = eeReq.ExpData[utils.MetaExp].OrderedFieldsAsStrings() } updateEEMetrics(fFwv.dc, cgrEv.Event, utils.FirstNonEmpty(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Timezone, @@ -135,16 +135,15 @@ func (fFwv *FileFWVee) composeHeader() (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaHdr: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(nil, fFwv.dc, nil, - fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Tenant, - fFwv.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Timezone, - fFwv.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaDC: fFwv.dc, + utils.MetaCfg: fFwv.cgrCfg.GetDataProvider(), + }, fFwv.cgrCfg.GeneralCfg().DefaultTenant, fFwv.filterS, oNm) if err = eeReq.SetFields(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].HeaderFields()); err != nil { return } - for _, record := range eeReq.OrdNavMP[utils.MetaHdr].OrderedFieldsAsStrings() { + for _, record := range eeReq.ExpData[utils.MetaHdr].OrderedFieldsAsStrings() { if _, err = io.WriteString(fFwv.file, record); err != nil { return } @@ -161,16 +160,15 @@ func (fFwv *FileFWVee) composeTrailer() (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaTrl: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(nil, fFwv.dc, nil, - fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Tenant, - fFwv.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].Timezone, - fFwv.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaDC: fFwv.dc, + utils.MetaCfg: fFwv.cgrCfg.GetDataProvider(), + }, fFwv.cgrCfg.GeneralCfg().DefaultTenant, fFwv.filterS, oNm) if err = eeReq.SetFields(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].TrailerFields()); err != nil { return } - for _, record := range eeReq.OrdNavMP[utils.MetaTrl].OrderedFieldsAsStrings() { + for _, record := range eeReq.ExpData[utils.MetaTrl].OrderedFieldsAsStrings() { if _, err = io.WriteString(fFwv.file, record); err != nil { return } diff --git a/ees/httpjsonmap.go b/ees/httpjsonmap.go index cca819ff1..7d472e1dd 100644 --- a/ees/httpjsonmap.go +++ b/ees/httpjsonmap.go @@ -87,18 +87,20 @@ func (httpEE *HTTPjsonMapEE) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(utils.MapStorage(cgrEv.Event), httpEE.dc, cgrEv.APIOpts, - httpEE.cgrCfg.EEsCfg().Exporters[httpEE.cfgIdx].Tenant, - httpEE.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(httpEE.cgrCfg.EEsCfg().Exporters[httpEE.cfgIdx].Timezone, - httpEE.cgrCfg.GeneralCfg().DefaultTimezone), httpEE.filterS, oNm) + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: httpEE.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: httpEE.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, httpEE.cgrCfg.GeneralCfg().DefaultTenant), + httpEE.filterS, oNm) if err = eeReq.SetFields(httpEE.cgrCfg.EEsCfg().Exporters[httpEE.cfgIdx].ContentFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { + for el := eeReq.ExpData[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { path := el.Value - nmIt, _ := eeReq.OrdNavMP[utils.MetaExp].Field(path) + nmIt, _ := eeReq.ExpData[utils.MetaExp].Field(path) path = path[:len(path)-1] // remove the last index valMp[strings.Join(path, utils.NestingSep)] = nmIt.String() } @@ -135,19 +137,18 @@ func (httpEE *HTTPjsonMapEE) composeHeader() (hdr http.Header, err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaHdr: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(nil, httpEE.dc, nil, - httpEE.cgrCfg.EEsCfg().Exporters[httpEE.cfgIdx].Tenant, - httpEE.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(httpEE.cgrCfg.EEsCfg().Exporters[httpEE.cfgIdx].Timezone, - httpEE.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaDC: httpEE.dc, + utils.MetaCfg: httpEE.cgrCfg.GetDataProvider(), + }, httpEE.cgrCfg.GeneralCfg().DefaultTenant, httpEE.filterS, oNm) if err = eeReq.SetFields(httpEE.cgrCfg.EEsCfg().Exporters[httpEE.cfgIdx].HeaderFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaHdr].GetFirstElement(); el != nil; el = el.Next() { + for el := eeReq.ExpData[utils.MetaHdr].GetFirstElement(); el != nil; el = el.Next() { path := el.Value - nmIt, _ := eeReq.OrdNavMP[utils.MetaHdr].Field(path) //Safe to ignore error, since the path always exists - path = path[:len(path)-1] // remove the last index + nmIt, _ := eeReq.ExpData[utils.MetaHdr].Field(path) //Safe to ignore error, since the path always exists + path = path[:len(path)-1] // remove the last index hdr.Set(strings.Join(path, utils.NestingSep), nmIt.String()) } return diff --git a/ees/httppost.go b/ees/httppost.go index 96069e0dd..7011342e2 100644 --- a/ees/httppost.go +++ b/ees/httppost.go @@ -82,19 +82,19 @@ func (httpPost *HTTPPost) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - req := utils.MapStorage(cgrEv.Event) - eeReq := engine.NewEventRequest(req, httpPost.dc, cgrEv.APIOpts, - httpPost.cgrCfg.EEsCfg().Exporters[httpPost.cfgIdx].Tenant, - httpPost.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(httpPost.cgrCfg.EEsCfg().Exporters[httpPost.cfgIdx].Timezone, - httpPost.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: httpPost.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: httpPost.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, httpPost.cgrCfg.GeneralCfg().DefaultTenant), httpPost.filterS, oNm) if err = eeReq.SetFields(httpPost.cgrCfg.EEsCfg().Exporters[httpPost.cfgIdx].ContentFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { + for el := eeReq.ExpData[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { path := el.Value - nmIt, _ := eeReq.OrdNavMP[utils.MetaExp].Field(path) + nmIt, _ := eeReq.ExpData[utils.MetaExp].Field(path) path = path[:len(path)-1] // remove the last index urlVals.Set(strings.Join(path, utils.NestingSep), nmIt.String()) } @@ -129,18 +129,17 @@ func (httpPost *HTTPPost) composeHeader() (hdr http.Header, err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaHdr: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(nil, httpPost.dc, nil, - httpPost.cgrCfg.EEsCfg().Exporters[httpPost.cfgIdx].Tenant, - httpPost.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(httpPost.cgrCfg.EEsCfg().Exporters[httpPost.cfgIdx].Timezone, - httpPost.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaDC: httpPost.dc, + utils.MetaCfg: httpPost.cgrCfg.GetDataProvider(), + }, httpPost.cgrCfg.GeneralCfg().DefaultTenant, httpPost.filterS, oNm) if err = eeReq.SetFields(httpPost.cgrCfg.EEsCfg().Exporters[httpPost.cfgIdx].HeaderFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaHdr].GetFirstElement(); el != nil; el = el.Next() { + for el := eeReq.ExpData[utils.MetaHdr].GetFirstElement(); el != nil; el = el.Next() { path := el.Value - nmIt, _ := eeReq.OrdNavMP[utils.MetaHdr].Field(path) + nmIt, _ := eeReq.ExpData[utils.MetaHdr].Field(path) path = path[:len(path)-1] // remove the last index hdr.Set(strings.Join(path, utils.NestingSep), nmIt.String()) } diff --git a/ees/posterjsonmap.go b/ees/posterjsonmap.go index 4054f045e..8f237199b 100644 --- a/ees/posterjsonmap.go +++ b/ees/posterjsonmap.go @@ -103,18 +103,20 @@ func (pstrEE *PosterJSONMapEE) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(utils.MapStorage(cgrEv.Event), pstrEE.dc, cgrEv.APIOpts, - pstrEE.cgrCfg.EEsCfg().Exporters[pstrEE.cfgIdx].Tenant, - pstrEE.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(pstrEE.cgrCfg.EEsCfg().Exporters[pstrEE.cfgIdx].Timezone, - pstrEE.cgrCfg.GeneralCfg().DefaultTimezone), pstrEE.filterS, oNm) + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: pstrEE.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: pstrEE.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, pstrEE.cgrCfg.GeneralCfg().DefaultTenant), + pstrEE.filterS, oNm) if err = eeReq.SetFields(pstrEE.cgrCfg.EEsCfg().Exporters[pstrEE.cfgIdx].ContentFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { + for el := eeReq.ExpData[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { path := el.Value - nmIt, _ := eeReq.OrdNavMP[utils.MetaExp].Field(path) + nmIt, _ := eeReq.ExpData[utils.MetaExp].Field(path) path = path[:len(path)-1] // remove the last index valMp[strings.Join(path, utils.NestingSep)] = nmIt.String() } diff --git a/ees/sql.go b/ees/sql.go index 4fbac55b8..9d225faa9 100644 --- a/ees/sql.go +++ b/ees/sql.go @@ -160,19 +160,19 @@ func (sqlEe *SQLEe) ExportEvent(cgrEv *utils.CGREvent) (err error) { oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - req := utils.MapStorage(cgrEv.Event) - eeReq := engine.NewEventRequest(req, sqlEe.dc, cgrEv.APIOpts, - sqlEe.cgrCfg.EEsCfg().Exporters[sqlEe.cfgIdx].Tenant, - sqlEe.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(sqlEe.cgrCfg.EEsCfg().Exporters[sqlEe.cfgIdx].Timezone, - sqlEe.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: sqlEe.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: sqlEe.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, sqlEe.cgrCfg.GeneralCfg().DefaultTenant), sqlEe.filterS, oNm) if err = eeReq.SetFields(sqlEe.cgrCfg.EEsCfg().Exporters[sqlEe.cfgIdx].ContentFields()); err != nil { return } - for el := eeReq.OrdNavMP[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { - nmIt, _ := eeReq.OrdNavMP[utils.MetaExp].Field(el.Value) + for el := eeReq.ExpData[utils.MetaExp].GetFirstElement(); el != nil; el = el.Next() { + nmIt, _ := eeReq.ExpData[utils.MetaExp].Field(el.Value) pathWithoutIndex := strings.Join(el.Value[:len(el.Value)-1], utils.NestingSep) // remove the index path.index if pathWithoutIndex != utils.MetaRow { colNames = append(colNames, pathWithoutIndex) diff --git a/ees/virtualee.go b/ees/virtualee.go index a1d4c5d3d..d819cf2d3 100644 --- a/ees/virtualee.go +++ b/ees/virtualee.go @@ -70,15 +70,15 @@ func (vEe *VirtualEe) ExportEvent(cgrEv *utils.CGREvent) (err error) { }() vEe.dc[utils.NumberOfEvents] = vEe.dc[utils.NumberOfEvents].(int64) + 1 - req := utils.MapStorage(cgrEv.Event) oNm := map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), } - eeReq := engine.NewEventRequest(req, vEe.dc, cgrEv.APIOpts, - vEe.cgrCfg.EEsCfg().Exporters[vEe.cfgIdx].Tenant, - vEe.cgrCfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(vEe.cgrCfg.EEsCfg().Exporters[vEe.cfgIdx].Timezone, - vEe.cgrCfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaDC: vEe.dc, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: vEe.cgrCfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, vEe.cgrCfg.GeneralCfg().DefaultTenant), vEe.filterS, oNm) if err = eeReq.SetFields(vEe.cgrCfg.EEsCfg().Exporters[vEe.cfgIdx].ContentFields()); err != nil { return diff --git a/engine/account.go b/engine/account.go index 50e392236..8418d5050 100644 --- a/engine/account.go +++ b/engine/account.go @@ -22,7 +22,6 @@ import ( "encoding/json" "errors" "fmt" - "net" "strings" "time" @@ -1252,11 +1251,6 @@ func (as *AccountSummary) String() string { return utils.ToIJSON(as) } -// RemoteHost implements utils.DataProvider -func (ar *AccountSummary) RemoteHost() net.Addr { - return utils.LocalAddr() -} - func (as *AccountSummary) AsMapInterface() map[string]interface{} { return map[string]interface{}{ utils.Tenant: as.Tenant, diff --git a/engine/action.go b/engine/action.go index 317dbb549..8a2155b77 100644 --- a/engine/action.go +++ b/engine/action.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "html/template" - "net" "net/http" "net/smtp" "reflect" @@ -890,11 +889,6 @@ func (cdrP *cdrLogProvider) FieldAsString(fldPath []string) (data string, err er return utils.IfaceAsString(valIface), nil } -// RemoteHost is part of utils.DataProvider interface -func (cdrP *cdrLogProvider) RemoteHost() net.Addr { - return utils.LocalAddr() -} - func removeSessionCosts(_ *Account, action *Action, _ Actions, _ interface{}) error { // FiltersID;inlineFilter tenant := config.CgrConfig().GeneralCfg().DefaultTenant smcFilter := new(utils.SMCostFilter) diff --git a/engine/attributes.go b/engine/attributes.go index 52ce74f4b..a026b16d7 100644 --- a/engine/attributes.go +++ b/engine/attributes.go @@ -502,8 +502,6 @@ func ParseAttribute(dp utils.DataProvider, attrType, path string, value config.R return } out = pathVal + val - case utils.MetaRemoteHost: - out = dp.RemoteHost().String() case utils.MetaCCUsage: if len(value) != 3 { return nil, fmt.Errorf("invalid arguments <%s> to %s", diff --git a/engine/calldesc.go b/engine/calldesc.go index 8d16e16d1..e1d30e090 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -21,7 +21,6 @@ package engine import ( "errors" "fmt" - "net" "sync" "time" @@ -1038,11 +1037,6 @@ func (cd *CallDescriptor) String() string { return utils.ToJSON(cd) } -// RemoteHost is part of utils.DataProvider -func (cd *CallDescriptor) RemoteHost() net.Addr { - return utils.LocalAddr() -} - type CallDescriptorWithAPIOpts struct { *CallDescriptor APIOpts map[string]interface{} diff --git a/engine/caps.go b/engine/caps.go index 8657a3482..6cdeccc8a 100644 --- a/engine/caps.go +++ b/engine/caps.go @@ -19,7 +19,6 @@ along with this program. If not, see package engine import ( - "net" "strconv" "sync" "time" @@ -135,4 +134,3 @@ type floatDP float64 func (f floatDP) String() string { return strconv.FormatFloat(float64(f), 'f', -1, 64) } func (f floatDP) FieldAsInterface(fldPath []string) (interface{}, error) { return float64(f), nil } func (f floatDP) FieldAsString(fldPath []string) (string, error) { return f.String(), nil } -func (f floatDP) RemoteHost() net.Addr { return nil } diff --git a/engine/caps_test.go b/engine/caps_test.go index f575a0221..a37cd10eb 100644 --- a/engine/caps_test.go +++ b/engine/caps_test.go @@ -135,9 +135,6 @@ func TestFloatDP(t *testing.T) { } else if s != expStr { t.Errorf("Expected: %v ,received:%v", expStr, s) } - if r := f.RemoteHost(); r != nil { - t.Errorf("Expected remote host to be nil received:%v", r) - } exp := 10. if s, err := f.FieldAsInterface(nil); err != nil { t.Error(err) diff --git a/engine/dynamicdp.go b/engine/dynamicdp.go index 171213e42..b24e1a99d 100644 --- a/engine/dynamicdp.go +++ b/engine/dynamicdp.go @@ -17,7 +17,6 @@ package engine import ( "fmt" - "net" "github.com/nyaruka/phonenumbers" @@ -57,10 +56,6 @@ func (dDP *dynamicDP) FieldAsString(fldPath []string) (string, error) { return utils.IfaceAsString(val), nil } -func (dDP *dynamicDP) RemoteHost() net.Addr { - return utils.LocalAddr() -} - var initialDPPrefixes = utils.NewStringSet([]string{ utils.MetaReq, utils.MetaVars, utils.MetaCgreq, utils.MetaCgrep, utils.MetaRep, utils.MetaAct, @@ -174,10 +169,6 @@ func (dDP *libphonenumberDP) FieldAsString(fldPath []string) (string, error) { return utils.IfaceAsString(val), nil } -func (dDP *libphonenumberDP) RemoteHost() net.Addr { - return utils.LocalAddr() -} - func (dDP *libphonenumberDP) FieldAsInterface(fldPath []string) (val interface{}, err error) { if len(fldPath) == 0 { dDP.setDefaultFields() diff --git a/engine/eventcost.go b/engine/eventcost.go index 90bedbe43..f9606a77d 100644 --- a/engine/eventcost.go +++ b/engine/eventcost.go @@ -21,7 +21,6 @@ package engine import ( "errors" "fmt" - "net" "time" "github.com/cgrates/cgrates/utils" @@ -1194,8 +1193,3 @@ func (ec *EventCost) FieldAsString(fldPath []string) (string, error) { } return utils.IfaceAsString(ival), nil } - -// RemoteHost to implement Dataprovider -func (ec *EventCost) RemoteHost() net.Addr { - return utils.LocalAddr() -} diff --git a/engine/eventcost_test.go b/engine/eventcost_test.go index bf3448956..63413ce2c 100644 --- a/engine/eventcost_test.go +++ b/engine/eventcost_test.go @@ -3366,13 +3366,6 @@ func TestEventCostFieldAsString(t *testing.T) { } } -func TestEventCostRemoteHost(t *testing.T) { - eventCost := &EventCost{} - eOut := utils.LocalAddr() - if rcv := eventCost.RemoteHost(); !reflect.DeepEqual(eOut, rcv) { - t.Errorf("Expecting: %+v, received: %+v", eOut, rcv) - } -} func TestECAsCallCost3(t *testing.T) { eCC := &CallCost{ Category: "call", diff --git a/engine/eventrequest.go b/engine/eventrequest.go index 1466b1923..6ef0e27c8 100644 --- a/engine/eventrequest.go +++ b/engine/eventrequest.go @@ -20,79 +20,58 @@ package engine import ( "fmt" - "net" "strings" "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/utils" ) -// NewEventRequest returns a new EventRequest -func NewEventRequest(req utils.DataProvider, dc, opts utils.MapStorage, - tntTpl config.RSRParsers, dfltTenant, timezone string, - filterS *FilterS, oNM map[string]*utils.OrderedNavigableMap) (eeR *EventRequest) { - eeR = &EventRequest{ - req: req, - Tenant: dfltTenant, - Timezone: timezone, - filterS: filterS, - dc: dc, - opts: opts, - OrdNavMP: oNM, - Cfg: config.CgrConfig().GetDataProvider(), - } - if tnt, err := tntTpl.ParseDataProvider(eeR); err == nil && tnt != utils.EmptyString { - eeR.Tenant = tnt +// NewExportRequest returns a new EventRequest +func NewExportRequest(inData map[string]utils.MapStorage, + tnt string, + filterS *FilterS, oNM map[string]*utils.OrderedNavigableMap) (eeR *ExportRequest) { + eeR = &ExportRequest{ + inData: inData, + filterS: filterS, + tnt: tnt, + ExpData: oNM, } return } -// EventRequest represents data related to one request towards agent +// ExportRequest represents data related to one request towards agent // implements utils.DataProvider so we can pass it to filters -type EventRequest struct { - req utils.DataProvider // request - Tenant string - Timezone string - OrdNavMP map[string]*utils.OrderedNavigableMap // *exp:OrderNavMp *trl:OrderNavMp *cdr:OrderNavMp - dc utils.MapStorage - opts utils.MapStorage - Cfg utils.DataProvider - +type ExportRequest struct { + inData map[string]utils.MapStorage // request + ExpData map[string]*utils.OrderedNavigableMap // *exp:OrderNavMp *trl:OrderNavMp *cdr:OrderNavMp + tnt string filterS *FilterS } // String implements utils.DataProvider -func (eeR *EventRequest) String() string { +func (eeR *ExportRequest) String() string { return utils.ToIJSON(eeR) } -// RemoteHost implements utils.DataProvider -func (eeR *EventRequest) RemoteHost() net.Addr { - return eeR.req.RemoteHost() -} - // FieldAsInterface implements utils.DataProvider -func (eeR *EventRequest) FieldAsInterface(fldPath []string) (val interface{}, err error) { +func (eeR *ExportRequest) FieldAsInterface(fldPath []string) (val interface{}, err error) { switch fldPath[0] { default: - dp, has := eeR.OrdNavMP[fldPath[0]] - if !has { - return nil, fmt.Errorf("unsupported field prefix: <%s>", fldPath[0]) + var dp utils.DataProvider + var has bool + if dp, has = eeR.ExpData[fldPath[0]]; !has { + if dp, has = eeR.inData[fldPath[0]]; !has { + return nil, fmt.Errorf("unsupported field prefix: <%s>", fldPath[0]) + } } val, err = dp.FieldAsInterface(fldPath[1:]) - case utils.MetaReq: - val, err = eeR.req.FieldAsInterface(fldPath[1:]) case utils.MetaUCH: var ok bool if val, ok = Cache.Get(utils.CacheUCH, strings.Join(fldPath[1:], utils.NestingSep)); !ok { return nil, utils.ErrNotFound } - case utils.MetaDC: - val, err = eeR.dc.FieldAsInterface(fldPath[1:]) - case utils.MetaOpts: - val, err = eeR.opts.FieldAsInterface(fldPath[1:]) - case utils.MetaCfg: - val, err = eeR.Cfg.FieldAsInterface(fldPath[1:]) + case utils.MetaTenant: + return eeR.tnt, nil } if err != nil { return @@ -107,7 +86,7 @@ func (eeR *EventRequest) FieldAsInterface(fldPath []string) (val interface{}, er } // FieldAsString implements utils.DataProvider -func (eeR *EventRequest) FieldAsString(fldPath []string) (val string, err error) { +func (eeR *ExportRequest) FieldAsString(fldPath []string) (val string, err error) { var iface interface{} if iface, err = eeR.FieldAsInterface(fldPath); err != nil { return @@ -116,9 +95,9 @@ func (eeR *EventRequest) FieldAsString(fldPath []string) (val string, err error) } //SetFields will populate fields of AgentRequest out of templates -func (eeR *EventRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { +func (eeR *ExportRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { for _, tplFld := range tplFlds { - if pass, err := eeR.filterS.Pass(eeR.Tenant, + if pass, err := eeR.filterS.Pass(eeR.tnt, tplFld.Filters, eeR); err != nil { return err } else if !pass { @@ -167,14 +146,14 @@ func (eeR *EventRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { } // Set implements utils.NMInterface -func (eeR *EventRequest) SetAsSlice(fullPath *utils.FullPath, val *utils.DataLeaf) (err error) { +func (eeR *ExportRequest) SetAsSlice(fullPath *utils.FullPath, val *utils.DataLeaf) (err error) { switch prfx := fullPath.PathSlice[0]; prfx { case utils.MetaUCH: return Cache.Set(utils.CacheUCH, fullPath.Path[5:], val.Data, nil, true, utils.NonTransactional) case utils.MetaOpts: - return eeR.opts.Set(fullPath.PathSlice[1:], val.Data) + return eeR.inData[utils.MetaOpts].Set(fullPath.PathSlice[1:], val.Data) default: - oNM, has := eeR.OrdNavMP[prfx] + oNM, has := eeR.ExpData[prfx] if !has { return fmt.Errorf("unsupported field prefix: <%s> when set field", prfx) } @@ -186,14 +165,14 @@ func (eeR *EventRequest) SetAsSlice(fullPath *utils.FullPath, val *utils.DataLea } // ParseField outputs the value based on the template item -func (eeR *EventRequest) ParseField( +func (eeR *ExportRequest) ParseField( cfgFld *config.FCTemplate) (out interface{}, err error) { tmpType := cfgFld.Type switch tmpType { case utils.MetaMaskedDestination: //check if we have destination in the event var dst string - if dst, err = eeR.req.FieldAsString([]string{utils.Destination}); err != nil { + if dst, err = eeR.inData[utils.MetaReq].FieldAsString([]string{utils.Destination}); err != nil { err = fmt.Errorf("error <%s> getting destination for %s", err, utils.ToJSON(cfgFld)) return @@ -224,14 +203,14 @@ func (eeR *EventRequest) ParseField( // Set sets the value at the given path // this used with full path and the processed path to not calculate them for every set -func (eeR *EventRequest) Append(fullPath *utils.FullPath, val *utils.DataLeaf) (err error) { +func (eeR *ExportRequest) Append(fullPath *utils.FullPath, val *utils.DataLeaf) (err error) { switch prfx := fullPath.PathSlice[0]; prfx { case utils.MetaUCH: return Cache.Set(utils.CacheUCH, fullPath.Path[5:], val.Data, nil, true, utils.NonTransactional) case utils.MetaOpts: - return eeR.opts.Set(fullPath.PathSlice[1:], val.Data) + return eeR.inData[utils.MetaOpts].Set(fullPath.PathSlice[1:], val.Data) default: - oNM, has := eeR.OrdNavMP[prfx] + oNM, has := eeR.ExpData[prfx] if !has { return fmt.Errorf("unsupported field prefix: <%s> when set field", prfx) } @@ -244,7 +223,7 @@ func (eeR *EventRequest) Append(fullPath *utils.FullPath, val *utils.DataLeaf) ( // Set sets the value at the given path // this used with full path and the processed path to not calculate them for every set -func (eeR *EventRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf) (err error) { +func (eeR *ExportRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf) (err error) { switch prfx := fullPath.PathSlice[0]; prfx { case utils.MetaUCH: path := fullPath.Path[5:] @@ -257,7 +236,7 @@ func (eeR *EventRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf) return Cache.Set(utils.CacheUCH, path, prv, nil, true, utils.NonTransactional) case utils.MetaOpts: var prv interface{} - if prv, err = eeR.opts.FieldAsInterface(fullPath.PathSlice[1:]); err != nil { + if prv, err = eeR.inData[utils.MetaOpts].FieldAsInterface(fullPath.PathSlice[1:]); err != nil { if err != utils.ErrNotFound { return } @@ -265,9 +244,9 @@ func (eeR *EventRequest) Compose(fullPath *utils.FullPath, val *utils.DataLeaf) } else { prv = utils.IfaceAsString(prv) + utils.IfaceAsString(val.Data) } - return eeR.opts.Set(fullPath.PathSlice[1:], prv) + return eeR.inData[utils.MetaOpts].Set(fullPath.PathSlice[1:], prv) default: - oNM, has := eeR.OrdNavMP[prfx] + oNM, has := eeR.ExpData[prfx] if !has { return fmt.Errorf("unsupported field prefix: <%s> when set field", prfx) } diff --git a/engine/eventrequest_test.go b/engine/eventrequest_test.go index fbf7fc41a..2ec505a1e 100644 --- a/engine/eventrequest_test.go +++ b/engine/eventrequest_test.go @@ -29,8 +29,7 @@ import ( ) func TestEventRequestParseFieldDateTimeDaily(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*daily", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*daily", utils.InfieldSep), @@ -58,8 +57,7 @@ func TestEventRequestParseFieldDateTimeDaily(t *testing.T) { } func TestEventReqParseFieldDateTimeTimeZone(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*daily", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*daily", utils.InfieldSep), @@ -87,8 +85,7 @@ func TestEventReqParseFieldDateTimeTimeZone(t *testing.T) { } func TestEventReqParseFieldDateTimeMonthly(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*monthly", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*monthly", utils.InfieldSep), @@ -115,8 +112,7 @@ func TestEventReqParseFieldDateTimeMonthly(t *testing.T) { } func TestEventReqParseFieldDateTimeMonthlyEstimated(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*monthly_estimated", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*monthly_estimated", utils.InfieldSep), @@ -143,8 +139,7 @@ func TestEventReqParseFieldDateTimeMonthlyEstimated(t *testing.T) { } func TestEventReqParseFieldDateTimeYearly(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*yearly", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*yearly", utils.InfieldSep), @@ -171,8 +166,7 @@ func TestEventReqParseFieldDateTimeYearly(t *testing.T) { } func TestEventReqParseFieldDateTimeMetaUnlimited(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile(utils.MetaUnlimited, utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile(utils.MetaUnlimited, utils.InfieldSep), @@ -199,8 +193,7 @@ func TestEventReqParseFieldDateTimeMetaUnlimited(t *testing.T) { } func TestEventReqParseFieldDateTimeEmpty(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("", utils.InfieldSep), @@ -227,8 +220,7 @@ func TestEventReqParseFieldDateTimeEmpty(t *testing.T) { } func TestEventReqParseFieldDateTimeMonthEnd(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*month_endTest", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*month_endTest", utils.InfieldSep), @@ -255,8 +247,7 @@ func TestEventReqParseFieldDateTimeMonthEnd(t *testing.T) { } func TestAgentRequestParseFieldDateTimeError(t *testing.T) { - tntTpl := config.NewRSRParsersMustCompile("*month_endTest", utils.InfieldSep) - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, tntTpl, "", "", nil, nil) + EventReq := NewExportRequest(map[string]utils.MapStorage{}, "", nil, nil) fctTemp := &config.FCTemplate{ Type: utils.MetaDateTime, Value: config.NewRSRParsersMustCompile("*month_endTest", utils.InfieldSep), @@ -269,22 +260,3 @@ func TestAgentRequestParseFieldDateTimeError(t *testing.T) { t.Errorf("Expected <%+v> but received <%+v>", expected, err) } } - -func TestEventReqParseFieldDateTimeError2(t *testing.T) { - prsr, err := config.NewRSRParsersFromSlice([]string{"2.", "~*req.CGRID<~*opts.Converter>"}) - if err != nil { - t.Fatal(err) - } - EventReq := NewEventRequest(utils.MapStorage{}, nil, nil, prsr, "", "", nil, nil) - fctTemp := &config.FCTemplate{Type: utils.MetaDateTime, - Value: prsr, - Layout: "“Mon Jan _2 15:04:05 2006”", - Timezone: "/", - } - - _, err = EventReq.ParseField(fctTemp) - expected := utils.ErrNotFound - if err == nil || err != expected { - t.Errorf("Expected <%+v> but received <%+v>", expected, err) - } -} diff --git a/engine/mapevent.go b/engine/mapevent.go index 2cb09dc6c..07ae70145 100644 --- a/engine/mapevent.go +++ b/engine/mapevent.go @@ -20,7 +20,6 @@ package engine import ( "fmt" - "net" "time" "github.com/cgrates/cgrates/config" @@ -60,10 +59,6 @@ func (me MapEvent) FieldAsString(fldPath []string) (string, error) { return me.GetString(fldPath[0]) } -func (me MapEvent) RemoteHost() net.Addr { - return utils.LocalAddr() -} - func (me MapEvent) HasField(fldName string) (has bool) { _, has = me[fldName] return diff --git a/engine/mapevent_test.go b/engine/mapevent_test.go index 0d3e975bf..0155c909e 100644 --- a/engine/mapevent_test.go +++ b/engine/mapevent_test.go @@ -95,13 +95,6 @@ func TestMapEventFieldAsString(t *testing.T) { } } -func TestMapEventRemoteHost(t *testing.T) { - data := utils.DataProvider(mapEv) - if rply, expected := data.RemoteHost(), utils.LocalAddr(); !reflect.DeepEqual(expected, rply) { - t.Errorf("Expecting %+v, received: %+v", expected, rply) - } -} - func TestMapEventString(t *testing.T) { me := NewMapEvent(nil) if rply, expected := me.String(), utils.ToJSON(me); !reflect.DeepEqual(expected, rply) { diff --git a/engine/safevent.go b/engine/safevent.go index f6fe866fc..56d0b1770 100644 --- a/engine/safevent.go +++ b/engine/safevent.go @@ -19,7 +19,6 @@ along with this program. If not, see package engine import ( - "net" "sync" "time" @@ -70,13 +69,6 @@ func (se *SafEvent) FieldAsString(fldPath []string) (out string, err error) { return } -func (se *SafEvent) RemoteHost() (out net.Addr) { - se.RLock() - out = se.Me.RemoteHost() - se.RUnlock() - return -} - func (se *SafEvent) HasField(fldName string) (has bool) { se.RLock() has = se.Me.HasField(fldName) diff --git a/engine/safevent_test.go b/engine/safevent_test.go index 98c12a1a7..209ba7f80 100644 --- a/engine/safevent_test.go +++ b/engine/safevent_test.go @@ -92,13 +92,6 @@ func TestSafEventFieldAsString(t *testing.T) { } } -func TestSafEventRemoteHost(t *testing.T) { - data := utils.DataProvider(safEv) - if rply, expected := data.RemoteHost(), utils.LocalAddr(); !reflect.DeepEqual(expected, rply) { - t.Errorf("Expecting %+v, received: %+v", expected, rply) - } -} - func TestSafEventClone(t *testing.T) { for i := 0; i < 10; i++ { t.Run("clone", func(t *testing.T) { diff --git a/engine/task.go b/engine/task.go index c79725139..80cd3f37b 100644 --- a/engine/task.go +++ b/engine/task.go @@ -19,7 +19,6 @@ along with this program. If not, see package engine import ( - "net" "strings" "github.com/cgrates/cgrates/utils" @@ -74,8 +73,3 @@ func (t *Task) FieldAsString(fldPath []string) (s string, err error) { return "", utils.ErrPrefixNotFound(strings.Join(fldPath, utils.NestingSep)) } } - -// RemoteHost implements utils.DataProvider -func (t *Task) RemoteHost() (rh net.Addr) { - return -} diff --git a/engine/task_test.go b/engine/task_test.go index 1d515adad..b837674d5 100644 --- a/engine/task_test.go +++ b/engine/task_test.go @@ -19,7 +19,6 @@ along with this program. If not, see package engine import ( - "net" "reflect" "testing" @@ -126,12 +125,3 @@ func TestTaskFieldAsString(t *testing.T) { t.Errorf("Expecting: %q, received: %q", eOut, rcv) } } - -func TestTaskRemoteHost(t *testing.T) { - task := new(Task) - var eOut net.Addr - rcv := task.RemoteHost() - if !reflect.DeepEqual(eOut, rcv) { - t.Errorf("Expecting: %q, received: %q", eOut, rcv) - } -} diff --git a/ers/ers.go b/ers/ers.go index 9217f4245..16bf603a2 100644 --- a/ers/ers.go +++ b/ers/ers.go @@ -414,10 +414,11 @@ func (erS *ERService) onEvicted(id string, value interface{}) { return } // convert the event to record - eeReq := engine.NewEventRequest(utils.MapStorage(cgrEv.Event), - utils.MapStorage{}, cgrEv.APIOpts, - eEvs.rdrCfg.Tenant, erS.cfg.GeneralCfg().DefaultTenant, - utils.FirstNonEmpty(eEvs.rdrCfg.Timezone, erS.cfg.GeneralCfg().DefaultTimezone), + eeReq := engine.NewExportRequest(map[string]utils.MapStorage{ + utils.MetaReq: cgrEv.Event, + utils.MetaOpts: cgrEv.APIOpts, + utils.MetaCfg: erS.cfg.GetDataProvider(), + }, utils.FirstNonEmpty(cgrEv.Tenant, erS.cfg.GeneralCfg().DefaultTenant), erS.filterS, map[string]*utils.OrderedNavigableMap{ utils.MetaExp: utils.NewOrderedNavigableMap(), }) @@ -429,7 +430,7 @@ func (erS *ERService) onEvicted(id string, value interface{}) { return } - record := eeReq.OrdNavMP[utils.MetaExp].OrderedFieldsAsStrings() + record := eeReq.ExpData[utils.MetaExp].OrderedFieldsAsStrings() // open the file and write the record dumpFilePath := path.Join(expPath, fmt.Sprintf("%s.%d%s", diff --git a/loaders/libloader.go b/loaders/libloader.go index 29361645d..825d604d3 100644 --- a/loaders/libloader.go +++ b/loaders/libloader.go @@ -20,7 +20,6 @@ package loaders import ( "fmt" - "net" "strconv" "strings" @@ -168,8 +167,3 @@ func (cP *csvProvider) FieldAsString(fldPath []string) (data string, err error) } return utils.IfaceAsString(valIface), nil } - -// RemoteHost is part of utils.DataProvider interface -func (cP *csvProvider) RemoteHost() net.Addr { - return utils.LocalAddr() -} diff --git a/loaders/libloader_test.go b/loaders/libloader_test.go index bf2e6b5e9..89896bd21 100644 --- a/loaders/libloader_test.go +++ b/loaders/libloader_test.go @@ -272,18 +272,6 @@ func TestDataUpdateFromCSVMultiFiles(t *testing.T) { } } -func TestRemoteHostLoaderData(t *testing.T) { - record := []string{"ignored", "ignored", "Subject", "*any", "1001"} - fNmae := "File1.csv" - csvProv := newCsvProvider(record, fNmae) - exp := "local" - rcv := csvProv.RemoteHost() - rcvStr := rcv.String() - if !reflect.DeepEqual(exp, rcvStr) { - t.Errorf("Expected %+v, received %+v", exp, rcv) - } -} - func TestGetRateIDsLoaderData(t *testing.T) { ldrData := LoaderData{ "File1.csv": []string{"Subject", "*any", "1001"}, diff --git a/utils/consts.go b/utils/consts.go index d38bb7e0e..ea9a37f30 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -760,7 +760,6 @@ const ( IdxEnd = "]" IdxCombination = "][" - MetaRemoteHost = "*remote_host" RemoteHost = "RemoteHost" Local = "local" TCP = "tcp" @@ -2710,7 +2709,6 @@ var ( // StringTmplType a string set used, by agentRequest and eventRequest to determine if the returned template type is string var StringTmplType = StringSet{ MetaConstant: struct{}{}, - MetaRemoteHost: struct{}{}, MetaVariable: struct{}{}, MetaComposed: struct{}{}, MetaUsageDifference: struct{}{}, diff --git a/utils/dataprovider.go b/utils/dataprovider.go index 730446578..b698f70f3 100644 --- a/utils/dataprovider.go +++ b/utils/dataprovider.go @@ -21,7 +21,6 @@ package utils import ( "errors" "fmt" - "net" "strings" ) @@ -40,7 +39,6 @@ type DataProvider interface { String() string // printable version of data FieldAsInterface(fldPath []string) (interface{}, error) FieldAsString(fldPath []string) (string, error) // remove this - RemoteHost() net.Addr } // RWDataProvider is a DataProvider with write methods on it diff --git a/utils/mapstorage.go b/utils/mapstorage.go index 8c3184ea1..f4d1c6c3f 100644 --- a/utils/mapstorage.go +++ b/utils/mapstorage.go @@ -21,7 +21,6 @@ package utils import ( "errors" "fmt" - "net" "reflect" "strconv" "strings" @@ -316,11 +315,6 @@ func (ms MapStorage) Remove(fldPath []string) (err error) { } -// RemoteHost is part of dataStorage interface -func (ms MapStorage) RemoteHost() net.Addr { - return LocalAddr() -} - func (ms MapStorage) Clone() (msClone MapStorage) { if ms == nil { return diff --git a/utils/mapstorage_test.go b/utils/mapstorage_test.go index 4215b19ff..14e26e3d8 100644 --- a/utils/mapstorage_test.go +++ b/utils/mapstorage_test.go @@ -436,14 +436,6 @@ func TestNavMapFieldAsInterface2(t *testing.T) { } } -func TestMapStorageRemote(t *testing.T) { - nm := MapStorage{} - eOut := LocalAddr() - if rcv := nm.RemoteHost(); !reflect.DeepEqual(eOut, rcv) { - t.Errorf("Expecting: %+v, received: %+v", eOut, rcv) - } -} - func TestNavMapGetField2(t *testing.T) { nM := MapStorage{ "FirstLevel": MapStorage{ diff --git a/utils/orderednavigablemap.go b/utils/orderednavigablemap.go index 878c59605..493b89456 100644 --- a/utils/orderednavigablemap.go +++ b/utils/orderednavigablemap.go @@ -19,7 +19,6 @@ along with this program. If not, see package utils import ( - "net" "strconv" "strings" ) @@ -152,11 +151,6 @@ func (onm *OrderedNavigableMap) FieldAsInterface(fldPath []string) (iface interf return onm.nm.FieldAsInterface(fldPath) } -// RemoteHost is part of dataStorage interface -func (OrderedNavigableMap) RemoteHost() net.Addr { - return LocalAddr() -} - // GetOrder returns the elements order as a slice func (onm *OrderedNavigableMap) GetOrder() (order [][]string) { for el := onm.GetFirstElement(); el != nil; el = el.Next() { diff --git a/utils/orderednavigablemap_test.go b/utils/orderednavigablemap_test.go index 9359b1cc7..be5a11de5 100644 --- a/utils/orderednavigablemap_test.go +++ b/utils/orderednavigablemap_test.go @@ -637,14 +637,6 @@ func TestOrderedNavigableMapRemove(t *testing.T) { } } -func TestOrderedNavigableRemote(t *testing.T) { - nm := &OrderedNavigableMap{nm: &DataNode{Type: NMMapType, Map: map[string]*DataNode{"Field1": NewLeafNode("1001")}}} - eOut := LocalAddr() - if rcv := nm.RemoteHost(); !reflect.DeepEqual(eOut, rcv) { - t.Errorf("Expecting: %+v, received: %+v", eOut, rcv) - } -} - /* func BenchmarkOrderdNavigableMapSet(b *testing.B) { nm := NewOrderedNavigableMap()