Skip to content
Open
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
8 changes: 8 additions & 0 deletions src/main/java/com/bandwidth/sdk/model/bxml/Transfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
* This parameter is considered only when diversionTreatment is set to stack. Defaults is unknown.
* Defaults to None.
* @param privacy (bool, optional): A boolean value to indicate that the calling number should be hidden. Use transferCallerDisplayName to customize the name shown to the recipient. Default is false.
* @param requestedAttestationLevel (str, optional): The STIR/SHAKEN attestation level to sign the transferred call with. Can be A, B, or C. Only applies to accounts using the Hosted Signing Service. Cannot be combined with identity. Defaults to None.
* @param identity (str, optional): A SIP Identity header value (PASSporT) signed by you, sent unmodified on the transferred call. Max length 2000 characters. Cannot be combined with requestedAttestationLevel. Defaults to None.
*
*/
public class Transfer implements Verb {
Expand Down Expand Up @@ -132,6 +134,12 @@ public class Transfer implements Verb {
@XmlAttribute
protected Boolean privacy;

@XmlAttribute
protected String requestedAttestationLevel;

@XmlAttribute
protected String identity;

@Override
public String getVerbName() {
return TYPE_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class TransferVerbTest {
.transferCallerId("+19195554321")
.tag("test")
.privacy(true)
.requestedAttestationLevel("A")
.identity("eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://example.com/cert.pem>;ppt=\"shaken\"")
.build();
Transfer transfer2 = Transfer.builder()
.callTimeout(15d)
Expand All @@ -59,7 +61,7 @@ public class TransferVerbTest {
@Test
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\" privacy=\"true\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">sip@bw.com</SipUri></Transfer></Bxml>";
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\" privacy=\"true\" requestedAttestationLevel=\"A\" identity=\"eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=&lt;https://example.com/cert.pem&gt;;ppt=&quot;shaken&quot;\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">sip@bw.com</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\" uui=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>";

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