From 453f12d53291fb13b3882ace0b0fa35fad6524c5 Mon Sep 17 00:00:00 2001
From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com>
Date: Fri, 16 Feb 2024 15:54:30 -0500
Subject: [PATCH] SWI-4587 Add ` transferCallerDisplayName` to Transfer Verb
(#87)
---
src/bxml/transfer.ts | 9 +++++++++
tests/bxml.test.js | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/bxml/transfer.ts b/src/bxml/transfer.ts
index de7e3c7..86e99e6 100644
--- a/src/bxml/transfer.ts
+++ b/src/bxml/transfer.ts
@@ -4,6 +4,8 @@ import { Verb } from './Verb'
export interface TransferOptions {
transferCallerId?: string
+ transferCallerDisplayName?: string
+
callTimeout?: number
tag?: string
@@ -36,6 +38,8 @@ export interface TransferOptions {
export class Transfer implements TransferOptions, Verb {
transferCallerId?: string
+ transferCallerDisplayName?: string
+
callTimeout?: number
tag?: string
@@ -77,6 +81,7 @@ export class Transfer implements TransferOptions, Verb {
this.username = options.username
this.tag = options.tag
this.transferCallerId = options.transferCallerId
+ this.transferCallerDisplayName = options.transferCallerDisplayName
this.transferCompleteFallbackMethod = options.transferCompleteFallbackMethod
this.transferCompleteFallbackUrl = options.transferCompleteFallbackUrl
this.transferCompleteMethod = options.transferCompleteMethod
@@ -90,6 +95,10 @@ export class Transfer implements TransferOptions, Verb {
attributes['transferCallerId'] = this.transferCallerId
}
+ if (this.transferCallerDisplayName !== undefined) {
+ attributes['transferCallerDisplayName'] = this.transferCallerDisplayName
+ }
+
if (this.callTimeout !== undefined) {
attributes['callTimeout'] = `${this.callTimeout}`
}
diff --git a/tests/bxml.test.js b/tests/bxml.test.js
index e7864be..3fc7afe 100644
--- a/tests/bxml.test.js
+++ b/tests/bxml.test.js
@@ -381,6 +381,7 @@ describe("Transfer", () => {
var transfer = new Transfer({
transferCallerId: "+18888888888",
+ transferCallerDisplayName: "test",
callTimeout: 3,
tag: "tagTransfer",
transferCompleteUrl: "https://testtransfer.com",
@@ -399,7 +400,7 @@ describe("Transfer", () => {
var response = new Response(transfer);
- var expectedString = "+17777777777sip-uri";
+ var expectedString = "+17777777777sip-uri";
expect(response.toBxml()).toEqual(expectedString);
});
});