punchblock 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +9 -0
- data/CHANGELOG.md +5 -0
- data/Rakefile +0 -6
- data/lib/punchblock.rb +0 -6
- data/lib/punchblock/command/dial.rb +1 -0
- data/lib/punchblock/connection/xmpp.rb +2 -1
- data/lib/punchblock/translator/asterisk/call.rb +12 -10
- data/lib/punchblock/translator/asterisk/component.rb +2 -0
- data/lib/punchblock/translator/asterisk/component/asterisk.rb +0 -2
- data/lib/punchblock/translator/asterisk/component/input.rb +114 -0
- data/lib/punchblock/translator/asterisk/component/output.rb +92 -0
- data/lib/punchblock/version.rb +1 -1
- data/punchblock.gemspec +0 -1
- data/spec/punchblock/translator/asterisk/call_spec.rb +29 -3
- data/spec/punchblock/translator/asterisk/component/input_spec.rb +282 -0
- data/spec/punchblock/translator/asterisk/component/output_spec.rb +491 -0
- metadata +46 -60
- data/lib/punchblock/component/tropo.rb +0 -9
- data/lib/punchblock/component/tropo/conference.rb +0 -331
- data/lib/punchblock/translator/asterisk/component/asterisk/input.rb +0 -116
- data/lib/punchblock/translator/asterisk/component/asterisk/output.rb +0 -94
- data/spec/punchblock/component/tropo/conference_spec.rb +0 -361
- data/spec/punchblock/translator/asterisk/component/asterisk/input_spec.rb +0 -284
- data/spec/punchblock/translator/asterisk/component/asterisk/output_spec.rb +0 -493
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
|
+
version: 0.9.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -11,11 +11,11 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2012-01-
|
|
14
|
+
date: 2012-01-30 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: niceogiri
|
|
18
|
-
requirement: &
|
|
18
|
+
requirement: &2156354020 !ruby/object:Gem::Requirement
|
|
19
19
|
none: false
|
|
20
20
|
requirements:
|
|
21
21
|
- - ! '>='
|
|
@@ -23,10 +23,10 @@ dependencies:
|
|
|
23
23
|
version: 0.0.4
|
|
24
24
|
type: :runtime
|
|
25
25
|
prerelease: false
|
|
26
|
-
version_requirements: *
|
|
26
|
+
version_requirements: *2156354020
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: blather
|
|
29
|
-
requirement: &
|
|
29
|
+
requirement: &2156353400 !ruby/object:Gem::Requirement
|
|
30
30
|
none: false
|
|
31
31
|
requirements:
|
|
32
32
|
- - ! '>='
|
|
@@ -34,10 +34,10 @@ dependencies:
|
|
|
34
34
|
version: 0.5.12
|
|
35
35
|
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
|
-
version_requirements: *
|
|
37
|
+
version_requirements: *2156353400
|
|
38
38
|
- !ruby/object:Gem::Dependency
|
|
39
39
|
name: activesupport
|
|
40
|
-
requirement: &
|
|
40
|
+
requirement: &2156352860 !ruby/object:Gem::Requirement
|
|
41
41
|
none: false
|
|
42
42
|
requirements:
|
|
43
43
|
- - ! '>='
|
|
@@ -45,10 +45,10 @@ dependencies:
|
|
|
45
45
|
version: 2.1.0
|
|
46
46
|
type: :runtime
|
|
47
47
|
prerelease: false
|
|
48
|
-
version_requirements: *
|
|
48
|
+
version_requirements: *2156352860
|
|
49
49
|
- !ruby/object:Gem::Dependency
|
|
50
50
|
name: state_machine
|
|
51
|
-
requirement: &
|
|
51
|
+
requirement: &2156352080 !ruby/object:Gem::Requirement
|
|
52
52
|
none: false
|
|
53
53
|
requirements:
|
|
54
54
|
- - ! '>='
|
|
@@ -56,10 +56,10 @@ dependencies:
|
|
|
56
56
|
version: 1.0.1
|
|
57
57
|
type: :runtime
|
|
58
58
|
prerelease: false
|
|
59
|
-
version_requirements: *
|
|
59
|
+
version_requirements: *2156352080
|
|
60
60
|
- !ruby/object:Gem::Dependency
|
|
61
61
|
name: future-resource
|
|
62
|
-
requirement: &
|
|
62
|
+
requirement: &2156351380 !ruby/object:Gem::Requirement
|
|
63
63
|
none: false
|
|
64
64
|
requirements:
|
|
65
65
|
- - ! '>='
|
|
@@ -67,10 +67,10 @@ dependencies:
|
|
|
67
67
|
version: 0.0.2
|
|
68
68
|
type: :runtime
|
|
69
69
|
prerelease: false
|
|
70
|
-
version_requirements: *
|
|
70
|
+
version_requirements: *2156351380
|
|
71
71
|
- !ruby/object:Gem::Dependency
|
|
72
72
|
name: has-guarded-handlers
|
|
73
|
-
requirement: &
|
|
73
|
+
requirement: &2156350580 !ruby/object:Gem::Requirement
|
|
74
74
|
none: false
|
|
75
75
|
requirements:
|
|
76
76
|
- - ! '>='
|
|
@@ -78,10 +78,10 @@ dependencies:
|
|
|
78
78
|
version: 0.1.0
|
|
79
79
|
type: :runtime
|
|
80
80
|
prerelease: false
|
|
81
|
-
version_requirements: *
|
|
81
|
+
version_requirements: *2156350580
|
|
82
82
|
- !ruby/object:Gem::Dependency
|
|
83
83
|
name: celluloid
|
|
84
|
-
requirement: &
|
|
84
|
+
requirement: &2156349440 !ruby/object:Gem::Requirement
|
|
85
85
|
none: false
|
|
86
86
|
requirements:
|
|
87
87
|
- - ! '>='
|
|
@@ -89,10 +89,10 @@ dependencies:
|
|
|
89
89
|
version: 0.6.0
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
|
-
version_requirements: *
|
|
92
|
+
version_requirements: *2156349440
|
|
93
93
|
- !ruby/object:Gem::Dependency
|
|
94
94
|
name: ruby_ami
|
|
95
|
-
requirement: &
|
|
95
|
+
requirement: &2156348720 !ruby/object:Gem::Requirement
|
|
96
96
|
none: false
|
|
97
97
|
requirements:
|
|
98
98
|
- - ! '>='
|
|
@@ -100,10 +100,10 @@ dependencies:
|
|
|
100
100
|
version: 0.1.3
|
|
101
101
|
type: :runtime
|
|
102
102
|
prerelease: false
|
|
103
|
-
version_requirements: *
|
|
103
|
+
version_requirements: *2156348720
|
|
104
104
|
- !ruby/object:Gem::Dependency
|
|
105
105
|
name: ruby_speech
|
|
106
|
-
requirement: &
|
|
106
|
+
requirement: &2156347760 !ruby/object:Gem::Requirement
|
|
107
107
|
none: false
|
|
108
108
|
requirements:
|
|
109
109
|
- - ! '>='
|
|
@@ -111,10 +111,10 @@ dependencies:
|
|
|
111
111
|
version: 0.5.1
|
|
112
112
|
type: :runtime
|
|
113
113
|
prerelease: false
|
|
114
|
-
version_requirements: *
|
|
114
|
+
version_requirements: *2156347760
|
|
115
115
|
- !ruby/object:Gem::Dependency
|
|
116
116
|
name: bundler
|
|
117
|
-
requirement: &
|
|
117
|
+
requirement: &2156344520 !ruby/object:Gem::Requirement
|
|
118
118
|
none: false
|
|
119
119
|
requirements:
|
|
120
120
|
- - ~>
|
|
@@ -122,10 +122,10 @@ dependencies:
|
|
|
122
122
|
version: 1.0.0
|
|
123
123
|
type: :development
|
|
124
124
|
prerelease: false
|
|
125
|
-
version_requirements: *
|
|
125
|
+
version_requirements: *2156344520
|
|
126
126
|
- !ruby/object:Gem::Dependency
|
|
127
127
|
name: rspec
|
|
128
|
-
requirement: &
|
|
128
|
+
requirement: &2156343760 !ruby/object:Gem::Requirement
|
|
129
129
|
none: false
|
|
130
130
|
requirements:
|
|
131
131
|
- - ~>
|
|
@@ -133,10 +133,10 @@ dependencies:
|
|
|
133
133
|
version: 2.7.0
|
|
134
134
|
type: :development
|
|
135
135
|
prerelease: false
|
|
136
|
-
version_requirements: *
|
|
136
|
+
version_requirements: *2156343760
|
|
137
137
|
- !ruby/object:Gem::Dependency
|
|
138
138
|
name: ci_reporter
|
|
139
|
-
requirement: &
|
|
139
|
+
requirement: &2156343140 !ruby/object:Gem::Requirement
|
|
140
140
|
none: false
|
|
141
141
|
requirements:
|
|
142
142
|
- - ! '>='
|
|
@@ -144,10 +144,10 @@ dependencies:
|
|
|
144
144
|
version: 1.6.3
|
|
145
145
|
type: :development
|
|
146
146
|
prerelease: false
|
|
147
|
-
version_requirements: *
|
|
147
|
+
version_requirements: *2156343140
|
|
148
148
|
- !ruby/object:Gem::Dependency
|
|
149
149
|
name: yard
|
|
150
|
-
requirement: &
|
|
150
|
+
requirement: &2156342280 !ruby/object:Gem::Requirement
|
|
151
151
|
none: false
|
|
152
152
|
requirements:
|
|
153
153
|
- - ~>
|
|
@@ -155,21 +155,10 @@ dependencies:
|
|
|
155
155
|
version: 0.6.0
|
|
156
156
|
type: :development
|
|
157
157
|
prerelease: false
|
|
158
|
-
version_requirements: *
|
|
159
|
-
- !ruby/object:Gem::Dependency
|
|
160
|
-
name: rcov
|
|
161
|
-
requirement: &2156132420 !ruby/object:Gem::Requirement
|
|
162
|
-
none: false
|
|
163
|
-
requirements:
|
|
164
|
-
- - ! '>='
|
|
165
|
-
- !ruby/object:Gem::Version
|
|
166
|
-
version: '0'
|
|
167
|
-
type: :development
|
|
168
|
-
prerelease: false
|
|
169
|
-
version_requirements: *2156132420
|
|
158
|
+
version_requirements: *2156342280
|
|
170
159
|
- !ruby/object:Gem::Dependency
|
|
171
160
|
name: rake
|
|
172
|
-
requirement: &
|
|
161
|
+
requirement: &2156341340 !ruby/object:Gem::Requirement
|
|
173
162
|
none: false
|
|
174
163
|
requirements:
|
|
175
164
|
- - ! '>='
|
|
@@ -177,10 +166,10 @@ dependencies:
|
|
|
177
166
|
version: '0'
|
|
178
167
|
type: :development
|
|
179
168
|
prerelease: false
|
|
180
|
-
version_requirements: *
|
|
169
|
+
version_requirements: *2156341340
|
|
181
170
|
- !ruby/object:Gem::Dependency
|
|
182
171
|
name: mocha
|
|
183
|
-
requirement: &
|
|
172
|
+
requirement: &2156340520 !ruby/object:Gem::Requirement
|
|
184
173
|
none: false
|
|
185
174
|
requirements:
|
|
186
175
|
- - ! '>='
|
|
@@ -188,10 +177,10 @@ dependencies:
|
|
|
188
177
|
version: '0'
|
|
189
178
|
type: :development
|
|
190
179
|
prerelease: false
|
|
191
|
-
version_requirements: *
|
|
180
|
+
version_requirements: *2156340520
|
|
192
181
|
- !ruby/object:Gem::Dependency
|
|
193
182
|
name: i18n
|
|
194
|
-
requirement: &
|
|
183
|
+
requirement: &2156339920 !ruby/object:Gem::Requirement
|
|
195
184
|
none: false
|
|
196
185
|
requirements:
|
|
197
186
|
- - ! '>='
|
|
@@ -199,10 +188,10 @@ dependencies:
|
|
|
199
188
|
version: '0'
|
|
200
189
|
type: :development
|
|
201
190
|
prerelease: false
|
|
202
|
-
version_requirements: *
|
|
191
|
+
version_requirements: *2156339920
|
|
203
192
|
- !ruby/object:Gem::Dependency
|
|
204
193
|
name: countdownlatch
|
|
205
|
-
requirement: &
|
|
194
|
+
requirement: &2156339260 !ruby/object:Gem::Requirement
|
|
206
195
|
none: false
|
|
207
196
|
requirements:
|
|
208
197
|
- - ! '>='
|
|
@@ -210,10 +199,10 @@ dependencies:
|
|
|
210
199
|
version: '0'
|
|
211
200
|
type: :development
|
|
212
201
|
prerelease: false
|
|
213
|
-
version_requirements: *
|
|
202
|
+
version_requirements: *2156339260
|
|
214
203
|
- !ruby/object:Gem::Dependency
|
|
215
204
|
name: guard-rspec
|
|
216
|
-
requirement: &
|
|
205
|
+
requirement: &2156338720 !ruby/object:Gem::Requirement
|
|
217
206
|
none: false
|
|
218
207
|
requirements:
|
|
219
208
|
- - ! '>='
|
|
@@ -221,7 +210,7 @@ dependencies:
|
|
|
221
210
|
version: '0'
|
|
222
211
|
type: :development
|
|
223
212
|
prerelease: false
|
|
224
|
-
version_requirements: *
|
|
213
|
+
version_requirements: *2156338720
|
|
225
214
|
description: Like Rack is to Rails and Sinatra, Punchblock provides a consistent API
|
|
226
215
|
on top of several underlying third-party call control protocols.
|
|
227
216
|
email: punchblock@adhearsion.com
|
|
@@ -232,6 +221,7 @@ files:
|
|
|
232
221
|
- .document
|
|
233
222
|
- .gitignore
|
|
234
223
|
- .rspec
|
|
224
|
+
- .travis.yml
|
|
235
225
|
- CHANGELOG.md
|
|
236
226
|
- Gemfile
|
|
237
227
|
- Guardfile
|
|
@@ -264,8 +254,6 @@ files:
|
|
|
264
254
|
- lib/punchblock/component/output.rb
|
|
265
255
|
- lib/punchblock/component/record.rb
|
|
266
256
|
- lib/punchblock/component/stop.rb
|
|
267
|
-
- lib/punchblock/component/tropo.rb
|
|
268
|
-
- lib/punchblock/component/tropo/conference.rb
|
|
269
257
|
- lib/punchblock/connection.rb
|
|
270
258
|
- lib/punchblock/connection/asterisk.rb
|
|
271
259
|
- lib/punchblock/connection/connected.rb
|
|
@@ -302,8 +290,8 @@ files:
|
|
|
302
290
|
- lib/punchblock/translator/asterisk/component/asterisk.rb
|
|
303
291
|
- lib/punchblock/translator/asterisk/component/asterisk/agi_command.rb
|
|
304
292
|
- lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb
|
|
305
|
-
- lib/punchblock/translator/asterisk/component/
|
|
306
|
-
- lib/punchblock/translator/asterisk/component/
|
|
293
|
+
- lib/punchblock/translator/asterisk/component/input.rb
|
|
294
|
+
- lib/punchblock/translator/asterisk/component/output.rb
|
|
307
295
|
- lib/punchblock/version.rb
|
|
308
296
|
- punchblock.gemspec
|
|
309
297
|
- spec/punchblock/client/component_registry_spec.rb
|
|
@@ -325,7 +313,6 @@ files:
|
|
|
325
313
|
- spec/punchblock/component/input_spec.rb
|
|
326
314
|
- spec/punchblock/component/output_spec.rb
|
|
327
315
|
- spec/punchblock/component/record_spec.rb
|
|
328
|
-
- spec/punchblock/component/tropo/conference_spec.rb
|
|
329
316
|
- spec/punchblock/connection/asterisk_spec.rb
|
|
330
317
|
- spec/punchblock/connection/xmpp_spec.rb
|
|
331
318
|
- spec/punchblock/event/answered_spec.rb
|
|
@@ -343,8 +330,8 @@ files:
|
|
|
343
330
|
- spec/punchblock/translator/asterisk/call_spec.rb
|
|
344
331
|
- spec/punchblock/translator/asterisk/component/asterisk/agi_command_spec.rb
|
|
345
332
|
- spec/punchblock/translator/asterisk/component/asterisk/ami_action_spec.rb
|
|
346
|
-
- spec/punchblock/translator/asterisk/component/
|
|
347
|
-
- spec/punchblock/translator/asterisk/component/
|
|
333
|
+
- spec/punchblock/translator/asterisk/component/input_spec.rb
|
|
334
|
+
- spec/punchblock/translator/asterisk/component/output_spec.rb
|
|
348
335
|
- spec/punchblock/translator/asterisk/component_spec.rb
|
|
349
336
|
- spec/punchblock/translator/asterisk_spec.rb
|
|
350
337
|
- spec/spec_helper.rb
|
|
@@ -364,7 +351,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
364
351
|
version: '0'
|
|
365
352
|
segments:
|
|
366
353
|
- 0
|
|
367
|
-
hash:
|
|
354
|
+
hash: 1650436713009858818
|
|
368
355
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
369
356
|
none: false
|
|
370
357
|
requirements:
|
|
@@ -397,7 +384,6 @@ test_files:
|
|
|
397
384
|
- spec/punchblock/component/input_spec.rb
|
|
398
385
|
- spec/punchblock/component/output_spec.rb
|
|
399
386
|
- spec/punchblock/component/record_spec.rb
|
|
400
|
-
- spec/punchblock/component/tropo/conference_spec.rb
|
|
401
387
|
- spec/punchblock/connection/asterisk_spec.rb
|
|
402
388
|
- spec/punchblock/connection/xmpp_spec.rb
|
|
403
389
|
- spec/punchblock/event/answered_spec.rb
|
|
@@ -415,8 +401,8 @@ test_files:
|
|
|
415
401
|
- spec/punchblock/translator/asterisk/call_spec.rb
|
|
416
402
|
- spec/punchblock/translator/asterisk/component/asterisk/agi_command_spec.rb
|
|
417
403
|
- spec/punchblock/translator/asterisk/component/asterisk/ami_action_spec.rb
|
|
418
|
-
- spec/punchblock/translator/asterisk/component/
|
|
419
|
-
- spec/punchblock/translator/asterisk/component/
|
|
404
|
+
- spec/punchblock/translator/asterisk/component/input_spec.rb
|
|
405
|
+
- spec/punchblock/translator/asterisk/component/output_spec.rb
|
|
420
406
|
- spec/punchblock/translator/asterisk/component_spec.rb
|
|
421
407
|
- spec/punchblock/translator/asterisk_spec.rb
|
|
422
408
|
- spec/spec_helper.rb
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
module Punchblock
|
|
2
|
-
module Component
|
|
3
|
-
module Tropo
|
|
4
|
-
class Conference < ComponentNode
|
|
5
|
-
register :conference, :conference
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
# Creates an Rayo conference command
|
|
9
|
-
#
|
|
10
|
-
# @param [Hash] options
|
|
11
|
-
# @option options [String] :name room id to with which to create or join the conference
|
|
12
|
-
# @option options [Announcement, Hash, Optional] :announcement to play on entry
|
|
13
|
-
# @option options [Music, Hash, Optional] :music to play to the participant when no moderator is present
|
|
14
|
-
# @option options [Boolean, Optional] :mute If set to true, the user will be muted in the conference
|
|
15
|
-
# @option options [Boolean, Optional] :moderator Whether or not the conference should be moderated
|
|
16
|
-
# @option options [Boolean, Optional] :tone_passthrough Identifies whether or not conference members can hear the tone generated when a a key on the phone is pressed.
|
|
17
|
-
# @option options [String, Optional] :terminator This is the touch-tone key (also known as "DTMF digit") used to exit the conference.
|
|
18
|
-
#
|
|
19
|
-
# @return [Command::Conference] a formatted Rayo conference command
|
|
20
|
-
#
|
|
21
|
-
# @example
|
|
22
|
-
# conference :name => 'the_one_true_conference', :terminator => '#'
|
|
23
|
-
#
|
|
24
|
-
# returns:
|
|
25
|
-
# <conference xmlns="urn:xmpp:tropo:conference:1" name="the_one_true_conference" terminator="#"/>
|
|
26
|
-
def self.new(options = {})
|
|
27
|
-
super().tap do |new_node|
|
|
28
|
-
options.each_pair do |k,v|
|
|
29
|
-
new_node.send :"#{k}=", v
|
|
30
|
-
end
|
|
31
|
-
new_node.register_hold_status_handlers
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
# @return [String] the name of the conference
|
|
37
|
-
#
|
|
38
|
-
def name
|
|
39
|
-
read_attr :name
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
# @param [String] name of the conference
|
|
44
|
-
#
|
|
45
|
-
def name=(name)
|
|
46
|
-
write_attr :name, name
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
##
|
|
50
|
-
# @return [Boolean] If set to true, the user will be muted in the conference.
|
|
51
|
-
#
|
|
52
|
-
def mute
|
|
53
|
-
read_attr(:mute) == 'true'
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
##
|
|
57
|
-
# @param [Boolean] mute If set to true, the user will be muted in the conference
|
|
58
|
-
#
|
|
59
|
-
def mute=(mute)
|
|
60
|
-
write_attr :mute, mute.to_s
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
##
|
|
64
|
-
# @return [String] This is the touch-tone key (also known as "DTMF digit") used to exit the conference.
|
|
65
|
-
#
|
|
66
|
-
def terminator
|
|
67
|
-
read_attr :terminator
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
##
|
|
71
|
-
# @param [String] terminator This is the touch-tone key (also known as "DTMF digit") used to exit the conference.
|
|
72
|
-
#
|
|
73
|
-
def terminator=(terminator)
|
|
74
|
-
write_attr :terminator, terminator
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
##
|
|
78
|
-
# @return [Boolean] Identifies whether or not conference members can hear the tone generated when a a key on the phone is pressed.
|
|
79
|
-
#
|
|
80
|
-
def tone_passthrough
|
|
81
|
-
read_attr('tone-passthrough') == 'true'
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
##
|
|
85
|
-
# @param [Boolean] tone_passthrough Identifies whether or not conference members can hear the tone generated when a a key on the phone is pressed.
|
|
86
|
-
#
|
|
87
|
-
def tone_passthrough=(tone_passthrough)
|
|
88
|
-
write_attr 'tone-passthrough', tone_passthrough.to_s
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
##
|
|
92
|
-
# @return [Boolean] Whether or not the conference should be moderated
|
|
93
|
-
#
|
|
94
|
-
def moderator
|
|
95
|
-
read_attr(:moderator) == 'true'
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
##
|
|
99
|
-
# @param [Boolean] moderator Whether or not the conference should be moderated
|
|
100
|
-
#
|
|
101
|
-
def moderator=(moderator)
|
|
102
|
-
write_attr :moderator, moderator.to_s
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
##
|
|
106
|
-
# @return [Announcement] the announcement to play to the participant on entry
|
|
107
|
-
#
|
|
108
|
-
def announcement
|
|
109
|
-
node = find_first '//ns:announcement', :ns => self.registered_ns
|
|
110
|
-
Announcement.new node if node
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
##
|
|
114
|
-
# @param [Announcement, Hash] ann
|
|
115
|
-
# @option ann [String] :text Text to speak to the caller as an announcement
|
|
116
|
-
# @option ann [String] :url URL to play to the caller as an announcement
|
|
117
|
-
#
|
|
118
|
-
def announcement=(ann)
|
|
119
|
-
ann = Announcement.new(ann) unless ann.is_a? Announcement
|
|
120
|
-
self << ann
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
##
|
|
124
|
-
# @return [Music] the music to play to the participant on entry if there's no moderator present
|
|
125
|
-
#
|
|
126
|
-
def music
|
|
127
|
-
node = find_first '//ns:music', :ns => self.registered_ns
|
|
128
|
-
Music.new node if node
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
##
|
|
132
|
-
# @param [Music, Hash] m
|
|
133
|
-
# @option m [String] :text Text to speak to the caller
|
|
134
|
-
# @option m [String] :url URL to play to the caller
|
|
135
|
-
#
|
|
136
|
-
def music=(m)
|
|
137
|
-
m = Music.new(m) unless m.is_a? Announcement
|
|
138
|
-
self << m
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
class Announcement < MediaNode
|
|
142
|
-
register :announcement, :conference
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
class Music < MediaNode
|
|
146
|
-
register :music, :conference
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
def inspect_attributes # :nodoc:
|
|
150
|
-
[:name, :mute, :terminator, :tone_passthrough, :moderator, :announcement, :music] + super
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
def register_hold_status_handlers
|
|
154
|
-
register_handler :internal, OnHold do |event|
|
|
155
|
-
onhold!
|
|
156
|
-
throw :pass
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
register_handler :internal, OffHold do |event|
|
|
160
|
-
offhold!
|
|
161
|
-
throw :pass
|
|
162
|
-
end
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
state_machine :state do
|
|
166
|
-
after_transition :new => :requested do |command, transition|
|
|
167
|
-
command.mute ? command.muted! : command.unmuted!
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
state_machine :mute_status, :initial => :unknown_mute do
|
|
172
|
-
event :muted do
|
|
173
|
-
transition [:unmuted, :unknown_mute] => :muted
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
event :unmuted do
|
|
177
|
-
transition [:muted, :unknown_mute] => :unmuted
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
state_machine :hold_status, :initial => :unknown_hold do
|
|
182
|
-
event :onhold do
|
|
183
|
-
transition [:offhold, :unknown_hold] => :onhold
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
event :offhold do
|
|
187
|
-
transition [:onhold, :unknown_hold] => :offhold
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
class OnHold < Event
|
|
192
|
-
register :'on-hold', :conference
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
class OffHold < Event
|
|
196
|
-
register :'off-hold', :conference
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
module ActiveSpeaker
|
|
200
|
-
def speaking_call_id
|
|
201
|
-
read_attr :'call-id'
|
|
202
|
-
end
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
class Speaking < Event
|
|
206
|
-
register :speaking, :conference
|
|
207
|
-
include ActiveSpeaker
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
class FinishedSpeaking < Event
|
|
211
|
-
register :'finished-speaking', :conference
|
|
212
|
-
include ActiveSpeaker
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
class Complete
|
|
216
|
-
class Kick < Event::Complete::Reason
|
|
217
|
-
register :kick, :conference_complete
|
|
218
|
-
|
|
219
|
-
alias :details :text
|
|
220
|
-
|
|
221
|
-
def inspect_attributes # :nodoc:
|
|
222
|
-
[:details] + super
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
class Terminator < Event::Complete::Reason
|
|
227
|
-
register :terminator, :conference_complete
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
##
|
|
232
|
-
# Create an Rayo mute message for the current conference
|
|
233
|
-
#
|
|
234
|
-
# @return [Command::Conference::Mute] an Rayo mute message
|
|
235
|
-
#
|
|
236
|
-
# @example
|
|
237
|
-
# conf_obj.mute_action.to_xml
|
|
238
|
-
#
|
|
239
|
-
# returns:
|
|
240
|
-
# <mute xmlns="urn:xmpp:tropo:conference:1"/>
|
|
241
|
-
#
|
|
242
|
-
def mute_action
|
|
243
|
-
Command::Mute.new :component_id => component_id, :call_id => call_id
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
##
|
|
247
|
-
# Sends an Rayo mute message for the current Conference
|
|
248
|
-
#
|
|
249
|
-
def mute!
|
|
250
|
-
raise InvalidActionError, "Cannot mute a Conference that is already muted" if muted?
|
|
251
|
-
mute_action.tap do |action|
|
|
252
|
-
result = write_action action
|
|
253
|
-
muted! if result
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
|
|
257
|
-
##
|
|
258
|
-
# Create an Rayo unmute message for the current conference
|
|
259
|
-
#
|
|
260
|
-
# @return [Command::Conference::Unmute] an Rayo unmute message
|
|
261
|
-
#
|
|
262
|
-
# @example
|
|
263
|
-
# conf_obj.unmute_action.to_xml
|
|
264
|
-
#
|
|
265
|
-
# returns:
|
|
266
|
-
# <unmute xmlns="urn:xmpp:tropo:conference:1"/>
|
|
267
|
-
#
|
|
268
|
-
def unmute_action
|
|
269
|
-
Command::Unmute.new :component_id => component_id, :call_id => call_id
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
##
|
|
273
|
-
# Sends an Rayo unmute message for the current Conference
|
|
274
|
-
#
|
|
275
|
-
def unmute!
|
|
276
|
-
raise InvalidActionError, "Cannot unmute a Conference that is not muted" unless muted?
|
|
277
|
-
unmute_action.tap do |action|
|
|
278
|
-
result = write_action action
|
|
279
|
-
unmuted! if result
|
|
280
|
-
end
|
|
281
|
-
end
|
|
282
|
-
|
|
283
|
-
##
|
|
284
|
-
# Create an Rayo conference kick message
|
|
285
|
-
#
|
|
286
|
-
# @param [Hash] options
|
|
287
|
-
# @option options [String] :message to explain the reason for kicking
|
|
288
|
-
#
|
|
289
|
-
# @return [Command::Conference::Kick] an Rayo conference kick message
|
|
290
|
-
#
|
|
291
|
-
# @example
|
|
292
|
-
# conf_obj.kick_action(:message => 'bye!').to_xml
|
|
293
|
-
#
|
|
294
|
-
# returns:
|
|
295
|
-
# <kick xmlns="urn:xmpp:tropo:conference:1">bye!</kick>
|
|
296
|
-
#
|
|
297
|
-
def kick_action(options = {})
|
|
298
|
-
Kick.new options.merge(:component_id => component_id, :call_id => call_id)
|
|
299
|
-
end
|
|
300
|
-
|
|
301
|
-
##
|
|
302
|
-
# Sends an Rayo kick message for the current Conference
|
|
303
|
-
#
|
|
304
|
-
# @param [Hash] options
|
|
305
|
-
# @option options [String] :message to explain the reason for kicking
|
|
306
|
-
#
|
|
307
|
-
def kick!(options = {})
|
|
308
|
-
raise InvalidActionError, "Cannot kick a Conference that is not executing" unless executing?
|
|
309
|
-
kick_action.tap do |action|
|
|
310
|
-
write_action action
|
|
311
|
-
end
|
|
312
|
-
end
|
|
313
|
-
|
|
314
|
-
class Kick < CommandNode # :nodoc:
|
|
315
|
-
register :kick, :conference
|
|
316
|
-
|
|
317
|
-
def self.new(options = {})
|
|
318
|
-
super.tap do |new_node|
|
|
319
|
-
new_node.message = options[:message]
|
|
320
|
-
end
|
|
321
|
-
end
|
|
322
|
-
|
|
323
|
-
def message=(m)
|
|
324
|
-
self << m if m
|
|
325
|
-
end
|
|
326
|
-
end
|
|
327
|
-
|
|
328
|
-
end # Conference
|
|
329
|
-
end # Tropo
|
|
330
|
-
end # Command
|
|
331
|
-
end # Punchblock
|