plivo 4.26.0 → 4.28.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
  SHA1:
3
- metadata.gz: 28692b913ed5944eadc3dc9cb233f821ac357681
4
- data.tar.gz: 6f4ae15fc412b3eef3c09fe9588e5b65d4e0ccc1
3
+ metadata.gz: 91f541dc63837a9f4a0b79eb70e711da032861ee
4
+ data.tar.gz: 69f4ea6a4ad5fe0055b823a19c1b4ba58bdc76ea
5
5
  SHA512:
6
- metadata.gz: a63734b4798e92b7cd8805783fd696d884fed366c15707f182da49562f192f600740f11997aa16132aaa5cbc115476cfb995532e310f480834e8e4f078f05722
7
- data.tar.gz: 8c0564708aceb0ce7d2658fa39075b4c53c2549e3d8f21d3141b66091326551883042c7138eb8c39a0aeb15eb1c28ee93039ddb89011a14c73d2f5a1cc6acf0a
6
+ metadata.gz: ea87b969d9dc6d4f8bc7133d15b0d3225e64015898677262c334043e7afc6f67367f57f4a439f98bd678814423c4b0298175945dfee10c820502c38accc413c3
7
+ data.tar.gz: 1ad27edb2ed4f707d2e1a969e3d8f19b7f0650e2e47f59df3cc9ab4ee25674c7f9c003917f926e669ac32f7d94704644b6589872b5945e638b855acd5b4dddbf
data/CHANGELOG.md CHANGED
@@ -1,4 +1,17 @@
1
1
  # Change Log
