Skip to content

Commit

Permalink
Merge branch 'master' into SMS-6997
Browse files Browse the repository at this point in the history
  • Loading branch information
narayana-plivo authored Sep 6, 2024
2 parents 963dc5e + 1c8317c commit 17e6948
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
- Added new request param `brand_name`, `code_length` and `app_hash` in create Session API
- Added support for `brand_name`, `code_length` and `app_hash` param in get and list Session response

## [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
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 17e6948

Please sign in to comment.