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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312b0bc255083247ef770a23a6a573c791058472a8409d334fc7426620120b3f
4
- data.tar.gz: aa695796f9b3308e357278d11915b9e6fbcf868c6019c1aed4725c6513248bef
3
+ metadata.gz: e3ec33d8fe7a40f2672fd2ca63d9306891b9447a010f4d497443fef722498f2b
4
+ data.tar.gz: da44cf1cb3989166b25a72dbadaed1eea574d761e4114cabe9de5e948ed3604a
5
5
  SHA512:
6
- metadata.gz: 5179646f55e326405a6de502cd1856ef3a086f23cbea7fedaef9de69f2a384331131f0dd3dba2b4ac505706edf7b349806fe44c953560cdbe710ae0e7a756aee
7
- data.tar.gz: 3ac724772b01cf4ce0f0a6885dfccc085d345c9e6df1119b4452c3b3d899430a6097923d2db93805c29cc2c6d02d0b39904ede41207cfe2bd6a3736a658354d0
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
@@ -8,7 +8,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'plivo', '>= 4.1.1'
11
+ gem 'plivo', '>= 4.1.2'
12
12
  ```
13
13
 
14
14
  And then execute:
@@ -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
- }.to_s
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], true)
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
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = '4.1.1'.freeze
2
+ VERSION = '4.1.2'.freeze
3
3
  end
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.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-08-08 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday