Skip to content

Differing extmaps in an offer cause the answer to be malformedΒ #308

Open
@KillingSpark

Description

@KillingSpark

Hi,

So this is a bit of a weird case. I have an offer SDP looking like this (abbreviated)

... (session level stuff)
m=audio 9 UDP/TLS/RTP/SAVPF 111 0 8
a=mid:0
... (codecs)
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
... (misc a= lines)
m=video 9 UDP/TLS/RTP/SAVPF 96 97
a=mid:1
... (codecs)
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
... (misc a= lines)

Note the two differing extmap:X for the two m-lines.

This might be a malformed offer, I am not exactly sure how to interpret the standard here RFC 5285

A usable mapping MUST use IDs in the valid range, and each ID in this
range MUST be used only once for each media (or only once if the
mappings are session level)

I think it means that this offer is fine, but there isn't a lot of discussion around that topic, most discussions revolve around mismatching IDs in the offer and answer, not inside one and the same SDP. But it might also be malformed.

In any case, this causes the answer returned by a call to create_answer to be formed like this:

...
a=group:BUNDLE 0 1
m=audio 9 UDP/TLS/RTP/SAVPF 111 0 8
a=mid:0
...
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
m=video 9 UDP/TLS/RTP/SAVPF 96 97
...
a=mid:1

Not the ABSENCE of an extmap ID for urn:ietf:params:rtp-hdrext:sdes:mid in the second m-line.

This is not allowed, every bundeled m-line needs an extmap ID for this extension to facilitate demuxing of the bundled streams.

Regardless of whether this offer is ok but unsupported or just malformed, this should raise an error instead of creating a malformed answer.

I think the most straight foward thing to improve the situation would be to check that the extmap IDs match for each m-line before accepting the offer as valid. But depending on whether this offer is fine and should be supported more subtantial changes might be necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsubcrate:sdpFor issues specific to the SDP crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions