-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
The main problem is that Janus creates incorrect SDP when updating an active call (specifically, an active SIP plugin handle managing the call leg) like during a transfer.
Specifically, the Janus SIP Plugin fails to keep the numeric ID numbers for a=extmap features consistent for that specific ongoing call (within the context of that plugin handle's session state). These IDs are like temporary nicknames agreed upon at the start of the call (when the handle negotiated the initial SDP) for things like audio level or media line identification. When Janus sends an updated SDP Offer (updating_call/re-INVITE) related to this handle, it incorrectly changes these agreed-upon ID numbers, violating WebRTC rules (RFC 8829) and causing client-side setRemoteDescription errors.
Instead of reusing the IDs originally negotiated for the current call session (e.g., Android B’s active session), the server appears to:
- Reuse IDs from a different session (e.g., Firefox’s), or
- Generate new IDs arbitrarily during the transfer/renegotiation.
This violates RFC 8285 which mandate that the mapping between an RTP header extension URI and its numeric ID A session update MAY add or remove extension(s). Identifier values in the valid range MUST NOT be altered (remapped)..
Observed Behavior
1. Initial Negotiation (Android A → Android B – Call ID: e0kHeN...)
Simplified Answer (Agreed Mapping):
m=audio 9 UDP/TLS/RTP/SAVPF ... 111 102 9 0 8 101
...
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
...
State:
Session e0kHeN... expects sdes:mid → ID 4.
All RTP packets will encode the MID using this ID.
2. Faulty updating_call SDP (Server → Android B – During Transfer to Firefox)
m=audio 9 UDP/TLS/RTP/SAVPF 9 0 8 96 3 7 18 101
...
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
...
Problem:
The SDP correctly limits the extmaps to the minimal set supported by Firefox (ssrc-audio-level, sdes:mid)
—but it incorrectly changes the ID for sdes:mid from 4 → 3.
This violates:
-
RFC 8285 §4.3:
“Identifier values... MUST NOT be altered (remapped) during a session update.”
-
RFC 8285 §5:
“The same identifier MUST be used for the same offered extension in the answer.”
Expected Behavior
When sending the updating_call SDP to Android B for the attended transfer to Firefox,
the server must generate an SDP that:
-
Includes only the extmap URIs supported by the new peer (Firefox):
urn:ietf:params:rtp-hdrext:ssrc-audio-levelurn:ietf:params:rtp-hdrext:sdes:mid
-
Reuses the IDs originally negotiated for those URIs in the current active session (
e0kHeN...).
Correct Updating SDP (Expected Server Behavior)
m=audio 9 UDP/TLS/RTP/SAVPF 9 0 8 101
...
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
...
This version:
- Removes unsupported extensions (
abs-send-time,transport-cc) - Preserves the correct numeric mapping (
ID 4) forsdes:mid - Keeps session state consistent across renegotiation
Impact
-
Negotiation Failure:
WebRTC clients (Chrome, Firefox, Safari, Pion) will reject the non-compliant SDP with:Error: Answer changed id for extmap attribute (urn:ietf:params:rtp-hdrext:sdes:mid) from 4 to 3→
RTCPeerConnection.setRemoteDescription()rejects.
→ The renegotiation fails completely. -
Media Loss or Corruption:
Sincesdes:middefines how bundled media are demultiplexed,
any remapping causes the client to misroute or drop RTP packets, leading to total media failure.
Standards References
| Topic | RFC | Section | Quote |
|---|---|---|---|
| Identifier Stability | RFC 8285 | §4.3 | “Identifier values... MUST NOT be altered (remapped) during a session update.” |
| Answerer Behavior | RFC 8285 | §5 | “The same identifier MUST be used for the same offered extension in the answer.” |
Related References
Conclusion
This issue represents a critical standards violation.
By altering extmap IDs mid-session, the server:
- Breaks Offer/Answer consistency (RFC 8285)
- Causes
setRemoteDescription()rejection in all major WebRTC clients
Required Fix
Janus must preserve the extmap ID mapping per session context:
Once a mapping between
URI → IDis negotiated for a session,
it must remain stable for all subsequent Offers/Answers within that same session (including attended transfers and re-INVITEs).
Severity: Critical — causes total renegotiation failure and media loss in multiparty / attended transfer scenarios.
Affected Components: Janus SIP Plugin / SDP generation during updating_call or re-INVITE handling.