Skip to content

Commit cd6357f

Browse files
committed
Add tracks attribute
1 parent c705f48 commit cd6357f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Bandwidth.Standard/Voice/Bxml/StartStream.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public class StartStream : IXmlSerializable, IVerb, IAudioProducer
2121
/// </summary>
2222
public string Name { get; set; }
2323

24+
/// <summary>
25+
/// The part of the call to send a stream from. `inbound`, `outbound` or `both`.
26+
/// </summary>
27+
public string Tracks { get; set; }
28+
2429
/// <summary>
2530
/// URL to send the associated Webhook events to during this stream's lifetime
2631
/// </summary>
@@ -58,6 +63,10 @@ void IXmlSerializable.WriteXml(XmlWriter writer)
5863
{
5964
writer.WriteAttributeString("name", Name);
6065
}
66+
if (!string.IsNullOrEmpty(Tracks))
67+
{
68+
writer.WriteAttributeString("tracks", Tracks);
69+
}
6170
if (!string.IsNullOrEmpty(StreamEventUrl))
6271
{
6372
writer.WriteAttributeString("streamEventUrl", StreamEventUrl);

Bandwidth.StandardTests/Voice/Bxml/StreamTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ public class StreamTests
99
[Fact]
1010
public void StartStreamBxmlVerbTest()
1111
{
12-
var expected = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <StartStream destination=\"https://www.test.com/stream\" name=\"test_stream\" streamEventUrl=\"https://www.test.com/event\" streamEventMethod=\"POST\" username=\"username\" password=\"password\" /></Response>";
12+
var expected = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <StartStream destination=\"https://www.test.com/stream\" name=\"test_stream\" tracks =\"inbound\" streamEventUrl=\"https://www.test.com/event\" streamEventMethod=\"POST\" username=\"username\" password=\"password\" /></Response>";
1313
var startStream = new StartStream();
1414
startStream.Destination = "https://www.test.com/stream";
1515
startStream.Name = "test_stream";
16+
startStream.Tracks = "inbound";
1617
startStream.StreamEventUrl = "https://www.test.com/event";
1718
startStream.StreamEventMethod = "POST";
1819
startStream.Username = "username";

0 commit comments

Comments
 (0)