Skip to content

Commit

Permalink
Added support for forwarding groups in AudioBridge (#2653)
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Jul 29, 2021
1 parent 31f6c54 commit 17005c7
Show file tree
Hide file tree
Showing 3 changed files with 525 additions and 84 deletions.
2 changes: 2 additions & 0 deletions conf/janus.plugin.audiobridge.jcfg.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# record_dir = "/path/to/" (path to save the recording to, makes record_file a relative path if provided)
# allow_rtp_participants = true|false (whether participants should be allowed to join
# via plain RTP as well, rather than just WebRTC, default=false)
# groups = optional, non-hierarchical, array of groups to tag participants, for external forwarding purposes only
#
# The following lines are only needed if you want the mixed audio
# to be automatically forwarded via plain RTP to an external component
Expand All @@ -28,6 +29,7 @@
# rtp_forward_ssrc = SSRC to use to use when streaming (optional: stream_id used if missing)
# rtp_forward_codec = opus (default), pcma (A-Law) or pcmu (mu-Law)
# rtp_forward_ptype = payload type to use when streaming (optional: only read for Opus, 100 used if missing)
# rtp_forward_group = group of participants to forward, if enabled in the room (optional: forwards full mix if missing)
# rtp_forward_srtp_suite = length of authentication tag (32 or 80)
# rtp_forward_srtp_crypto = "<key to use as crypto (base64 encoded key as in SDES)>"
# rtp_forward_always_on = true|false, whether silence should be forwarded when the room is empty (optional: false used if missing)
Expand Down
9 changes: 8 additions & 1 deletion html/audiobridgetest.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ if(getQueryStringValue("room") !== "")
var stereo = false;
if(getQueryStringValue("stereo") !== "")
stereo = (getQueryStringValue("stereo") === "true");
var mygroup = null; // Forwarding group, if required by the room
if(getQueryStringValue("group") !== "")
mygroup = getQueryStringValue("group");
var myusername = null;
var myid = null;
var webrtcUp = false;
Expand Down Expand Up @@ -426,7 +429,11 @@ function registerUsername() {
}
var register = { request: "join", room: myroom, display: username };
myusername = username;
mixertest.send({ message: register});
// If the room uses forwarding groups, this is how we state ours
if(mygroup)
register["group"] = mygroup;
// Send the message
mixertest.send({ message: register });
}
}

Expand Down
Loading

0 comments on commit 17005c7

Please sign in to comment.