Skip to content

Commit

Permalink
Merge branch 'master' of github.com:plivo/plivo-ruby into VT-8204
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinaya-Shunmugavel committed Nov 5, 2024
2 parents 21eff3b + d59b0e8 commit 06cb61c
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 18 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Change Log
## [4.60.4](https://github.com/plivo/plivo-ruby/tree/v4.60.4) (2024-09-12)
## [4.62.0](https://github.com/plivo/plivo-ruby/tree/v4.62.0) (2024-11-06)
**Feature - Adding few optional parameters to the existing machine detection params**
- Added six new optional machine detection params `machine_detection_maximum_speech_length`,`machine_detection_initial_silence`,`machine_detection_maximum_words`,`machine_detection_initial_greeting`,`machine_detection_silence`,`machine_detection_answer_time`

## [4.61.2](https://github.com/plivo/plivo-ruby/tree/v4.61.2)(2024-10-23)
**Feature - FraudCheck param in Create, Get and List Session**
- Support for the `fraud_check` parameter in sms verify session request
- Added support for `fraud_check` paramter in GET and LIST veriyf session

## [4.61.1](https://github.com/plivo/plivo-ruby/tree/v4.61.1) (2024-10-10)
**Feature - Dtmf param in Create, Get and List Session**
- Support for the `dtmf` parameter in voice verify session request
- Added support for `dtmf` in GET and LIST verify session

## [4.61.0](https://github.com/plivo/plivo-ruby/tree/v4.61.0) (2024-09-30)
**Feature - Adding new param support for Number Masking session with single party **
- Added `create_session_with_single_party`, `virtual_number_cooloff_period` and `force_pin_authentication` attributes in Masking Session

## [4.60.3](https://github.com/plivo/plivo-ruby/tree/v4.60.3) (2024-09-06)
**Feature - Adding more attribute on mdr object**
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ build:

start:
docker-compose up --build --remove-orphans --detach
docker attach $(shell docker-compose ps -q rubySDK)
# Wait for the container to be running before attaching
@while [ -z "$$(docker-compose ps -q rubySDK)" ]; do \
sleep 1; \
done
docker attach $$(docker-compose ps -q rubySDK)

test:
@[ "${CONTAINER}" ] && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
Add this line to your application's Gemfile:

```ruby
gem 'plivo', '>= 4.60.4'
gem 'plivo', '>= 4.62.0'
```

And then execute:
Expand Down
23 changes: 14 additions & 9 deletions lib/plivo/resources/maskingsession.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def update(options = nil)
valid_param?(:options, options, Hash, true)

params = {}
params_expected = %i[session_expiry call_time_limit record record_file_format recording_callback_url
params_expected = %i[first_party second_party session_expiry call_time_limit record record_file_format recording_callback_url
callback_url callback_method ring_timeout first_party_play_url second_party_play_url recording_callback_method
subaccount geomatch]
params_expected.each do |param|
Expand Down Expand Up @@ -90,7 +90,10 @@ def to_s
pin_retry: @pin_retry,
pin_retry_wait: @pin_retry_wait,
incorrect_pin_play: @incorrect_pin_play,
unknown_caller_play: @unknown_caller_play
unknown_caller_play: @unknown_caller_play,
force_pin_authentication: @force_pin_authentication,
virtual_number_cooloff_period: @virtual_number_cooloff_period,
create_session_with_single_party: @create_session_with_single_party
}.to_s
end
end
Expand All @@ -109,18 +112,18 @@ def get(session_uuid)
perform_get_with_response(session_uuid)
end

def create(first_party:, second_party:, session_expiry: nil, call_time_limit: nil, record: nil, record_file_format: nil,
def create(first_party: nil, second_party: nil, session_expiry: nil, call_time_limit: nil, record: nil, record_file_format: nil,
recording_callback_url: nil, initiate_call_to_first_party: nil, callback_url: nil, callback_method: nil, ring_timeout: nil,
first_party_play_url: nil, second_party_play_url: nil, recording_callback_method: nil, is_pin_authentication_required: nil,
generate_pin: nil, generate_pin_length: nil, first_party_pin: nil, second_party_pin: nil, pin_prompt_play: nil, pin_retry: nil,
pin_retry_wait: nil, incorrect_pin_play: nil, unknown_caller_play: nil, subaccount: nil, geomatch: nil)
pin_retry_wait: nil, incorrect_pin_play: nil, unknown_caller_play: nil, subaccount: nil, geomatch: nil, force_pin_authentication: nil, virtual_number_cooloff_period: nil, create_session_with_single_party: nil)

