preserve supplemental codecs in publish mode - #2100
Conversation
6bc068c to
2cb2240
Compare
|
Rebased on top of #2101 to fix CI. |
|
@rfuchs ping |
|
Seems like this is a little misbehaved in that it accepts all supplemental codecs, and not just the ones matching the accepted primary codec. When I publish with it answers with The 48000 ones aren't supposed to be there. Also the test outputs should be exact matches as much as possible, with regex matches only where variable output is expected (e.g. port numbers). |
|
Good catch! Should be fixed now. |
|
hmm... Turns out our SBC sends hardcoded We will fix the SBC, but this will take time. So we can either keep using a patched version of rtpengine, or work out a compatible solution... |
|
Pff... Does it provide a
I suppose so? If the offerer doesn't agree with it, then technically they should just ignore it. OTOH I wouldn't be surprised if this lead to failures in some other fringe cases 🤦 |
Unfortunately not. Sample SDP:
I'll need to discuss this internally first. Since we won't be updating to upstream rtpengine soon (and when we will, I hope to get the SBC fix along with that), I suppose you can just merge it as it is now (if it is acceptable of course). We'll use the patched version until then. Thank you! |
Add RED (RFC 2198) codec definition to codeclib as a supplemental codec. Modify codec_store_accept_one() to preserve supplemental codecs whose clock rate matches the accepted primary codec. Skip supplemental codecs in codec_store_is_full_answer() since they are optional in SDP answers.
|
Rebased to resolve the conflict. |
|
All right, thank you. We could use more/proper support for RED anyway, but this is a wishlist item for now. |
|
@rfuchs After some internal discussion, we're hesitant to change the SBC behavior since it could break existing deployments. We did notice that although the SDP advertises Given this context, and considering our SIPREC use case where the SDP already represents the negotiated media and should not contain conflicting media descriptions like in your example, our expectation is to record all advertised media streams and preserve their metadata. With that in mind, do you have an alternative approach to suggest that would allow us to simply include everything without applying this filtering? |
|
In cases like this we typically use a flag to signal to rtpengine to alter its default behaviour. We already have a few "allow asymmetric ..." flags for similar cases. One of them could probably even be reused for The problem with inconsistent SDP offers is that rtpengine has no way to reliably know what the offerer meant. If the SDP offers "8=PCMA/8000" and "96=opus/48000" and then "97=red/8000", does this mean that 97 should be used for Opus as well, or does it mean that RED is only applied to PCMA? Receiving the RTP is not a problem is that makes it obvious, but that doesn't help in the decision about what to put in the answer SDP, and responding in the wrong may lead to a failure. |
|
Hi @rfuchs. Would it be an acceptable change to add We need to accept and record everything to pcap, and we post-process it later. What do you say? |
I would be ok with that, yes. |
|
Thank you. Pushed: |
Add RED (RFC 2198) codec definition to codeclib as a supplemental codec. Modify codec_store_accept_one() to preserve supplemental codecs whose clock rate matches the accepted primary codec. Skip supplemental codecs in codec_store_is_full_answer() since they are optional in SDP answers.