plivo 4.25.1 → 4.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/lib/plivo/resources/calls.rb +43 -27
- data/lib/plivo/resources/multipartycalls.rb +14 -10
- data/lib/plivo/resources/recordings.rb +14 -1
- data/lib/plivo/version.rb +1 -1
- data/lib/plivo/xml/dial.rb +1 -1
- data/lib/plivo/xml/multipartycall.rb +7 -1
- metadata +2 -3
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41cd25f112799f4fb4e95c0fadd5b7ba21d22d94
|
4
|
+
data.tar.gz: f8fdff993484bbf582168aaa778e4d36673cec4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb2714de044e486a8c098d78ece87266f80c3ce05bdc6db8b5bd87ffd41326c3ef63b1c420be142bd9a1bf4baa7a8b72ceec36114fa9d1e747b247bd42936e7d
|
7
|
+
data.tar.gz: 3e08b774f282d3b92207e0ff7eeaa1e31da0b54461dc705245a8760b448af584ca68b730ac6845341c91ea16ede9ab52f2e44595f87ecc4b0b9b11bb7eb676ab
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [4.27.1](https://github.com/plivo/plivo-ruby/tree/v4.27.1) (2022-06-30)
|
4
|
+
- `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)
|
5
|
+
|
6
|
+
## [4.27.0](https://github.com/plivo/plivo-ruby/tree/v4.27.0) (2022-05-05)
|
7
|
+
**Feature - List all recordings**
|
8
|
+
- `from_number` and `to_number` added to filter param [List all recordings](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
|
9
|
+
- `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)
|
10
|
+
|
11
|
+
## [4.26.0](https://github.com/plivo/plivo-ruby/tree/v4.26.0) (2022-03-24)
|
12
|
+
**Feature - DialElement**
|
13
|
+
- `confirmTimeout` parameter added to [The Dial element](https://www.plivo.com/docs/voice/xml/dial/)
|
14
|
+
|
3
15
|
## [4.25.1](https://github.com/plivo/plivo-ruby/tree/v4.25.1) (2022-02-02)
|
4
16
|
**Bugfix - Recording**
|
5
17
|
- Fix for Start Recording API response issue
|
data/README.md
CHANGED
@@ -275,14 +275,14 @@ module Plivo
|
|
275
275
|
# @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
276
|
# @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
277
|
# @return [Call] Call
|
278
|
-
def create(from, to, answer_url, options = nil)
|
278
|
+
def create(from, to, answer_url, options = nil)
|
279
279
|
valid_param?(:from, from, [String, Symbol, Integer], true)
|
280
280
|
valid_param?(:to, to, Array, true)
|
281
281
|
to.each do |to_num|
|
282
282
|
valid_param?(:to_num, to_num, [Integer, String, Symbol], true)
|
283
283
|
end
|
284
284
|
valid_param?(:answer_url, answer_url, [String, Symbol], true)
|
285
|
-
|
285
|
+
|
286
286
|
|
287
287
|
params = {
|
288
288
|
from: from,
|
@@ -345,31 +345,6 @@ module Plivo
|
|
345
345
|
return perform_list if options.nil?
|
346
346
|
valid_param?(:options, options, Hash, true)
|
347
347
|
|
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
348
|
raise_invalid_request("Offset can't be negative") if options.key?(:offset) && options[:offset] < 0
|
374
349
|
|
375
350
|
if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0)
|
@@ -377,6 +352,47 @@ module Plivo
|
|
377
352
|
"fetched is 20. limit can't be more than 20 or less than 1")
|
378
353
|
end
|
379
354
|
|
355
|
+
# initial list of possible params
|
356
|
+
params = %i[
|
357
|
+
bill_duration
|
358
|
+
bill_duration__gt
|
359
|
+
bill_duration__gte
|
360
|
+
bill_duration__lt
|
361
|
+
bill_duration__lte
|
362
|
+
call_direction
|
363
|
+
end_time
|
364
|
+
end_time__gt
|
365
|
+
end_time__gte
|
366
|
+
end_time__lt
|
367
|
+
end_time__lte
|
368
|
+
from_number
|
369
|
+
hangup_cause_code
|
370
|
+
hangup_source
|
371
|
+
limit
|
372
|
+
offset
|
373
|
+
parent_call_uuid
|
374
|
+
subaccount
|
375
|
+
to_number
|
376
|
+
stir_verification
|
377
|
+
].reduce({}) do |result_hash, param|
|
378
|
+
if options.key?(param)
|
379
|
+
if param == :call_direction
|
380
|
+
if valid_param?(:call_direction, options[:call_direction],
|
381
|
+
[String, Symbol], true, %w[inbound outbound])
|
382
|
+
result_hash[:call_direction] = options[:call_direction]
|
383
|
+
end
|
384
|
+
elsif %i[offset limit hangup_cause_code].include?(param)
|
385
|
+
if valid_param?(param, options[param], [Integer, Integer], true)
|
386
|
+
result_hash[param] = options[param]
|
387
|
+
end
|
388
|
+
elsif valid_param?(param, options[param], [String, Symbol], true)
|
389
|
+
result_hash[param] = options[param]
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
393
|
+
result_hash
|
394
|
+
end
|
395
|
+
|
380
396
|
perform_list(params)
|
381
397
|
end
|
382
398
|
|
@@ -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
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
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
data/lib/plivo/xml/dial.rb
CHANGED
@@ -3,7 +3,7 @@ module Plivo
|
|
3
3
|
class Dial < Element
|
4
4
|
@nestables = %w[Number User]
|
5
5
|
@valid_attributes = %w[action method timeout hangupOnStar
|
6
|
-
timeLimit callerId callerName confirmSound
|
6
|
+
timeLimit callerId callerName confirmSound confirmTimeout
|
7
7
|
dialMusic confirmKey redirect
|
8
8
|
callbackUrl callbackMethod digitsMatch digitsMatchBLeg
|
9
9
|
sipHeaders]
|
@@ -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.
|
4
|
+
version: 4.27.1
|
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-
|
11
|
+
date: 2022-06-30 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
|