Add core RTP-over-WebSocket (rtpws) for AudioBridge WebSocket media#3653
Open
mirkobrankovic82 wants to merge 4 commits into
Open
Add core RTP-over-WebSocket (rtpws) for AudioBridge WebSocket media#3653mirkobrankovic82 wants to merge 4 commits into
mirkobrankovic82 wants to merge 4 commits into
Conversation
This was referenced Jun 29, 2026
Add core RTP-over-WebSocket (rtpws) for AudioBridge WebSocket media
mirkobrankovic82/janus-gateway#1
Merged
Add a Janus core rtpws listener for binary RTP over WebSocket (janus.jcfg `rtpws` section) and wire AudioBridge `media=websocket` joins to rtpws peer bindings and `websocket_media.url`. - Honor the AudioBridge join codec (opus, pcma, pcmu); call_info reports the negotiated codec, payload type and sample rate. - Keep the Janus session alive from ws-media RTP so HTTP-only join clients are not torn down by session_timeout while media is flowing (via the plugin touch_session callback, so the plugin build does not pull in ice.h). - Optional rtpws::allow_ws_bind (default off) for browser-first connect-then-bind: a client may connect without ?sid=, receive the pod's server-name, and bind an AudioBridge-created sid over the same WS. - Include ws-audio-test Go CLI and shell wrapper for RTP/WS validation. Requires --enable-websockets at build time. Rooms need allow_ws_participants set at create time. Co-authored-by: Cursor <cursoragent@cursor.com>
mirkobrankovic82
force-pushed
the
feature/audiobridge-rtpws
branch
from
July 16, 2026 09:01
f805c53 to
7b0d27b
Compare
Support l16 and l16-48 on join, decode/encode, plain RTP and rtpws call_info with room sampling_rate validation; extend ws-audio-test. Co-authored-by: Cursor <cursoragent@cursor.com>
Add a per-participant "ws_framing" option to media=websocket AudioBridge joins: "rtp" (default, full RTP packets on the wire, unchanged) or "payload" (raw codec payloads, no RTP header). In payload mode the core strips the RTP header outbound and synthesizes one inbound (monotonic seq/timestamp/SSRC), so external AI/STT/TTS clients can exchange plain codec bytes without parsing or emitting RTP. The negotiated framing is advertised in the call_info handshake. Pairs well with the L16 linear-PCM codec: payload framing + l16/l16-48 yields raw 16-bit PCM that most STT/TTS providers accept directly. The ws-audio-test client gains --framing payload and --codec l16/l16-48. Co-authored-by: Cursor <cursoragent@cursor.com>
…-payload AudioBridge rtpws: L16 codec + optional payload-only framing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
janus.jcfgrtpwssection).media=websocketjoins to rtpws peer bindings andwebsocket_media.url.codec(opus,pcma,pcmu,l16,l16-48) when creating the rtpws peer —call_inforeports the negotiated codec, payload type, sample rate, and framing.l16@ 16 kHz,l16-48@ 48 kHz) on plain RTP andmedia=websocket; decode/encode big-endian slinear and restrict L16 joins to a matching roomsampling_rate.ws_framingonmedia=websocketjoins —rtp(default, full RTP packets, unchanged) orpayload(raw codec payloads, no RTP header). In payload mode the core strips the RTP header outbound and synthesizes one inbound (monotonic seq/timestamp/SSRC), so external AI/STT/TTS clients can exchange plain codec bytes without parsing or emitting RTP.--codecselects opus / pcma / pcmu / l16 / l16-48;--framingselects rtp / payload; G.711 and L16 tone encoding).Notes
--enable-websocketsat build time.allow_ws_participants = trueat create time (cannot be enabled later viaedit).call_info(codec, PT, sample rate).l16requires a roomsampling_rateof 16000 andl16-48requires 48000; mismatched joins are rejected.ws_framingis negotiated per join (no global config);payloadframing pairs well withl16/l16-48to hand STT/TTS providers raw 16-bit PCM directly.Example (Opus)
Example (G.711 μ-law)
Example (L16 / 16 kHz)
Example (payload framing, raw L16 for AI/STT/TTS)