From 66f2f2fca8b7d88d2e67c962285d749da597af2f Mon Sep 17 00:00:00 2001 From: LSAITHARUN Date: Wed, 28 Jul 2021 00:54:01 +0530 Subject: [PATCH 1/5] Removed range validation for ringtimeout and delaydial params in MPC --- multipartycall.go | 4 ++-- validators.go | 22 +++++----------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/multipartycall.go b/multipartycall.go index 7063c6c..574046f 100644 --- a/multipartycall.go +++ b/multipartycall.go @@ -225,12 +225,12 @@ func (service *MultiPartyCallService) AddParticipant(basicParams MultiPartyCallB if params.RingTimeout == nil { params.RingTimeout = 45 } else { - MultipleValidIntegers("RingTimeout", params.RingTimeout, 15, 120) + MultipleValidIntegers("RingTimeout", params.RingTimeout) } if params.DelayDial == nil { params.DelayDial = 0 } else { - MultipleValidIntegers("DelayDial", params.DelayDial, 0, 120) + MultipleValidIntegers("DelayDial", params.DelayDial) } req, err := service.client.NewRequest("POST", params, "MultiPartyCall/%s/Participant", mpcId) if err != nil { diff --git a/validators.go b/validators.go index f2187c8..135096d 100644 --- a/validators.go +++ b/validators.go @@ -6,29 +6,17 @@ import ( "strconv" "strings" ) - -func MultipleValidIntegers(paramname string, paramvalue interface{}, lowerbound int, upperbound int) { - if reflect.TypeOf(paramvalue).Kind() == reflect.Int { - paramvalue := paramvalue.(int) - if paramvalue < lowerbound || paramvalue > upperbound { - error := paramname + " values must be in the range [" + strconv.Itoa(lowerbound) + " , " + strconv.Itoa(upperbound) + "]" - logrus.Fatal(error) - } - } else if reflect.TypeOf(paramvalue).Kind() == reflect.String { +func MultipleValidIntegers(paramname string, paramvalue interface{}) { + if reflect.TypeOf(paramvalue).Kind() == reflect.String { paramvalue := paramvalue.(string) values := strings.SplitN(paramvalue, "<", -1) for i := 0; i < len(values); i++ { - val, err := strconv.Atoi(values[i]) + _, err := strconv.Atoi(values[i]) if err != nil { logrus.Fatal(paramname + " Destination values in the string must be integers") - } else { - if val < lowerbound || val > upperbound { - error := paramname + " Destination values must be in the range [" + strconv.Itoa(lowerbound) + " , " + strconv.Itoa(upperbound) + "]" - logrus.Fatal(error) - } } } - } else { + } else if reflect.TypeOf(paramvalue).Kind() != reflect.Int && reflect.TypeOf(paramvalue).Kind() != reflect.String { logrus.Fatal(paramname + " must be either string or integer") } -} +} \ No newline at end of file From 5b1ae509cd87182b7758c322961eedefaadf11c7 Mon Sep 17 00:00:00 2001 From: LSAITHARUN Date: Wed, 28 Jul 2021 00:58:11 +0530 Subject: [PATCH 2/5] Removed range validation for ringtimeout and delaydial params in MPC --- validators.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validators.go b/validators.go index 135096d..f1238f8 100644 --- a/validators.go +++ b/validators.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" ) + func MultipleValidIntegers(paramname string, paramvalue interface{}) { if reflect.TypeOf(paramvalue).Kind() == reflect.String { paramvalue := paramvalue.(string) @@ -19,4 +20,4 @@ func MultipleValidIntegers(paramname string, paramvalue interface{}) { } else if reflect.TypeOf(paramvalue).Kind() != reflect.Int && reflect.TypeOf(paramvalue).Kind() != reflect.String { logrus.Fatal(paramname + " must be either string or integer") } -} \ No newline at end of file +} From e5a1f0e6882f2426d02e8eec8ff26835fea2219a Mon Sep 17 00:00:00 2001 From: LSAITHARUN Date: Wed, 28 Jul 2021 01:05:55 +0530 Subject: [PATCH 3/5] Updated SDK versioning --- CHANGELOG.md | 3 +++ baseclient.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d197b5..34a6265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [7.2.2](https://github.com/plivo/plivo-go/tree/v7.2.2) (2021-07-28) +- Removed range validation for ringtimeout and delaydial params in MPC. + ## [7.2.1](https://github.com/plivo/plivo-go/tree/v7.2.1) (2021-07-22) - Updated default HTTP client request timeout to 5 seconds. diff --git a/baseclient.go b/baseclient.go index 649a58b..d4d10f5 100644 --- a/baseclient.go +++ b/baseclient.go @@ -13,7 +13,7 @@ import ( "github.com/google/go-querystring/query" ) -const sdkVersion = "7.2.1" +const sdkVersion = "7.2.2" const lookupBaseUrl = "lookup.plivo.com" From 0aa1995926364a9215422a1ca34ef5e4c254e7ad Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Wed, 28 Jul 2021 21:13:08 +0530 Subject: [PATCH 4/5] updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34a6265..fcb5446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log ## [7.2.2](https://github.com/plivo/plivo-go/tree/v7.2.2) (2021-07-28) -- Removed range validation for ringtimeout and delaydial params in MPC. +- Removed validation for `ringtimeout` and `delaydial` params in [Start a multi party call](https://www.plivo.com/docs/voice/api/multiparty-call#start-a-new-multiparty-call). ## [7.2.1](https://github.com/plivo/plivo-go/tree/v7.2.1) (2021-07-22) - Updated default HTTP client request timeout to 5 seconds. From b36da721d0bde073692215b007b3f9ed9bbae23c Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Thu, 29 Jul 2021 14:04:28 +0530 Subject: [PATCH 5/5] updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb5446..ca41f8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [7.2.2](https://github.com/plivo/plivo-go/tree/v7.2.2) (2021-07-28) +## [7.2.2](https://github.com/plivo/plivo-go/tree/v7.2.2) (2021-07-29) - Removed validation for `ringtimeout` and `delaydial` params in [Start a multi party call](https://www.plivo.com/docs/voice/api/multiparty-call#start-a-new-multiparty-call). ## [7.2.1](https://github.com/plivo/plivo-go/tree/v7.2.1) (2021-07-22)