punchblock 2.1.0 → 2.1.1

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: 8497250485b747e066b5df34ae25d12b6773e884
4
- data.tar.gz: 833a6638459f513c128d0765cc9ed39668216218
3
+ metadata.gz: d1695be81bb0d8afb829d648392c00705f8ec56a
4
+ data.tar.gz: 1a2fd855be244f16d1858b00aeca5309bd865af8
5
5
  SHA512:
6
- metadata.gz: 91fc99d918b5b81045adff0aac91b924abe2874c1777ffd40c452f8a71dd5c88392b1b46d9987dbfa5ba7238f86f3860072c811b962ebda478b810006679783c
7
- data.tar.gz: baff387cd63774ab1aefecc86055d816de003b9e4bf216488ecaced37a296f18315bf3e9c4d8682f02475d7ea77e45d4b5fc62701ed29f4e029e94f7b38b1b10
6
+ metadata.gz: 8fc40e0dbcad7bf5435a1fff4e37a3237c0768cea38bab9bdacc5bcce20df41baf74cff01160a3a39db566198c92a049461ebcd7e9f8152ace80d05b65be23a4
7
+ data.tar.gz: 43917ff261fa61ddfce65cc0260e07a04d7b673d59bce5fc73149ab8e29056e9fbb04747bafcd8fba949274ad4fef45453e7ba36347d2da3d733997b7cff5434
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # [develop](https://github.com/adhearsion/punchblock)
2
2
 
3
+ # [v2.1.1](https://github.com/adhearsion/punchblock/compare/v2.1.0...v2.1.1) - [2013-12-19](https://rubygems.org/gems/punchblock/versions/2.1.1)
4
+ * Bugfix: Allow sending string SSML docs via Rayo
5
+ * Bugfix: Ensure that joined calls on Asterisk do not have implicitly linked lifecycles. Previously, joinees would be hungup when the joiner exited the bridge.
6
+
3
7
  # [v2.1.0](https://github.com/adhearsion/punchblock/compare/v2.0.2...v2.1.0) - [2013-11-12](https://rubygems.org/gems/punchblock/versions/2.1.0)
4
8
  * Feature: Support RubySpeech builtin grammars on Asterisk and FreeSWITCH
5
9
  * Update: Update to stable release of Virtus
@@ -47,7 +47,7 @@ module Punchblock
47
47
 
48
48
  def xml_value
49
49
  if ssml?
50
- value.to_xml
50
+ value.to_s
51
51
  elsif urilist?
52
52
  value.to_s
53
53
  elsif
@@ -15,6 +15,8 @@ module Punchblock
15
15
 
16
16
  InvalidCommandError = Class.new Punchblock::Error
17
17
 
18
+ OUTBOUND_CHANNEL_MATCH = /.* <(?<channel>.*)>/.freeze
19
+
18
20
  attr_reader :id, :channel, :translator, :agi_env, :direction
19
21
 
20
22
  HANGUP_CAUSE_TO_END_REASON = Hash.new { :error }
@@ -70,10 +72,11 @@ module Punchblock
70
72
  def dial(dial_command)
71
73
  @direction = :outbound
72
74
  channel = dial_command.to || ''
73
- channel.match(/.* <(?<channel>.*)>/) { |m| channel = m[:channel] }
75
+ channel.match(OUTBOUND_CHANNEL_MATCH) { |m| channel = m[:channel] }
74
76
  params = { :async => true,
75
- :application => 'AGI',
76
- :data => 'agi:async',
77
+ :context => REDIRECT_CONTEXT,
78
+ :exten => REDIRECT_EXTENSION,
79
+ :priority => REDIRECT_PRIORITY,
77
80
  :channel => channel,
78
81
  :callerid => dial_command.from
79
82
  }
@@ -188,7 +191,7 @@ module Punchblock
188
191
  when Command::Join
189
192
  other_call = translator.call_with_id command.call_uri
190
193
  @pending_joins[other_call.channel] = command
191
- execute_agi_command 'EXEC Bridge', other_call.channel
194
+ execute_agi_command 'EXEC Bridge', "#{other_call.channel},F(#{REDIRECT_CONTEXT},#{REDIRECT_EXTENSION},#{REDIRECT_PRIORITY})"
192
195
  when Command::Unjoin
193
196
  other_call = translator.call_with_id command.call_uri
194
197
  redirect_back other_call
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Punchblock
4
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
5
5
  end
@@ -131,6 +131,19 @@ module Punchblock
131
131
  rayo_doc = subject.to_rayo(parent)
