diff --git a/bandwidth/tests/test_bxml.py b/bandwidth/tests/test_bxml.py
index 482d7d6e..24c52f2d 100644
--- a/bandwidth/tests/test_bxml.py
+++ b/bandwidth/tests/test_bxml.py
@@ -409,8 +409,16 @@ def test_generate_transfer_bxml_verb(self):
assert actual == expected
def test_start_stream_bxml_verb(self):
- expected = ''
+ expected = ''
response = Response()
+ stream_param_1 = StreamParam(
+ name="name1",
+ value="value1"
+ )
+ stream_param_2 = StreamParam(
+ name="name2",
+ value="value2"
+ )
start_stream = StartStream(
destination='https://www.test.com/stream',
name='test_stream',
@@ -418,8 +426,10 @@ def test_start_stream_bxml_verb(self):
streamEventUrl='https://www.test.com/event',
streamEventMethod='POST',
username='username',
- password='password'
+ password='password',
+ streamParams=[stream_param_1, stream_param_2]
)
+
response.add_verb(start_stream)
actual = response.to_bxml()
diff --git a/bandwidth/voice/bxml/verbs/__init__.py b/bandwidth/voice/bxml/verbs/__init__.py
index 27c4d0bb..c8ed0ccc 100644
--- a/bandwidth/voice/bxml/verbs/__init__.py
+++ b/bandwidth/voice/bxml/verbs/__init__.py
@@ -21,4 +21,5 @@
from .tag import Tag
from .sip_uri import SipUri
from .start_stream import StartStream
+from .stream_param import StreamParam
from .stop_stream import StopStream
diff --git a/bandwidth/voice/bxml/verbs/start_stream.py b/bandwidth/voice/bxml/verbs/start_stream.py
index 26090519..41166ff0 100644
--- a/bandwidth/voice/bxml/verbs/start_stream.py
+++ b/bandwidth/voice/bxml/verbs/start_stream.py
@@ -15,9 +15,9 @@
class StartStream(AbstractBxmlVerb):
- def __init__(self, destination, name=None, tracks=None, streamEventUrl=None, streamEventMethod=None, username=None, password=None):
+ def __init__(self, destination, name=None, tracks=None, streamEventUrl=None, streamEventMethod=None, username=None, password=None, streamParams=None):
"""
- Initializes the PlayAudio class with the following parameters
+ Initializes the StartStream class with the following parameters
:param str destination: A websocket URI to send the stream to
:param str name: A name to refer to this stream by
@@ -34,6 +34,7 @@ def __init__(self, destination, name=None, tracks=None, streamEventUrl=None, str
self.streamEventMethod = streamEventMethod
self.username = username
self.password = password
+ self.stream_params = streamParams
def to_etree_element(self):
"""
@@ -55,6 +56,9 @@ def to_etree_element(self):
root.set("username", self.username)
if self.password is not None:
root.set("password", self.password)
+ if self.stream_params is not None:
+ for stream_param in self.stream_params:
+ root.append(stream_param.to_etree_element())
return root
def to_bxml(self):
diff --git a/bandwidth/voice/bxml/verbs/stop_stream.py b/bandwidth/voice/bxml/verbs/stop_stream.py
index 031fba3a..cb7c9e84 100644
--- a/bandwidth/voice/bxml/verbs/stop_stream.py
+++ b/bandwidth/voice/bxml/verbs/stop_stream.py
@@ -17,7 +17,7 @@ class StopStream(AbstractBxmlVerb):
def __init__(self, name):
"""
- Initializes the PlayAudio class with the following parameters
+ Initializes the StopStream class with the following parameters
:param str name: The name of the stream to stop
"""
diff --git a/bandwidth/voice/bxml/verbs/stream_param.py b/bandwidth/voice/bxml/verbs/stream_param.py
new file mode 100644
index 00000000..8d5e6e3a
--- /dev/null
+++ b/bandwidth/voice/bxml/verbs/stream_param.py
@@ -0,0 +1,40 @@
+"""
+start_stream.py
+
+Representation of Bandwidth's start stream BXML verb
+
+@copyright Bandwidth INC
+"""
+
+from lxml import etree
+
+from .base_verb import AbstractBxmlVerb
+
+STREAM_PARAM_TAG = "StreamParam"
+
+
+class StreamParam(AbstractBxmlVerb):
+
+ def __init__(self, name, value):
+ """
+ Initializes the StreamParam class with the following parameters
+
+ :param str name: The name of this parameter, up to 256 characters.
+ :param str value: The value of this parameter, up to 2048 characters.
+ """
+ self.name = name
+ self.value = value
+
+ def to_etree_element(self):
+ """
+ Converts the class into an etree element. Used for other verb classes to build xml
+
+ :return etree.Element: The etree Element representing this class
+ """
+ root = etree.Element(STREAM_PARAM_TAG)
+ root.set("name", self.name)
+ root.set("value", self.value)
+ return root
+
+ def to_bxml(self):
+ return etree.tostring(self.to_etree_element()).decode()
diff --git a/setup.py b/setup.py
index 0dbc733a..7c734f1b 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@
setup(
name='bandwidth-sdk',
- version='14.1.0',
+ version='14.2.0',
description='Bandwidth\'s set of APIs',
long_description=long_description,
long_description_content_type="text/markdown",