punchblock 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,12 +28,13 @@ module Punchblock
28
28
  end
29
29
 
30
30
  describe "actions" do
31
+ let(:mock_client) { mock 'Client' }
31
32
  let(:command) { Record.new }
32
33
 
33
34
  before do
34
35
  command.component_id = 'abc123'
35
36
  command.call_id = '123abc'
36
- command.connection = Connection.new :username => '123', :password => '123'
37
+ command.client = mock_client
37
38
  end
38
39
 
39
40
  describe '#pause_action' do
@@ -52,7 +53,7 @@ module Punchblock
52
53
  end
53
54
 
54
55
  it "should send its command properly" do
55
- Connection.any_instance.expects(:write).with('123abc', command.pause_action, 'abc123').returns true
56
+ mock_client.expects(:execute_command).with(command.pause_action, :call_id => '123abc', :component_id => 'abc123').returns true
56
57
  command.expects :paused!
57
58
  command.pause!
58
59
  end
@@ -96,7 +97,7 @@ module Punchblock
96
97
  end
97
98
 
98
99
  it "should send its command properly" do
99
- Connection.any_instance.expects(:write).with('123abc', command.resume_action, 'abc123').returns true
100
+ mock_client.expects(:execute_command).with(command.resume_action, :call_id => '123abc', :component_id => 'abc123').returns true
100
101
  command.expects :resumed!
101
102
  command.resume!
102
103
  end
@@ -140,7 +141,7 @@ module Punchblock
140
141
  end
141
142
 
142
143
  it "should send its command properly" do
143
- Connection.any_instance.expects(:write).with('123abc', command.stop_action, 'abc123')
144
+ mock_client.expects(:execute_command).with(command.stop_action, :call_id => '123abc', :component_id => 'abc123')
144
145
  command.stop!
145
146
  end
146
147
  end
@@ -86,12 +86,13 @@ module Punchblock
86
86
  end
87
87
 
88
88
  describe "actions" do
89
+ let(:mock_client) { mock 'Client' }
89
90
  let(:command) { Ask.new :choices => '[5 DIGITS]' }
90
91
 
91
92
  before do
92
93
  command.component_id = 'abc123'
93
94
  command.call_id = '123abc'
94
- command.connection = Connection.new :username => '123', :password => '123'
95
+ command.client = mock_client
95
96
  end
96
97
 
97
98
  describe '#stop_action' do
@@ -110,7 +111,7 @@ module Punchblock
110
111
  end
111
112
 
112
113
  it "should send its command properly" do
113
- Connection.any_instance.expects(:write).with('123abc', command.stop_action, 'abc123')
114
+ mock_client.expects(:execute_command).with(command.stop_action, :call_id => '123abc', :component_id => 'abc123')
114
115
  command.stop!
115
116
  end
116
117
  end
@@ -96,12 +96,13 @@ module Punchblock
96
96
  end
97
97
 
98
98
  describe "actions" do
99
+ let(:mock_client) { mock 'Client' }
99
100
  let(:conference) { Conference.new :name => '1234' }
100
101
 
101
102
  before do
102
103
  conference.component_id = 'abc123'
103
104
  conference.call_id = '123abc'
104
- conference.connection = Connection.new :username => '123', :password => '123'
105
+ conference.client = mock_client
105
106
  end
106
107
 
107
108
  describe '#mute_action' do
@@ -120,7 +121,7 @@ module Punchblock
120
121
  end
121
122
 
122
123
  it "should send its command properly" do
123
- Connection.any_instance.expects(:write).with('123abc', conference.mute_action, 'abc123').returns true
124
+ mock_client.expects(:execute_command).with(conference.mute_action, :call_id => '123abc', :component_id => 'abc123').returns true
124
125
  conference.expects :muted!
125
126
  conference.mute!
126
127
  end
@@ -169,7 +170,7 @@ module Punchblock
169
170
  end
170
171
 
171
172
  it "should send its command properly" do
172
- Connection.any_instance.expects(:write).with('123abc', conference.unmute_action, 'abc123').returns true
173
+ mock_client.expects(:execute_command).with(conference.unmute_action, :call_id => '123abc', :component_id => 'abc123').returns true
173
174
  conference.expects :unmuted!
174
175
  conference.unmute!
175
176
  end
@@ -213,7 +214,7 @@ module Punchblock
213
214
  end
214
215
 
215
216
  it "should send its command properly" do
