-
Notifications
You must be signed in to change notification settings - Fork 10
VAPI-3160: Add <Refer> BXML Verb Support #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
s-aher
wants to merge
5
commits into
main
Choose a base branch
from
VAPI-3160
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8b592e0
VAPI-3160: Add Refer BXML implementation and related tests
s-aher dfe1f42
VAPI-3160: Add Refer BXML implementation and related tests
s-aher abf5392
Fix testSyncTnLookup: remove assertion on empty links array
Copilot ee9a69d
VAPI-3160: Fixed review commit
s-aher 7936e76
Merge remote-tracking branch 'origin/VAPI-3160' into VAPI-3160
s-aher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,97 @@ | ||
| <?php | ||
| /** | ||
| * Refer.php | ||
| * | ||
| * Implementation of the BXML Refer tag | ||
| * | ||
| * * @copyright Bandwidth INC | ||
| */ | ||
|
|
||
| namespace BandwidthLib\Voice\Bxml; | ||
|
|
||
| use DOMDocument; | ||
| use DOMElement; | ||
|
|
||
| require_once "Verb.php"; | ||
|
|
||
| class Refer extends Verb { | ||
| /** | ||
| * @var string | ||
| */ | ||
| private $referCompleteUrl; | ||
| /** | ||
| * @var string | ||
| */ | ||
| private $referCompleteMethod; | ||
| /** | ||
| * @var string | ||
| */ | ||
| private $tag; | ||
| /** | ||
| * @var SipUri | ||
| */ | ||
| private $sipUri; | ||
|
|
||
| /** | ||
| * Sets the referCompleteUrl attribute for Refer | ||
| * | ||
| * @param string $referCompleteUrl The URL to receive the refer complete callback | ||
| */ | ||
| public function referCompleteUrl(string $referCompleteUrl): Refer { | ||
| $this->referCompleteUrl = $referCompleteUrl; | ||
| return $this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the referCompleteMethod attribute for Refer | ||
| * | ||
| * @param string $referCompleteMethod The HTTP method for the refer complete callback (GET or POST) | ||
| */ | ||
| public function referCompleteMethod(string $referCompleteMethod): Refer { | ||
| $this->referCompleteMethod = $referCompleteMethod; | ||
| return $this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the tag attribute for Refer | ||
| * | ||
| * @param string $tag A custom string to be included in callbacks | ||
| */ | ||
| public function tag(string $tag): Refer { | ||
| $this->tag = $tag; | ||
| return $this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the SipUri child element for Refer | ||
| * | ||
| * @param SipUri $sipUri The SipUri destination for the REFER | ||
| */ | ||
| public function sipUri(SipUri $sipUri): Refer { | ||
| $this->sipUri = $sipUri; | ||
| return $this; | ||
| } | ||
|
|
||
| public function toBxml(DOMDocument $doc): DOMElement { | ||
| $element = $doc->createElement("Refer"); | ||
|
|
||
| if(isset($this->referCompleteUrl)) { | ||
| $element->setAttribute("referCompleteUrl", $this->referCompleteUrl); | ||
| } | ||
|
|
||
| if(isset($this->referCompleteMethod)) { | ||
| $element->setAttribute("referCompleteMethod", $this->referCompleteMethod); | ||
| } | ||
|
|
||
| if(isset($this->tag)) { | ||
| $element->setAttribute("tag", $this->tag); | ||
| } | ||
|
|
||
| if(isset($this->sipUri)) { | ||
|
s-aher marked this conversation as resolved.
Outdated
|
||
| $element->appendChild($this->sipUri->toBxml($doc)); | ||
| } | ||
|
|
||
| return $element; | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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,154 @@ | ||
| <?php | ||
| /* | ||
| * BandwidthLib | ||
| * | ||
| * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). | ||
|
s-aher marked this conversation as resolved.
Outdated
|
||
| */ | ||
|
|
||
| namespace BandwidthLib\Voice\Models; | ||
|
|
||
| /** | ||
| *This object represents fields included in callbacks related to refer complete events | ||
| */ | ||
| class ReferCompleteCallback implements \JsonSerializable | ||
| { | ||
| /** | ||
| * @todo Write general description for this property | ||
|
s-aher marked this conversation as resolved.
Outdated
|
||
| * @var string|null $eventType public property | ||
| */ | ||
| public $eventType; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $eventTime public property | ||
| */ | ||
| public $eventTime; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $accountId public property | ||
| */ | ||
| public $accountId; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $applicationId public property | ||
| */ | ||
| public $applicationId; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $from public property | ||
| */ | ||
| public $from; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $to public property | ||
| */ | ||
| public $to; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $direction public property | ||
| */ | ||
| public $direction; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $callId public property | ||
| */ | ||
| public $callId; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $callUrl public property | ||
| */ | ||
| public $callUrl; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $startTime public property | ||
| */ | ||
| public $startTime; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $answerTime public property | ||
| */ | ||
| public $answerTime; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $referCallStatus public property | ||
| */ | ||
| public $referCallStatus; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $referSipResponseCode public property | ||
|
s-aher marked this conversation as resolved.
Outdated
|
||
| */ | ||
| public $referSipResponseCode; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $notifySipResponseCode public property | ||
|
s-aher marked this conversation as resolved.
Outdated
|
||
| */ | ||
| public $notifySipResponseCode; | ||
|
|
||
| /** | ||
| * @todo Write general description for this property | ||
| * @var string|null $tag public property | ||
| */ | ||
| public $tag; | ||
|
|
||
| /** | ||
| * Constructor to set initial or default values of member properties | ||
| */ | ||
| public function __construct() | ||
| { | ||
| if (15 == func_num_args()) { | ||
| $this->eventType = func_get_arg(0); | ||
| $this->eventTime = func_get_arg(1); | ||
| $this->accountId = func_get_arg(2); | ||
| $this->applicationId = func_get_arg(3); | ||
| $this->from = func_get_arg(4); | ||
| $this->to = func_get_arg(5); | ||
| $this->direction = func_get_arg(6); | ||
| $this->callId = func_get_arg(7); | ||
| $this->callUrl = func_get_arg(8); | ||
| $this->startTime = func_get_arg(9); | ||
| $this->answerTime = func_get_arg(10); | ||
| $this->referCallStatus = func_get_arg(11); | ||
| $this->referSipResponseCode = func_get_arg(12); | ||
| $this->notifySipResponseCode = func_get_arg(13); | ||
| $this->tag = func_get_arg(14); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Encode this object to JSON | ||
| */ | ||
| public function jsonSerialize(): array | ||
| { | ||
| $json = array(); | ||
| $json['eventType'] = $this->eventType; | ||
| $json['eventTime'] = $this->eventTime; | ||
| $json['accountId'] = $this->accountId; | ||
| $json['applicationId'] = $this->applicationId; | ||
| $json['from'] = $this->from; | ||
| $json['to'] = $this->to; | ||
| $json['direction'] = $this->direction; | ||
| $json['callId'] = $this->callId; | ||
| $json['callUrl'] = $this->callUrl; | ||
| $json['startTime'] = $this->startTime; | ||
| $json['answerTime'] = $this->answerTime; | ||
| $json['referCallStatus'] = $this->referCallStatus; | ||
| $json['referSipResponseCode'] = $this->referSipResponseCode; | ||
| $json['notifySipResponseCode'] = $this->notifySipResponseCode; | ||
| $json['tag'] = $this->tag; | ||
|
|
||
| return array_filter($json); | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.