ruby_rabbitmq_janus 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/init.rb +2 -1
- data/lib/rrj/janus/responses/response.rb +0 -20
- data/lib/rrj/janus/responses/standard.rb +0 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5916d357d819d815ed544afa0335e1ba5a38239
|
4
|
+
data.tar.gz: 0f8410f6753375fcaf62b08232f3d46c6e53955f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03698c63eac40e145e24d5b47ac39a62da35e337f805902b36e230658e706866177caca09de4b3df73f42f7020ae7f1c2135932420dc5593b18b1279a197776e
|
7
|
+
data.tar.gz: f3326f8f7cad19087f97c3c2d4170d21de8f31a12e7c1d07add308a7ecc1f7210c76bcc696325106c7a160fa6b29bbfd40411086e14537a6812f7941ddd18939
|
data/lib/rrj/info.rb
CHANGED
data/lib/rrj/init.rb
CHANGED
@@ -29,6 +29,7 @@ module RubyRabbitmqJanus
|
|
29
29
|
|
30
30
|
# Create an session while time opening
|
31
31
|
@session = Janus::Concurrencies::Keepalive.instance.session
|
32
|
+
Tools::Log.instance.info "Create an session janus with id : #{@session}"
|
32
33
|
|
33
34
|
@transaction = nil
|
34
35
|
end
|
@@ -143,7 +144,7 @@ module RubyRabbitmqJanus
|
|
143
144
|
handle = replace.include?('handle_id') ? replace['handle_id'] : 0
|
144
145
|
@transaction = Janus::Transactions::Handle.new(@session)
|
145
146
|
@transaction.handle_connect_and_stop(exclusive, handle) do
|
146
|
-
message_handle(type, replace, add)
|
147
|
+
message_handle(type, replace, add)
|
147
148
|
end
|
148
149
|
rescue => error
|
149
150
|
raise Errors::RRJErrorHandle, error
|
@@ -20,7 +20,6 @@ module RubyRabbitmqJanus
|
|
20
20
|
|
21
21
|
# Return request to json format
|
22
22
|
def to_json
|
23
|
-
analysis
|
24
23
|
@request.to_json
|
25
24
|
rescue => error
|
26
25
|
Tools::Log.instance.debug "Request error [to_json] : #{@request}"
|
@@ -37,7 +36,6 @@ module RubyRabbitmqJanus
|
|
37
36
|
|
38
37
|
# Return request to hash format
|
39
38
|
def to_hash
|
40
|
-
analysis
|
41
39
|
@request
|
42
40
|
rescue => error
|
43
41
|
Tools::Log.instance.debug "Request error [to_hash] : #{@request}"
|
@@ -47,24 +45,6 @@ module RubyRabbitmqJanus
|
|
47
45
|
private
|
48
46
|
|
49
47
|
attr_accessor :request
|
50
|
-
|
51
|
-
# Analysis response and send exception if janus return an error
|
52
|
-
def analysis
|
53
|
-
raise Errors::JanusResponseSimple, @request if error_simple?
|
54
|
-
raise Errors::JanusResponsePlugin, @request['plugindata']['data'] \
|
55
|
-
if error_plugin?
|
56
|
-
end
|
57
|
-
|
58
|
-
# Test if message response contains an simple error
|
59
|
-
def error_simple?
|
60
|
-
@request['janus'].equal? 'error'
|
61
|
-
end
|
62
|
-
|
63
|
-
# Test if message response contains an error in plugin
|
64
|
-
def error_plugin?
|
65
|
-
@request.key?('plugindata') && \
|
66
|
-
@request['plugindata']['data'].key?('error_code')
|
67
|
-
end
|
68
48
|
end
|
69
49
|
end
|
70
50
|
end
|
@@ -6,17 +6,6 @@ module RubyRabbitmqJanus
|
|
6
6
|
module Responses
|
7
7
|
# Response for events message
|
8
8
|
class Standard < Response
|
9
|
-
# Return a response simple for client
|
10
|
-
def for_plugin
|
11
|
-
case request['janus']
|
12
|
-
when 'success' then request['plugindata']['data']
|
13
|
-
when 'ack' then {}
|
14
|
-
end
|
15
|
-
rescue => error
|
16
|
-
Tools::Log.instance.debug "Request error : #{request}"
|
17
|
-
raise Errors::JanusResponsePluginData, error
|
18
|
-
end
|
19
|
-
|
20
9
|
# Return a integer to session
|
21
10
|
def session
|
22
11
|
data_id
|
@@ -31,7 +20,6 @@ module RubyRabbitmqJanus
|
|
31
20
|
|
32
21
|
# Read a hash and return an identifier
|
33
22
|
def data_id
|
34
|
-
analysis
|
35
23
|
request['data']['id'].to_i
|
36
24
|
rescue => error
|
37
25
|
raise Errors::JanusResponseDataId, error
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rabbitmq_janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|