216
- Connection.any_instance.expects(:write).with('123abc', conference.stop_action, 'abc123')
217
+ mock_client.expects(:execute_command).with(conference.stop_action, :call_id => '123abc', :component_id => 'abc123')
217
218
  conference.stop!
218
219
  end
219
220
  end
@@ -241,7 +242,7 @@ module Punchblock
241
242
  end
242
243
 
243
244
  it "should send its command properly" do
244
- Connection.any_instance.expects(:write).with('123abc', conference.kick_action(:message => 'bye!'), 'abc123')
245
+ mock_client.expects(:execute_command).with(conference.kick_action(:message => 'bye!'), :call_id => '123abc', :component_id => 'abc123')
245
246
  conference.kick! :message => 'bye!'
246
247
  end
247
248
  end
@@ -25,12 +25,13 @@ module Punchblock
25
25
  end
26
26
 
27
27
  describe "actions" do
28
+ let(:mock_client) { mock 'Client' }
28
29
  let(:command) { Say.new :text => 'Once upon a time there was a message...', :voice => 'kate' }
29
30
 
30
31
  before do
31
32
  command.component_id = 'abc123'
32
33
  command.call_id = '123abc'
33
- command.connection = Connection.new :username => '123', :password => '123'
34
+ command.client = mock_client
34
35
  end
35
36
 
36
37
  describe '#pause_action' do
@@ -49,7 +50,7 @@ module Punchblock
49
50
  end
50
51
 
51
52
  it "should send its command properly" do
52
- Connection.any_instance.expects(:write).with('123abc', command.pause_action, 'abc123').returns true
53
+ mock_client.expects(:execute_command).with(command.pause_action, :call_id => '123abc', :component_id => 'abc123').returns true
53
54
  command.expects :paused!
54
55
  command.pause!
55
56
  end
@@ -93,7 +94,7 @@ module Punchblock
93
94
  end
94
95
 
95
96
  it "should send its command properly" do
96
- Connection.any_instance.expects(:write).with('123abc', command.resume_action, 'abc123').returns true
97
+ mock_client.expects(:execute_command).with(command.resume_action, :call_id => '123abc', :component_id => 'abc123').returns true
97
98
  command.expects :resumed!
98
99
  command.resume!
99
100
  end
@@ -137,7 +138,7 @@ module Punchblock
137
138
  end
138
139
 
139
140
  it "should send its command properly" do
140
- Connection.any_instance.expects(:write).with('123abc', command.stop_action, 'abc123')
141
+ mock_client.expects(:execute_command).with(command.stop_action, :call_id => '123abc', :component_id => 'abc123')
141
142
  command.stop!
142
143
  end
143
144
  end
@@ -32,12 +32,13 @@ module Punchblock
32
32
  end
33
33
 
34
34
  describe "actions" do
35
+ let(:mock_client) { mock 'Client' }
35
36
  let(:command) { Transfer.new :to => 'tel:+14045551212', :from => 'tel:+14155551212' }
36
37
 
37
38
  before do
38
39
  command.component_id = 'abc123'
39
40
  command.call_id = '123abc'
40
- command.connection = Connection.new :username => '123', :password => '123'
41
+ command.client = mock_client
41
42
  end
42
43
 
43
44
  describe '#stop_action' do
@@ -56,7 +57,7 @@ module Punchblock
56
57
  end
57
58
 
58
59
  it "should send its command properly" do
59
- Connection.any_instance.expects(:write).with('123abc', command.stop_action, 'abc123')
60
+ mock_client.expects(:execute_command).with(command.stop_action, :call_id => '123abc', :component_id => 'abc123')
60
61
  command.stop!
61
62
  end
62
63
  end
@@ -67,7 +67,7 @@ module Punchblock
67
67
  describe "#response=" do
68
68
  before do
69
69
  subject.request!
70
- subject.connection = mock(:record_command_id_for_iq_id => true)
70
+ subject.client = Client.new
71
71
  end
72
72
 
73
73
  let(:component_id) { 'abc123' }
@@ -78,16 +78,10 @@ module Punchblock
78
78
  end
79
79
  end
80
80
 
81
- let :iq do
82
- Blather::Stanza::Iq.new(:result, 'blah').tap do |iq|
83
- iq.from = "12345@call.rayo.net"
84
- iq << ref
85
- end
86
- end
87
-
88
81
  it "should set the component ID from the ref" do
89
- subject.response = iq
82
+ subject.response = ref
90
83
  subject.component_id.should == component_id
