-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from Bandwidth/DX-2862
Added StreamParam for StartStream
- Loading branch information
Showing
3 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* StreamParam.php | ||
* | ||
* Implementation of the BXML 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. | ||
* | ||
* * @copyright Bandwidth INC | ||
*/ | ||
|
||
namespace BandwidthLib\Voice\Bxml; | ||
|
||
require_once "Verb.php"; | ||
|
||
class StreamParam extends Verb { | ||
|
||
/** | ||
* Sets the name attribute for StreamParam | ||
* | ||
* @param string $name (required) The name of this parameter, up to 256 characters. | ||
*/ | ||
public function name($name) { | ||
$this->name = $name; | ||
} | ||
|
||
/** | ||
* Sets the value attribute for StreamParam | ||
* | ||
* @param string $value (required) The value of this parameter, up to 2048 characters. | ||
*/ | ||
public function value($value) { | ||
$this->value = $value; | ||
} | ||
|
||
public function toBxml($doc) { | ||
$element = $doc->createElement("StreamParam"); | ||
|
||
if(isset($this->name)) { | ||
$element->setAttribute("name", $this->name); | ||
} | ||
|
||
if(isset($this->value)) { | ||
$element->setAttribute("value", $this->value); | ||
} | ||
|
||
return $element; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters