telnyx 2.4.0 → 2.5.0

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
  SHA256:
3
- metadata.gz: bbfad03f6f54106bf7c6a1257febe38d392921e17352d3d6acbd3ecb1e7a30dd
4
- data.tar.gz: a51edd8d431e5b45b4fb178eb59a51d3350bca6e21790c82d86b3fa3c435af37
3
+ metadata.gz: 489eabc07a51f5c6eb4907f5e14f79718d0d94653cc3353e85cb1df637e90d5d
4
+ data.tar.gz: d3676bdfb8587cd41be67f7471d9b0f8040ff4ed638e499e337f8e66ee51e584
5
5
  SHA512:
6
- metadata.gz: ce3781a4464b221f9b0386ab6a2bf5330b2f3b87d9ab8e916c6e8b54b15c8e8a010487714ffb6a8f1bddaad59ac52eeea6a60ac63ca0da94d674282cd836b238
7
- data.tar.gz: 18204899a08b75d02346eb1612223c5f79ddf2d0b1bafee880c27b8a2bd4daecbd827b3caf1a9585aa560fe3a15e0a3446ce44c67e5c2ca911efcc46ff9a5589
6
+ metadata.gz: 22bcd3bff117a1e95b1e08526c4d6c2f313c67b801fb2c3376dd9096db4dde5d8bc9b92533111fb23dd58ed6edd63e7bde547c5521054239c46e7c17e98ff6a2
7
+ data.tar.gz: 36f193b14347d3e5d973bab543b1a40336f3940d00fead38f2961a5c77e70780e1b3b83f0651bb2f899a2cd86d0fd8d999adbc7d182c9b5468776c538dcfec4a
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ tags
6
6
  /.bundle/
7
7
  coverage/
8
8
  .idea/