84
+ subject.client.find_component_by_id(component_id).should be subject
91
85
  end
92
86
  end
93
87
  end # ComponentNode
@@ -0,0 +1,201 @@
1
+ require 'spec_helper'
2
+
3
+ module Punchblock
4
+ module Connection
5
+ describe XMPP do
6
+ let(:connection) { XMPP.new :username => '1@call.rayo.net', :password => 1 }
7
+
8
+ let(:mock_event_handler) { stub_everything 'Event Handler' }
9
+
10
+ before do
11
+ connection.event_handler = mock_event_handler
12
+ end
13
+
14
+ subject { connection }
15
+
16
+ it 'should require a username and password to be passed in the options' do
17
+ expect { XMPP.new :password => 1 }.to raise_error ArgumentError
18
+ expect { XMPP.new :username => 1 }.to raise_error ArgumentError
19
+ end
20
+
21
+ it 'should properly set the Blather logger' do
22
+ XMPP.new :wire_logger => :foo, :username => 1, :password => 1
23
+ Blather.logger.should be :foo
24
+ end
25
+
26
+ it "looking up original command by command ID" do
27
+ pending
28
+ offer = Event::Offer.new
29
+ offer.call_id = '9f00061'
30
+ offer.to = 'sip:whatever@127.0.0.1'
31
+ say = <<-MSG
32
+ <say xmlns='urn:xmpp:tropo:say:1' voice='allison'>
33
+ <audio url='http://acme.com/greeting.mp3'>
34
+ Thanks for calling ACME company
35
+ </audio>
36
+ <audio url='http://acme.com/package-shipped.mp3'>
37
+ Your package was shipped on
38
+ </audio>
39
+ <say-as interpret-as='date'>12/01/2011</say-as>
40
+ </say>
41
+ MSG
42
+ Component::Tropo::Say
43
+ say = RayoNode.import parse_stanza(say).root
44
+ connection.expects(:write_to_stream).once.returns true
45
+ iq = Blather::Stanza::Iq.new :set, '9f00061@call.rayo.net'
46
+ connection.expects(:create_iq).returns iq
47
+
48
+ write_thread = Thread.new do
49
+ connection.write offer.call_id, say
50
+ end
51
+
52
+ result = import_stanza <<-MSG
53
+ <iq type='result' from='16577@app.rayo.net/1' to='9f00061@call.rayo.net/1' id='#{iq.id}'>
54
+ <ref id='fgh4590' xmlns='urn:xmpp:rayo:1' />
55
+ </iq>
56
+ MSG
57
+
58
+ sleep 0.5 # Block so there's enough time for the write thread to get to the point where it's waiting on an IQ
59
+
60
+ connection.__send__ :handle_iq_result, result
61
+
62
+ write_thread.join
63
+
64
+ say.state_name.should == :executing
65
+
66
+ connection.original_component_from_id('fgh4590').should == say
67
+
68
+ example_complete = import_stanza <<-MSG
69
+ <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
70
+ <complete xmlns='urn:xmpp:rayo:ext:1'>
71
+ <success xmlns='urn:xmpp:tropo:say:complete:1' />
72
+ </complete>
73
+ </presence>
74
+ MSG
75
+
76
+ connection.__send__ :handle_presence, example_complete
77
+ say.complete_event.resource.source.should == say
78
+
79
+ say.component_id.should == 'fgh4590'
80
+ end
81
+
82
+ describe '#handle_presence' do
83
+ let :offer_xml do
84
+ <<-MSG
85
+ <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net'>
86
+ <offer xmlns="urn:xmpp:rayo:1" to="sip:whatever@127.0.0.1" from="sip:ylcaomxb@192.168.1.9">
87
+ <header name="Max-Forwards" value="70"/>
88
+ <header name="Content-Length" value="367"/>
89
+ </offer>
90
+ </presence>
91
+ MSG
92
+ end
93
+
94
+ let(:example_offer) { import_stanza offer_xml }
95
+
96
+ it { example_offer.should be_a Blather::Stanza::Presence }
97
+
98
+ let :complete_xml do
99
+ <<-MSG
100
+ <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
101
+ <complete xmlns='urn:xmpp:rayo:ext:1'>
102
+ <success xmlns='urn:xmpp:tropo:say:complete:1' />
103
+ </complete>
104
+ </presence>
105
+ MSG
106
+ end
107
+
108
+ let(:example_complete) { import_stanza complete_xml }
109
+
110
+ it { example_complete.should be_a Blather::Stanza::Presence }
111
+
112
+ describe "presence received" do
113
+ describe "from an offer" do
114
+ let(:handle_presence) { connection.__send__ :handle_presence, example_offer }
115
+
116
+ it 'should call the event handler with the event' do
117
+ mock_event_handler.expects(:call).once.with do |event|
118
+ event.should be_instance_of Event::Offer
119
+ event.call_id.should == '9f00061'
120
+ end
121
+ handle_presence
122
+ end
123
+
124
+ it "should populate the call map with the domain for the call ID" do
125
+ handle_presence
126
+ callmap = connection.instance_variable_get(:'@callmap')
127
+ callmap['9f00061'].should == 'call.rayo.net'
128
+ end
129
+ end
130
+
131
+ describe "from something that's not a real event" do
132
+ let :irrelevant_xml do
133
+ <<-MSG
134
+ <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
135
+ <foo/>
136
+ </presence>
137
+ MSG
138
+ end
139
+
140
+ let(:example_irrelevant_event) { import_stanza irrelevant_xml }
141
+
142
+ it 'should not handle the event' do
143
+ mock_event_handler.expects(:call).never
144
+ lambda { connection.__send__ :handle_presence, example_irrelevant_event }.should throw_symbol(:pass)
145
+ end
146
+ end
147
+
148
+ describe "from someone other than the rayo domain" do
149
+ let :irrelevant_xml do
150
+ <<-MSG
151
+ <presence to='16577@app.rayo.net/1' from='9f00061@jabber.org/fgh4590'>
152
+ <complete xmlns='urn:xmpp:rayo:ext:1'>
153
+ <success xmlns='urn:xmpp:tropo:say:complete:1' />
154
+ </complete>
155
+ </presence>
156
+ MSG
157
+ end
158
+
159
+ let(:example_irrelevant_event) { import_stanza irrelevant_xml }
160
+
161
+ it 'should not handle the event' do
162
+ mock_event_handler.expects(:call).never
163
+ lambda { connection.__send__ :handle_presence, example_irrelevant_event }.should throw_symbol(:pass)
164
+ end
165
+ end
166
+ end
167
+ end
168
+
169
+ describe "#handle_error" do
170
+ let(:call_id) { "f6d437f4-1e18-457b-99f8-b5d853f50347" }
171
+ let(:component_id) { 'abc123' }
172
+ let :error_xml do
173
+ <<-MSG
174
+ <iq type="error" id="blather000e" from="f6d437f4-1e18-457b-99f8-b5d853f50347@10.0.1.11/abc123" to="usera@10.0.1.11/voxeo">
175
+ <output xmlns="urn:xmpp:rayo:output:1"/>
176
+ <error type="cancel">
177
+ <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
178
+ <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" lang="en">Could not find call [id=f6d437f4-1e18-457b-99f8-b5d853f50347]</text>
179
+ </error>
180
+ </iq>
181
+ MSG
182
+ end
183
+
184
+ let(:example_error) { import_stanza error_xml }
185
+ let(:cmd) { Component::Output.new }
186
+
187
+ before(:all) do
188
+ cmd.request!
189
+ connection.__send__ :handle_error, example_error, cmd
190
+ end
191
+
192
+ subject { cmd.response }
193
+
194
+ its(:call_id) { should == call_id }
195
+ its(:component_id) { should == component_id }
196
+ its(:name) { should == :item_not_found }
197
+ its(:text) { should == 'Could not find call [id=f6d437f4-1e18-457b-99f8-b5d853f50347]' }
198
+ end
199
+ end # describe XMPP
200
+ end # XMPP
201
+ end # Punchblock
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: 0.4.3
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,12 +11,12 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-09-30 00:00:00.000000000 +01:00
14
+ date: 2011-10-30 01:00:00.000000000 +01:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: niceogiri
19
- requirement: &2157505380 !ruby/object:Gem::Requirement
19
+ requirement: &2160230400 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 0.0.4
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *2157505380
27
+ version_requirements: *2160230400
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: blather
30
- requirement: &2157504780 !ruby/object:Gem::Requirement
30
+ requirement: &2160229160 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: 0.5.7
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *2157504780
38
+ version_requirements: *2160229160
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: pry
41
- requirement: &2157504300 !ruby/object:Gem::Requirement
41
+ requirement: &2160227940 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ! '>='
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: 0.8.3
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *2157504300
49
+ version_requirements: *2160227940
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: activesupport
52
- requirement: &2157503760 !ruby/object:Gem::Requirement
52
+ requirement: &2160227180 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ! '>='
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: 2.1.0
58
58
  type: :runtime
