Skip to content

Commit 6e9402d

Browse files
authored
pass ext params to BBB even without a mapping to an LMS param (#420)
therefore, you can either input an lms-param-name:bbb-param-name mapping in the broker ext_params rake task, and Rooms will pull the value form the launch params, or you can input a bbb-param-name:bbb-param-value setting in the rake task, which will be passed directly
1 parent 5a72147 commit 6e9402d

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

app/controllers/concerns/bbb_helper.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,15 @@ def string_to_bool(value)
335335
# Note:
336336
# The value in ext_params from the tenant settings is the name that should be passed to BBB. And it can be a comma separated list.
337337
def add_ext_params(action, options)
338-
@extra_params_to_bbb[action]&.each do |key, value|
339-
# the value in ext_params from the tenant settings is the name that should be passed to BBB
340-
bbb_names = @broker_ext_params&.[](action)&.[](key)&.split(',')
341-
bbb_names&.each do |bbb_name|
342-
options[bbb_name.strip.to_sym] = value if bbb_name
338+
@extra_params_to_bbb[action]&.each do |key, value_hash|
339+
if value_hash[:mapping] == true
340+
# the value in ext_params from the tenant settings is the name that should be passed to BBB
341+
bbb_names = @broker_ext_params&.[](action)&.[](key)&.split(',')
342+
bbb_names&.each do |bbb_name|
343+
options[bbb_name.strip.to_sym] = value_hash[:value]
344+
end
345+
else
346+
options[key.to_sym] = value_hash[:value]
343347
end
344348
end
345349
end

app/controllers/rooms_controller.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,14 @@ def launch_and_extra_params_intersection_hash(launch_params, action, actions_has
599599

600600
def calculate_intersection_hash(launch_params, actions_hash)
601601
result = {}
602-
actions_hash&.each_key do |key|
603-
value = find_launch_param(launch_params, key)
604-
result[key] = value if value
602+
actions_hash&.each do |key, broker_value|
603+
lms_value = find_launch_param(launch_params, key)
604+
605+
result[key] = if lms_value
606+
{ value: lms_value, mapping: true }
607+
else
608+
{ value: broker_value, mapping: false }
609+
end
605610
end
606611
result
607612
end

0 commit comments

Comments
 (0)