From 766f3abb4fff9aeb108f46c9c911135ff090e1c7 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 25 Oct 2021 14:24:08 +0300 Subject: [PATCH] Updated libphonenumber library --- engine/dynamicdp.go | 10 ---------- go.mod | 3 +-- go.sum | 4 ++-- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/engine/dynamicdp.go b/engine/dynamicdp.go index 8bf03ea7c..e787e1d3e 100644 --- a/engine/dynamicdp.go +++ b/engine/dynamicdp.go @@ -19,8 +19,6 @@ import ( "fmt" "github.com/nyaruka/phonenumbers" - "golang.org/x/text/language" - "golang.org/x/text/language/display" "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/utils" @@ -202,14 +200,6 @@ func (dDP *libphonenumberDP) fieldAsInterface(fldPath []string) (val interface{} if err != nil { utils.Logger.Warning(fmt.Sprintf("Received error: <%+v> when getting GeoLocation for number %+v", err, dDP.pNumber)) } - if geoLocation == utils.EmptyString { // until https://github.com/nyaruka/phonenumbers/issues/100 is fixed - var reg language.Region - if reg, err = language.ParseRegion(regCode); err != nil { - utils.Logger.Warning(fmt.Sprintf("Received error: <%+v> when converting region in GeoLocation for number %+v", err, dDP.pNumber)) - } else { - geoLocation = display.English.Regions().Name(reg) - } - } val = geoLocation case "Carrier": carrier, err := phonenumbers.GetCarrierForNumber(dDP.pNumber, phonenumbers.GetRegionCodeForNumber(dDP.pNumber)) diff --git a/go.mod b/go.mod index 2264de62e..f73f6df40 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/mitchellh/mapstructure v1.4.0 github.com/nats-io/nats-server/v2 v2.2.6 // indirect github.com/nats-io/nats.go v1.11.0 - github.com/nyaruka/phonenumbers v1.0.72 + github.com/nyaruka/phonenumbers v1.0.73 github.com/peterh/liner v1.2.1 github.com/pierrec/lz4 v2.6.0+incompatible // indirect github.com/rivo/uniseg v0.2.0 // indirect @@ -61,7 +61,6 @@ require ( golang.org/x/net v0.0.0-20210924151903-3ad01bbaa167 golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect - golang.org/x/text v0.3.7 golang.org/x/tools v0.1.6 // indirect google.golang.org/api v0.36.0 google.golang.org/genproto v0.0.0-20210111234610-22ae2b108f89 // indirect diff --git a/go.sum b/go.sum index 0262971de..ae7905c76 100644 --- a/go.sum +++ b/go.sum @@ -408,8 +408,8 @@ github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nyaruka/phonenumbers v1.0.72 h1:l1ClBSmRpEN6lfp28emOGPk7nzcuZ1hgWLtWk5lZXpM= -github.com/nyaruka/phonenumbers v1.0.72/go.mod h1:DTw5PBWllLZuh8TwMfgiC+g3+4wmowrsO+4HhnSENkc= +github.com/nyaruka/phonenumbers v1.0.73 h1:bP2WN8/NUP8tQebR+WCIejFaibwYMHOaB7MQVayclUo= +github.com/nyaruka/phonenumbers v1.0.73/go.mod h1:3aiS+PS3DuYwkbK3xdcmRwMiPNECZ0oENH8qUT1lY7Q= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=