Files
Miau Lightouch a9e0e1a81e fix(webrtc): fix GStreamer WHEP interop (#4720)
## Summary

This PR fixes GStreamer interoperability issues during WebRTC/WHEP
negotiation with ZLMediaServer.

GStreamer could fail to establish the connection for two separate
reasons:

1. ZLMediaServer generated a non-compliant ICE `ufrag`. The generated
value contained `_`, which is not a valid ICE character, so GStreamer
rejected the SDP.
2. ZLMediaServer did not correctly handle `bundle-only` offers and could
answer an accepted bundled m-line with `port=0`, which caused the later
WHEP negotiation to fail.

## Changes

- Generate ICE `ufrag` values using ICE-compliant characters only.
- Preserve and handle `a=bundle-only` correctly during SDP parsing and
answer generation.
- Return `port=9` instead of `port=0` for accepted bundled m-lines.
- Add regression coverage for `bundle-only` SDP handling.
- URL-encode `delete_webrtc` query parameters in the returned `Location`
header so ICE-safe identifiers remain round-trippable over HTTP.

## Validation

- Built with WebRTC and SCTP enabled.
- Added regression test: `test_webrtc_regression`
- Verified:
  - ICE-safe identifier round-trip through `delete_webrtc`
  - `bundle-only` SDP answer generation
2026-04-21 11:37:08 +08:00
..

致谢与声明

本文件夹下部分文件提取自MediaSoup ,分别为:

  • dtls相关功能

    • DtlsTransport.cpp
    • DtlsTransport.hpp
  • srtp相关功能

    • SrtpSession.cpp
    • SrtpSession.hpp
  • datachannel相关功能

    • SctpAssociation.cpp
    • SctpAssociation.hpp

以上源码有一定的修改和裁剪感谢MediaSoup开源项目及作者 用户在使用本项目的同时应该同时遵循MediaSoup的开源协议。

同时,在此也感谢开源项目easy_webrtc_server 及作者, 在集成MediaSoup相关代码前期主要参考这个项目。

另外,感谢big panda 开发并贡献的webrtc js测试客户端(www/webrtc目录下文件) 其开源项目地址为:https://gitee.com/xiongguangjie/zlmrtcclient.js