Skip to content

Commit

Permalink
Add tracks attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrice6713 committed Aug 3, 2022
1 parent c705f48 commit cd6357f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Bandwidth.Standard/Voice/Bxml/StartStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class StartStream : IXmlSerializable, IVerb, IAudioProducer
/// </summary>
public string Name { get; set; }

/// <summary>
/// The part of the call to send a stream from. `inbound`, `outbound` or `both`.
/// </summary>
public string Tracks { get; set; }

/// <summary>
/// URL to send the associated Webhook events to during this stream's lifetime
/// </summary>
Expand Down Expand Up @@ -58,6 +63,10 @@ void IXmlSerializable.WriteXml(XmlWriter writer)
{
writer.WriteAttributeString("name", Name);
}
if (!string.IsNullOrEmpty(Tracks))
{
writer.WriteAttributeString("tracks", Tracks);
}
if (!string.IsNullOrEmpty(StreamEventUrl))
{
writer.WriteAttributeString("streamEventUrl", StreamEventUrl);
Expand Down
3 changes: 2 additions & 1 deletion Bandwidth.StandardTests/Voice/Bxml/StreamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ public class StreamTests
[Fact]
public void StartStreamBxmlVerbTest()
{
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>";
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>";
var startStream = new StartStream();
startStream.Destination = "https://www.test.com/stream";
startStream.Name = "test_stream";
startStream.Tracks = "inbound";
startStream.StreamEventUrl = "https://www.test.com/event";
startStream.StreamEventMethod = "POST";
startStream.Username = "username";
Expand Down

0 comments on commit cd6357f

Please sign in to comment.