2
+
3
+ ## [4.28.0](https://github.com/plivo/plivo-go/tree/v4.28.0) (2022-07-11)
4
+ **Feature - STIR Attestation**
5
+ - Add stir attestation param as part of Get CDR and Get live call APIs Response
6
+
7
+ ## [4.27.1](https://github.com/plivo/plivo-ruby/tree/v4.27.1) (2022-06-30)
8
+ - `from_number`, `to_number` and `stir_verification` added to filter param [Retrieve all calls] (https://www.plivo.com/docs/voice/api/call#retrieve-all-calls)
9
+
10
+ ## [4.27.0](https://github.com/plivo/plivo-ruby/tree/v4.27.0) (2022-05-05)
11
+ **Feature - List all recordings**
12
+ - `from_number` and `to_number` added to filter param [List all recordings](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
13
+ - `record_min_member_count` param added to [Add a participant to a multiparty call using API](https://www.plivo.com/docs/voice/api/multiparty-call/participants#add-a-participant)
14
+
2
15
  ## [4.26.0](https://github.com/plivo/plivo-ruby/tree/v4.26.0) (2022-03-24)
3
16
  **Feature - DialElement**
4
17
  - `confirmTimeout` parameter added to [The Dial element](https://www.plivo.com/docs/voice/xml/dial/)
data/README.md CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'plivo', '>= 4.26.0'
12
+ gem 'plivo', '>= 4.28.0'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -231,7 +231,8 @@ module Plivo
231
231
  request_uuid: @request_uuid,
232
232
  direction: @direction,
233
233
  caller_name: @caller_name,
234
- stir_verification: @stir_verification
234
+ stir_verification: @stir_verification,
235
+ stir_attestation: @stir_attestation
235
236
  }
236
237
  call_details = call_details.select {|k, v| !v.nil? }
237
238
  call_details.to_s
@@ -275,14 +276,14 @@ module Plivo
275
276
  # @option options [String] :parent_call_uuid - The call_uuid of the first leg in an ongoing conference call. It is recommended to use this parameter in scenarios where a member who is already present in the conference intends to add new members by initiating outbound API calls. This minimizes the delay in adding a new memeber to the conference.
276
277
  # @option options [Boolean] :error_parent_not_found - if set to true and the parent_call_uuid cannot be found, the API request would return an error. If set to false, the outbound call API request will be executed even if the parent_call_uuid is not found. Defaults to false.
277
278
  # @return [Call] Call
278
- def create(from, to, answer_url, options = nil)
279
+ def create(from, to, answer_url, options = nil)
279
280
  valid_param?(:from, from, [String, Symbol, Integer], true)
280
281
  valid_param?(:to, to, Array, true)
281
282
  to.each do |to_num|
282
283
  valid_param?(:to_num, to_num, [Integer, String, Symbol], true)
283
284
  end
284
285
  valid_param?(:answer_url, answer_url, [String, Symbol], true)
285
-
286
+
286
287
 
287
288
  params = {
288
289
  from: from,
@@ -345,31 +346,6 @@ module Plivo
345
346
  return perform_list if options.nil?
346
347
  valid_param?(:options, options, Hash, true)
347
348
 
348
- params = {}
349
- params_expected = %i[
350
- subaccount bill_duration bill_duration__gt bill_duration__gte
351
- bill_duration__lt bill_duration__lte end_time end_time__gt
352
- end_time__gte end_time__lt end_time__lte parent_call_uuid hangup_source
353
- ]
354
- params_expected.each do |param|
355
- if options.key?(param) &&
356
- valid_param?(param, options[param], [String, Symbol], true)
357
- params[param] = options[param]
358
- end
359
- end
360
-
361
- if options.key?(:call_direction) &&
362
- valid_param?(:call_direction, options[:call_direction],
363
- [String, Symbol], true, %w[inbound outbound])
364
- params[:call_direction] = options[:call_direction]
365
- end
366
-
367
- %i[offset limit hangup_cause_code].each do |param|
368
- if options.key?(param) && valid_param?(param, options[param], [Integer, Integer], true)
369
- params[param] = options[param]
370
- end
371
- end
372
-
373
349
  raise_invalid_request("Offset can't be negative") if options.key?(:offset) && options[:offset] < 0
374
350
 
375
351
  if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0)
@@ -377,6 +353,47 @@ module Plivo
377
353
  "fetched is 20. limit can't be more than 20 or less than 1")
378
354
  end
379
355
 
356
+ # initial list of possible params
357
+ params = %i[
358
+ bill_duration
359
+ bill_duration__gt
360
+ bill_duration__gte
361
+ bill_duration__lt
362
+ bill_duration__lte
363
+ call_direction
364
+ end_time
365
+ end_time__gt
366
+ end_time__gte
367
+ end_time__lt
368
+ end_time__lte
369
+ from_number
370
+ hangup_cause_code
371
+ hangup_source
372
+ limit
373
+ offset
374
+ parent_call_uuid
375
+ subaccount
376
+ to_number
377
+ stir_verification
378
+ ].reduce({}) do |result_hash, param|
379
+ if options.key?(param)
380
+ if param == :call_direction
381
+ if valid_param?(:call_direction, options[:call_direction],
382
+ [String, Symbol], true, %w[inbound outbound])
383
+ result_hash[:call_direction] = options[:call_direction]
384
+ end
385
+ elsif %i[offset limit hangup_cause_code].include?(param)
386
+ if valid_param?(param, options[param], [Integer, Integer], true)
387
+ result_hash[param] = options[param]
388
+ end
389
+ elsif valid_param?(param, options[param], [String, Symbol], true)
390
+ result_hash[param] = options[param]
391
+ end
392
+ end
393
+
394
+ result_hash
395
+ end
396
+
380
397
  perform_list(params)
381
398
  end
382
399
 
@@ -35,6 +35,7 @@ module Plivo
35
35
  delay_dial=0,
36
36
  max_duration=14400,
37
37
  max_participants=10,
38
+ record_min_member_count=1,
38
39
  wait_music_url=nil,
39
40
  wait_music_method='GET',
40
41
  agent_hold_music_url=nil,
@@ -95,6 +96,7 @@ module Plivo
95
96
  valid_multiple_destination_integers?(:delay_dial, delay_dial)
96
97
  valid_range?(:max_duration, max_duration, false, 300, 28800)
97
98
  valid_range?(:max_participants, max_participants, false, 2, 10)
99
+ valid_range?(:record_min_member_count, record_min_member_count, false, 1, 2)
98
100
  valid_url?(:wait_music_url, wait_music_url, false ) unless wait_music_url.nil?
99
101
  valid_param?(:wait_music_method, wait_music_method.upcase, String, false , %w[GET POST])
100
102
  valid_url?(:agent_hold_music_url, agent_hold_music_url, false) unless agent_hold_music_url.nil?
@@ -128,7 +130,7 @@ module Plivo
128
130
  if (to!=nil) && (ring_timeout.is_a?(String)) && (to.split('<').size < ring_timeout.split('<').size)
129
131
  raise_invalid_request("RingTimeout:number of ring_timout(s) should be same as number of destination(s)")
130
132
  end
131
-
133
+
132
134
  if (to!=nil) && (delay_dial.is_a?(String)) && (to.split('<').size < delay_dial.split('<').size)
133
135
  raise_invalid_request("Delaydial : number of delay_dial(s) should be same as number of destination(s)")
134
136
  end
@@ -150,6 +152,7 @@ module Plivo
150
152
  params[:delay_dial] = delay_dial unless delay_dial.nil?
151
153
  params[:max_duration] = max_duration unless max_duration.nil?
152
154
  params[:max_participants] = max_participants unless max_participants.nil?
155
+ params[:record_min_member_count] = record_min_member_count unless record_min_member_count.nil?
153
156
  params[:wait_music_url] = wait_music_url unless wait_music_url.nil?
154
157
  params[:wait_music_method] = wait_music_method.upcase unless wait_music_method.nil?
155
158
  params[:agent_hold_music_url] = agent_hold_music_url unless agent_hold_music_url.nil?
@@ -235,7 +238,7 @@ module Plivo
235
238
  valid_param?(:member_id, member_id, [String, Integer], true)
236
239
  MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], member_id: member_id).resume_participant_recording