132
132
  rayo_doc.should == parent
133
133
  end
134
+
135
+ context "with a string SSML document" do
136
+ let(:ssml_string) { "<speak/>" }
137
+
138
+ subject do
139
+ Output.new ssml: ssml_string
140
+ end
141
+
142
+ it "passes the string right through" do
143
+ content = subject.to_rayo.at_xpath('//ns:output/ns:document/text()', ns: described_class.registered_ns).content
144
+ content.should == ssml_string
145
+ end
146
+ end
134
147
  end
135
148
  end
136
149
 
@@ -182,8 +182,9 @@ module Punchblock
182
182
  expected_action = Punchblock::Component::Asterisk::AMI::Action.new(:name => 'Originate',
183
183
  :params => {
184
184
  :async => true,
185
- :application => 'AGI',
186
- :data => 'agi:async',
185
+ :context => REDIRECT_CONTEXT,
186
+ :exten => REDIRECT_EXTENSION,
187
+ :priority => REDIRECT_PRIORITY,
187
188
  :channel => 'SIP/1234',
188
189
  :callerid => 'sip:foo@bar.com',
189
190
  :variable => "punchblock_call_id=#{subject.id}"
@@ -200,8 +201,9 @@ module Punchblock
200
201
  expected_action = Punchblock::Component::Asterisk::AMI::Action.new(:name => 'Originate',
201
202
  :params => {
202
203
  :async => true,
203
- :application => 'AGI',
204
- :data => 'agi:async',
204
+ :context => REDIRECT_CONTEXT,
205
+ :exten => REDIRECT_EXTENSION,
206
+ :priority => REDIRECT_PRIORITY,
205
207
  :channel => 'SIP/5678',
206
208
  :callerid => 'sip:foo@bar.com',
207
209
  :variable => "punchblock_call_id=#{subject.id}"
@@ -221,8 +223,9 @@ module Punchblock
221
223
  expected_action = Punchblock::Component::Asterisk::AMI::Action.new(:name => 'Originate',
222
224
  :params => {
223
225
  :async => true,
224
- :application => 'AGI',
225
- :data => 'agi:async',
226
+ :context => REDIRECT_CONTEXT,
227
+ :exten => REDIRECT_EXTENSION,
228
+ :priority => REDIRECT_PRIORITY,
226
229
  :channel => 'SIP/1234',
227
230
  :callerid => 'sip:foo@bar.com',
228
231
  :variable => "punchblock_call_id=#{subject.id}",
@@ -243,8 +246,9 @@ module Punchblock
243
246
  expected_action = Punchblock::Component::Asterisk::AMI::Action.new(:name => 'Originate',
244
247
  :params => {
245
248
  :async => true,
246
- :application => 'AGI',
247
- :data => 'agi:async',
249
+ :context => REDIRECT_CONTEXT,
250
+ :exten => REDIRECT_EXTENSION,
251
+ :priority => REDIRECT_PRIORITY,
248
252
  :channel => 'SIP/1234',
249
253
  :callerid => 'sip:foo@bar.com',
250
254
  :variable => "punchblock_call_id=#{subject.id},SIPADDHEADER51=\"X-foo: bar\",SIPADDHEADER52=\"X-doo: dah\""
@@ -1038,7 +1042,7 @@ module Punchblock
1038
1042
  before { translator.should_receive(:call_with_id).with(other_call_id).and_return(other_call) }
1039
1043
 
1040
1044
  it "executes the proper dialplan Bridge application" do
1041
- subject.wrapped_object.should_receive(:execute_agi_command).with('EXEC Bridge', other_channel).and_return code: 200
1045
+ subject.wrapped_object.should_receive(:execute_agi_command).with('EXEC Bridge', "#{other_channel},F(#{REDIRECT_CONTEXT},#{REDIRECT_EXTENSION},#{REDIRECT_PRIORITY})").and_return code: 200
1042
1046
  subject.execute_command command
1043
1047
  end
1044
1048
 
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.1.0
4
+ version: 2.1.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-11-12 00:00:00.000000000 Z
13
+ date: 2013-12-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -552,7 +552,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
552
552
  version: 1.3.7
553
553
  requirements: []
554
554
  rubyforge_project: punchblock
555
- rubygems_version: 2.0.3
555
+ rubygems_version: 2.0.2
556
556
  signing_key:
557
557
  specification_version: 4
558
558
  summary: Punchblock is a telephony middleware library