librevox 1.0.0.alpha1 → 1.0.0.alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/librevox/client.rb +1 -1
- data/lib/librevox/listener/base.rb +3 -11
- data/lib/librevox/listener/outbound.rb +1 -1
- data/lib/librevox/protocol/connection.rb +6 -0
- data/lib/librevox/server.rb +1 -1
- data/lib/librevox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52c30042c2b87d8bce357c5aaaa49147988cacc455f39f48f3517e2c29337990
|
|
4
|
+
data.tar.gz: 8b8d1608e69f8f5a8637233224e2d25b7d601d98f095b68ba266be60a887bb7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd87a95e593d39615cf34ba02b343ba2ab4ef2f8f6862494e4c23d98daf8f1e7f252bb887c15a51440f4c1650ed2bbe8c8c41db89c50d50ff77bb60e4efb3c6e
|
|
7
|
+
data.tar.gz: 655726a4f85cb4a4f8f6a546d4c254118d32712fbbd7d8a36a82f22850dffaa7503e8f241576c209c673a71179f016102bc32d20bd0cdfee47e77f4a701a7cc1
|
data/README.md
CHANGED
|
@@ -171,12 +171,12 @@ Default ports are 8021 for inbound and 8084 for outbound.
|
|
|
171
171
|
|
|
172
172
|
## Closing Connections
|
|
173
173
|
|
|
174
|
-
After a session ends (e.g. the caller hangs up), the outbound socket connection to FreeSWITCH remains open for post-session events. Close it manually when done to avoid lingering sessions
|
|
174
|
+
After a session ends (e.g. the caller hangs up), the outbound socket connection to FreeSWITCH remains open for post-session events. Close it manually when done to avoid lingering sessions:
|
|
175
175
|
|
|
176
176
|
```ruby
|
|
177
177
|
class MyOutbound < Librevox::Listener::Outbound
|
|
178
178
|
event :channel_hangup do
|
|
179
|
-
|
|
179
|
+
disconnect
|
|
180
180
|
end
|
|
181
181
|
end
|
|
182
182
|
```
|
data/lib/librevox/client.rb
CHANGED
|
@@ -50,7 +50,7 @@ module Librevox
|
|
|
50
50
|
|
|
51
51
|
def command(msg)
|
|
52
52
|
@command_mutex.acquire do
|
|
53
|
-
|
|
53
|
+
write "#{msg}\n\n"
|
|
54
54
|
@reply_queue.dequeue
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -81,25 +81,17 @@ module Librevox
|
|
|
81
81
|
def on_event(event)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
def
|
|
84
|
+
def write(data)
|
|
85
85
|
@connection&.write(data)
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
def read_loop
|
|
89
|
-
while (msg = @connection.read_message)
|
|
90
|
-
receive_message(msg)
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
88
|
def run_session
|
|
95
89
|
end
|
|
96
90
|
|
|
97
|
-
def
|
|
91
|
+
def disconnect
|
|
98
92
|
@connection&.close
|
|
99
93
|
end
|
|
100
94
|
|
|
101
|
-
alias :done :close_connection_after_writing
|
|
102
|
-
|
|
103
95
|
private
|
|
104
96
|
|
|
105
97
|
def invoke_event_hooks(resp)
|
data/lib/librevox/server.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Librevox
|
|
|
18
18
|
listener = @handler.new(connection)
|
|
19
19
|
|
|
20
20
|
session_task = Async { listener.run_session }
|
|
21
|
-
listener.
|
|
21
|
+
connection.read_loop { |msg| listener.receive_message(msg) }
|
|
22
22
|
rescue => e
|
|
23
23
|
Librevox.logger.error "Session error: #{e.full_message}"
|
|
24
24
|
ensure
|
data/lib/librevox/version.rb
CHANGED