Skip to content

Commit e839d47

Browse files
authored
SWI-7766 Add uui to PhoneNumber Verb (#186)
1 parent 0959969 commit e839d47

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/bandwidth/sdk/model/bxml/PhoneNumber.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* @param fallbackUsername (str, optional): The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
4242
* @param fallbackPassword (str, optional): The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
4343
* @param tag (str, optional): A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None.
44+
* @param uui (str, optional): The value of the User-To-User header to send within the initial INVITE. Must include the encoding parameter as specified in RFC 7433. Only base64, jwt and hex encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters.
4445
*
4546
*/
4647
public class PhoneNumber implements OutboundDestination {
@@ -86,4 +87,7 @@ public class PhoneNumber implements OutboundDestination {
8687

8788
@XmlAttribute
8889
protected String tag;
90+
91+
@XmlAttribute
92+
protected String uui;
8993
}

src/test/java/com/bandwidth/sdk/unit/models/bxml/TransferVerbTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class TransferVerbTest {
3838
.number("+19195551234")
3939
.transferAnswerUrl("https://example.com/webhooks/transfer_answer")
4040
.tag("test")
41+
.uui("test")
4142
.transferAnswerMethod("POST")
4243
.build();
4344
Transfer transfer1 = Transfer.builder()
@@ -58,7 +59,7 @@ public class TransferVerbTest {
5859
public void transferVerbWorks() throws JAXBException {
5960
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
6061
String expectedSipUriBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">sip@bw.com</SipUri></Transfer></Bxml>";
61-
String expectedPhoneNumberBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" transferCallerDisplayName=\"Clark Kent\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><PhoneNumber transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>";
62+
String expectedPhoneNumberBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" transferCallerDisplayName=\"Clark Kent\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><PhoneNumber transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\" uui=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>";
6263

6364
assertThat(new Bxml().with(transfer1).toBxml(jaxbContext), is(expectedSipUriBxml));
6465
assertThat(new Bxml().with(transfer2).toBxml(jaxbContext), is(expectedPhoneNumberBxml));

0 commit comments

Comments
 (0)