Skip to content

Commit

Permalink
Merge pull request #247 from plivo/VT-8038
Browse files Browse the repository at this point in the history
VT-8038: SDK changes for stream xml element keepCallAlive
  • Loading branch information
manjunath-plivo authored Sep 3, 2024
2 parents ae7e38f + a8da2bb commit 1c8317c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [4.60.1](https://github.com/plivo/plivo-ruby/tree/v4.60.1) (2024-09-03)
**Feature - Adding new element for Audio Stream XML **
- Added `keepCallAlive` element in Audio Stream XML

## [4.60.0](https://github.com/plivo/plivo-ruby/tree/v4.60.0) (2024-07-11)
**Feature - Adding support for Locale param in Create, Get and List Session**
- Added new request param `locale` in create Session API
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.0'
gem 'plivo', '>= 4.60.1'
```

And then execute:
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.0".freeze
VERSION = "4.60.1".freeze
end
6 changes: 5 additions & 1 deletion lib/plivo/xml/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module XML
class Stream < Element
@nestables = []
@valid_attributes = %w[bidirectional audioTrack streamTimeout statusCallbackUrl
statusCallbackMethod contentType extraHeaders]
statusCallbackMethod contentType extraHeaders keepCallAlive]

SUPPORTED_BIDIRECTIONAL=%w(true false)
SUPPORTED_AUDIOTRACK=%w(inbound outbound both)
SUPPORTED_CALLBACKMETHOD=%w(GET POST)
SUPPORTED_KEEPCALLALIVE=%w(true false)

def initialize(body, attributes = {})
if attributes[:bidirectional] && !SUPPORTED_BIDIRECTIONAL.include?(attributes[:bidirectional])
Expand All @@ -19,6 +20,9 @@ def initialize(body, attributes = {})
if attributes[:statusCallbackMethod] && !SUPPORTED_CALLBACKMETHOD.include?(attributes[:statusCallbackMethod].upcase)
raise PlivoXMLError, "<Stream> statusCallbackMethod #{attributes[:statusCallbackMethod]} is not valid."
end
if attributes[:keepCallAlive] && !SUPPORTED_KEEPCALLALIVE.include?(attributes[:keepCallAlive])
raise PlivoXMLError, "<Stream> keepCallAlive #{attributes[:keepCallAlive]} is not valid."
end
raise PlivoXMLError, 'No text set for Stream' unless body
super(body, attributes)
end
Expand Down

0 comments on commit 1c8317c

Please sign in to comment.