signalwire 2.2.0 → 2.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/signalwire/relay.rb +7 -0
- data/lib/signalwire/relay/calling/action/play_action.rb +12 -0
- data/lib/signalwire/relay/calling/action/prompt_action.rb +4 -0
- data/lib/signalwire/relay/calling/action/record_action.rb +4 -0
- data/lib/signalwire/relay/calling/call.rb +27 -13
- data/lib/signalwire/relay/calling/call_convenience_methods.rb +58 -22
- data/lib/signalwire/relay/calling/component.rb +7 -2
- data/lib/signalwire/relay/calling/component/connect.rb +6 -2
- data/lib/signalwire/relay/calling/component/play.rb +18 -2
- data/lib/signalwire/relay/calling/component/prompt.rb +9 -2
- data/lib/signalwire/relay/calling/component/record.rb +4 -0
- data/lib/signalwire/relay/calling/control_component.rb +9 -5
- data/lib/signalwire/relay/calling/result/base_action_result.rb +10 -0
- data/lib/signalwire/relay/calling/result/play_pause_result.rb +6 -0
- data/lib/signalwire/relay/calling/result/play_resume_result.rb +6 -0
- data/lib/signalwire/relay/calling/result/play_volume_result.rb +6 -0
- data/lib/signalwire/relay/calling/result/prompt_volume_result.rb +6 -0
- data/lib/signalwire/relay/calling/result/stop_result.rb +6 -0
- data/lib/signalwire/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6165a9529b9376430f0d3d27ee60d19e0fef310ceb5bf9ec8ac602b4cf0d45f6
|
4
|
+
data.tar.gz: 56cd7d1ae685944c202bb82000d4549da11960bc278ddc977b5cc728a2019851
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96659014e4dd5da3a222f9690085b5be43c625d3f1ff767a30574c3c90edd1ddc2abf31b757bc5a0eb54f99d7d7f248b170c2067c087a6f75775a2aac49b3dba
|
7
|
+
data.tar.gz: '070834c4ac95d63981b45ec4b8684f4b2d5b385eb8c24e0bf9fcc7036a76144f9cdedf37a19d6e19d193dd3485ab0837b10d87ee6945f2d3797fa76eda2249da'
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.3.0] - 2019-10-22
|
9
|
+
### Added
|
10
|
+
- Add `pause` and `resume` on `PlayAction`.
|
11
|
+
- Add `volume` optional parameter to `play` and `prompt` methods
|
12
|
+
- Add `volume` method to `Play` and `Prompt` components
|
13
|
+
- Add `play_ringtone` and `play_ringtone!` for ringback.
|
14
|
+
- Add `prompt_ringtone` and `prompt_ringtone!` for ringback on a prompt.
|
15
|
+
- Added `ringback` parameter to the `connect` and `connect!` methods.
|
16
|
+
|
8
17
|
## [2.2.0] - 2019-09-09
|
9
18
|
### Added
|
10
19
|
- `detect_answering_machine` method with its `amd` alias
|
data/lib/signalwire/relay.rb
CHANGED
@@ -28,17 +28,24 @@ require 'signalwire/relay/calling/action/send_digits_action'
|
|
28
28
|
|
29
29
|
require 'signalwire/relay/calling/result'
|
30
30
|
require 'signalwire/relay/calling/result/answer_result'
|
31
|
+
require 'signalwire/relay/calling/result/base_action_result'
|
31
32
|
require 'signalwire/relay/calling/result/connect_result'
|
32
33
|
require 'signalwire/relay/calling/result/detect_result'
|
33
34
|
require 'signalwire/relay/calling/result/dial_result'
|
34
35
|
require 'signalwire/relay/calling/result/hangup_result'
|
35
36
|
require 'signalwire/relay/calling/result/play_result'
|
37
|
+
require 'signalwire/relay/calling/result/play_pause_result'
|
38
|
+
require 'signalwire/relay/calling/result/play_resume_result'
|
39
|
+
require 'signalwire/relay/calling/result/play_volume_result'
|
36
40
|
require 'signalwire/relay/calling/result/prompt_result'
|
41
|
+
require 'signalwire/relay/calling/result/prompt_volume_result'
|
37
42
|
require 'signalwire/relay/calling/result/record_result'
|
38
43
|
require 'signalwire/relay/calling/result/fax_result'
|
39
44
|
require 'signalwire/relay/calling/result/tap_result'
|
40
45
|
require 'signalwire/relay/calling/result/send_digits_result'
|
41
46
|
|
47
|
+
require 'signalwire/relay/calling/result/stop_result'
|
48
|
+
|
42
49
|
require 'signalwire/relay/calling/component'
|
43
50
|
require 'signalwire/relay/calling/control_component'
|
44
51
|
require 'signalwire/relay/calling/component/answer'
|
@@ -112,50 +112,64 @@ module Signalwire::Relay::Calling
|
|
112
112
|
AnswerResult.new(component: answer_component)
|
113
113
|
end
|
114
114
|
|
115
|
-
def play(
|
116
|
-
|
115
|
+
def play(play_p = nil, volume_p = nil, **args)
|
116
|
+
play = args.delete(:play)
|
117
|
+
volume = args.delete(:volume)
|
118
|
+
set_parameters(binding, %i{play volume}, %i{play})
|
119
|
+
|
120
|
+
play_component = Signalwire::Relay::Calling::Play.new(call: self, play: play, volume: volume)
|
117
121
|
play_component.wait_for(Relay::CallPlayState::FINISHED, Relay::CallPlayState::ERROR)
|
118
122
|
PlayResult.new(component: play_component)
|
119
123
|
end
|
120
124
|
|
121
|
-
def play!(
|
122
|
-
|
125
|
+
def play!(play_p = nil, volume_p = nil, **args)
|
126
|
+
play = args.delete(:play)
|
127
|
+
volume = args.delete(:volume)
|
128
|
+
set_parameters(binding, %i{play volume}, %i{play})
|
129
|
+
|
130
|
+
play_component = Signalwire::Relay::Calling::Play.new(call: self, play: play, volume: volume)
|
123
131
|
play_component.execute
|
124
132
|
PlayAction.new(component: play_component)
|
125
133
|
end
|
126
134
|
|
127
|
-
def prompt(collect_p = nil, play_p = nil, **args)
|
128
|
-
|
135
|
+
def prompt(collect_p = nil, play_p = nil, volume_p = nil, **args)
|
129
136
|
collect = args.delete(:collect)
|
130
137
|
play = args.delete(:play)
|
138
|
+
volume = args.delete(:volume)
|
131
139
|
|
132
140
|
collect = compile_collect_arguments(args) if collect.nil? && collect_p.nil?
|
133
141
|
set_parameters(binding, %i{collect play}, %i{collect play})
|
134
142
|
|
135
|
-
component = Prompt.new(call: self, collect: collect, play: play)
|
143
|
+
component = Prompt.new(call: self, collect: collect, play: play, volume: volume)
|
136
144
|
component.wait_for(Relay::CallPromptState::ERROR, Relay::CallPromptState::NO_INPUT,
|
137
145
|
Relay::CallPromptState::NO_MATCH, Relay::CallPromptState::DIGIT,
|
138
146
|
Relay::CallPromptState::SPEECH)
|
139
147
|
PromptResult.new(component: component)
|
140
148
|
end
|
141
149
|
|
142
|
-
def prompt!(collect_p = nil, play_p = nil, **args)
|
150
|
+
def prompt!(collect_p = nil, play_p = nil, volume_p = nil, **args)
|
151
|
+
collect = args.delete(:collect)
|
152
|
+
play = args.delete(:play)
|
153
|
+
volume = args.delete(:volume)
|
154
|
+
|
143
155
|
collect = compile_collect_arguments(args) if collect.nil? && collect_p.nil?
|
144
156
|
set_parameters(binding, %i{collect play}, %i{collect play})
|
145
157
|
|
146
|
-
component = Prompt
|
158
|
+
component = Prompt.new(call: self, collect: collect, play: play, volume: volume)
|
147
159
|
component.execute
|
148
160
|
PromptAction.new(component: component)
|
149
161
|
end
|
150
162
|
|
151
|
-
def connect(
|
152
|
-
|
163
|
+
def connect(devices_p = nil, ringback_p = nil, devices: nil, ringback: nil)
|
164
|
+
set_parameters(binding, %i{devices ringback}, %i{devices})
|
165
|
+
component = ringback.nil? ? Connect.new(call: self, devices: devices) : Connect.new(call: self, devices: devices, ringback: ringback)
|
153
166
|
component.wait_for(Relay::CallConnectState::CONNECTED, Relay::CallConnectState::FAILED)
|
154
167
|
ConnectResult.new(component: component)
|
155
168
|
end
|
156
169
|
|
157
|
-
def connect!(
|
158
|
-
|
170
|
+
def connect!(devices_p = nil, ringback_p = nil, devices: nil, ringback: nil)
|
171
|
+
set_parameters(binding, %i{devices ringback}, %i{devices})
|
172
|
+
component = ringback.nil? ? Connect.new(call: self, devices: devices) : Connect.new(call: self, devices: devices, ringback: ringback)
|
159
173
|
component.execute
|
160
174
|
ConnectAction.new(component: component)
|
161
175
|
end
|
@@ -1,11 +1,19 @@
|
|
1
1
|
module Signalwire::Relay::Calling
|
2
2
|
module CallConvenienceMethods
|
3
|
-
def play_audio(
|
4
|
-
|
3
|
+
def play_audio(url_p = nil, volume_p = nil, **args)
|
4
|
+
url = args.delete(:url)
|
5
|
+
volume = args.delete(:volume)
|
6
|
+
set_parameters(binding, %i{url volume}, %i{url})
|
7
|
+
|
8
|
+
play(play: audio_payload(url), volume: volume)
|
5
9
|
end
|
6
10
|
|
7
|
-
def play_audio!(
|
8
|
-
|
11
|
+
def play_audio!(url_p = nil, volume_p = nil, **args)
|
12
|
+
url = args.delete(:url)
|
13
|
+
volume = args.delete(:volume)
|
14
|
+
set_parameters(binding, %i{url volume}, %i{url})
|
15
|
+
|
16
|
+
play!(play: audio_payload(url), volume: volume)
|
9
17
|
end
|
10
18
|
|
11
19
|
def play_silence(duration)
|
@@ -16,33 +24,43 @@ module Signalwire::Relay::Calling
|
|
16
24
|
play! silence_payload(duration)
|
17
25
|
end
|
18
26
|
|
19
|
-
def play_tts(text_p=nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, text: nil, language: Relay::DEFAULT_LANGUAGE, gender: Relay::DEFAULT_GENDER)
|
20
|
-
set_parameters(binding, %i{text language gender}, %i{text})
|
27
|
+
def play_tts(text_p=nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, volume_p=nil, text: nil, language: Relay::DEFAULT_LANGUAGE, gender: Relay::DEFAULT_GENDER, volume: nil)
|
28
|
+
set_parameters(binding, %i{text language gender volume}, %i{text})
|
29
|
+
|
30
|
+
play play: tts_payload(text, language, gender), volume: volume
|
31
|
+
end
|
32
|
+
|
33
|
+
def play_tts!(text_p=nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, text: nil, language: Relay::DEFAULT_LANGUAGE, gender: Relay::DEFAULT_GENDER, volume: nil)
|
34
|
+
set_parameters(binding, %i{text language gender volume}, %i{text})
|
35
|
+
play! tts_payload(text, language, gender), volume: volume
|
36
|
+
end
|
21
37
|
|
22
|
-
|
38
|
+
def play_ringtone(name:, duration: nil)
|
39
|
+
play ringtone_payload(name, duration)
|
23
40
|
end
|
24
41
|
|
25
|
-
def
|
26
|
-
|
27
|
-
play! tts_payload(text, language, gender)
|
42
|
+
def play_ringtone!(name:, duration: nil)
|
43
|
+
play ringtone_payload(name, duration)
|
28
44
|
end
|
29
45
|
|
30
|
-
def prompt_audio(collect_p = nil, url_p = nil, **args)
|
46
|
+
def prompt_audio(collect_p = nil, url_p = nil, volume_p=nil, **args)
|
31
47
|
collect = args.delete(:collect)
|
32
48
|
url = args.delete(:url)
|
49
|
+
volume = args.delete(:volume)
|
33
50
|
collect = compile_collect_arguments(args) if collect.nil? && collect_p.nil?
|
34
|
-
set_parameters(binding, %i{collect url}, %i{collect url})
|
51
|
+
set_parameters(binding, %i{collect url volume}, %i{collect url})
|
35
52
|
|
36
|
-
prompt(collect: collect, play: audio_payload(url))
|
53
|
+
prompt(collect: collect, play: audio_payload(url), volume: volume)
|
37
54
|
end
|
38
55
|
|
39
|
-
def prompt_audio!(collect_p = nil, url_p = nil, **args)
|
56
|
+
def prompt_audio!(collect_p = nil, url_p = nil, volume_p=nil, **args)
|
40
57
|
collect = args.delete(:collect)
|
41
58
|
url = args.delete(:url)
|
59
|
+
volume = args.delete(:volume)
|
42
60
|
collect = compile_collect_arguments(args) if collect.nil? && collect_p.nil?
|
43
|
-
set_parameters(binding, %i{collect url}, %i{collect url})
|
61
|
+
set_parameters(binding, %i{collect url volume}, %i{collect url})
|
44
62
|
|
45
|
-
prompt!(collect: collect, play: audio_payload(url))
|
63
|
+
prompt!(collect: collect, play: audio_payload(url), volume: volume)
|
46
64
|
end
|
47
65
|
|
48
66
|
def prompt_silence(collect_p = nil, duration_p = nil, **args)
|
@@ -63,28 +81,40 @@ module Signalwire::Relay::Calling
|
|
63
81
|
prompt!(collect: collect, play: silence_payload(duration))
|
64
82
|
end
|
65
83
|
|
66
|
-
def prompt_tts(collect_p = nil, text_p = nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, **args)
|
84
|
+
def prompt_tts(collect_p = nil, text_p = nil, volume_p=nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, **args)
|
67
85
|
collect = args.delete(:collect)
|
68
86
|
text = args.delete(:text)
|
87
|
+
volume = args.delete(:volume)
|
69
88
|
language = args.delete(:language) || Relay::DEFAULT_LANGUAGE
|
70
89
|
gender = args.delete(:gender) || Relay::DEFAULT_GENDER
|
71
90
|
collect = compile_collect_arguments(args) if collect.nil? && collect_p.nil?
|
72
91
|
|
73
|
-
set_parameters(binding, %i{collect text language gender}, %i{collect text})
|
92
|
+
set_parameters(binding, %i{collect text language gender volume}, %i{collect text})
|
74
93
|
|
75
|
-
prompt(collect: collect, play: tts_payload(text, language, gender))
|
94
|
+
prompt(collect: collect, play: tts_payload(text, language, gender), volume: volume)
|
76
95
|
end
|
77
96
|
|
78
|
-
def prompt_tts!(collect_p = nil, text_p = nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, **args)
|
97
|
+
def prompt_tts!(collect_p = nil, text_p = nil, volume_p=nil, language_p=Relay::DEFAULT_LANGUAGE, gender_p=Relay::DEFAULT_GENDER, **args)
|
79
98
|
collect = args.delete(:collect)
|
80
99
|
text = args.delete(:text)
|
100
|
+
volume = args.delete(:volume)
|
81
101
|
language = args.delete(:language) || Relay::DEFAULT_LANGUAGE
|
82
102
|
gender = args.delete(:gender) || Relay::DEFAULT_GENDER
|
83
103
|
collect = compile_collect_arguments(args) if collect.nil? && collect_p.nil?
|
84
104
|
|
85
|
-
set_parameters(binding, %i{collect text language gender}, %i{collect text})
|
105
|
+
set_parameters(binding, %i{collect text language gender volume}, %i{collect text})
|
106
|
+
|
107
|
+
prompt!(collect: collect, play: tts_payload(text, language, gender), volume: volume)
|
108
|
+
end
|
86
109
|
|
87
|
-
|
110
|
+
def prompt_ringtone(collect: nil, name:, duration: nil, **args)
|
111
|
+
collect = compile_collect_arguments(args) if collect.nil?
|
112
|
+
prompt(collect: collect, play: ringtone_payload(name, duration))
|
113
|
+
end
|
114
|
+
|
115
|
+
def prompt_ringtone!(collect: nil, name:, duration: nil, **args)
|
116
|
+
collect = compile_collect_arguments(args) if collect.nil?
|
117
|
+
prompt!(collect: collect, play: ringtone_payload(name, duration))
|
88
118
|
end
|
89
119
|
|
90
120
|
def wait_for_ringing
|
@@ -116,5 +146,11 @@ module Signalwire::Relay::Calling
|
|
116
146
|
def tts_payload(text, language=Relay::DEFAULT_LANGUAGE, gender=Relay::DEFAULT_GENDER)
|
117
147
|
[{ "type": 'tts', "params": { "text": text, "language": language, "gender": gender } }]
|
118
148
|
end
|
149
|
+
|
150
|
+
def ringtone_payload(name, duration)
|
151
|
+
params = { name: name }
|
152
|
+
params[:duration] = duration if duration && duration.to_i > 0
|
153
|
+
[{ type: "ringtone", params: params }]
|
154
|
+
end
|
119
155
|
end
|
120
156
|
end
|
@@ -30,11 +30,11 @@ module Signalwire::Relay::Calling
|
|
30
30
|
raise NotImplementedError, 'Define this method on the child classes'
|
31
31
|
end
|
32
32
|
|
33
|
-
def execute_params(method_suffix = nil)
|
33
|
+
def execute_params(method_suffix = nil, inner_params_merge = {})
|
34
34
|
{
|
35
35
|
protocol: @call.client.protocol,
|
36
36
|
method: method + method_suffix.to_s,
|
37
|
-
params: inner_params
|
37
|
+
params: inner_params.merge(inner_params_merge)
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
@@ -62,9 +62,14 @@ module Signalwire::Relay::Calling
|
|
62
62
|
|
63
63
|
def handle_execute_result(event, outcome)
|
64
64
|
@execute_result = event
|
65
|
+
after_execute(event)
|
65
66
|
terminate if outcome == :failure
|
66
67
|
end
|
67
68
|
|
69
|
+
def after_execute(event)
|
70
|
+
# implemented in subclasses
|
71
|
+
end
|
72
|
+
|
68
73
|
def terminate(event = nil)
|
69
74
|
@completed = true
|
70
75
|
@successful = false
|
@@ -2,9 +2,10 @@
|
|
2
2
|
|
3
3
|
module Signalwire::Relay::Calling
|
4
4
|
class Connect < Component
|
5
|
-
def initialize(call:, devices:)
|
5
|
+
def initialize(call:, devices:, ringback: nil)
|
6
6
|
super(call: call)
|
7
7
|
@devices = devices
|
8
|
+
@ringback = ringback
|
8
9
|
end
|
9
10
|
|
10
11
|
def method
|
@@ -16,11 +17,14 @@ module Signalwire::Relay::Calling
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def inner_params
|
19
|
-
{
|
20
|
+
params = {
|
20
21
|
node_id: @call.node_id,
|
21
22
|
call_id: @call.id,
|
22
23
|
devices: @devices
|
23
24
|
}
|
25
|
+
|
26
|
+
params[:ringback] = @ringback unless @ringback.nil?
|
27
|
+
params
|
24
28
|
end
|
25
29
|
|
26
30
|
def notification_handler(event)
|
@@ -2,9 +2,10 @@
|
|
2
2
|
|
3
3
|
module Signalwire::Relay::Calling
|
4
4
|
class Play < ControlComponent
|
5
|
-
def initialize(call:, play:)
|
5
|
+
def initialize(call:, play:, volume: nil)
|
6
6
|
super(call: call)
|
7
7
|
@play = play
|
8
|
+
@volume = volume
|
8
9
|
end
|
9
10
|
|
10
11
|
def method
|
@@ -16,12 +17,15 @@ module Signalwire::Relay::Calling
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def inner_params
|
19
|
-
{
|
20
|
+
prm = {
|
20
21
|
node_id: @call.node_id,
|
21
22
|
call_id: @call.id,
|
22
23
|
control_id: control_id,
|
23
24
|
play: @play
|
24
25
|
}
|
26
|
+
|
27
|
+
prm[:volume] = @volume unless @volume.nil?
|
28
|
+
prm
|
25
29
|
end
|
26
30
|
|
27
31
|
def notification_handler(event)
|
@@ -42,5 +46,17 @@ module Signalwire::Relay::Calling
|
|
42
46
|
@call.broadcast "play_#{@state}".to_sym, event
|
43
47
|
@call.broadcast :play_state_change, event
|
44
48
|
end
|
49
|
+
|
50
|
+
def pause
|
51
|
+
execute_subcommand '.pause', Signalwire::Relay::Calling::PlayPauseResult
|
52
|
+
end
|
53
|
+
|
54
|
+
def resume
|
55
|
+
execute_subcommand '.resume', Signalwire::Relay::Calling::PlayResumeResult
|
56
|
+
end
|
57
|
+
|
58
|
+
def volume(setting)
|
59
|
+
execute_subcommand '.volume', Signalwire::Relay::Calling::PlayVolumeResult, { volume: setting }
|
60
|
+
end
|
45
61
|
end
|
46
62
|
end
|
@@ -3,10 +3,11 @@
|
|
3
3
|
module Signalwire::Relay::Calling
|
4
4
|
class Prompt < ControlComponent
|
5
5
|
attr_reader :type, :input, :terminator
|
6
|
-
def initialize(call:, collect:, play:)
|
6
|
+
def initialize(call:, collect:, play:, volume: nil)
|
7
7
|
super(call: call)
|
8
8
|
@play = play
|
9
9
|
@collect = collect
|
10
|
+
@volume = volume
|
10
11
|
end
|
11
12
|
|
12
13
|
def method
|
@@ -18,13 +19,15 @@ module Signalwire::Relay::Calling
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def inner_params
|
21
|
-
{
|
22
|
+
prm = {
|
22
23
|
node_id: @call.node_id,
|
23
24
|
call_id: @call.id,
|
24
25
|
control_id: control_id,
|
25
26
|
play: @play,
|
26
27
|
collect: @collect
|
27
28
|
}
|
29
|
+
prm[:volume] = @volume unless @volume.nil?
|
30
|
+
prm
|
28
31
|
end
|
29
32
|
|
30
33
|
def notification_handler(event)
|
@@ -45,6 +48,10 @@ module Signalwire::Relay::Calling
|
|
45
48
|
check_for_waiting_events
|
46
49
|
end
|
47
50
|
|
51
|
+
def volume(setting)
|
52
|
+
execute_subcommand '.volume', Signalwire::Relay::Calling::PromptVolumeResult, { volume: setting }
|
53
|
+
end
|
54
|
+
|
48
55
|
private
|
49
56
|
|
50
57
|
def digit_event(result)
|
@@ -24,11 +24,15 @@ module Signalwire::Relay::Calling
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def stop
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
execute_subcommand '.stop', Signalwire::Relay::Calling::StopResult
|
28
|
+
end
|
29
|
+
|
30
|
+
def execute_subcommand(suffix, result_klass, extra_params = {})
|
31
|
+
@call.relay_execute execute_params('.stop', extra_params) do |event, outcome|
|
32
|
+
succeeded = outcome == :success
|
33
|
+
terminate(event) unless succeeded
|
34
|
+
|
35
|
+
return result_klass.new(succeeded)
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
data/lib/signalwire/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signalwire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SignalWire Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -312,15 +312,21 @@ files:
|
|
312
312
|
- lib/signalwire/relay/calling/control_component.rb
|
313
313
|
- lib/signalwire/relay/calling/result.rb
|
314
314
|
- lib/signalwire/relay/calling/result/answer_result.rb
|
315
|
+
- lib/signalwire/relay/calling/result/base_action_result.rb
|
315
316
|
- lib/signalwire/relay/calling/result/connect_result.rb
|
316
317
|
- lib/signalwire/relay/calling/result/detect_result.rb
|
317
318
|
- lib/signalwire/relay/calling/result/dial_result.rb
|
318
319
|
- lib/signalwire/relay/calling/result/fax_result.rb
|
319
320
|
- lib/signalwire/relay/calling/result/hangup_result.rb
|
321
|
+
- lib/signalwire/relay/calling/result/play_pause_result.rb
|
320
322
|
- lib/signalwire/relay/calling/result/play_result.rb
|
323
|
+
- lib/signalwire/relay/calling/result/play_resume_result.rb
|
324
|
+
- lib/signalwire/relay/calling/result/play_volume_result.rb
|
321
325
|
- lib/signalwire/relay/calling/result/prompt_result.rb
|
326
|
+
- lib/signalwire/relay/calling/result/prompt_volume_result.rb
|
322
327
|
- lib/signalwire/relay/calling/result/record_result.rb
|
323
328
|
- lib/signalwire/relay/calling/result/send_digits_result.rb
|
329
|
+
- lib/signalwire/relay/calling/result/stop_result.rb
|
324
330
|
- lib/signalwire/relay/calling/result/tap_result.rb
|
325
331
|
- lib/signalwire/relay/client.rb
|
326
332
|
- lib/signalwire/relay/constants.rb
|