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
90e3c6e3
Commit
90e3c6e3
authored
6 years ago
by
jfederico
Browse files
Options
Downloads
Patches
Plain Diff
Added script for recording ready notification
parent
494f9b34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+89
-0
89 additions, 0 deletions
...pts/post_publish/post_publish_recording_ready_callback.rb
with
89 additions
and
0 deletions
record-and-playback/core/scripts/post_publish/post_publish_recording_ready_callback.rb
0 → 100644
+
89
−
0
View file @
90e3c6e3
#!/usr/bin/ruby
# encoding: UTF-8
#
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
#
# Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3.0 of the License, or (at your option)
# any later version.
#
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
#
require
"trollop"
require
'net/http'
require
"jwt"
require
"java_properties"
require
File
.
expand_path
(
'../../../lib/recordandplayback'
,
__FILE__
)
logger
=
Logger
.
new
(
"/var/log/bigbluebutton/post_publish.log"
,
'weekly'
)
logger
.
level
=
Logger
::
INFO
BigBlueButton
.
logger
=
logger
opts
=
Trollop
::
options
do
opt
:meeting_id
,
"Meeting id to archive"
,
:type
=>
String
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"
)
#
# Main code
#
BigBlueButton
.
logger
.
info
(
"Recording Ready Notify for [
#{
meeting_id
}
] starts"
)
begin
callback_url
=
meeting_metadata
[
"bbb-recording-ready-url"
].
value
unless
callback_url
.
nil?
BigBlueButton
.
logger
.
info
(
"Making callback for recording ready notification"
)
props
=
JavaProperties
::
Properties
.
new
(
"/var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
)
secret
=
props
[
:securitySalt
]
external_meeting_id
=
meeting_metadata
[
"meetingId"
].
value
payload
=
{
meeting_id:
external_meeting_id
,
record_id:
meeting_id
}
payload_encoded
=
JWT
.
encode
(
payload
,
secret
)
uri
=
URI
.
parse
(
callback_url
)
http
=
Net
::
HTTP
.
new
(
uri
.
host
,
uri
.
port
)
http
.
use_ssl
=
(
uri
.
scheme
==
'https'
)
BigBlueButton
.
logger
.
info
(
"Sending request to
#{
uri
.
scheme
}
://
#{
uri
.
host
}#{
uri
.
request_uri
}
"
)
request
=
Net
::
HTTP
::
Post
.
new
(
uri
.
request_uri
)
request
.
set_form_data
({
signed_parameters:
payload_encoded
})
response
=
http
.
request
(
request
)
code
=
response
.
code
.
to_i
if
code
==
410
BigBlueButton
.
logger
.
info
(
"Notified for deleted meeting:
#{
meeting_id
}
"
)
# TODO: should we automatically delete the recording here?
elsif
code
==
404
BigBlueButton
.
logger
.
info
(
"404 error when notifying for recording:
#{
meeting_id
}
, ignoring"
)
elsif
code
<
200
||
code
>=
300
BigBlueButton
.
logger
.
info
(
"Callback HTTP request failed:
#{
response
.
code
}
#{
response
.
message
}
(code
#{
code
}
)"
)
else
BigBlueButton
.
logger
.
info
(
"Recording notifier successful:
#{
meeting_id
}
(code
#{
code
}
)"
)
end
end
rescue
=>
e
BigBlueButton
.
logger
.
info
(
"Rescued"
)
BigBlueButton
.
logger
.
info
(
e
.
to_s
)
end
BigBlueButton
.
logger
.
info
(
"Recording Ready notify ends"
)
exit
0
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