bigbluebutton-api-ruby 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/CHANGELOG.rdoc +6 -1
- data/README.rdoc +1 -1
- data/bigbluebutton-api-ruby.gemspec +1 -2
- data/lib/bigbluebutton-api.rb +85 -9
- data/test/test.rb +7 -11
- metadata +5 -5
data/.gitignore
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -21,7 +21,7 @@ See CHANGELOG.rdoc
|
|
21
21
|
Author:: Leonardo Crauss Daronco
|
22
22
|
Email:: leonardodaronco@gmail.com
|
23
23
|
Project:: GT-Mconf: Multiconference system for interoperable web and mobile @ PRAV Labs - UFRGS
|
24
|
-
Home Page:: http://www.inf.ufrgs.br/prav/gtmconf
|
24
|
+
Home Page:: http://www.inf.ufrgs.br/prav/gtmconf
|
25
25
|
License:: Distributed under same terms as Ruby
|
26
26
|
|
27
27
|
=== Version 0.0.3 and below
|
@@ -2,8 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'bigbluebutton-api-ruby'
|
5
|
-
s.version = '0.0.
|
6
|
-
s.has_rdoc = true
|
5
|
+
s.version = '0.0.8'
|
7
6
|
s.extra_rdoc_files = ['README.rdoc', 'LICENSE', 'CHANGELOG.rdoc']
|
8
7
|
s.summary = 'Provides an interface to the BigBlueButton web meeting API (https://github.com/mconf/bigbluebutton-api-ruby)'
|
9
8
|
s.description = s.summary
|
data/lib/bigbluebutton-api.rb
CHANGED
@@ -69,7 +69,7 @@ module BigBlueButton
|
|
69
69
|
def moderator_url(meeting_id, user_name, password,
|
70
70
|
user_id = nil, web_voice_conf = nil)
|
71
71
|
warn "#{caller[0]}: moderator_url is deprecated and will soon be removed, please use join_meeting_url instead."
|
72
|
-
|
72
|
+
join_meeting_url(meeting_id, user_name, password, user_id, web_voice_conf)
|
73
73
|
end
|
74
74
|
|
75
75
|
# DEPRECATED
|
@@ -106,7 +106,27 @@ module BigBlueButton
|
|
106
106
|
# welcome_message:: Welcome message to display in chat window
|
107
107
|
# dialin_number:: Dial in number for conference using a regular phone
|
108
108
|
# logout_url:: URL to return user to after exiting meeting
|
109
|
-
# voice_bridge:: Voice conference number (>=0.7)
|
109
|
+
# voice_bridge:: Voice conference number (>= 0.7)
|
110
|
+
#
|
111
|
+
# === Return examples
|
112
|
+
#
|
113
|
+
# On successful creation:
|
114
|
+
#
|
115
|
+
# {
|
116
|
+
# :returncode=>"SUCCESS", :meetingID=>"bigbluebutton-api-ruby-test3",
|
117
|
+
# :attendeePW=>1234, :moderatorPW=>4321, :hasBeenForciblyEnded=>"false",
|
118
|
+
# :messageKey=>{}, :message=>{}
|
119
|
+
# }
|
120
|
+
#
|
121
|
+
# Meeting that was just forcibly ended:
|
122
|
+
#
|
123
|
+
# {
|
124
|
+
# :returncode=>"SUCCESS", :meetingID=>"bigbluebutton-api-ruby-test3",
|
125
|
+
# :attendeePW=>1234, :moderatorPW=>4321, :hasBeenForciblyEnded=>"true",
|
126
|
+
# :messageKey=>"duplicateWarning",
|
127
|
+
# :message=>"This conference was already in existence and may currently be in progress."
|
128
|
+
# }
|
129
|
+
#
|
110
130
|
# TODO check if voice_bridge exists in 0.64
|
111
131
|
def create_meeting(meeting_name, meeting_id, moderator_password, attendee_password,
|
112
132
|
welcome_message = nil, dial_number = nil, logout_url = nil,
|
@@ -120,9 +140,20 @@ module BigBlueButton
|
|
120
140
|
send_api_request(:create, params)
|
121
141
|
end
|
122
142
|
|
123
|
-
# Ends an existing meeting.
|
143
|
+
# Ends an existing meeting. Throws BigBlueButtonException on failure.
|
124
144
|
# meeting_id:: Unique identifier for the meeting
|
125
145
|
# moderator_password:: Moderator password
|
146
|
+
#
|
147
|
+
# === Return examples
|
148
|
+
#
|
149
|
+
# On success:
|
150
|
+
#
|
151
|
+
# {
|
152
|
+
# :returncode=>"SUCCESS", :messageKey=>"sentEndMeetingRequest",
|
153
|
+
# :message=>"A request to end the meeting was sent. Please wait a few seconds, and then use the getMeetingInfo
|
154
|
+
# or isMeetingRunning API calls to verify that it was ended."
|
155
|
+
# }
|
156
|
+
#
|
126
157
|
def end_meeting(meeting_id, moderator_password)
|
127
158
|
send_api_request(:end, { :meetingID => meeting_id, :password => moderator_password } )
|
128
159
|
end
|
@@ -168,21 +199,66 @@ module BigBlueButton
|
|
168
199
|
send_api_request(:getMeetingInfo, { :meetingID => meeting_id, :password => password } )
|
169
200
|
end
|
170
201
|
|
171
|
-
# Returns a hash object containing the
|
172
|
-
#
|
173
|
-
#
|
202
|
+
# Returns a hash object containing information about the meetings currently existent in the BBB
|
203
|
+
# server, either they are running or not.
|
204
|
+
#
|
205
|
+
# === Return examples
|
206
|
+
#
|
207
|
+
# Server with one or more meetings:
|
208
|
+
#
|
209
|
+
# { :returncode => "SUCCESS",
|
210
|
+
# :meetings => [
|
211
|
+
# {:meetingID=>"Demo Meeting", :attendeePW=>"ap", :moderatorPW=>"mp", :hasBeenForciblyEnded=>"false", :running=>"true"},
|
212
|
+
# {:meetingID=>"I was ended Meeting", :attendeePW=>"pass", :moderatorPW=>"pass", :hasBeenForciblyEnded=>"true", :running=>"false"}
|
213
|
+
# ]
|
214
|
+
# }
|
215
|
+
#
|
216
|
+
# Server with no meetings:
|
217
|
+
#
|
218
|
+
# {:returncode=>"SUCCESS", :meetings=>[], :messageKey=>"noMeetings", :message=>"no meetings were found on this server"}
|
219
|
+
#
|
174
220
|
def get_meetings
|
175
|
-
send_api_request(:getMeetings, { :random => rand(9999999999) } )
|
221
|
+
response = send_api_request(:getMeetings, { :random => rand(9999999999) } )
|
222
|
+
|
223
|
+
# simplify the hash making a node :meetings with an array with all meetings
|
224
|
+
node = response[:meetings][:meeting]
|
225
|
+
if response[:meetings].empty?
|
226
|
+
meetings = []
|
227
|
+
else
|
228
|
+
if node.kind_of?(Array)
|
229
|
+
meetings = node
|
230
|
+
else
|
231
|
+
meetings = []
|
232
|
+
meetings << node
|
233
|
+
end
|
234
|
+
end
|
235
|
+
response[:meetings] = meetings
|
236
|
+
|
237
|
+
response
|
238
|
+
end
|
239
|
+
|
240
|
+
# Returns the API version (as string) of the associated server. This actually returns
|
241
|
+
# the version requested to the BBB server, and not the version set by the user in
|
242
|
+
# the initialization.
|
243
|
+
#
|
244
|
+
# Works for BBB >= 0.7 only. For earlier versions, returns an empty string.
|
245
|
+
def get_api_version
|
246
|
+
response = send_api_request(:index)
|
247
|
+
if response[:returncode] == "SUCCESS"
|
248
|
+
response[:version]
|
249
|
+
else
|
250
|
+
""
|
251
|
+
end
|
176
252
|
end
|
177
253
|
|
178
254
|
# Make a simple request to the server to test the connection
|
179
|
-
# TODO implement test for version 0.64
|
180
255
|
def test_connection
|
181
256
|
if @version == '0.7'
|
182
257
|
response = send_api_request(:index)
|
183
258
|
response[:returncode] == "SUCCESS"
|
184
259
|
else
|
185
|
-
|
260
|
+
response = get_meetings
|
261
|
+
response[:returncode] == "SUCCESS"
|
186
262
|
end
|
187
263
|
end
|
188
264
|
|
data/test/test.rb
CHANGED
@@ -33,21 +33,17 @@ def general_test
|
|
33
33
|
Kernel.exit!
|
34
34
|
end
|
35
35
|
|
36
|
+
puts
|
37
|
+
puts "---------------------------------------------------"
|
38
|
+
version = @api.get_api_version
|
39
|
+
puts "The API version of your server is #{version}"
|
40
|
+
|
36
41
|
puts
|
37
42
|
puts "---------------------------------------------------"
|
38
43
|
response = @api.get_meetings
|
39
44
|
puts "Existent meetings in your server:"
|
40
|
-
|
41
|
-
puts "
|
42
|
-
else
|
43
|
-
node = response[:meetings][:meeting]
|
44
|
-
if node.kind_of?(Array)
|
45
|
-
node.each do |m|
|
46
|
-
puts " " + m[:meetingID] + ": " + m.inspect
|
47
|
-
end
|
48
|
-
else
|
49
|
-
puts " " + node[:meetingID] + ": " + node.inspect
|
50
|
-
end
|
45
|
+
response[:meetings].each do |m|
|
46
|
+
puts " " + m[:meetingID] + ": " + m.inspect
|
51
47
|
end
|
52
48
|
|
53
49
|
puts
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigbluebutton-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-06 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
17
|
-
requirement: &
|
17
|
+
requirement: &78256160 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 1.4.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *78256160
|
26
26
|
description: Provides an interface to the BigBlueButton web meeting API (https://github.com/mconf/bigbluebutton-api-ruby)
|
27
27
|
email:
|
28
28
|
- leonardodaronco@gmail.com
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
66
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.7.
|
67
|
+
rubygems_version: 1.7.2
|
68
68
|
signing_key:
|
69
69
|
specification_version: 3
|
70
70
|
summary: Provides an interface to the BigBlueButton web meeting API (https://github.com/mconf/bigbluebutton-api-ruby)
|