diff --git a/decoder.go b/decoder.go index 628c219..9f16686 100644 --- a/decoder.go +++ b/decoder.go @@ -540,7 +540,7 @@ func (d *Decoder) decodeBandwidth(m *Message) error { n int ) switch bandWidthType := BandwidthType(k); bandWidthType { - case BandwidthApplicationSpecific, BandwidthConferenceTotal, BandwidthApplicationSpecificTransportIndependent: + case BandwidthApplicationSpecific, BandwidthConferenceTotal, BandwidthApplicationSpecificTransportIndependent, BandwidthSenders, BandwidthReceivers: t = bandWidthType default: msg := fmt.Sprintf("bad bandwidth type %s", k) diff --git a/fields.go b/fields.go index 8459f1c..b8f7919 100644 --- a/fields.go +++ b/fields.go @@ -391,6 +391,9 @@ const ( BandwidthApplicationSpecific BandwidthType = "AS" // defined in RFC 3890 BandwidthApplicationSpecificTransportIndependent BandwidthType = "TIAS" + // RFC 3556 + BandwidthSenders BandwidthType = "RS" + BandwidthReceivers BandwidthType = "RR" ) // AddBandwidth appends Bandwidth field to Session. diff --git a/fields_test.go b/fields_test.go index cbc09b9..5899ebc 100644 --- a/fields_test.go +++ b/fields_test.go @@ -94,7 +94,9 @@ func TestSession_AddBandwidth(t *testing.T) { s := new(Session). AddBandwidth(BandwidthConferenceTotal, 154798). AddBandwidth(BandwidthApplicationSpecific, 66781). - AddBandwidth(BandwidthApplicationSpecificTransportIndependent, 96000) + AddBandwidth(BandwidthApplicationSpecificTransportIndependent, 96000). + AddBandwidth(BandwidthSenders, 800). + AddBandwidth(BandwidthReceivers, 2400) shouldDecodeExpS(t, s, "bandwidth") } diff --git a/testdata/spd_session_ex_bandwidth.txt b/testdata/spd_session_ex_bandwidth.txt index 96226d9..2ba719a 100644 --- a/testdata/spd_session_ex_bandwidth.txt +++ b/testdata/spd_session_ex_bandwidth.txt @@ -1,3 +1,5 @@ b=CT:154798 b=AS:66781 b=TIAS:96000 +b=RS:800 +b=RR:2400