punchblock 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/lib/punchblock/translator/asterisk/component/composed_prompt.rb +17 -5
- data/lib/punchblock/translator/asterisk/component/output.rb +1 -1
- data/lib/punchblock/version.rb +1 -1
- data/spec/punchblock/translator/asterisk/call_spec.rb +1 -0
- data/spec/punchblock/translator/asterisk/component/composed_prompt_spec.rb +3 -3
- data/spec/punchblock/translator/asterisk/component/output_spec.rb +23 -3
- data/spec/spec_helper.rb +1 -1
- 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: 6fd9d8e6a3b698f31b5807e789454fc7231ed468
|
4
|
+
data.tar.gz: 4128a656a2bbbba2a1dedf0cb9a8a7269a8f73be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a89def0af7a9299fe9278115c9495694c7092d34b54d6a20148e00761999b484a21682b9ed867dd3880e5720177a7e8341f5487677f0aa9d38df28d268d17f9d
|
7
|
+
data.tar.gz: 9a6a06392dc2c41a29f55443c2093d1505be65974f2796308ce9ea3b3b1e02b5b6b198ff634e7794d27d89319ceede8d73dcd1de157b4b2aeae01e3645b50bff
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# [develop](https://github.com/adhearsion/punchblock)
|
2
2
|
|
3
|
+
# [v2.0.1](https://github.com/adhearsion/punchblock/compare/v2.0.0...v2.0.1) - [2013-09-17](https://rubygems.org/gems/punchblock/versions/2.0.1)
|
4
|
+
* Bugfix: Allow audio file URIs with file extensions on Asterisk
|
5
|
+
* Bugfix: Input timers were being started before output finished on Asterisk composed prompts
|
6
|
+
* Bugfix: Input initial timers were being started on Asterisk composed prompts even if the prompt was barged
|
7
|
+
* Bugfix: Output was being interrupted on Asterisk composed prompts at every DTMF keypress, even if the output was already finished
|
8
|
+
|
3
9
|
# [v2.0.0](https://github.com/adhearsion/punchblock/compare/v1.9.4...v2.0.0) - [2013-08-29](https://rubygems.org/gems/punchblock/versions/2.0.0)
|
4
10
|
* Feature: Compliance with v0.2 of the published Rayo spec (http://xmpp.org/extensions/xep-0327.html)
|
5
11
|
* Feature: Add support for Rayo Prompt component
|
@@ -13,6 +13,8 @@ module Punchblock
|
|
13
13
|
output_command.request!
|
14
14
|
setup_dtmf_recognizer
|
15
15
|
|
16
|
+
@output_incomplete = true
|
17
|
+
|
16
18
|
output_component = Output.new_link(output_command, @call)
|
17
19
|
call.register_component output_component
|
18
20
|
fut = output_component.future.execute
|
@@ -24,14 +26,24 @@ module Punchblock
|
|
24
26
|
set_node_response output_command.response
|
25
27
|
end
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
if @component_node.barge_in
|
30
|
+
@barged = false
|
31
|
+
register_dtmf_event_handler
|
32
|
+
fut.value # Block until output is complete before starting timers
|
33
|
+
@output_incomplete = false
|
34
|
+
start_timers unless @barged
|
35
|
+
else
|
36
|
+
fut.value # Block until output is complete before allowing input
|
37
|
+
register_dtmf_event_handler
|
38
|
+
start_timers
|
39
|
+
end
|
31
40
|
end
|
32
41
|
|
33
42
|
def process_dtmf(digit)
|
34
|
-
|
43
|
+
if @component_node.barge_in && @output_incomplete
|
44
|
+
call.async.redirect_back
|
45
|
+
@barged = true
|
46
|
+
end
|
35
47
|
super
|
36
48
|
end
|
37
49
|
|
data/lib/punchblock/version.rb
CHANGED
@@ -26,7 +26,7 @@ module Punchblock
|
|
26
26
|
|
27
27
|
let :ssml_doc do
|
28
28
|
RubySpeech::SSML.draw do
|
29
|
-
audio src: '
|
29
|
+
audio src: 'tt-monkeys'
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -92,7 +92,7 @@ module Punchblock
|
|
92
92
|
context '#barge_in' do
|
93
93
|
context 'true' do
|
94
94
|
it "should execute an output component on the call and return a ref" do
|
95
|
-
call.should_receive(:execute_agi_command).once.with('EXEC Playback', '
|
95
|
+
call.should_receive(:execute_agi_command).once.with('EXEC Playback', 'tt-monkeys')
|
96
96
|
subject.execute
|
97
97
|
original_command.response(0.1).should be_a Ref
|
98
98
|
end
|
@@ -116,7 +116,7 @@ module Punchblock
|
|
116
116
|
|
117
117
|
context 'false' do
|
118
118
|
it "should execute an output component on the call" do
|
119
|
-
call.should_receive(:execute_agi_command).once.with('EXEC Playback', '
|
119
|
+
call.should_receive(:execute_agi_command).once.with('EXEC Playback', 'tt-monkeys')
|
120
120
|
subject.execute
|
121
121
|
original_command.response(0.1).should be_a Ref
|
122
122
|
end
|
@@ -432,7 +432,7 @@ module Punchblock
|
|
432
432
|
mock_call.should_receive(:execute_agi_command).once.with('EXEC Playback', audio_filename + ',noanswer').and_return code: 200
|
433
433
|
end
|
434
434
|
|
435
|
-
let(:audio_filename) { '
|
435
|
+
let(:audio_filename) { 'tt-monkeys' }
|
436
436
|
|
437
437
|
let :ssml_doc do
|
438
438
|
RubySpeech::SSML.draw do
|
@@ -494,6 +494,26 @@ module Punchblock
|
|
494
494
|
end
|
495
495
|
end
|
496
496
|
|
497
|
+
context "when the audio filename has an extension" do
|
498
|
+
let(:audio_filename) { 'tt-monkeys.wav' }
|
499
|
+
|
500
|
+
it 'should playback the audio file using Playback' do
|
501
|
+
expect_answered
|
502
|
+
expect_playback 'tt-monkeys'
|
503
|
+
subject.execute
|
504
|
+
end
|
505
|
+
|
506
|
+
context "when there are other dots in the filename" do
|
507
|
+
let(:audio_filename) { 'blue.tt-monkeys.wav' }
|
508
|
+
|
509
|
+
it 'should playback the audio file using Playback' do
|
510
|
+
expect_answered
|
511
|
+
expect_playback 'blue.tt-monkeys'
|
512
|
+
subject.execute
|
513
|
+
end
|
514
|
+
end
|
515
|
+
end
|
516
|
+
|
497
517
|
context "when we get a RubyAMI Error" do
|
498
518
|
it "should send an error complete event" do
|
499
519
|
expect_answered
|
@@ -591,8 +611,8 @@ module Punchblock
|
|
591
611
|
end
|
592
612
|
|
593
613
|
context 'with multiple audio SSML nodes' do
|
594
|
-
let(:audio_filename1) { '
|
595
|
-
let(:audio_filename2) { '
|
614
|
+
let(:audio_filename1) { 'foo' }
|
615
|
+
let(:audio_filename2) { 'bar' }
|
596
616
|
let :ssml_doc do
|
597
617
|
RubySpeech::SSML.draw do
|
598
618
|
audio :src => audio_filename1
|
data/spec/spec_helper.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.1
|
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-
|
13
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|