237
240
  end
238
-
241
+
239
242
  def list_participants(call_uuid = nil )
240
243
  valid_param?(:call_uuid, call_uuid, String, false) unless call_uuid.nil?
241
244
  params = {}
@@ -405,7 +408,7 @@ module Plivo
405
408
  valid_range?(:offset, options[:offset], false, 0)
406
409
  perform_action(nil ,'GET', options ,true )
407
410
  end
408
-
411
+
409
412
  def get(options = {})
410
413
  valid_param?(:options, options, Hash, false)
411
414
  valid_param?(:uuid, options[:uuid], String, false) unless options[:uuid].nil?
@@ -422,10 +425,11 @@ module Plivo
422
425
  options[:call_status_callback_method] = 'POST' unless options.key?(:call_status_callback_method)
423
426
  options[:confirm_key_sound_method] = 'GET' unless options.key?(:confirm_key_sound_method)
424
427
  options[:dial_music] = 'Real' unless options.key?(:dial_music)
425
- options[:ring_timeout] = 45 unless options.key?(:ring_timeout)
428
+ options[:ring_timeout] = 45 unless options.key?(:ring_timeout)
426
429
  options[:delay_dial] = 0 unless options.key?(:delay_dial)
427
430
  options[:max_duration] = 14400 unless options.key?(:max_duration)
428
431
  options[:max_participants] = 10 unless options.key?(:max_participants)
432
+ options[:record_min_member_count] = 1 unless options.key?(:record_min_member_count)
429
433
  options[:wait_music_method] = 'GET' unless options.key?(:wait_music_method)
430
434
  options[:agent_hold_music_method] = 'GET' unless options.key?(:agent_hold_music_method)
431
435
  options[:customer_hold_music_method] = 'GET' unless options.key?(:customer_hold_music_method)
@@ -453,11 +457,11 @@ module Plivo
453
457
  mpc_id = make_mpc_id(options[:uuid], options[:friendly_name])
454
458
 
455
459
  MultiPartyCall.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0]).add_participant(options[:role],options[:from],options[:to],options[:call_uuid],options[:caller_name],options[:call_status_callback_url],options[:call_status_callback_method],options[:sip_headers],options[:confirm_key],
456
- options[:confirm_key_sound_url],options[:confirm_key_sound_method],options[:dial_music],options[:ring_timeout],options[:delay_dial],options[:max_duration], options[:max_participants],options[:wait_music_url],
457
- options[:wait_music_method],options[:agent_hold_music_url],options[:agent_hold_music_method],options[:customer_hold_music_url],options[:customer_hold_music_method],
458
- options[:recording_callback_url],options[:recording_callback_method],options[:status_callback_url],options[:status_callback_method],options[:on_exit_action_url], options[:on_exit_action_method],
459
- options[:record],options[:record_file_format],options[:status_callback_events],options[:stay_alone], options[:coach_mode],options[:mute],options[:hold],options[:start_mpc_on_enter],options[:end_mpc_on_exit],
460
- options[:relay_dtmf_inputs],options[:enter_sound],options[:enter_sound_method],options[:exit_sound],options[:exit_sound_method], options[:start_recording_audio], options[:start_recording_audio_method],
460
+ options[:confirm_key_sound_url],options[:confirm_key_sound_method],options[:dial_music],options[:ring_timeout],options[:delay_dial],options[:max_duration], options[:max_participants],options[:record_min_member_count],options[:wait_music_url],
461
+ options[:wait_music_method],options[:agent_hold_music_url],options[:agent_hold_music_method],options[:customer_hold_music_url],options[:customer_hold_music_method],
462
+ options[:recording_callback_url],options[:recording_callback_method],options[:status_callback_url],options[:status_callback_method],options[:on_exit_action_url], options[:on_exit_action_method],
463
+ options[:record],options[:record_file_format],options[:status_callback_events],options[:stay_alone], options[:coach_mode],options[:mute],options[:hold],options[:start_mpc_on_enter],options[:end_mpc_on_exit],
464
+ options[:relay_dtmf_inputs],options[:enter_sound],options[:enter_sound_method],options[:exit_sound],options[:exit_sound_method], options[:start_recording_audio], options[:start_recording_audio_method],
461
465
  options[:stop_recording_audio], options[:stop_recording_audio_method])
462
466
  end
463
467
 
@@ -560,7 +564,7 @@ module Plivo
560
564
  mpc_id = make_mpc_id(options[:uuid], options[:friendly_name])
