punchblock 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/punchblock/connection/asterisk.rb +2 -1
- data/lib/punchblock/connection/freeswitch.rb +5 -1
- data/lib/punchblock/translator/freeswitch/call.rb +2 -2
- data/lib/punchblock/translator/freeswitch/component/output.rb +1 -2
- data/lib/punchblock/translator/freeswitch/component/tts_output.rb +1 -2
- data/lib/punchblock/version.rb +1 -1
- data/punchblock.gemspec +1 -1
- data/spec/punchblock/connection/asterisk_spec.rb +3 -1
- data/spec/punchblock/translator/freeswitch/call_spec.rb +8 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8cab569413379f9b64819195dbecb7b8f921182
|
4
|
+
data.tar.gz: 84ff42e219d7ab469132aedc89467c99c8e3666b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36e448fa84bb6ad08baedf61ee0fe85b131de31f1801306f97428d6affd718f5b9957cd16d059ea195a9e63dc53b1aa511e5897bd6bd50cd15c07d132344cc70
|
7
|
+
data.tar.gz: f328f5d65afd54685f29dd7e64607f9a069fd87477b18758610ee28e37f979cea9982ad0e7297b8c4acd1a41dd89bb57b316dacedad12e9bc842c9f50026068a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# [develop](https://github.com/adhearsion/punchblock)
|
2
2
|
|
3
|
+
# [v1.9.2](https://github.com/adhearsion/punchblock/compare/v1.9.1...v1.9.2) - [2013-05-10](https://rubygems.org/gems/punchblock/versions/1.9.2)
|
4
|
+
* Bugfix: We were raising an exception on connection shutdown due to waiting for the connection to end incorrectly.
|
5
|
+
* Bugfix/Perf: FreeSWITCH Call actors were being kept alive after hangup for no reason
|
6
|
+
* Bugfix/Perf: FreeSWITCH component complete events were looping out of the actor
|
7
|
+
* Perf: We were wasting CPU cycles listening to all ES events when we really don't need to
|
8
|
+
|
3
9
|
# [v1.9.1](https://github.com/adhearsion/punchblock/compare/v1.9.0...v1.9.1) - [2013-05-08](https://rubygems.org/gems/punchblock/versions/1.9.1)
|
4
10
|
* Bugfix: AMI errors indicating dead channels were not being handled correctly
|
5
11
|
* Bugfix: We were broken on Celluloid 0.14 due to changes in block execution semantics between actors
|
@@ -37,7 +37,11 @@ module Punchblock
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def new_fs_stream
|
40
|
-
RubyFS::Stream.new(*@stream_options, lambda { |e| translator.async.handle_es_event e })
|
40
|
+
RubyFS::Stream.new(*@stream_options, lambda { |e| translator.async.handle_es_event e }, event_mask)
|
41
|
+
end
|
42
|
+
|
43
|
+
def event_mask
|
44
|
+
%w{CHANNEL_PARK CHANNEL_ANSWER CHANNEL_STATE CHANNEL_HANGUP CHANNEL_BRIDGE CHANNEL_UNBRIDGE CHANNEL_EXECUTE_COMPLETE DTMF RECORD_STOP}
|
41
45
|
end
|
42
46
|
|
43
47
|
def start_stream
|
@@ -245,13 +245,13 @@ module Punchblock
|
|
245
245
|
def send_end_event(reason)
|
246
246
|
send_pb_event Event::End.new(:reason => reason)
|
247
247
|
translator.deregister_call current_actor
|
248
|
-
|
248
|
+
terminate
|
249
249
|
end
|
250
250
|
|
251
251
|
def execute_component(type, command, *execute_args)
|
252
252
|
type.new_link(command, current_actor).tap do |component|
|
253
253
|
register_component component
|
254
|
-
component.
|
254
|
+
component.execute(*execute_args)
|
255
255
|
end
|
256
256
|
end
|
257
257
|
|
@@ -33,9 +33,8 @@ module Punchblock
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def playback(path)
|
36
|
-
op = current_actor
|
37
36
|
register_handler :es, :event_name => 'CHANNEL_EXECUTE_COMPLETE' do |event|
|
38
|
-
|
37
|
+
send_complete_event complete_reason_for_event(event)
|
39
38
|
end
|
40
39
|
application 'playback', path
|
41
40
|
end
|
@@ -8,9 +8,8 @@ module Punchblock
|
|
8
8
|
private
|
9
9
|
|
10
10
|
def do_output(engine, default_voice = nil)
|
11
|
-
op = current_actor
|
12
11
|
register_handler :es, :event_name => 'CHANNEL_EXECUTE_COMPLETE' do |event|
|
13
|
-
|
12
|
+
send_complete_event success_reason
|
14
13
|
end
|
15
14
|
voice = @component_node.voice || default_voice || 'kal'
|
16
15
|
application :speak, [engine, voice, document].join('|')
|
data/lib/punchblock/version.rb
CHANGED
data/punchblock.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_runtime_dependency %q<has-guarded-handlers>, ["~> 1.5"]
|
32
32
|
s.add_runtime_dependency %q<celluloid>, ["~> 0.14"]
|
33
33
|
s.add_runtime_dependency %q<ruby_ami>, ["~> 2.0"]
|
34
|
-
s.add_runtime_dependency %q<ruby_fs>, ["~> 1.
|
34
|
+
s.add_runtime_dependency %q<ruby_fs>, ["~> 1.1"]
|
35
35
|
s.add_runtime_dependency %q<ruby_speech>, ["~> 1.0"]
|
36
36
|
|
37
37
|
s.add_development_dependency %q<bundler>, ["~> 1.0"]
|
@@ -37,7 +37,9 @@ module Punchblock
|
|
37
37
|
|
38
38
|
describe '#run' do
|
39
39
|
it 'starts the RubyAMI::Stream' do
|
40
|
-
subject.ami_client.should_receive(:run).once
|
40
|
+
subject.ami_client.async.should_receive(:run).once do
|
41
|
+
subject.ami_client.terminate
|
42
|
+
end
|
41
43
|
lambda { subject.run }.should raise_error DisconnectedError
|
42
44
|
end
|
43
45
|
end
|
@@ -344,7 +344,7 @@ module Punchblock
|
|
344
344
|
it "should cause the actor to be terminated" do
|
345
345
|
translator.should_receive(:handle_pb_event).once
|
346
346
|
subject.handle_es_event es_event
|
347
|
-
sleep
|
347
|
+
sleep 0.25
|
348
348
|
subject.should_not be_alive
|
349
349
|
end
|
350
350
|
|
@@ -782,7 +782,7 @@ module Punchblock
|
|
782
782
|
context "with a media engine of #{media_engine}" do
|
783
783
|
it 'should create an Output component and execute it asynchronously' do
|
784
784
|
Component::Output.should_receive(:new_link).once.with(command, subject).and_return mock_component
|
785
|
-
mock_component.
|
785
|
+
mock_component.should_receive(:execute).once
|
786
786
|
subject.execute_command command
|
787
787
|
subject.component_with_id(mock_component.id).should be mock_component
|
788
788
|
end
|
@@ -794,7 +794,7 @@ module Punchblock
|
|
794
794
|
|
795
795
|
it 'should create a FliteOutput component and execute it asynchronously using flite and the calls default voice' do
|
796
796
|
Component::FliteOutput.should_receive(:new_link).once.with(command, subject).and_return mock_component
|
797
|
-
mock_component.
|
797
|
+
mock_component.should_receive(:execute).once.with(media_engine, default_voice)
|
798
798
|
subject.execute_command command
|
799
799
|
subject.component_with_id(mock_component.id).should be mock_component
|
800
800
|
end
|
@@ -805,7 +805,7 @@ module Punchblock
|
|
805
805
|
|
806
806
|
it 'should create a TTSOutput component and execute it asynchronously using cepstral and the calls default voice' do
|
807
807
|
Component::TTSOutput.should_receive(:new_link).once.with(command, subject).and_return mock_component
|
808
|
-
mock_component.
|
808
|
+
mock_component.should_receive(:execute).once.with(media_engine, default_voice)
|
809
809
|
subject.execute_command command
|
810
810
|
subject.component_with_id(mock_component.id).should be mock_component
|
811
811
|
end
|
@@ -816,7 +816,7 @@ module Punchblock
|
|
816
816
|
|
817
817
|
it 'should create a TTSOutput component and execute it asynchronously using unimrcp and the calls default voice' do
|
818
818
|
Component::TTSOutput.should_receive(:new_link).once.with(command, subject).and_return mock_component
|
819
|
-
mock_component.
|
819
|
+
mock_component.should_receive(:execute).once.with(media_engine, default_voice)
|
820
820
|
subject.execute_command command
|
821
821
|
subject.component_with_id(mock_component.id).should be mock_component
|
822
822
|
end
|
@@ -831,7 +831,7 @@ module Punchblock
|
|
831
831
|
|
832
832
|
it "should use the component media engine and not the platform one if it is set" do
|
833
833
|
Component::Output.should_receive(:new_link).once.with(command_with_renderer, subject).and_return mock_component
|
834
|
-
mock_component.
|
834
|
+
mock_component.should_receive(:execute).once
|
835
835
|
subject.execute_command command_with_renderer
|
836
836
|
subject.component_with_id(mock_component.id).should be mock_component
|
837
837
|
end
|
@@ -847,7 +847,7 @@ module Punchblock
|
|
847
847
|
|
848
848
|
it 'should create an Input component and execute it asynchronously' do
|
849
849
|
Component::Input.should_receive(:new_link).once.with(command, subject).and_return mock_component
|
850
|
-
mock_component.
|
850
|
+
mock_component.should_receive(:execute).once
|
851
851
|
subject.execute_command command
|
852
852
|
end
|
853
853
|
end
|
@@ -861,7 +861,7 @@ module Punchblock
|
|
861
861
|
|
862
862
|
it 'should create a Record component and execute it asynchronously' do
|
863
863
|
Component::Record.should_receive(:new_link).once.with(command, subject).and_return mock_component
|
864
|
-
mock_component.
|
864
|
+
mock_component.should_receive(:execute).once
|
865
865
|
subject.execute_command command
|
866
866
|
end
|
867
867
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: punchblock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Goecke
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: niceogiri
|
@@ -150,14 +150,14 @@ dependencies:
|
|
150
150
|
requirements:
|
151
151
|
- - ~>
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: '1.
|
153
|
+
version: '1.1'
|
154
154
|
type: :runtime
|
155
155
|
prerelease: false
|
156
156
|
version_requirements: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
158
|
- - ~>
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version: '1.
|
160
|
+
version: '1.1'
|
161
161
|
- !ruby/object:Gem::Dependency
|
162
162
|
name: ruby_speech
|
163
163
|
requirement: !ruby/object:Gem::Requirement
|