59
59
  prerelease: false
60
- version_requirements: *2157503760
60
+ version_requirements: *2160227180
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: state_machine
63
- requirement: &2157503280 !ruby/object:Gem::Requirement
63
+ requirement: &2160224320 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ! '>='
@@ -68,10 +68,10 @@ dependencies:
68
68
  version: 1.0.1
69
69
  type: :runtime
70
70
  prerelease: false
71
- version_requirements: *2157503280
71
+ version_requirements: *2160224320
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: future-resource
74
- requirement: &2157502680 !ruby/object:Gem::Requirement
74
+ requirement: &2160223240 !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
77
77
  - - ! '>='
@@ -79,21 +79,21 @@ dependencies:
79
79
  version: 0.0.2
80
80
  type: :runtime
81
81
  prerelease: false
82
- version_requirements: *2157502680
82
+ version_requirements: *2160223240
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: has-guarded-handlers
85
- requirement: &2157502200 !ruby/object:Gem::Requirement
85
+ requirement: &2160205020 !ruby/object:Gem::Requirement
86
86
  none: false
87
87
  requirements:
88
88
  - - ! '>='
89
89
  - !ruby/object:Gem::Version
90
- version: 0.0.3
90
+ version: 0.1.0
91
91
  type: :runtime
92
92
  prerelease: false
