Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
41daeca1
Commit
41daeca1
authored
3 years ago
by
Pedro Beschorner Marin
Browse files
Options
Downloads
Patches
Plain Diff
refactor(recording): callback url getter
parent
63dca750
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
record-and-playback/core/scripts/post_publish/post_publish_recording_ready_callback.rb
+26
-8
26 additions, 8 deletions
...pts/post_publish/post_publish_recording_ready_callback.rb
with
26 additions
and
8 deletions
record-and-playback/core/scripts/post_publish/post_publish_recording_ready_callback.rb
+
26
−
8
View file @
41daeca1
...
...
@@ -36,9 +36,31 @@ opts = Trollop::options do
end
meeting_id
=
opts
[
:meeting_id
]
processed_files
=
"/var/bigbluebutton/recording/process/presentation/
#{
meeting_id
}
"
meeting_metadata
=
BigBlueButton
::
Events
.
get_meeting_metadata
(
"/var/bigbluebutton/recording/raw/
#{
meeting_id
}
/events.xml"
)
bbb_web_properties
=
"/etc/bigbluebutton/bbb-web.properties"
events_xml
=
"/var/bigbluebutton/recording/raw/
#{
meeting_id
}
/events.xml"
def
get_metadata
(
key
,
meeting_metadata
)
meeting_metadata
.
key?
(
key
)
?
meeting_metadata
[
key
].
value
:
nil
end
def
get_callback_url
(
events_xml
)
meeting_metadata
=
BigBlueButton
::
Events
.
get_meeting_metadata
(
events_xml
)
meta_bbb_rec_ready_url
=
"bbb-recording-ready-url"
callback_url
=
get_metadata
(
meta_bbb_rec_ready_url
,
meeting_metadata
)
# For compatibility with some 3rd party implementations, look up for
# bn-recording-ready-url or canvas-recording-ready, when bbb-recording-ready
# is not included.
meta_bn_rec_ready_url
=
"bn-recording-ready-url"
meta_canvas_rec_ready_url
=
"canvas-recording-ready-url"
callback_url
||=
get_metadata
(
meta_bn_rec_ready_url
,
meeting_metadata
)
callback_url
||=
get_metadata
(
meta_canvas_rec_ready_url
,
meeting_metadata
)
callback_url
end
#
# Main code
...
...
@@ -46,18 +68,14 @@ bbb_web_properties = "/etc/bigbluebutton/bbb-web.properties"
BigBlueButton
.
logger
.
info
(
"Recording Ready Notify for [
#{
meeting_id
}
] starts"
)
begin
callback_url
=
meeting_metadata
.
key?
(
"bbb-recording-ready-url"
)
?
meeting_metadata
[
"bbb-recording-ready-url"
].
value
:
nil
# For compatibility with some 3rd party implementations, look up for bn-recording-ready-url or canvas-recording-ready, when bbb-recording-ready is not included.
callback_url
||=
meeting_metadata
.
key?
(
"bn-recording-ready-url"
)
?
meeting_metadata
[
"bn-recording-ready-url"
].
value
:
nil
callback_url
||=
meeting_metadata
.
key?
(
"canvas-recording-ready-url"
)
?
meeting_metadata
[
"canvas-recording-ready-url"
].
value
:
nil
callback_url
=
get_callback_url
(
events_xml
)
unless
callback_url
.
nil?
BigBlueButton
.
logger
.
info
(
"Making callback for recording ready notification"
)
props
=
JavaProperties
::
Properties
.
new
(
bbb_web_properties
)
secret
=
props
[
:securitySalt
]
external_meeting_id
=
meeting_metadata
[
"meetingId"
].
value
external_meeting_id
=
BigBlueButton
::
Events
.
get_external_meeting_id
(
events_xml
)
payload
=
{
meeting_id:
external_meeting_id
,
record_id:
meeting_id
}
payload_encoded
=
JWT
.
encode
(
payload
,
secret
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment