Skip to content

VAPI-2273 Add UUI property to PhoneNumber BXML #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 6 additions & 2 deletions bandwidth/models/bxml/verbs/phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def __init__(
self, number: str, transfer_answer_url: str=None, transfer_answer_method: str=None,
transfer_answer_fallback_url: str=None, transfer_answer_fallback_method: str=None,
transfer_disconnect_url: str=None, transfer_disconnect_method: str=None, username: str=None,
password: str=None, fallback_username: str=None, fallback_password: str=None, tag: str=None
password: str=None, fallback_username: str=None, fallback_password: str=None, tag: str=None,
uui: str=None
):
"""Initialize a <PhoneNumber> verb

Expand All @@ -31,6 +32,7 @@ def __init__(
fallback_username (str, optional): The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
fallback_password (str, optional): The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
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.
uui (str, optional): A comma-separated list of 'User-To-User' headers to be sent in the INVITE. The entire value cannot exceed 350 characters, including parameters and separators. Defaults to None.
"""
self.number = number
self.transfer_answer_url = transfer_answer_url
Expand All @@ -44,6 +46,7 @@ def __init__(
self.fallback_username = fallback_username
self.fallback_password = fallback_password
self.tag = tag
self.uui = uui
super().__init__(
tag="PhoneNumber",
content=self.number
Expand All @@ -62,5 +65,6 @@ def _attributes(self):
"password": self.password,
"fallbackUsername": self.fallback_username,
"fallbackPassword": self.fallback_password,
"tag": self.tag
"tag": self.tag,
"uui": self.uui
}
5 changes: 5 additions & 0 deletions test/unit/models/bxml/test_phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ def test_instance(self):
def test_to_bxml(self):
expected = '<PhoneNumber transferAnswerUrl="https://example.com/webhooks/transfer_answer" transferAnswerMethod="POST" tag="">+19195551234</PhoneNumber>'
assert expected == self.phone_number.to_bxml()

Copy link
Contributor

@ckoegel ckoegel May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just add uui to the instance created in seUp, no need to make another test function for this

def test_with_uui(self):
self.phone_number.uui = "abc123"
expected = '<PhoneNumber transferAnswerUrl="https://example.com/webhooks/transfer_answer" transferAnswerMethod="POST" tag="" uui="abc123">+19195551234</PhoneNumber>'
assert expected == self.phone_number.to_bxml()