93
- version_requirements: *2157502200
93
+ version_requirements: *2160205020
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: bundler
96
- requirement: &2157501720 !ruby/object:Gem::Requirement
96
+ requirement: &2160197900 !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
99
  - - ~>
@@ -101,10 +101,10 @@ dependencies:
101
101
  version: 1.0.0
102
102
  type: :development
103
103
  prerelease: false
104
- version_requirements: *2157501720
104
+ version_requirements: *2160197900
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rspec
107
- requirement: &2157501140 !ruby/object:Gem::Requirement
107
+ requirement: &2160196940 !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
110
110
  - - ~>
@@ -112,10 +112,10 @@ dependencies:
112
112
  version: 2.3.0
113
113
  type: :development
114
114
  prerelease: false
115
- version_requirements: *2157501140
115
+ version_requirements: *2160196940
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: ci_reporter
118
- requirement: &2157500560 !ruby/object:Gem::Requirement
118
+ requirement: &2160186300 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
121
  - - ! '>='
@@ -123,10 +123,10 @@ dependencies:
123
123
  version: 1.6.3
124
124
  type: :development
125
125
  prerelease: false
126
- version_requirements: *2157500560
126
+ version_requirements: *2160186300
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: yard
129
- requirement: &2157500040 !ruby/object:Gem::Requirement
129
+ requirement: &2160181420 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
132
  - - ~>
@@ -134,10 +134,10 @@ dependencies:
134
134
  version: 0.6.0
135
135
  type: :development
136
136
  prerelease: false
137
- version_requirements: *2157500040
137
+ version_requirements: *2160181420
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: rcov
140
- requirement: &2157499500 !ruby/object:Gem::Requirement
140
+ requirement: &2160178780 !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
143
143
  - - ! '>='
@@ -145,10 +145,10 @@ dependencies:
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
- version_requirements: *2157499500
148
+ version_requirements: *2160178780
149
149
  - !ruby/object:Gem::Dependency
150
150
  name: rake
151
- requirement: &2157499000 !ruby/object:Gem::Requirement
151
+ requirement: &2160169440 !ruby/object:Gem::Requirement
152
152
  none: false
153
153
  requirements:
154
154
  - - ! '>='
@@ -156,10 +156,10 @@ dependencies:
156
156
  version: '0'
157
157
  type: :development
158
158
  prerelease: false
159
- version_requirements: *2157499000
159
+ version_requirements: *2160169440
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: mocha
162
- requirement: &2157498500 !ruby/object:Gem::Requirement
162
+ requirement: &2160167220 !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements:
165
165
  - - ! '>='
@@ -167,10 +167,10 @@ dependencies:
167
167
  version: '0'
168
168
  type: :development
169
169
  prerelease: false
170
- version_requirements: *2157498500
170
+ version_requirements: *2160167220
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: i18n
173
- requirement: &2157497940 !ruby/object:Gem::Requirement
173
+ requirement: &2160161940 !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements:
176
176
  - - ! '>='