561
565
  MultiPartyCallParticipant.new(@_client, resource_id: mpc_id[1], multi_party_prefix: mpc_id[0], member_id: options[:member_id]).resume_participant_recording
562
566
  end
563
-
567
+
564
568
  def list_participants(options = {})
565
569
  valid_param?(:options, options, Hash, false)
566
570
  valid_param?(:uuid, options[:uuid], String, false) unless options[:uuid].nil?
@@ -26,7 +26,12 @@ module Plivo
26
26
  recording_start_ms: @recording_start_ms,
27
27
  recording_type: @recording_type,
28
28
  recording_url: @recording_url,
29
- resource_uri: @resource_uri
29
+ resource_uri: @resource_uri,
30
+ from_number: @from_number,
31
+ to_number: @to_number,
32
+ mpc_name: @mpc_name,
33
+ conference_uuid: @conference_uuid,
34
+ mpc_uuid: @mpc_uuid
30
35
  }.to_s
31
36
  end
32
37
  end
@@ -43,6 +48,12 @@ module Plivo
43
48
  # @param [Hash] options
44
49
  # @option options [String] :subaccount auth_id of the subaccount. Lists only those recordings of the main accounts which are tied to the specified subaccount.
45
50
  # @option options [String] :call_uuid Used to filter recordings for a specific call.
51
+ # @option options [String] :from_number Used to filter recordings for a specific from_number.
52
+ # @option options [String] :to_number Used to filter recordings for a specific to_number.
53
+ # @option options [String] :conference_name Used to filter recordings for a specific conference_name.
54
+ # @option options [String] :mpc_name Used to filter recordings for a specific mpc_name.
55
+ # @option options [String] :conference_uuid Used to filter recordings for a specific conference_uuid.
56
+ # @option options [String] :mpc_uuid Used to filter recordings for a specific mpc_uuid.
46
57
  # @option options [String] :add_time Used to filter out recordings according to the time they were added.The add_time filter is a comparative filter that can be used in the following four forms:
47
58
  # - add_time\__gt: gt stands for greater than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started after 2012-03-21 11:47, use add_time\__gt=2012-03-21 11:47
48
59
  # - add_time\__gte: gte stands for greater than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started after or exactly at 2012-03-21 11:47[:30], use add_time\__gte=2012-03-21 11:47[:30]
@@ -59,6 +70,8 @@ module Plivo
59
70
  params_expected = %i[
60
71
  call_uuid add_time__gt add_time__gte
61
72
  add_time__lt add_time__lte
73
+ from_number to_number conference_uuid
74
+ conference_name mpc_name mpc_uuid
62
75
  ]
63
76
 
64
77
  params_expected.each do |param|
data/lib/plivo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = "4.26.0".freeze
2
+ VERSION = "4.28.0".freeze
3
3
  end
@@ -11,7 +11,7 @@ module Plivo
11
11
  enterSound enterSoundMethod exitSound exitSoundMethod
12
12
  onExitActionUrl onExitActionMethod relayDTMFInputs
13
13
  startRecordingAudio startRecordingAudioMethod
14
- stopRecordingAudio stopRecordingAudioMethod]
14
+ stopRecordingAudio stopRecordingAudioMethod recordMinMemberCount]
15
15
 
16
16
  VALID_ROLE_VALUES = %w[agent supervisor customer]
17
17
  VALID_METHOD_VALUES = %w[GET POST]
@@ -37,6 +37,12 @@ module Plivo
37
37
  attributes[:maxParticipants] = 10
38
38
  end
39
39
 
40
+ if attributes[:recordMinMemberCount] && (attributes[:recordMinMemberCount]<1 || attributes[:recordMinMemberCount]>2)
41
+ raise PlivoXMLError, "invalid attribute value #{attributes[:recordMinMemberCount]} for recordMinMemberCount"
42
+ elsif !attributes[:recordMinMemberCount]
43
+ attributes[:recordMinMemberCount] = 1
44
+ end
45
+
40
46
  if attributes[:waitMusicMethod] && !VALID_METHOD_VALUES.include?(attributes[:waitMusicMethod].upcase)
41
47
  raise PlivoXMLError, "invalid attribute value #{attributes[:waitMusicMethod]} for waitMusicMethod"
42
48
  elsif !attributes[:waitMusicMethod]
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.26.0
4
+ version: 4.28.0
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: 2022-03-24 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -155,7 +155,6 @@ files:
155
155
  - ".github/workflows/unitTests.yml"
156
156
  - ".gitignore"
157
157
  - ".rspec"
158
- - ".travis.yml"
159
158
  - AUTHORS.md
160
159
  - CHANGELOG.md
161
160
  - Gemfile
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- bundler_args: --without development
5
- rvm:
6
- - ruby-head
7
- - 2.4.0
8
- - 2.3.0
9
- - 2.2.0
10
- - 2.1
11
- - 2.0.0