Skip to content

Commit

Permalink
VT-8038: SDK changes for stream xml element keepCallAlive (#213)
Browse files Browse the repository at this point in the history
* VT-8038: SDK changes for stream xml element keepCallAlive

* VT-8038: Fix lint issues

* VT-8038: Fix lint issues

* VT-8038: Fix lint issues

* VT-8038: Remove Lint related changes
  • Loading branch information
prashantp-plivo authored Sep 5, 2024
1 parent bc08145 commit 9198e72
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change Log
## [7.51.1](https://github.com/plivo/plivo-go/tree/v7.51.1) (2024-09-05)
**Feature - Adding new element for Audio Stream XML **
- Added `keepCallAlive` element in Audio Stream XML

## [7.51.0](https://github.com/plivo/plivo-go/tree/v7.51.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 baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/google/go-querystring/query"
)

const sdkVersion = "7.51.0"
const sdkVersion = "7.51.1"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
7 changes: 7 additions & 0 deletions xml/plivoxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,8 @@ type StreamElement struct {

ExtraHeaders *string `xml:"extraHeaders,attr"`

KeepCallAlive *bool `xml:"keepCallAlive,attr"`

XMLName xml.Name `xml:"Stream"`
}

Expand Down Expand Up @@ -1444,6 +1446,11 @@ func (e StreamElement) SetExtraHeaders(value string) StreamElement {
return e
}

func (e StreamElement) SetKeepCallAlive(value bool) StreamElement {
e.KeepCallAlive = &value
return e
}

func (e StreamElement) SetContents(value string) StreamElement {
e.Contents = value
return e
Expand Down
4 changes: 2 additions & 2 deletions xml/plivoxml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ func TestMPCXMLWithHold(t *testing.T) {
}

func TestStreamXML(t *testing.T) {
assert.Equal(t, "<Response><Stream bidirectional=\"true\" extraHeaders=\"a=1,b=2\">wss://test.url</Stream></Response>", ResponseElement{
assert.Equal(t, "<Response><Stream bidirectional=\"true\" extraHeaders=\"a=1,b=2\" keepCallAlive=\"true\">wss://test.url</Stream></Response>", ResponseElement{
Contents: []interface{}{
new(StreamElement).SetBidirectional(true).SetContents("wss://test.url").SetExtraHeaders("a=1,b=2"),
new(StreamElement).SetBidirectional(true).SetContents("wss://test.url").SetExtraHeaders("a=1,b=2").SetKeepCallAlive(true),
},
}.String())
}

0 comments on commit 9198e72

Please sign in to comment.