9
+ vendor/*
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
 
7
7
  group :development do
8
8
  gem "coveralls", require: false
9
- gem "faraday", "0.17.3"
9
+ gem "faraday", "~> 1.0"
10
10
  gem "mocha", "~> 0.13.2"
11
11
  gem "rake"
12
12
  gem "shoulda-context"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.5.0
data/lib/telnyx/call.rb CHANGED
@@ -33,7 +33,9 @@ module Telnyx
33
33
 
34
34
  ACTIONS = %w[reject answer hangup bridge speak fork_start fork_stop
35
35
  gather_using_audio gather_using_speak playback_start
36
- playback_stop record_start record_stop send_dtmf transfer].freeze
36
+ playback_stop record_start record_stop send_dtmf transfer
37
+ transcription_start transcription_stop record_pause
38
+ record_resume gather_stop refer].freeze
37
39
 
38
40
  ACTIONS.each do |action|
39
41
  nested_resource_class_methods action,
@@ -5,5 +5,6 @@ module Telnyx
5
5
  extend APIOperations::List
6
6
 
7
7
  OBJECT_NAME = "phone_number_regulatory_requirement".freeze
8
+ RESOURCE_PATH = "phone_numbers_regulatory_requirements".freeze
8
9
  end
9
10
  end
@@ -240,7 +240,7 @@ module Telnyx
240
240
  end
241
241
 
242
242
  case e
243
- when Faraday::ClientError
243
+ when Faraday::Error
244
244
  if e.response
245
245
  handle_error_response(e.response, error_context)
246
246
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "2.4.0".freeze
4
+ VERSION = "2.5.0".freeze
5
5
  end
data/telnyx.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  "source_code_uri" => "https://github.com/team-telnyx/telnyx-ruby",
23
23
  }
24
24
 
25
- s.add_dependency("faraday", "~> 0.13", "!= 0.16.0", "!= 0.16.1", "!= 0.16.2", "!= 0.17.1")
25
+ s.add_dependency("faraday", ">= 0.13", "< 2.0", "!= 0.16.0", "!= 0.16.1", "!= 0.16.2", "!= 0.17.1")
26
26
  s.add_dependency("net-http-persistent", "~> 3.0")
27
27
  s.add_dependency("ed25519", "~> 1")
28
28
 
@@ -67,86 +67,110 @@ module Telnyx
67
67
  @call = Call.new
68
68
  @call.id = "1234"
69
69
  @call.reject cause: "CALL_REJECTED"
70
- assert_requested :post, format_url(@call, "reject")
70
+ assert_requested :post, format_action_url(@call, "reject")
71
71
  @call.answer
72
- assert_requested :post, format_url(@call, "answer")
72
+ assert_requested :post, format_action_url(@call, "answer")
73
73
  @call.hangup
74
- assert_requested :post, format_url(@call, "hangup")
74
+ assert_requested :post, format_action_url(@call, "hangup")
75
75
  @call.bridge call_control_id: SecureRandom.base64(20)
76
- assert_requested :post, format_url(@call, "bridge")
76
+ assert_requested :post, format_action_url(@call, "bridge")
77
77
  @call.speak language: "en-US", voice: "female", payload: "Telnyx call control test"
78
- assert_requested :post, format_url(@call, "speak")
78
+ assert_requested :post, format_action_url(@call, "speak")
79
79
  @call.fork_start call_control_id: SecureRandom.base64(20)
80
- assert_requested :post, format_url(@call, "fork_start")
80
+ assert_requested :post, format_action_url(@call, "fork_start")
81
81
  @call.fork_stop
82
- assert_requested :post, format_url(@call, "fork_stop")
82
+ assert_requested :post, format_action_url(@call, "fork_stop")
83
83
  @call.gather_using_audio audio_url: "https://audio.example.com"
84
- assert_requested :post, format_url(@call, "gather_using_audio")
84
+ assert_requested :post, format_action_url(@call, "gather_using_audio")
85
85
  @call.gather_using_speak language: "en-US", voice: "female", payload: "Telnyx call control test"
86
- assert_requested :post, format_url(@call, "gather_using_speak")
86
+ assert_requested :post, format_action_url(@call, "gather_using_speak")
87
87
  @call.playback_start audio_url: "https://audio.example.com"
88
- assert_requested :post, format_url(@call, "playback_start")
88
+ assert_requested :post, format_action_url(@call, "playback_start")
89
89
  @call.playback_stop
90
- assert_requested :post, format_url(@call, "playback_stop")
90
+ assert_requested :post, format_action_url(@call, "playback_stop")
91
91
  @call.send_dtmf digits: "1www2WABCDw9"
92
- assert_requested :post, format_url(@call, "send_dtmf")
92
+ assert_requested :post, format_action_url(@call, "send_dtmf")
93
93
  @call.transfer to: "+15552223333"
94
- assert_requested :post, format_url(@call, "transfer")
94
+ assert_requested :post, format_action_url(@call, "transfer")
95
95
  end
96
96
  end
97
97
 
98
98
  context "commands" do
99
99
  should "reject" do
100
100
  @call.reject cause: "CALL_REJECTED"
101
- assert_requested :post, format_url(@call, "reject")
101
+ assert_requested :post, format_action_url(@call, "reject")
102
102
  end
103
103
  should "answer" do
104
104
  @call.answer
105
- assert_requested :post, format_url(@call, "answer")
105
+ assert_requested :post, format_action_url(@call, "answer")
106
106
  end
107
107
  should "hangup" do
108
108
  @call.hangup
109
- assert_requested :post, format_url(@call, "hangup")
109
+ assert_requested :post, format_action_url(@call, "hangup")
110
110
  end
111
111
  should "bridge" do
112
112
  @call.bridge call_control_id: SecureRandom.base64(20)
113
- assert_requested :post, format_url(@call, "bridge")
113
+ assert_requested :post, format_action_url(@call, "bridge")
114
114
  end
115
115
  should "speak" do
116
116
  @call.speak language: "en-US", voice: "female", payload: "Telnyx call control test"
117
- assert_requested :post, format_url(@call, "speak")
117
+ assert_requested :post, format_action_url(@call, "speak")
118
118
  end
119
119
  should "start fork" do
120
120
  @call.fork_start call_control_id: SecureRandom.base64(20)
121
- assert_requested :post, format_url(@call, "fork_start")
121
+ assert_requested :post, format_action_url(@call, "fork_start")
122
122
  end
123
123
  should "stop fork" do
124
124
  @call.fork_stop
125
- assert_requested :post, format_url(@call, "fork_stop")
125
+ assert_requested :post, format_action_url(@call, "fork_stop")
126
126
  end
127
127
  should "gather using audio" do
128
128
  @call.gather_using_audio audio_url: "https://audio.example.com"
129
- assert_requested :post, format_url(@call, "gather_using_audio")
129
+ assert_requested :post, format_action_url(@call, "gather_using_audio")
130
130
  end
131
131
  should "gather using speak" do
132
132
  @call.gather_using_speak language: "en-US", voice: "female", payload: "Telnyx call control test"
133
- assert_requested :post, format_url(@call, "gather_using_speak")
133
+ assert_requested :post, format_action_url(@call, "gather_using_speak")
134
134
  end
135
135
  should "playback start" do
136
136
  @call.playback_start audio_url: "https://audio.example.com"
137
- assert_requested :post, format_url(@call, "playback_start")
137
+ assert_requested :post, format_action_url(@call, "playback_start")
138
138
  end
139
139
  should "playback stop" do
140
140
  @call.playback_stop
141
- assert_requested :post, format_url(@call, "playback_stop")
141
+ assert_requested :post, format_action_url(@call, "playback_stop")
142
142
  end
143
143
  should "send dtmf" do
144
144
  @call.send_dtmf digits: "1www2WABCDw9"
145
- assert_requested :post, format_url(@call, "send_dtmf")
145
+ assert_requested :post, format_action_url(@call, "send_dtmf")
146
146
  end
147
147
  should "transfer" do
148
148
  @call.transfer to: "+15552223333"
149
- assert_requested :post, format_url(@call, "transfer")
149
+ assert_requested :post, format_action_url(@call, "transfer")
150
+ end
151
+ should "start transcription" do
152
+ @call.transcription_start
153
+ assert_requested :post, format_action_url(@call, "transcription_start")
154
+ end
155
+ should "end transcription" do
156
+ @call.transcription_stop
157
+ assert_requested :post, format_action_url(@call, "transcription_stop")
158
+ end
159
+ should "pause recording" do
160
+ @call.record_pause
161
+ assert_requested :post, format_action_url(@call, "record_pause")
162
+ end
163
+ should "resume recording" do
164
+ @call.record_resume
165
+ assert_requested :post, format_action_url(@call, "record_resume")
166
+ end
167
+ should "gather stop" do
168
+ @call.gather_stop
169
+ assert_requested :post, format_action_url(@call, "gather_stop")
170
+ end
171
+ should "refer" do
172
+ @call.refer sip_address: "sip:username@sip.non-telnyx-address.com"
173
+ assert_requested :post, format_action_url(@call, "refer")
150
174
  end
151
175
  end
152
176
 
@@ -154,7 +178,7 @@ module Telnyx
154
178
  Telnyx::Call.create connection_id: "12345", to: "+15550001111", from: "+15550002222", cause: "test"
155
179
  end
156
180
 
157
- def format_url(call, action)
181
+ def format_action_url(call, action)
158
182
  "#{Telnyx.api_base}/v2/calls/#{call.call_control_id}/actions/#{action}"
159
183
  end
160
184
  end
@@ -7,7 +7,7 @@ module Telnyx
7
7
  class PhoneNumberRegulatoryRequirementTest < Test::Unit::TestCase
8
8
  should "be listable" do
9
9
  phone_number_reg_req = PhoneNumberRegulatoryRequirement.list
10
- assert_requested :get, "#{Telnyx.api_base}/v2/phone_number_regulatory_requirements"
10
+ assert_requested :get, "#{Telnyx.api_base}/v2/phone_numbers_regulatory_requirements"
11
11
  assert_kind_of PhoneNumberRegulatoryRequirement, phone_number_reg_req.first
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,22 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telnyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Telnyx
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.13'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  - - "!="
21
24
  - !ruby/object:Gem::Version
22
25
  version: 0.16.0
@@ -33,9 +36,12 @@ dependencies:
33
36
  prerelease: false
34
37
  version_requirements: !ruby/object:Gem::Requirement
35
38
  requirements:
36
- - - "~>"
39
+ - - ">="
37
40
  - !ruby/object:Gem::Version
38
41
  version: '0.13'
42
+ - - "<"
43
+ - !ruby/object:Gem::Version
44
+ version: '2.0'
39
45
  - - "!="
40
46
  - !ruby/object:Gem::Version
41
47
  version: 0.16.0