Skip to content

Commit bdf27cf

Browse files
psanderscursoragent
andcommitted
fix(rtprelay): correct RTPEngine ng protocol parameters for WebRTC bridging
The RTPEngine parameters for WEB_TO_PHONE and PHONE_TO_WEB directions were not conforming to the ng protocol specification, causing DTLS fingerprint to be missing from the answer SDP sent to WebRTC clients. Key changes: - rtcp-mux: send as array per ng protocol spec (was string, silently ignored) - DTLS: explicitly set "off" for phone leg and "passive" for WebRTC leg - SDES: use "SDES-no" flag instead of separate SDES key - replace: use dedicated key instead of compound flags - Add "strip-extmap" flag for WebRTC answer These changes align with the drachtio/rtpengine-client reference implementation used in production WebRTC-to-SIP bridging deployments. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ec76c58 commit bdf27cf

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

mods/rtprelay/src/utils.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,20 @@ export function getRTPEParamsByDirection(dir: Direction) {
6565
case Direction.WEB_TO_PHONE:
6666
return {
6767
"transport-protocol": "RTP/AVP",
68-
"rtcp-mux": "demux",
68+
DTLS: "off",
6969
ICE: "remove",
70-
flags: ["trust-address", "replace-origin", "replace-session-connection"]
70+
"rtcp-mux": ["demux"],
71+
replace: ["origin", "session-connection"],
72+
flags: ["trust-address", "SDES-no"]
7173
}
7274
case Direction.PHONE_TO_WEB:
7375
return {
7476
"transport-protocol": "UDP/TLS/RTP/SAVPF",
75-
"rtcp-mux": "require",
7677
ICE: "force",
77-
SDES: ["off"],
78-
flags: [
79-
"trust-address",
80-
"replace-origin",
81-
"replace-session-connection",
82-
"generate-mid"
83-
]
78+
DTLS: "passive",
79+
"rtcp-mux": ["require"],
80+
replace: ["origin", "session-connection"],
81+
flags: ["SDES-no", "generate mid", "strip-extmap"]
8482
}
8583
case Direction.PHONE_TO_PHONE:
8684
return {

0 commit comments

Comments
 (0)