From 191de9748eee401721bd1fa7073c6d162d5b2459 Mon Sep 17 00:00:00 2001
From: Jacob Mulford <39915377+jmulford-bw@users.noreply.github.com>
Date: Thu, 22 Jul 2021 14:13:15 -0400
Subject: [PATCH] DX-2100 webrtc bxml transfer method (#30)
* DX-2100 webrtc bxml transfer method
* fixed method call
---
src/WebRtc/Utils/WebRtcTransfer.php | 6 +++++-
tests/WebRtcBxmlTest.php | 26 ++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 tests/WebRtcBxmlTest.php
diff --git a/src/WebRtc/Utils/WebRtcTransfer.php b/src/WebRtc/Utils/WebRtcTransfer.php
index 86debd0..afe6229 100644
--- a/src/WebRtc/Utils/WebRtcTransfer.php
+++ b/src/WebRtc/Utils/WebRtcTransfer.php
@@ -11,6 +11,10 @@
class WebRtcTransfer {
public static function generateBxml($deviceToken, $sipUri = "sip:sipx.webrtc.bandwidth.com:5060") {
- return '' . $sipUri . '';
+ return '' . WebRtcTransfer::generateTransferBxmlVerb($deviceToken, $sipUri) . '';
+ }
+
+ public static function generateTransferBxmlVerb($deviceToken, $sipUri = "sip:sipx.webrtc.bandwidth.com:5060") {
+ return '' . $sipUri . '';
}
}
diff --git a/tests/WebRtcBxmlTest.php b/tests/WebRtcBxmlTest.php
new file mode 100644
index 0000000..f8cc7ad
--- /dev/null
+++ b/tests/WebRtcBxmlTest.php
@@ -0,0 +1,26 @@
+sip:sipx.webrtc.bandwidth.com:5060';
+ $actual = BandwidthLib\WebRtc\Utils\WebRtcTransfer::generateBxml('asdf');
+ $this->assertEquals($expected, $actual);
+ }
+
+ public function testGenerateTransferBxmlVerb() {
+ $expected = 'sip:sipx.webrtc.bandwidth.com:5060';
+ $actual = BandwidthLib\WebRtc\Utils\WebRtcTransfer::generateTransferBxmlVerb('asdf');
+ $this->assertEquals($expected, $actual);
+ }
+}