From 84c6a0e498f3f93cdb4ac5d6807d2dbeddb8749a Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 14 May 2020 12:49:21 +0300 Subject: [PATCH] Updated SIP Agent integration tests --- agents/sipagent.go | 10 +-- agents/sipagent_it_test.go | 50 +++++++++----- config/diametercfg.go | 6 +- config/dnsagntcfg.go | 6 +- config/httpagntcfg.go | 6 +- config/radiuscfg.go | 6 +- config/rsrparser.go | 15 ++++ config/sipagentcfg.go | 6 +- .../samples/sipagent_internal/redirect.json | 56 ++++++++++++--- .../conf/samples/sipagent_mongo/redirect.json | 56 ++++++++++++--- .../conf/samples/sipagent_mysql/redirect.json | 56 ++++++++++++--- .../samples/sipagent_mysql/suppliers.json | 68 ------------------- go.mod | 2 +- go.sum | 2 + packages/debian/changelog | 8 ++- utils/dataconverter.go | 2 +- 16 files changed, 217 insertions(+), 138 deletions(-) delete mode 100644 data/conf/samples/sipagent_mysql/suppliers.json diff --git a/agents/sipagent.go b/agents/sipagent.go index ed56f67f4..b66404492 100644 --- a/agents/sipagent.go +++ b/agents/sipagent.go @@ -45,7 +45,7 @@ func NewSIPAgent(connMgr *engine.ConnManager, cfg *config.CGRConfig, } } -// SIPAgent is a handler for HTTP requests +// SIPAgent is a handler for SIP requests type SIPAgent struct { connMgr *engine.ConnManager filterS *engine.FilterS @@ -58,7 +58,7 @@ func (sa *SIPAgent) Shutdown() { close(sa.stopChan) } -// ListenAndServe will run the DNS handler doing also the connection to listen address +// ListenAndServe will run the SIP handler doing also the connection to listen address func (sa *SIPAgent) ListenAndServe() (err error) { sa.stopChan = make(chan struct{}) utils.Logger.Info(fmt.Sprintf("<%s> start listening on <%s:%s>", @@ -295,7 +295,7 @@ func (sa *SIPAgent) processRequest(reqProcessor *config.RequestProcessor, } if reqProcessor.Flags.HasKey(utils.MetaLog) { utils.Logger.Info( - fmt.Sprintf("<%s> LOG, processorID: %s, http message: %s", + fmt.Sprintf("<%s> LOG, processorID: %s, SIP message: %s", utils.SIPAgent, reqProcessor.ID, agReq.Request.String())) } switch reqType { @@ -446,12 +446,12 @@ func (sa *SIPAgent) processRequest(reqProcessor *config.RequestProcessor, } if reqProcessor.Flags.HasKey(utils.MetaLog) { utils.Logger.Info( - fmt.Sprintf("<%s> LOG, HTTP reply: %s", + fmt.Sprintf("<%s> LOG, SIP reply: %s", utils.SIPAgent, agReq.Reply)) } if reqType == utils.MetaDryRun { utils.Logger.Info( - fmt.Sprintf("<%s> DRY_RUN, HTTP reply: %s", + fmt.Sprintf("<%s> DRY_RUN, SIP reply: %s", utils.SIPAgent, agReq.Reply)) } return true, nil diff --git a/agents/sipagent_it_test.go b/agents/sipagent_it_test.go index fef4a6529..d5c6fba8e 100644 --- a/agents/sipagent_it_test.go +++ b/agents/sipagent_it_test.go @@ -24,10 +24,11 @@ import ( "net" "net/rpc" "path" + "reflect" "testing" "time" - v2 "github.com/cgrates/cgrates/apier/v2" + v1 "github.com/cgrates/cgrates/apier/v1" "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" @@ -47,9 +48,9 @@ var ( testSAitResetStorDb, testSAitStartEngine, testSAitApierRpcConn, - testSAitTPFromFolder, + // testSAitTPFromFolder, - testSAitSetAttributeProfile, + testSAitSetRouteProfile, testSAitSIPRegister, testSAitSIPInvite, @@ -132,9 +133,6 @@ func testSAitTPFromFolder(t *testing.T) { if err := saRPC.Call(utils.APIerSv2LoadTariffPlanFromFolder, attrs, &loadInst); err != nil { t.Error(err) } - if isDispatcherActive { - testRadiusitTPLoadData(t) - } time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Give time for scheduler to execute topups } @@ -144,26 +142,42 @@ func testSAitStopCgrEngine(t *testing.T) { } } -func testSAitSetAttributeProfile(t *testing.T) { - attrPrf := &v2.AttributeWithCache{ - ExternalAttributeProfile: &engine.ExternalAttributeProfile{ +func testSAitSetRouteProfile(t *testing.T) { + var reply *engine.RouteProfile + splPrf := &v1.RouteWithCache{ + RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", - ID: "ChangeDestination", - Contexts: []string{utils.ANY}, + ID: "SPL_ACNT_1001", FilterIDs: []string{"*string:~*req.Account:1001"}, - Attributes: []*engine.ExternalAttribute{{ - Path: utils.MetaReq + utils.NestingSep + "Destination", - Value: "sip:1003@192.168.53.203:5060", - }}, - Weight: 20, + Sorting: utils.MetaWeight, + Routes: []*engine.Route{ + { + ID: "supplier1", + Weight: 20, + RouteParameters: "cgrates.org", + }, + { + ID: "supplier2", + Weight: 10, + RouteParameters: "cgrates.net", + }, + }, + Weight: 10, }, } + var result string - if err := saRPC.Call(utils.APIerSv2SetAttributeProfile, attrPrf, &result); err != nil { + if err := saRPC.Call(utils.APIerSv1SetRouteProfile, splPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } + if err := saRPC.Call(utils.APIerSv1GetRouteProfile, + &utils.TenantID{Tenant: "cgrates.org", ID: "SPL_ACNT_1001"}, &reply); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(splPrf.RouteProfile, reply) { + t.Errorf("Expecting: %+v, received: %+v", splPrf.RouteProfile, reply) + } } func testSAitSIPRegister(t *testing.T) { @@ -210,7 +224,7 @@ func testSAitSIPInvite(t *testing.T) { if expected := "SIP/2.0 302 Moved Temporarily"; recived["Request"] != expected { t.Errorf("Expected %q, received: %q", expected, recived["Request"]) } - if expected := ""; recived["Contact"] != expected { + if expected := "\"1002\" ;q=0.7; expires=3600,\"1002\" ;q=0.1"; recived["Contact"] != expected { t.Errorf("Expected %q, received: %q", expected, recived["Contact"]) } } diff --git a/config/diametercfg.go b/config/diametercfg.go index 82117ffcb..7dfa18d8f 100644 --- a/config/diametercfg.go +++ b/config/diametercfg.go @@ -118,15 +118,15 @@ func (da *DiameterAgentCfg) loadFromJsonCfg(jsnCfg *DiameterAgentJsonCfg, separa break } } - if err := rp.loadFromJsonCfg(reqProcJsn, separator); err != nil { - return nil + if err = rp.loadFromJsonCfg(reqProcJsn, separator); err != nil { + return } if !haveID { da.RequestProcessors = append(da.RequestProcessors, rp) } } } - return nil + return } func (ds *DiameterAgentCfg) AsMapInterface(separator string) map[string]interface{} { diff --git a/config/dnsagntcfg.go b/config/dnsagntcfg.go index 52daffaf1..42809fe76 100644 --- a/config/dnsagntcfg.go +++ b/config/dnsagntcfg.go @@ -71,15 +71,15 @@ func (da *DNSAgentCfg) loadFromJsonCfg(jsnCfg *DNSAgentJsonCfg, sep string) (err break } } - if err := rp.loadFromJsonCfg(reqProcJsn, sep); err != nil { - return nil + if err = rp.loadFromJsonCfg(reqProcJsn, sep); err != nil { + return } if !haveID { da.RequestProcessors = append(da.RequestProcessors, rp) } } } - return nil + return } func (da *DNSAgentCfg) AsMapInterface(separator string) map[string]interface{} { diff --git a/config/httpagntcfg.go b/config/httpagntcfg.go index 2a704827c..51c8ce843 100644 --- a/config/httpagntcfg.go +++ b/config/httpagntcfg.go @@ -83,14 +83,14 @@ func (ca *HttpAgentCfg) appendHttpAgntProcCfgs(hps *[]*ReqProcessorJsnCfg, separ } } } - if err := rp.loadFromJsonCfg(reqProcJsn, separator); err != nil { - return err + if err = rp.loadFromJsonCfg(reqProcJsn, separator); err != nil { + return } if !haveID { ca.RequestProcessors = append(ca.RequestProcessors, rp) } } - return nil + return } func (ca *HttpAgentCfg) loadFromJsonCfg(jsnCfg *HttpAgentJsonCfg, separator string) (err error) { diff --git a/config/radiuscfg.go b/config/radiuscfg.go index de0f6a7fc..99c8b4779 100644 --- a/config/radiuscfg.go +++ b/config/radiuscfg.go @@ -89,15 +89,15 @@ func (self *RadiusAgentCfg) loadFromJsonCfg(jsnCfg *RadiusAgentJsonCfg, separato break } } - if err := rp.loadFromJsonCfg(reqProcJsn, separator); err != nil { - return nil + if err = rp.loadFromJsonCfg(reqProcJsn, separator); err != nil { + return } if !haveID { self.RequestProcessors = append(self.RequestProcessors, rp) } } } - return nil + return } func (ra *RadiusAgentCfg) AsMapInterface(separator string) map[string]interface{} { diff --git a/config/rsrparser.go b/config/rsrparser.go index d61b40844..0073ca6e0 100644 --- a/config/rsrparser.go +++ b/config/rsrparser.go @@ -35,6 +35,17 @@ func NewRSRParsers(parsersRules string, allFiltersMatch bool, rsrSeparator strin if parsersRules == "" { return } + if strings.HasPrefix(parsersRules, utils.META_CONSTANT+utils.InInFieldSep) { // in case we do not want the rule to be processed at all + // for example to compose a field in the agent request that contains `=` + prsrs = RSRParsers{ + { + Rules: parsersRules, + AllFiltersMatch: allFiltersMatch, + }, + } + err = prsrs.Compile() + return + } return NewRSRParsersFromSlice(strings.Split(parsersRules, rsrSeparator), allFiltersMatch) } @@ -229,6 +240,10 @@ func (prsr *RSRParser) AttrName() string { // Compile parses Rules string and repopulates other fields func (prsr *RSRParser) Compile() (err error) { var newPrsr *RSRParser + if strings.HasPrefix(prsr.Rules, utils.META_CONSTANT+utils.InInFieldSep) { // in case we do not want the rule to be processed at all + prsr.attrValue = strings.TrimPrefix(prsr.Rules, utils.META_CONSTANT+utils.InInFieldSep) + return + } if newPrsr, err = NewRSRParser(prsr.Rules, prsr.AllFiltersMatch); err != nil { return } diff --git a/config/sipagentcfg.go b/config/sipagentcfg.go index e720ee17f..f2bf50ce4 100644 --- a/config/sipagentcfg.go +++ b/config/sipagentcfg.go @@ -71,15 +71,15 @@ func (da *SIPAgentCfg) loadFromJsonCfg(jsnCfg *SIPAgentJsonCfg, sep string) (err break } } - if err := rp.loadFromJsonCfg(reqProcJsn, sep); err != nil { - return nil + if err = rp.loadFromJsonCfg(reqProcJsn, sep); err != nil { + return } if !haveID { da.RequestProcessors = append(da.RequestProcessors, rp) } } } - return nil + return } func (da *SIPAgentCfg) AsMapInterface(separator string) map[string]interface{} { diff --git a/data/conf/samples/sipagent_internal/redirect.json b/data/conf/samples/sipagent_internal/redirect.json index f0cd69de2..9c5d69576 100644 --- a/data/conf/samples/sipagent_internal/redirect.json +++ b/data/conf/samples/sipagent_internal/redirect.json @@ -4,33 +4,71 @@ "request_processors": [ { "id": "Register", - "filters": ["*prefix:~*req.Request:REGISTER"], + "filters": ["*notstring:~*vars.Method:INVITE"], "flags": ["*none"], "request_fields":[], "reply_fields":[ {"tag": "Request", "path": "*rep.Request", "type": "*constant", - "value": "SIP/2.0 405 Method Not Allowed"}, + "value": "SIP/2.0 405 Method Not Allowed"} ] }, { - "id": "InviteRedirect", - "filters": ["*prefix:~*req.Request:INVITE"], - "flags": ["*attributes","*event"], + "id": "NAPTRRoutesQuery", + "filters": ["*string:~*vars.Method:INVITE"], + "flags": ["*event", "*routes","*continue"], "request_fields":[ {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.From{*sipuri_user}", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", - "value": "~*req.To{*sipuri_user}", "mandatory": true} + "value": "~*req.To{*sipuri_user}", "mandatory": true}, ], + "reply_fields":[ + ] + }, + { + "id": "NAPTRSuppliersOneSupplier", + "filters": ["*string:~*vars.Method:INVITE", + ], + "flags": ["*none","*continue","*log"], // do not send request to CGRateS "reply_fields":[ {"tag": "Request", "path": "*rep.Request", "type": "*constant", "value": "SIP/2.0 302 Moved Temporarily"}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"<"}, + "value":"\""}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"~*cgrep.Attributes.Destination"}, + "value":"~*req.To{*sipuri_user}"}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":">"} + "value":"\" ;q=0.7; expires=3600"} + ] + }, + { + "id": "NAPTRSuppliersTwoSuppliers", + "filters": ["*string:~*vars.Method:INVITE", + "*gte:~*cgrep.Routes.Count:2"], + "flags": ["*none","*continue"], + "reply_fields":[ + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":",\""}, + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":"~*req.To{*sipuri_user}"}, + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":"\" ;q=0.1"} ] } ] diff --git a/data/conf/samples/sipagent_mongo/redirect.json b/data/conf/samples/sipagent_mongo/redirect.json index f0cd69de2..9c5d69576 100644 --- a/data/conf/samples/sipagent_mongo/redirect.json +++ b/data/conf/samples/sipagent_mongo/redirect.json @@ -4,33 +4,71 @@ "request_processors": [ { "id": "Register", - "filters": ["*prefix:~*req.Request:REGISTER"], + "filters": ["*notstring:~*vars.Method:INVITE"], "flags": ["*none"], "request_fields":[], "reply_fields":[ {"tag": "Request", "path": "*rep.Request", "type": "*constant", - "value": "SIP/2.0 405 Method Not Allowed"}, + "value": "SIP/2.0 405 Method Not Allowed"} ] }, { - "id": "InviteRedirect", - "filters": ["*prefix:~*req.Request:INVITE"], - "flags": ["*attributes","*event"], + "id": "NAPTRRoutesQuery", + "filters": ["*string:~*vars.Method:INVITE"], + "flags": ["*event", "*routes","*continue"], "request_fields":[ {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.From{*sipuri_user}", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", - "value": "~*req.To{*sipuri_user}", "mandatory": true} + "value": "~*req.To{*sipuri_user}", "mandatory": true}, ], + "reply_fields":[ + ] + }, + { + "id": "NAPTRSuppliersOneSupplier", + "filters": ["*string:~*vars.Method:INVITE", + ], + "flags": ["*none","*continue","*log"], // do not send request to CGRateS "reply_fields":[ {"tag": "Request", "path": "*rep.Request", "type": "*constant", "value": "SIP/2.0 302 Moved Temporarily"}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"<"}, + "value":"\""}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"~*cgrep.Attributes.Destination"}, + "value":"~*req.To{*sipuri_user}"}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":">"} + "value":"\" ;q=0.7; expires=3600"} + ] + }, + { + "id": "NAPTRSuppliersTwoSuppliers", + "filters": ["*string:~*vars.Method:INVITE", + "*gte:~*cgrep.Routes.Count:2"], + "flags": ["*none","*continue"], + "reply_fields":[ + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":",\""}, + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":"~*req.To{*sipuri_user}"}, + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":"\" ;q=0.1"} ] } ] diff --git a/data/conf/samples/sipagent_mysql/redirect.json b/data/conf/samples/sipagent_mysql/redirect.json index 78f9f62ff..9c5d69576 100644 --- a/data/conf/samples/sipagent_mysql/redirect.json +++ b/data/conf/samples/sipagent_mysql/redirect.json @@ -4,33 +4,71 @@ "request_processors": [ { "id": "Register", - "filters": ["*notprefix:~*vars.Method:INVITE"], + "filters": ["*notstring:~*vars.Method:INVITE"], "flags": ["*none"], "request_fields":[], "reply_fields":[ {"tag": "Request", "path": "*rep.Request", "type": "*constant", - "value": "SIP/2.0 405 Method Not Allowed"}, + "value": "SIP/2.0 405 Method Not Allowed"} ] }, { - "id": "InviteRedirect", - "filters": ["*prefix:~*vars.Method:INVITE"], - "flags": ["*attributes","*event"], + "id": "NAPTRRoutesQuery", + "filters": ["*string:~*vars.Method:INVITE"], + "flags": ["*event", "*routes","*continue"], "request_fields":[ {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.From{*sipuri_user}", "mandatory": true}, {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", - "value": "~*req.To{*sipuri_user}", "mandatory": true} + "value": "~*req.To{*sipuri_user}", "mandatory": true}, ], + "reply_fields":[ + ] + }, + { + "id": "NAPTRSuppliersOneSupplier", + "filters": ["*string:~*vars.Method:INVITE", + ], + "flags": ["*none","*continue","*log"], // do not send request to CGRateS "reply_fields":[ {"tag": "Request", "path": "*rep.Request", "type": "*constant", "value": "SIP/2.0 302 Moved Temporarily"}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"<"}, + "value":"\""}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"~*cgrep.Attributes.Destination"}, + "value":"~*req.To{*sipuri_user}"}, {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":">"} + "value":"\" ;q=0.7; expires=3600"} + ] + }, + { + "id": "NAPTRSuppliersTwoSuppliers", + "filters": ["*string:~*vars.Method:INVITE", + "*gte:~*cgrep.Routes.Count:2"], + "flags": ["*none","*continue"], + "reply_fields":[ + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":",\""}, + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":"~*req.To{*sipuri_user}"}, + {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", + "value":"\" ;q=0.1"} ] } ] diff --git a/data/conf/samples/sipagent_mysql/suppliers.json b/data/conf/samples/sipagent_mysql/suppliers.json deleted file mode 100644 index 4f20f0743..000000000 --- a/data/conf/samples/sipagent_mysql/suppliers.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "sip_agent": { - "request_processors": [ - { - "id": "NAPTRRoutesQuery", - "filters": ["*string:~*vars.Method:INVITE"], - "flags": ["*event", "*routes","*continue"], - "request_fields":[ - {"tag": "Account", "path": "*cgreq.Account", "type": "*variable", - "value": "~*req.From{*sipuri_user}", "mandatory": true}, - {"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", - "value": "~*req.To{*sipuri_user}", "mandatory": true} - ], - "reply_fields":[ - ], - }, - { - "id": "NAPTRSuppliersOneSupplier", - "filters": ["*string:~*vars.Method:INVITE", - "*gte:~*cgrep.Routes.Count:1"], - "flags": ["*none","*continue"], // do not send request to CGRateS - "reply_fields":[ - {"tag": "Request", "path": "*rep.Request", "type": "*constant", - "value": "SIP/2.0 302 Moved Temporarily"}, - {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"\""}, - {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"~*cgreq.Destination"}, - {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"\" ;q=0.7; expires=3600"}, - ], - }, - { - "id": "NAPTRSuppliersTwoSuppliers", - "filters": ["*string:~*vars.Method:INVITE", - "*gte:~*cgrep.Routes.Count:2"], - "flags": ["*none","*continue"], - "reply_fields":[ - {"tag": "Request", "path": "*rep.Request", "type": "*constant", - "value": "SIP/2.0 302 Moved Temporarily"}, - {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"\""}, - {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"~*cgreq.Destination"}, - {"tag": "Contact", "path": "*rep.Contact", "type": "*composed", - "value":"\" ;q=0.1"}, - ], - }, - ], - }, - -} diff --git a/go.mod b/go.mod index c301a91ad..1515be6c2 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/cgrates/ltcache v0.0.0-20181016092649-92fb7fa77cca github.com/cgrates/radigo v0.0.0-20200324152710-35e651804ad1 github.com/cgrates/rpcclient v0.0.0-20200326100105-a579e2c47453 - github.com/cgrates/sipd v1.0.1-0.20200513092040-728b130a73d6 + github.com/cgrates/sipd v1.0.1-0.20200514091151-e426e71861e8 github.com/creack/pty v1.1.7 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/fiorix/go-diameter v3.0.3-0.20190716165154-f4823472d0e0+incompatible diff --git a/go.sum b/go.sum index f1a8a8271..fef44ac8f 100644 --- a/go.sum +++ b/go.sum @@ -66,6 +66,8 @@ github.com/cgrates/rpcclient v0.0.0-20200326100105-a579e2c47453/go.mod h1:xXLqAK github.com/cgrates/sipd v1.0.0/go.mod h1:Itz4HoJHqckX9XAbGRanB1PvXfKrIO/UtMB8JwCFsT4= github.com/cgrates/sipd v1.0.1-0.20200513092040-728b130a73d6 h1:yKEwGpD79Pbss7/03mwPh9MvbBXmttiUX+iyA67PRA8= github.com/cgrates/sipd v1.0.1-0.20200513092040-728b130a73d6/go.mod h1:yAWcE5qt60PMrWME9Ijp6IWlWwL5d+/VflUYudO1Xm0= +github.com/cgrates/sipd v1.0.1-0.20200514091151-e426e71861e8 h1:4QTOvFTqLOWHUQCUs22mGfiw3WZaZRzaEstTjYlXsgo= +github.com/cgrates/sipd v1.0.1-0.20200514091151-e426e71861e8/go.mod h1:yAWcE5qt60PMrWME9Ijp6IWlWwL5d+/VflUYudO1Xm0= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= diff --git a/packages/debian/changelog b/packages/debian/changelog index 5b6b9f8ef..86eda22fe 100644 --- a/packages/debian/changelog +++ b/packages/debian/changelog @@ -12,12 +12,12 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium ToJSON for request String method * [DiameterAgent] Updated 3gp_vendor dictionary * [Templates] Added new dataconvertor: *ip2hex - * [AgentRequest] Added support for *group type and correctly overwrite + * [AgentS] Added support for *group type and correctly overwrite the values in case of *variable * [EventReader] Correctly populate ConcurrentRequest from config * [FilterS] Updated *exists to dynamically compute the path if the path - * [AgentRequest] Added support for *tmp path + * [AgentS] Added support for *tmp path * [SessionS] Added new API SessionSv1.GetCost * [SessionS] Updateed MaxUsage field from API replies * [SessionS] Added support for *cdrs flag in SessionSv1.ProcessEvent @@ -54,12 +54,14 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium * [SessionS] Added support for *stir_authenticate * [SessionS] Added support for *stir_initiate * [RouteS] Renaming from SupplierS to RouteS - * [AgentRequest] Improved NavigableMap + * [AgentS] Improved NavigableMap * [General] Default timingIDs start from time.Now() (i.e. *monthly time.Now() + 1 month ) * [AgentS] FieldAsInterface return data instead of NMItem * [RouteS] Add posibility to load routes with the sameID and different filters * [RouteS] Correctly populate Sorting out of models * [AgentS] Added SIPAgent for SIP redirection + * [AgentS] Added *constant: prefix to do not proccess the value + with RSRParsers -- DanB Wed, 19 Feb 2020 13:25:52 +0200 diff --git a/utils/dataconverter.go b/utils/dataconverter.go index eb2c3952d..e3fad285a 100644 --- a/utils/dataconverter.go +++ b/utils/dataconverter.go @@ -323,7 +323,7 @@ type SIPURIUserConverter struct{} // Convert implements DataConverter interface func (*SIPURIUserConverter) Convert(in interface{}) (out interface{}, err error) { val := IfaceAsString(in) - return sipd.NameFrom(val), nil + return sipd.UserFrom(val), nil } // SIPURIMethodConverter will return the