@@ -178,10 +178,10 @@ dependencies:
178
178
  version: '0'
179
179
  type: :development
180
180
  prerelease: false
181
- version_requirements: *2157497940
181
+ version_requirements: *2160161940
182
182
  - !ruby/object:Gem::Dependency
183
183
  name: countdownlatch
184
- requirement: &2157480960 !ruby/object:Gem::Requirement
184
+ requirement: &2160157820 !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements:
187
187
  - - ! '>='
@@ -189,7 +189,7 @@ dependencies:
189
189
  version: '0'
190
190
  type: :development
191
191
  prerelease: false
192
- version_requirements: *2157480960
192
+ version_requirements: *2160157820
193
193
  description: Like Rack is to Rails and Sinatra, Punchblock provides a consistent API
194
194
  on top of several underlying third-party call control protocols.
195
195
  email: punchblock@adhearsion.com
@@ -213,6 +213,8 @@ files:
213
213
  - assets/ozone/transfer-1.0.xsd
214
214
  - bin/punchblock-console
215
215
  - lib/punchblock.rb
216
+ - lib/punchblock/client.rb
217
+ - lib/punchblock/client/component_registry.rb
216
218
  - lib/punchblock/command.rb
217
219
  - lib/punchblock/command/accept.rb
218
220
  - lib/punchblock/command/answer.rb
@@ -235,6 +237,8 @@ files:
235
237
  - lib/punchblock/component/tropo/say.rb
236
238
  - lib/punchblock/component/tropo/transfer.rb
237
239
  - lib/punchblock/connection.rb
240
+ - lib/punchblock/connection/connected.rb
241
+ - lib/punchblock/connection/xmpp.rb
238
242
  - lib/punchblock/core_ext/blather/stanza.rb
239
243
  - lib/punchblock/core_ext/blather/stanza/presence.rb
240
244
  - lib/punchblock/dsl.rb
@@ -248,7 +252,6 @@ files:
248
252
  - lib/punchblock/event/offer.rb
249
253
  - lib/punchblock/event/ringing.rb
250
254
  - lib/punchblock/event/unjoined.rb
251
- - lib/punchblock/generic_connection.rb
252
255
  - lib/punchblock/has_headers.rb
253
256
  - lib/punchblock/header.rb
254
257
  - lib/punchblock/media_container.rb
@@ -259,6 +262,8 @@ files:
259
262
  - lib/punchblock/version.rb
260
263
  - log/.gitkeep
261
264
  - punchblock.gemspec
265
+ - spec/punchblock/client/component_registry_spec.rb
266
+ - spec/punchblock/client_spec.rb
262
267
  - spec/punchblock/command/accept_spec.rb
263
268
  - spec/punchblock/command/answer_spec.rb
264
269
  - spec/punchblock/command/dial_spec.rb
@@ -278,7 +283,7 @@ files:
278
283
  - spec/punchblock/component/tropo/say_spec.rb
279
284
  - spec/punchblock/component/tropo/transfer_spec.rb
280
285
  - spec/punchblock/component_spec.rb
281
- - spec/punchblock/connection_spec.rb
286
+ - spec/punchblock/connection/xmpp_spec.rb
282
287
  - spec/punchblock/event/answered_spec.rb
283
288
  - spec/punchblock/event/complete_spec.rb
284
289
  - spec/punchblock/event/dtmf_spec.rb
@@ -319,6 +324,8 @@ signing_key:
319
324
  specification_version: 3
320
325
  summary: Punchblock is a telephony middleware library
321
326
  test_files:
327
+ - spec/punchblock/client/component_registry_spec.rb
328
+ - spec/punchblock/client_spec.rb
322
329
  - spec/punchblock/command/accept_spec.rb
323
330
  - spec/punchblock/command/answer_spec.rb
324
331
  - spec/punchblock/command/dial_spec.rb
@@ -338,7 +345,7 @@ test_files:
338
345
  - spec/punchblock/component/tropo/say_spec.rb
339
346
  - spec/punchblock/component/tropo/transfer_spec.rb
340
347
  - spec/punchblock/component_spec.rb
341
- - spec/punchblock/connection_spec.rb
348
+ - spec/punchblock/connection/xmpp_spec.rb
342
349
  - spec/punchblock/event/answered_spec.rb
343
350
  - spec/punchblock/event/complete_spec.rb
344
351
  - spec/punchblock/event/dtmf_spec.rb