Skip to content

Commit

Permalink
Update StartStream.php
Browse files Browse the repository at this point in the history
  • Loading branch information
brianluisgomez committed Sep 15, 2022
1 parent 8e99bad commit f546667
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Voice/Bxml/StartStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public function streamEventMethod($streamEventMethod) {
$this->streamEventMethod = $streamEventMethod;
}

/**
* Sets the <StreamParam/> tag. You may specify up to 12 <StreamParam/> elements nested within a <StartStream> tag. These elements define optional user specified parameters that will be sent to the destination URL when the stream is first started.
*
* @param list<StreamParam> $streamParams The list of StreamParam tags
*/
public function streamParams($streamParams) {
$this->streamParams = $streamParams;
}

public function toBxml($doc) {
$element = $doc->createElement("StartStream");

Expand Down Expand Up @@ -108,6 +117,12 @@ public function toBxml($doc) {
$element->setattribute("streamEventMethod", $this->streamEventMethod);
}

if(isset($this->streamParams)) {
foreach ($this->streamParams as $streamParam) {
$element->appendChild($streamParam->toBxml($doc));
}
}

return $element;
}
}

0 comments on commit f546667

Please sign in to comment.