From f769a0fff3a99a25dd9d56166dd2d03c2a47ed7c Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 18 Feb 2021 18:04:57 +0100 Subject: [PATCH] Support for additional values for bandwidth type Support additional bandwidth types defined in RFC3890 and RFC3556 --- README.md | 1 + unmarshal.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e7d7ff6..b368988 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu * [Tarrence van As](https://github.com/tarrencev) * [Maxim Oransky](https://github.com/sdfsdhgjkbmnmxc) * [Graham King](https://github.com/grahamking/) +* [Brendan Abolivier](https://github.com/babolivier) ### License MIT License - see [LICENSE](LICENSE) for full text diff --git a/unmarshal.go b/unmarshal.go index 92e0dcf..f301324 100644 --- a/unmarshal.go +++ b/unmarshal.go @@ -568,9 +568,11 @@ func unmarshalBandwidth(value string) (*Bandwidth, error) { experimental := strings.HasPrefix(parts[0], "X-") if experimental { parts[0] = strings.TrimPrefix(parts[0], "X-") - } else if !anyOf(parts[0], "CT", "AS") { + } else if !anyOf(parts[0], "CT", "AS", "TIAS", "RS", "RR") { // Set according to currently registered with IANA // https://tools.ietf.org/html/rfc4566#section-5.8 + // https://tools.ietf.org/html/rfc3890#section-6.2 + // https://tools.ietf.org/html/rfc3556#section-2 return nil, fmt.Errorf("%w `%v`", errSDPInvalidValue, parts[0]) }