From 16925c4db2a6dc78eb1970fc3eba54bdfe0e297b Mon Sep 17 00:00:00 2001
From: AJ Rice <53190766+ajrice6713@users.noreply.github.com>
Date: Tue, 20 Feb 2024 14:26:48 -0500
Subject: [PATCH] SWI-4587 Add `transferCallerDisplayName` (#184)
---
bandwidth/models/bxml/verbs/transfer.py | 5 ++++-
test/unit/bxml/test_transfer.py | 5 +++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/bandwidth/models/bxml/verbs/transfer.py b/bandwidth/models/bxml/verbs/transfer.py
index dae7e88c..c9fe94e5 100644
--- a/bandwidth/models/bxml/verbs/transfer.py
+++ b/bandwidth/models/bxml/verbs/transfer.py
@@ -16,7 +16,7 @@ class Transfer(Verb):
def __init__(
self, transfer_to: List[Union[PhoneNumber, SipUri]] = [],
- transfer_caller_id: str=None, call_timeout: str=None,
+ transfer_caller_id: str=None, transfer_caller_display_name: str=None, call_timeout: str=None,
transfer_complete_url: str=None, transfer_complete_method: str=None,
transfer_complete_fallback_url: str=None,
transfer_complete_fallback_method: str=None, username: str=None,
@@ -29,6 +29,7 @@ def __init__(
Args:
transfer_to (list[PhoneNumber, SipUri], optional): List of recipients to transfer a call to. Defaults to [].
transfer_caller_id (str, optional): The caller ID to use when the call is transferred, if different. Must be in E.164 format (e.g. +15555555555) or be one of the following strings Restricted, Anonymous, Private, or Unavailable. Leave as default to pass along the number of the remote party. Defaults to None.
+ transfer_caller_display_name (str, optional): The caller display name to use when the call is transferred. May not exceed 256 characters nor contain control characters such as new lines.
call_timeout (str, optional):The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Range: decimal values between 1 - 300. Default value is 30 seconds. Defaults to None.
transfer_complete_url (str, optional): URL to send the Transfer Complete event to and request new BXML. Optional but recommended. See below for further details. May be a relative URL. Defaults to None.
transfer_complete_method (str, optional): The HTTP method to use for the request to transferCompleteUrl. GET or POST. Default value is POST. Defaults to None.
@@ -63,6 +64,7 @@ def __init__(
"""
self.transfer_to = transfer_to
self.transfer_caller_id = transfer_caller_id
+ self.transfer_caller_display_name = transfer_caller_display_name
self.call_timeout = call_timeout
self.transfer_complete_url = transfer_complete_url
self.transfer_complete_method = transfer_complete_method
@@ -84,6 +86,7 @@ def __init__(
def _attributes(self):
return {
"transferCallerId": self.transfer_caller_id,
+ "transferCallerDisplayName": self.transfer_caller_display_name,
"callTimeout": self.call_timeout,
"transferCompleteUrl": self.transfer_complete_url,
"transferCompleteMethod": self.transfer_complete_method,
diff --git a/test/unit/bxml/test_transfer.py b/test/unit/bxml/test_transfer.py
index 3f5124ef..b63f0c2f 100644
--- a/test/unit/bxml/test_transfer.py
+++ b/test/unit/bxml/test_transfer.py
@@ -27,14 +27,15 @@ def setUp(self):
transfer_to=[self.sip_uri],
call_timeout = "15",
transfer_caller_id = "+19195554321",
+ transfer_caller_display_name="test",
tag = "test"
)
def test_to_bxml(self):
- expected = 'sip@bw.com'
+ expected = 'sip@bw.com'
assert(expected == self.transfer.to_bxml())
def test_add_verb(self):
- expected = 'sip@bw.com+19195551234'
+ expected = 'sip@bw.com+19195551234'
self.transfer.add_transfer_recipient(self.phone_number)
assert(expected == self.transfer.to_bxml())