Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/com/bandwidth/sdk/model/bxml/PhoneNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @param fallbackUsername (str, optional): The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
* @param fallbackPassword (str, optional): The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
* @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.
* @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.
*
*/
public class PhoneNumber implements OutboundDestination {
Expand Down Expand Up @@ -86,4 +87,7 @@ public class PhoneNumber implements OutboundDestination {

@XmlAttribute
protected String tag;

@XmlAttribute
protected String uui;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class TransferVerbTest {
.number("+19195551234")
.transferAnswerUrl("https://example.com/webhooks/transfer_answer")
.tag("test")
.uui("test")
.transferAnswerMethod("POST")
.build();
Transfer transfer1 = Transfer.builder()
Expand All @@ -58,7 +59,7 @@ public class TransferVerbTest {
public void transferVerbWorks() throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(Bxml.class);
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\">[email protected]</SipUri></Transfer></Bxml>";
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>";
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>";

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