ruby_rabbitmq_janus 3.0.0.pre.336 → 3.0.0.pre.351
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +80 -29
- data/bin/ruby_rabbitmq_janus +1 -1
- data/config/default.yml +1 -3
- data/config/requests/admin/allow_token.json +2 -1
- data/config/requests/admin/disallow_token.json +2 -1
- data/config/requests/admin/set_session_timeout.json +2 -3
- data/config/requests/peer/trickles.json +7 -0
- data/lib/rrj/admin.rb +0 -2
- data/lib/rrj/errors/error.rb +7 -2
- data/lib/rrj/errors/janus/janus.rb +3 -17
- data/lib/rrj/errors/janus/messages/message.rb +1 -1
- data/lib/rrj/errors/janus/responses/admin.rb +67 -23
- data/lib/rrj/errors/janus/responses/base.rb +15 -0
- data/lib/rrj/errors/janus/responses/code.rb +41 -0
- data/lib/rrj/errors/janus/responses/event.rb +23 -28
- data/lib/rrj/errors/janus/responses/standard.rb +43 -32
- data/lib/rrj/errors/janus/transactions/transaction.rb +1 -1
- data/lib/rrj/errors/process/concurency.rb +1 -1
- data/lib/rrj/errors/rabbit/listener/base.rb +8 -1
- data/lib/rrj/init.rb +5 -8
- data/lib/rrj/janus/janus.rb +6 -6
- data/lib/rrj/janus/messages/admin.rb +1 -5
- data/lib/rrj/janus/messages/message.rb +0 -10
- data/lib/rrj/janus/messages/standard.rb +0 -4
- data/lib/rrj/janus/responses/admin.rb +50 -9
- data/lib/rrj/janus/responses/error.rb +159 -0
- data/lib/rrj/janus/responses/event.rb +14 -14
- data/lib/rrj/janus/responses/response.rb +43 -13
- data/lib/rrj/janus/responses/standard.rb +46 -14
- data/lib/rrj/janus/transactions/admin.rb +0 -6
- data/lib/rrj/janus/transactions/handle.rb +0 -10
- data/lib/rrj/janus/transactions/session.rb +0 -6
- data/lib/rrj/janus/transactions/transaction.rb +0 -2
- data/lib/rrj/models/concerns/instances.rb +0 -4
- data/lib/rrj/process/concurrency.rb +0 -2
- data/lib/rrj/process/event.rb +0 -4
- data/lib/rrj/process/event_admin.rb +0 -4
- data/lib/rrj/rabbit/base_event.rb +0 -2
- data/lib/rrj/rabbit/connect.rb +0 -12
- data/lib/rrj/rabbit/listener/base.rb +10 -8
- data/lib/rrj/rabbit/listener/from.rb +0 -3
- data/lib/rrj/rabbit/listener/from_admin.rb +0 -3
- data/lib/rrj/rabbit/propertie.rb +7 -9
- data/lib/rrj/rabbit/publisher/admin.rb +0 -4
- data/lib/rrj/rabbit/publisher/base.rb +0 -4
- data/lib/rrj/rabbit/publisher/exclusive.rb +0 -4
- data/lib/rrj/rabbit/publisher/keepalive.rb +0 -4
- data/lib/rrj/rabbit/publisher/non_exclusive.rb +0 -4
- data/lib/rrj/task.rb +0 -2
- data/lib/rrj/tools/bin/config.rb +2 -1
- data/lib/rrj/tools/gem/cluster.rb +0 -4
- data/lib/rrj/tools/gem/config/queues.rb +0 -5
- data/lib/rrj/tools/gem/{log.rb → logger.rb} +0 -0
- data/lib/rrj/tools/gem/option.rb +1 -6
- data/lib/rrj/tools/gem/requests.rb +0 -2
- data/lib/rrj/tools/replaces/admin.rb +2 -5
- data/lib/rrj/tools/replaces/handle.rb +0 -6
- data/lib/rrj/tools/replaces/replace.rb +0 -10
- data/lib/rrj/tools/replaces/session.rb +0 -4
- data/lib/rrj/tools/replaces/type.rb +5 -4
- data/spec/config/database.rb +1 -2
- data/spec/config/initializer.rb +5 -5
- data/spec/rrj/ruby_rabbitmq_janus_spec.rb +1 -1
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_handles_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_info_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_level_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_libnice_debug_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_locking_debug_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_log_colors_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_log_timestamps_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_max_nack_queue_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_no_media_timer_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_sessions_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_spec.rb +1 -34
- data/spec/ruby_rabbitmq_janus/janus/responses/admin_timeout_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/event_data_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/event_event_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/event_jsep_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/event_keys_spec.rb +28 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/response_spec.rb +27 -15
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_data_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_plugin_data_spec.rb +28 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_plugin_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_sdp_spec.rb +28 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb +28 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_session_id_spec.rb +22 -0
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_session_spec.rb +28 -0
- data/spec/ruby_rabbitmq_janus/models/janus_instance_spec.rb +7 -2
- data/spec/ruby_rabbitmq_janus/rabbit/connect_spec.rb +0 -4
- data/spec/ruby_rabbitmq_janus/rabbit/propertie_instance_classic_spec.rb +12 -0
- data/spec/ruby_rabbitmq_janus/rabbit/propertie_instance_token_spec.rb +12 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_add_token_spec.rb +31 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_allow_token_spec.rb +43 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_disallow_token_spec.rb +43 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_handle_info_spec.rb +32 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_list_handles_spec.Rb +32 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_list_sessions_spec.rb +25 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_list_tokens_spec.rb +33 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_remove_token_spec.rb +43 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_libnice_debug_spec.rb +20 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_locking_debug_spec.rb +20 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_log_colors_spec.rb +20 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_log_level_spec.rb +75 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_log_timestamps_spec.rb +20 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_max_nack_queue_spec.rb +56 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_no_media_timer_spec.rb +47 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_session_timeout_spec.rb +47 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_start_pcap_spec.rb +38 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_start_text2pcap_spec.rb +38 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_stop_pcap_spec.rb +43 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_stop_text2pcap_spec.rb +43 -0
- data/spec/ruby_rabbitmq_janus/rrj_answer_spec.rb +79 -0
- data/spec/ruby_rabbitmq_janus/rrj_attach_spec.rb +56 -0
- data/spec/ruby_rabbitmq_janus/rrj_create_spec.rb +25 -0
- data/spec/ruby_rabbitmq_janus/rrj_destroy_spec.rb +56 -0
- data/spec/ruby_rabbitmq_janus/rrj_detach_spec.rb +56 -0
- data/spec/ruby_rabbitmq_janus/rrj_info_spec.rb +36 -0
- data/spec/ruby_rabbitmq_janus/rrj_keepalive_spec.rb +56 -0
- data/spec/ruby_rabbitmq_janus/rrj_offer_spec.rb +57 -0
- data/spec/ruby_rabbitmq_janus/rrj_trickle_spec.rb +41 -0
- data/spec/ruby_rabbitmq_janus/rrj_trickles_spec.rb +43 -0
- data/spec/ruby_rabbitmq_janus/tools/cluster_spec.rb +12 -7
- data/spec/ruby_rabbitmq_janus/tools/config_gem_spec.rb +94 -0
- data/spec/ruby_rabbitmq_janus/tools/config_janus_spec.rb +44 -0
- data/spec/ruby_rabbitmq_janus/tools/config_queues_spec.rb +34 -0
- data/spec/ruby_rabbitmq_janus/tools/config_rabbit_spec.rb +28 -0
- data/spec/ruby_rabbitmq_janus/tools/config_spec.rb +4 -77
- data/spec/ruby_rabbitmq_janus/tools/replaces/admin_spec.rb +13 -12
- data/spec/ruby_rabbitmq_janus/tools/replaces/handle_spec.rb +12 -11
- data/spec/ruby_rabbitmq_janus/tools/replaces/replace_spec.rb +15 -14
- data/spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb +12 -11
- data/spec/ruby_rabbitmq_janus/tools/type_spec.rb +20 -1
- data/spec/spec_helper.rb +23 -8
- data/spec/support/examples_admin.rb +43 -0
- data/spec/support/examples_base.rb +65 -0
- data/spec/support/examples_config.rb +4 -2
- data/spec/support/examples_message.rb +4 -2
- data/spec/support/initialize_janus_instance.rb +80 -0
- data/spec/support/schemas/config/{rabbit_options_admin.json → rabbit_options_admin_instance_classic.json} +0 -0
- data/spec/support/schemas/config/{rabbit_options_admin2.json → rabbit_options_admin_instance_token.json} +0 -0
- data/spec/support/schemas/config/{rabbit_options.json → rabbit_options_instance_classic.json} +0 -0
- data/spec/support/schemas/config/{rabbit_options2.json → rabbit_options_instance_token.json} +0 -0
- data/spec/support/schemas/request/admin/set_libnice_debug.json +13 -0
- data/spec/support/schemas/request/admin/set_log_colors.json +13 -0
- data/spec/support/schemas/request/admin/set_log_level.json +4 -2
- data/spec/support/schemas/request/admin/set_log_timestamps.json +13 -0
- data/spec/support/schemas/request/admin/set_max_nack_queue.json +13 -0
- data/spec/support/schemas/request/admin/set_no_media_timer.json +13 -0
- data/spec/support/schemas/request/admin/set_session_timeout.json +13 -0
- data/spec/support/schemas/request/peer/trickles.json +13 -0
- data/spec/support/sdp.rb +2 -0
- data/spec/support/type.rb +9 -7
- metadata +93 -55
- data/lib/rrj/errors/janus/responses/response.rb +0 -44
- data/spec/config/instance.rb +0 -63
- data/spec/request/admin/request_add_token_spec.rb +0 -29
- data/spec/request/admin/request_allow_token_spec.rb +0 -21
- data/spec/request/admin/request_disallow_token_spec.rb +0 -21
- data/spec/request/admin/request_handle_info_spec.rb +0 -21
- data/spec/request/admin/request_list_handles_spec.rb +0 -20
- data/spec/request/admin/request_list_sessions_spec.rb +0 -21
- data/spec/request/admin/request_list_tokens_spec.rb +0 -18
- data/spec/request/admin/request_remove_token_spec.rb +0 -18
- data/spec/request/admin/request_set_libnice_debug_spec.rb +0 -28
- data/spec/request/admin/request_set_locking_debug_spec.rb +0 -28
- data/spec/request/admin/request_set_log_colors_spec.rb +0 -28
- data/spec/request/admin/request_set_log_level_spec.rb +0 -70
- data/spec/request/admin/request_set_log_timestamps_spec.rb +0 -28
- data/spec/request/admin/request_set_max_nack_queue_spec.rb +0 -28
- data/spec/request/admin/request_set_no_media_timer_spec.rb +0 -28
- data/spec/request/admin/request_set_session_timeout_spec.rb +0 -35
- data/spec/request/admin/request_start_pcap_spec.rb +0 -28
- data/spec/request/admin/request_start_text2pcap_spec.rb +0 -27
- data/spec/request/admin/request_stop_pcap_spec.rb +0 -21
- data/spec/request/admin/request_stop_text2pcap_spec.rb +0 -28
- data/spec/request/base/request_attach_spec.rb +0 -27
- data/spec/request/base/request_create_spec.rb +0 -22
- data/spec/request/base/request_destroy_spec.rb +0 -23
- data/spec/request/base/request_detach_spec.rb +0 -27
- data/spec/request/base/request_info_spec.rb +0 -22
- data/spec/request/base/request_keepalive_spec.rb +0 -23
- data/spec/request/peer/request_offer_spec.rb +0 -27
- data/spec/request/peer/request_trickle_spec.rb +0 -30
- data/spec/request/peer/request_trickles_spec.rb +0 -30
- data/spec/responses/admin_handle_info.json +0 -32
- data/spec/responses/admin_list_handles.json +0 -4
- data/spec/responses/admin_list_sessions.json +0 -4
- data/spec/responses/admin_set_libnice_debug.json +0 -4
- data/spec/responses/admin_set_locking_debug.json +0 -4
- data/spec/responses/admin_set_log_colors.json +0 -4
- data/spec/responses/admin_set_log_level.json +0 -4
- data/spec/responses/base_info.json +0 -5
- data/spec/ruby_rabbitmq_janus/janus/responses/event_spec.rb +0 -26
- data/spec/ruby_rabbitmq_janus/janus/responses/standard_spec.rb +0 -44
- data/spec/ruby_rabbitmq_janus/rabbit/propertie_2_spec.rb +0 -28
- data/spec/ruby_rabbitmq_janus/rabbit/propertie_spec.rb +0 -29
- data/spec/ruby_rabbitmq_janus/tools/logger_spec.rb +0 -84
- data/spec/support/admin_requester.rb +0 -48
- data/spec/support/aruba.rb +0 -3
- data/spec/support/examples_request.rb +0 -65
- data/spec/support/examples_response.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26081e2dcef6062935a89a824e2545e00303be4ea41272496692a5be73745a4b
|
4
|
+
data.tar.gz: d84fc9d5f8f597cb4d8306f2e81c596df72687cbdb42ff05e80a1036d9d54363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f97d6b078e8b371138dc14cef095c120a9de8cea32c7d665adc539aa83525e4dfcb833b7834a088d75dff80e819c7e480ad1434750cc0ec06e437ed5aae49e
|
7
|
+
data.tar.gz: 233929c96f3f83c4ed996868a4c2b826234970ba75271441bac569c36a7cc2c396a79ad3586d368cb3b8eefb4df7bd680129024c32cc037a23b529f851d3dcf0
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ This gem is product by [Dazzl.tv](http://dazzl.tv)
|
|
16
16
|
|
17
17
|
* [How to use](#how-to-use)
|
18
18
|
* [Installation](#installation)
|
19
|
+
* [Requirements](#requirements)
|
19
20
|
* [Configuration](#configuration)
|
20
21
|
* [Janus](#janus)
|
21
22
|
* [Generators](#generators)
|
@@ -62,6 +63,11 @@ Install basic configuration :
|
|
62
63
|
rails g ruby_rabbitmq_janus:install
|
63
64
|
```
|
64
65
|
|
66
|
+
### Requirements
|
67
|
+
|
68
|
+
* Janus Gateway : minimum version `0.7.4` [Source Code](https://github.com/meetecho/janus-gateway) - [Documentation](https://janus.conf.meetecho.com/docs/)
|
69
|
+
* RabbitMQ server
|
70
|
+
|
65
71
|
### Configuration
|
66
72
|
|
67
73
|
If you want used a customize configuration see [ruby-rabbitmq-janus.yml](config/default.md)
|
@@ -127,6 +133,8 @@ end
|
|
127
133
|
|
128
134
|
#### Admin Request
|
129
135
|
|
136
|
+
__NOTE: The request authentication `HMAC-Signed token authentication` is not available.__
|
137
|
+
|
130
138
|
```ruby
|
131
139
|
require 'ruby_rabbitmq_janus'
|
132
140
|
|
@@ -154,6 +162,18 @@ actions = RubyRabbitmqJanus::ActionEvents.new.action
|
|
154
162
|
RubyRabbitmqJanus::Janus::Concurrencies::Event.new.run(@actions)
|
155
163
|
```
|
156
164
|
|
165
|
+
#### Listen Janus Admin Event
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
require 'ruby_rabbitmq_janus'
|
169
|
+
|
170
|
+
# Create a class in your Rails application
|
171
|
+
actions = RubyRabbitmqJanus::ActionAdminEvents.new.action
|
172
|
+
|
173
|
+
# Initialize a thread for listen public admin queue and send class to thread
|
174
|
+
RubyRabbitmqJanus::Janus::Concurrencies::EventAdmin.new.run(@actions)
|
175
|
+
```
|
176
|
+
|
157
177
|
## Upgrade
|
158
178
|
|
159
179
|
For upgrade your application read [CHANGELOG.md](CHANGELOG.md)
|
@@ -162,43 +182,74 @@ For upgrade your application read [CHANGELOG.md](CHANGELOG.md)
|
|
162
182
|
|
163
183
|
### RSpec test
|
164
184
|
|
185
|
+
__Use docker for running SPEC__
|
186
|
+
|
165
187
|
```linux
|
166
|
-
|
188
|
+
# Prepare images
|
189
|
+
docker-compose build
|
190
|
+
|
191
|
+
# Launch tiers service RabbitMQ
|
192
|
+
docker-compose up -d rabbit
|
193
|
+
|
194
|
+
# Launch tiers service Janus (ensure rabbit is started before and READY)
|
195
|
+
docker-compose up -d janus janus_token
|
196
|
+
|
197
|
+
## Excute ##
|
198
|
+
|
199
|
+
# Start for MongoID database
|
200
|
+
docker-compose run gem env MONGO=true bundle exec rake classic
|
201
|
+
docker-compose run gem env MONGO=true bundle exec rake concurrency
|
202
|
+
|
203
|
+
# Start for SQlite3 database
|
204
|
+
docker-compose run gem env MONGO=false bundle exec rake classic
|
205
|
+
docker-compose run gem env MONGO=false bundle exec rake concurrency
|
206
|
+
|
207
|
+
## OR ##
|
208
|
+
|
209
|
+
# Navigate in container an
|
210
|
+
docker-compose run gem ash
|
211
|
+
export MONGO=true
|
212
|
+
bundle exec rake classic
|
167
213
|
```
|
168
214
|
|
215
|
+
NOTE : Use `SPEC_DEBUG=true bundle exec rake classic` for stopping rspec execution when first test fail.
|
216
|
+
|
169
217
|
TIPS: for rspec install janus and rabbitmq server configured by default for user
|
170
218
|
rabbitmq and use plugin echotest for janus server.
|
171
219
|
|
172
220
|
Use tags for rspec :
|
173
221
|
|
174
|
-
| Describe
|
175
|
-
| -------------------------------------------------------------
|
176
|
-
|
|
177
|
-
| Use bunny gem
|
178
|
-
| Test log functions
|
179
|
-
| Test configuration function
|
180
|
-
| Test Gem contains CONSTANTS
|
181
|
-
|
|
182
|
-
| Request
|
183
|
-
| Request with admin right in Janus application.
|
184
|
-
| Request candidate/jsep
|
185
|
-
|
|
186
|
-
| Test request attach type
|
187
|
-
| Test request type create
|
188
|
-
| Test request type detach
|
189
|
-
| Test request type janus info
|
190
|
-
| Test request type test
|
191
|
-
| Test request type handle list
|
192
|
-
| Test request type sesssion list
|
193
|
-
| Test request type handle information
|
194
|
-
| Test request type (un)locking debug
|
195
|
-
| Test request type change log level
|
196
|
-
|
|
197
|
-
| Test request type destroy session
|
198
|
-
| Test request keepalive
|
199
|
-
|
|
200
|
-
| Test request type trickle, send on candidate
|
201
|
-
| Test request type trickles, send array candidate
|
222
|
+
| Describe | Type | Name |
|
223
|
+
| ------------------------------------------------------------- | --------------- | --------------- |
|
224
|
+
| Internaly function | config | |
|
225
|
+
| Use bunny gem | | rabbit |
|
226
|
+
| Test log functions | | log |
|
227
|
+
| Test configuration function | | config |
|
228
|
+
| Test Gem contains CONSTANTS | | describe |
|
229
|
+
| Level request sending to janus (admin monitor API or classic) | level | |
|
230
|
+
| Request basic. | | base |
|
231
|
+
| Request with admin right in Janus application. | | admin |
|
232
|
+
| Request candidate/jsep | | peer |
|
233
|
+
| Request JSON sending to Rabbitmq -> Janus | request | |
|
234
|
+
| Test request attach type | | attach |
|
235
|
+
| Test request type create | | create |
|
236
|
+
| Test request type detach | | detach |
|
237
|
+
| Test request type janus info | | info |
|
238
|
+
| Test request type test | | test |
|
239
|
+
| Test request type handle list | | handles |
|
240
|
+
| Test request type sesssion list | | sessions |
|
241
|
+
| Test request type handle information | | handle_info |
|
242
|
+
| Test request type (un)locking debug | | set_locking_debug |
|
243
|
+
| Test request type change log level | | set_log_level |
|
244
|
+
| Test request type tokens list | | tokens |
|
245
|
+
| Test request type destroy session | | destroy |
|
246
|
+
| Test request keepalive | | keepalive |
|
247
|
+
| Test request type sdp offer | | offer |
|
248
|
+
| Test request type trickle, send on candidate | | trickle |
|
249
|
+
| Test request type trickles, send array candidate | | trickles |
|
250
|
+
| Event(s) thread | event | |
|
251
|
+
| Test thread public queue | | event |
|
252
|
+
| Test thread admin queue | | event_admin |
|
202
253
|
|
203
254
|
Example usage rspec with tags :
|
204
255
|
```ruby
|
data/bin/ruby_rabbitmq_janus
CHANGED
data/config/default.yml
CHANGED
@@ -27,8 +27,6 @@ queues:
|
|
27
27
|
from: from-janus-admin
|
28
28
|
# Queue sending a message for admin API janus
|
29
29
|
to: to-janus-admin
|
30
|
-
# Name to queue for managing instances
|
31
|
-
instance: janus-instance-thread
|
32
30
|
|
33
31
|
# Janus plugin used
|
34
32
|
janus:
|
@@ -78,5 +76,5 @@ gem:
|
|
78
76
|
orm: 'mongoid'
|
79
77
|
# Read response json for RSpec
|
80
78
|
response_path: 'spec/supports/rrj/responses'
|
81
|
-
# Number
|
79
|
+
# Number of process read public queue
|
82
80
|
process: 1
|
data/lib/rrj/admin.rb
CHANGED
data/lib/rrj/errors/error.rb
CHANGED
@@ -12,19 +12,24 @@ module RubyRabbitmqJanus
|
|
12
12
|
# @param [String] message Text returning in raise
|
13
13
|
# @param [Symbol] level Important to error
|
14
14
|
def initialize(message, level)
|
15
|
-
super(message)
|
16
15
|
write_error(message, level)
|
16
|
+
super(message)
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def write_error(message, level = :unknown)
|
22
22
|
if defined?(::Log)
|
23
|
-
::Log.
|
23
|
+
::Log.send(level.class.eql?(Symbol) ? level : int_to_level(level),
|
24
|
+
message)
|
24
25
|
else
|
25
26
|
p "#{level}, #{message}"
|
26
27
|
end
|
27
28
|
end
|
29
|
+
|
30
|
+
def int_to_level(sym_level)
|
31
|
+
%I[debug info warn error fatal unknown].index(sym_level)
|
32
|
+
end
|
28
33
|
end
|
29
34
|
end
|
30
35
|
end
|
@@ -1,26 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
4
|
-
|
5
|
-
module RubyRabbitmqJanus
|
6
|
-
module Errors
|
7
|
-
# Define errors to message sending and response to janus
|
8
|
-
class BaseJanus < RRJError
|
9
|
-
# Initialize a error standard for janus module
|
10
|
-
#
|
11
|
-
# @param [String] message Text returning in raise
|
12
|
-
def initialize(message, level)
|
13
|
-
super "[JANUS]#{message}", level
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
3
|
require 'rrj/errors/janus/messages/message'
|
20
4
|
require 'rrj/errors/janus/messages/admin'
|
21
5
|
require 'rrj/errors/janus/messages/standard'
|
22
6
|
|
23
|
-
require 'rrj/errors/janus/responses/
|
7
|
+
require 'rrj/errors/janus/responses/base'
|
8
|
+
|
9
|
+
require 'rrj/errors/janus/responses/code'
|
24
10
|
require 'rrj/errors/janus/responses/admin'
|
25
11
|
require 'rrj/errors/janus/responses/event'
|
26
12
|
require 'rrj/errors/janus/responses/standard'
|
@@ -4,7 +4,7 @@ module RubyRabbitmqJanus
|
|
4
4
|
module Errors
|
5
5
|
module Janus
|
6
6
|
# Define a super class for all error in Janus::Message
|
7
|
-
class BaseMessage <
|
7
|
+
class BaseMessage < RubyRabbitmqJanus::Errors::RRJError
|
8
8
|
def initialize(message, level)
|
9
9
|
super "[Message]#{message}", level
|
10
10
|
end
|
@@ -1,36 +1,80 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
4
|
-
|
5
3
|
module RubyRabbitmqJanus
|
6
4
|
module Errors
|
7
5
|
module Janus
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
module Responses
|
7
|
+
module Admin
|
8
|
+
class Base < RubyRabbitmqJanus::Errors::Janus::Responses::Base
|
9
|
+
def initialize(message)
|
10
|
+
super 'Admin', message
|
11
|
+
end
|
12
|
+
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
super 'Error sessions information reading'
|
14
|
+
class Sessions < Base
|
15
|
+
def initialize
|
16
|
+
super "Missing key 'sessions'"
|
17
|
+
end
|
20
18
|
end
|
21
|
-
end
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
class Handles < Base
|
21
|
+
def initialize
|
22
|
+
super "Missing key 'handles'"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Info < Base
|
27
|
+
def initialize
|
28
|
+
super "Missing key 'info'"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class LibniceDebug < Base
|
33
|
+
def initialize
|
34
|
+
super "Missing key 'libnice_debug'"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class LockingDebug < Base
|
39
|
+
def initialize
|
40
|
+
super "Missing key 'locking_debug'"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class LogColors < Base
|
45
|
+
def initialize
|
46
|
+
super "Missing key 'log_color'"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class Level < Base
|
51
|
+
def initialize
|
52
|
+
super "Missing key 'log_level'"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
class LogTimestamps < Base
|
57
|
+
def initialize
|
58
|
+
super "Missing key 'log_timestamps'"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class MaxNackQueue < Base
|
63
|
+
def initialize
|
64
|
+
super "Missing key 'max_nack_queue'"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class NoMediaTimer < Base
|
69
|
+
def initialize
|
70
|
+
super "Missing key 'no_media_timer'"
|
71
|
+
end
|
27
72
|
end
|
28
|
-
end
|
29
73
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
74
|
+
class Timeout < Base
|
75
|
+
def initialize
|
76
|
+
super "Missing key 'session_timeout'"
|
77
|
+
end
|
34
78
|
end
|
35
79
|
end
|
36
80
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyRabbitmqJanus
|
4
|
+
module Errors
|
5
|
+
module Janus
|
6
|
+
module Responses
|
7
|
+
class Base < RubyRabbitmqJanus::Errors::RRJError
|
8
|
+
def initialize(klass, message, level = :warn)
|
9
|
+
super "[Response][#{klass}] #{message}", level
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyRabbitmqJanus
|
4
|
+
module Errors
|
5
|
+
module Janus
|
6
|
+
module Responses
|
7
|
+
class Nok < RubyRabbitmqJanus::Errors::RRJError
|
8
|
+
def initialize(request)
|
9
|
+
super "[#{request.error_code}] Reason : #{request.error_reason}", :error
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Unknown = Nok
|
14
|
+
NotAcceptingSession = Nok
|
15
|
+
WebRTCState = Nok
|
16
|
+
TokenNotFound = Nok
|
17
|
+
UnexpectedAnswer = Nok
|
18
|
+
SessionConflit = Nok
|
19
|
+
InvalidElementType = Nok
|
20
|
+
TrickleInvalidStream = Nok
|
21
|
+
JSEPInvalidSDP = Nok
|
22
|
+
JSEPUnknownType = Nok
|
23
|
+
PluginDetach = Nok
|
24
|
+
PluginMessage = Nok
|
25
|
+
PluginAttach = Nok
|
26
|
+
PluginNotFound = Nok
|
27
|
+
HandleNotFound = Nok
|
28
|
+
SessionNotFound = Nok
|
29
|
+
InvalidRequestPath = Nok
|
30
|
+
MissingMandatoryElement = Nok
|
31
|
+
InvalidJSONObject = Nok
|
32
|
+
InvalidJSON = Nok
|
33
|
+
UnknownRequest = Nok
|
34
|
+
MissingRequest = Nok
|
35
|
+
TransportSpecific = Nok
|
36
|
+
UnauthorizedPlugin = Nok
|
37
|
+
Unauthorized = Nok
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|