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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2afefcb37df1adbbdbd78069ace76a6e7a90ff6a
4
- data.tar.gz: 19c35819dbc195978dc642e89171e8ce2369cb9c
3
+ metadata.gz: e8cab569413379f9b64819195dbecb7b8f921182
4
+ data.tar.gz: 84ff42e219d7ab469132aedc89467c99c8e3666b
5
5
  SHA512:
6
- metadata.gz: 424af09c594e3ef4f26ae02452ebae5bdaf7b7c1f3df1b2235914e3397360468c9135905bb61e352a0b09097e4958538dec4645778413dcd61d5740a41e6b70b
7
- data.tar.gz: 809aa86ad8b9e5c211c774279f27d7f853a05802bb7c52b2c95f5d23477e8ff4f6c708d5f678c3c770821692727375748a2510d6ab284c5d7906910c45539986
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
@@ -15,7 +15,8 @@ module Punchblock
15
15
  end
16
16
 
17
17
  def run
18
- ami_client.run
18
+ ami_client.async.run
19
+ Celluloid::Actor.join(ami_client)
19
20
  raise DisconnectedError
20
21
  end
21
22
 
@@ -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
- after(5) { terminate }
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.async.execute(*execute_args)
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
- op.async.send_complete_event complete_reason_for_event(event)
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
- op.async.send_complete_event success_reason
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('|')
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Punchblock
4
- VERSION = "1.9.1"
4
+ VERSION = "1.9.2"
5
5
  end
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.0"]
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 5.5
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.async.should_receive(:execute).once
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.async.should_receive(:execute).once.with(media_engine, default_voice)
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.async.should_receive(:execute).once.with(media_engine, default_voice)
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.async.should_receive(:execute).once.with(media_engine, default_voice)
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.async.should_receive(:execute).once
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.async.should_receive(:execute).once
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.async.should_receive(:execute).once
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.1
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-08 00:00:00.000000000 Z
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.0'
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.0'
160
+ version: '1.1'
161
161
  - !ruby/object:Gem::Dependency
162
162
  name: ruby_speech
163
163
  requirement: !ruby/object:Gem::Requirement