Skip to content

Commit

Permalink
add workaround for voice_bridge=99999 (test_voice_bridge) issue (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil authored Dec 5, 2024
1 parent 9e2d219 commit ca13e62
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit ca13e62

Please sign in to comment.