Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for voice_bridge=99999 (test_voice_bridge) issue #1128

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/meeting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def self.find_or_create_with_server!(id, server, moderator_pw, voice_bridge = ni
def self.allocate_voice_bridge(meeting_id, voice_bridge = nil)
voice_bridge_len = Rails.configuration.x.voice_bridge_len
use_external_voice_bridge = Rails.configuration.x.use_external_voice_bridge
test_voice_bridge = "99999" # default value in BBB, must be avoided

# In order to make consistent random pin numbers, use the provided meeting as the seed. Ruby's 'Random' PRNG takes a 128bit
# integer as seed. Create one from a truncated hash of the meeting id.
Expand All @@ -225,6 +226,7 @@ def self.allocate_voice_bridge(meeting_id, voice_bridge = nil)
end
tries += 1
logger.debug { "Trying to allocate voice bridge number #{voice_bridge}, try #{tries}" }
next if voice_bridge == test_voice_bridge # avoid special voice bridge number

_created, allocated_meeting_id = redis.multi do |transaction|
transaction.hsetnx('voice_bridges', voice_bridge, meeting_id)
Expand Down