valid_param?(:first_party, first_party, [String, Symbol], true)
valid_param?(:second_party, second_party, [String, Symbol], true)
valid_param?(:first_party, first_party, [String, Symbol], false)
valid_param?(:second_party, second_party, [String, Symbol], false)

params = {}
params[:first_party] = first_party
params[:second_party] = second_party
params[:first_party] = first_party unless first_party.nil?
params[:second_party] = second_party unless second_party.nil?
params[:session_expiry] = session_expiry unless session_expiry.nil?
params[:call_time_limit] = call_time_limit unless call_time_limit.nil?
params[:record] = record unless record.nil?
Expand All @@ -145,7 +148,9 @@ def create(first_party:, second_party:, session_expiry: nil, call_time_limit: ni
params[:unknown_caller_play] = unknown_caller_play unless unknown_caller_play.nil?
params[:subaccount] = subaccount unless subaccount.nil?
params[:geomatch] = geomatch unless geomatch.nil?

params[:force_pin_authentication] = force_pin_authentication unless force_pin_authentication.nil?
params[:virtual_number_cooloff_period] = virtual_number_cooloff_period unless virtual_number_cooloff_period.nil?
params[:create_session_with_single_party] = create_session_with_single_party unless create_session_with_single_party.nil?
perform_create(params)
end

Expand Down
8 changes: 6 additions & 2 deletions lib/plivo/resources/verify_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get(session_uuid)
perform_get(session_uuid)
end

def create(app_uuid = nil, recipient = nil,channel = nil, url = nil, method = nil, locale=nil, brand_name=nil, app_hash=nil, code_length=nil)
def create(app_uuid = nil, recipient = nil,channel = nil, url = nil, method = nil, locale=nil, brand_name=nil, app_hash=nil, code_length=nil, dtmf=nil, fraud_check=nil)
valid_param?(:app_uuid, app_uuid, [String, Symbol], false)
valid_param?(:recipient, recipient, [Integer, String, Symbol], true)
valid_param?(:channel, channel, [String, Symbol], false)
Expand All @@ -52,6 +52,8 @@ def create(app_uuid = nil, recipient = nil,channel = nil, url = nil, method = ni
valid_param?(:brand_name, brand_name, [String, Symbol], false)
valid_param?(:app_hash, app_hash, [String, Symbol], false)
valid_param?(:code_length, code_length,[Integer,Symbol], false)
valid_param?(:dtmf, dtmf,[Integer,Symbol], false)
valid_param?(:fraud_check, fraud_check, [String, Symbol], false)

params = {
app_uuid: app_uuid,
Expand All @@ -62,7 +64,9 @@ def create(app_uuid = nil, recipient = nil,channel = nil, url = nil, method = ni
locale: locale,
brand_name: brand_name,
app_hash: app_hash,
code_length: code_length
code_length: code_length,
dtmf:dtmf,
fraud_check:fraud_check
}
perform_create(params)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/plivo/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Plivo
VERSION = "4.60.4".freeze
VERSION = "4.62.0".freeze
end
5 changes: 4 additions & 1 deletion spec/resource_maskingsession_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def to_json(masking_session)
pin_retry: masking_session.pin_retry,
pin_retry_wait: masking_session.pin_retry_wait,
incorrect_pin_play: masking_session.incorrect_pin_play,
unknown_caller_play: masking_session.unknown_caller_play
unknown_caller_play: masking_session.unknown_caller_play,
force_pin_authentication: masking_session.force_pin_authentication,
virtual_number_cooloff_period: masking_session.virtual_number_cooloff_period,
create_session_with_single_party: masking_session.create_session_with_single_party,
}.reject { |_, v| v.nil? }.to_json
end

Expand Down
5 changes: 4 additions & 1 deletion spec/resource_messages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def to_json(message)
carrier_fees: message.carrier_fees,
conversation_id: message.conversation_id,
conversation_origin: message.conversation_origin,
conversation_expiration_timestamp: message.conversation_expiration_timestamp
conversation_expiration_timestamp: message.conversation_expiration_timestamp,
error_message: message.error_message,
message_sent_time: message.message_sent_time,
message_updated_time: message.message_updated_time
}.to_json
end

Expand Down
8 changes: 7 additions & 1 deletion spec/resource_verify_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ def to_json_list(list_object)
recipient: '1234567890',
channel: nil,
url: nil,
method: nil
method: nil,
locale:nil,
brand_name:nil,
app_hash:nil,
code_length:nil,
dtmf:nil,
fraud_check:nil
})
end

Expand Down

0 comments on commit 06cb61c

Please sign in to comment.