plivo 4.1.1 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/plivo/resources/applications.rb +5 -1
- data/lib/plivo/resources/calls.rb +29 -4
- data/lib/plivo/resources/messages.rb +13 -3
- data/lib/plivo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3ec33d8fe7a40f2672fd2ca63d9306891b9447a010f4d497443fef722498f2b
|
4
|
+
data.tar.gz: da44cf1cb3989166b25a72dbadaed1eea574d761e4114cabe9de5e948ed3604a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5df853f4360fa18249129fb00521df14155b6299295cff14d54812b0709dfc9e9a460705f89977fe8c57ab768d9e275c2c30344cc34c7ca89df5df4cd8f18567
|
7
|
+
data.tar.gz: aff8e40a7cf8e1dd9b5475d35ee3143be5159094d2877099b5f49d0207d54a3b325a31163c5f50a59b411554d228dc6d2258ee149dd4d73780989a092577b358
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [4.1.2](https://github.com/plivo/plivo-ruby/releases/tag/v4.1.2) (2018-09-18)
|
4
|
+
- Added parent_call_uuid parameter to filter calls.
|
5
|
+
- Queued status added for filtering calls in queued status.
|
6
|
+
- Added log_incoming_messages parameter to application create and update.
|
7
|
+
|
3
8
|
## [4.1.1](https://github.com/plivo/plivo-ruby/releases/tag/v4.1.1) (2018-08-08)
|
4
9
|
- Upgraded version of faraday_middleware to 0.12.2 which parses YAML safely
|
5
10
|
|
data/README.md
CHANGED
@@ -22,6 +22,7 @@ module Plivo
|
|
22
22
|
# @option options [Boolean] :default_number_app - If set to true, this parameter ensures that newly created numbers, which don't have an app_id, point to this application.
|
23
23
|
# @option options [Boolean] :default_endpoint_app - If set to true, this parameter ensures that newly created endpoints, which don't have an app_id, point to this application.
|
24
24
|
# @option options [String] :subaccount - Id of the subaccount, in case only subaccount applications are needed.
|
25
|
+
# @option options [Boolean] :log_incoming_messages - If set to true, this parameter ensures that incoming messages are logged.
|
25
26
|
# @return [Application] Application
|
26
27
|
def update(options = nil)
|
27
28
|
return perform_update({}) if options.nil?
|
@@ -79,7 +80,8 @@ module Plivo
|
|
79
80
|
public_uri: @public_uri,
|
80
81
|
resource_uri: @resource_uri,
|
81
82
|
sip_uri: @sip_uri,
|
82
|
-
sub_account: @sub_account
|
83
|
+
sub_account: @sub_account,
|
84
|
+
log_incoming_messages: @log_incoming_messages
|
83
85
|
}.to_s
|
84
86
|
end
|
85
87
|
end
|
@@ -115,6 +117,7 @@ module Plivo
|
|
115
117
|
# @option options [Boolean] :default_number_app - If set to true, this parameter ensures that newly created numbers, which don't have an app_id, point to this application.
|
116
118
|
# @option options [Boolean] :default_endpoint_app - If set to true, this parameter ensures that newly created endpoints, which don't have an app_id, point to this application.
|
117
119
|
# @option options [String] :subaccount - Id of the subaccount, in case only subaccount applications are needed.
|
120
|
+
# @option options [Boolean] :log_incoming_messages - If set to true, this parameter ensures that incoming messages are logged.
|
118
121
|
# @return [Application] Application
|
119
122
|
def create(app_name, options = nil)
|
120
123
|
valid_param?(:app_name, app_name, [String, Symbol], true)
|
@@ -213,6 +216,7 @@ module Plivo
|
|
213
216
|
# @option options [Boolean] :default_number_app - If set to true, this parameter ensures that newly created numbers, which don't have an app_id, point to this application.
|
214
217
|
# @option options [Boolean] :default_endpoint_app - If set to true, this parameter ensures that newly created endpoints, which don't have an app_id, point to this application.
|
215
218
|
# @option options [String] :subaccount - Id of the subaccount, in case only subaccount applications are needed.
|
219
|
+
# @option options [Boolean] :log_incoming_messages - If set to true, this parameter ensures that incoming messages are logged.
|
216
220
|
# @return [Application] Application
|
217
221
|
def update(app_id, options = nil)
|
218
222
|
valid_param?(:app_id, app_id, [String, Symbol], true)
|
@@ -203,7 +203,7 @@ module Plivo
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def to_s
|
206
|
-
{
|
206
|
+
call_details = {
|
207
207
|
answer_time: @answer_time,
|
208
208
|
api_id: @api_id,
|
209
209
|
bill_duration: @bill_duration,
|
@@ -219,8 +219,15 @@ module Plivo
|
|
219
219
|
resource_uri: @resource_uri,
|
220
220
|
to_number: @to_number,
|
221
221
|
total_amount: @total_amount,
|
222
|
-
total_rate: @total_rate
|
223
|
-
|
222
|
+
total_rate: @total_rate,
|
223
|
+
to: @to,
|
224
|
+
from: @from,
|
225
|
+
request_uuid: @request_uuid,
|
226
|
+
direction: @direction,
|
227
|
+
caller_name: @caller_name
|
228
|
+
}
|
229
|
+
call_details = call_details.select {|k, v| !v.nil? }
|
230
|
+
call_details.to_s
|
224
231
|
end
|
225
232
|
end
|
226
233
|
|
@@ -296,6 +303,11 @@ module Plivo
|
|
296
303
|
perform_get(call_uuid, status: 'live')
|
297
304
|
end
|
298
305
|
|
306
|
+
# @param [String] call_uuid
|
307
|
+
def get_queued(call_uuid)
|
308
|
+
perform_get(call_uuid, status: 'queued')
|
309
|
+
end
|
310
|
+
|
299
311
|
# @param [Hash] options
|
300
312
|
# @option options [String] :subaccount - The id of the subaccount, if call details of the subaccount are needed.
|
301
313
|
# @option options [String] :call_direction - Filter the results by call direction. The valid inputs are inbound and outbound.
|
@@ -329,7 +341,7 @@ module Plivo
|
|
329
341
|
params_expected = %i[
|
330
342
|
subaccount bill_duration bill_duration__gt bill_duration__gte
|
331
343
|
bill_duration__lt bill_duration__lte end_time end_time__gt
|
332
|
-
end_time__gte end_time__lt end_time__lte
|
344
|
+
end_time__gte end_time__lt end_time__lte parent_call_uuid
|
333
345
|
]
|
334
346
|
params_expected.each do |param|
|
335
347
|
if options.key?(param) &&
|
@@ -378,11 +390,24 @@ module Plivo
|
|
378
390
|
}
|
379
391
|
end
|
380
392
|
|
393
|
+
def list_queued
|
394
|
+
perform_list_without_object(status: 'queued')
|
395
|
+
{
|
396
|
+
api_id: @api_id,
|
397
|
+
calls: @calls
|
398
|
+
}
|
399
|
+
end
|
400
|
+
|
381
401
|
def each_live
|
382
402
|
call_list = list_live
|
383
403
|
call_list[:calls].each { |call| yield call }
|
384
404
|
end
|
385
405
|
|
406
|
+
def each_queued
|
407
|
+
call_queued = list_queued
|
408
|
+
call_queued[:calls].each { |call| yield call}
|
409
|
+
end
|
410
|
+
|
386
411
|
##
|
387
412
|
# Transfer a call
|
388
413
|
# @param [String] call_uuid
|
@@ -60,10 +60,11 @@ module Plivo
|
|
60
60
|
# - ErrorCode - Delivery Response code returned by the carrier attempting the delivery. See Supported error codes {https://www.plivo.com/docs/api/message/#standard-plivo-error-codes}.
|
61
61
|
# @option options [String] :method The method used to call the url. Defaults to POST.
|
62
62
|
# @option options [String] :log If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true.
|
63
|
-
def create(src, dst, text, options = nil)
|
64
|
-
valid_param?(:src, src, [Integer, String, Symbol],
|
63
|
+
def create(src, dst, text, options = nil, powerpack_uuid = nil)
|
64
|
+
valid_param?(:src, src, [Integer, String, Symbol], false)
|
65
65
|
valid_param?(:text, text, [String, Symbol], true)
|
66
66
|
valid_param?(:dst, dst, Array, true)
|
67
|
+
valid_param?(:powerpack_uuid, powerpack_uuid, [String, Symbol], false)
|
67
68
|
dst.each do |dst_num|
|
68
69
|
valid_param?(:dst_num, dst_num, [Integer, String, Symbol], true)
|
69
70
|
end
|
@@ -72,10 +73,19 @@ module Plivo
|
|
72
73
|
raise InvalidRequestError, 'src and dst cannot be same'
|
73
74
|
end
|
74
75
|
|
76
|
+
if src.nil? && powerpack_uuid.nil?
|
77
|
+
raise InvalidRequestError, 'src and powerpack uuid both cannot be nil'
|
78
|
+
end
|
79
|
+
|
80
|
+
if !src.nil? && !powerpack_uuid.nil?
|
81
|
+
raise InvalidRequestError, 'src and powerpack uuid both cannot be present'
|
82
|
+
end
|
83
|
+
|
75
84
|
params = {
|
76
85
|
src: src,
|
77
86
|
dst: dst.join('<'),
|
78
|
-
text: text
|
87
|
+
text: text,
|
88
|
+
powerpack_uuid: powerpack_uuid
|
79
89
|
}
|
80
90
|
|
81
91
|
return perform_create(params) if options.nil?
|
data/lib/plivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|