Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.6.0 (Unreleased)
## 1.6.0 (2026-06-19)

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/communication/azure-communication-callautomation",
"Tag": "python/communication/azure-communication-callautomation_135357fbdb"
"Tag": "python/communication/azure-communication-callautomation_6fe3b5881c"
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,6 @@ def _sign_request(self, request: PipelineRequest) -> None:
if parsed_url.query:
query_url += "?" + parsed_url.query

# Need URL() to get a correct encoded key value, from "%3A" to ":", when transport is in type AioHttpTransport.
# There's a similar scenario in azure-storage-blob and azure-appconfiguration, the check logic is from there.
try:
from yarl import URL
from azure.core.pipeline.transport import ( # pylint:disable=non-abstract-transport-import
AioHttpTransport,
)

if (
isinstance(request.context.transport, AioHttpTransport)
or isinstance(
getattr(request.context.transport, "_transport", None),
AioHttpTransport,
)
or isinstance(
getattr(
getattr(request.context.transport, "_transport", None),
"_transport",
None,
),
AioHttpTransport,
)
):
query_url = str(URL(query_url))
except (ImportError, TypeError):
pass

if self._decode_url:
query_url = unquote(query_url)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ def _message_awaiter(self, unique_id) -> None:
unique_id = self._unique_key_gen(caller, receiver)
key = self._event_key_gen("IncomingCall")
print("EventRegistration(IncomingCall):" + key)
self.event_store[key] = mapper
self.event_to_save[key] = mapper
self.event_store.setdefault(key, []).append(mapper)
self.event_to_save.setdefault(key, []).append(mapper)
else:
if isinstance(mapper, list):
mapper = mapper[0]
if mapper["type"]:
key = self._event_key_gen(mapper["type"].split(".")[-1])
print("EventRegistration:" + key)
self.event_store[key] = mapper
self.event_to_save[key] = mapper
self.event_store.setdefault(key, []).append(mapper)
self.event_to_save.setdefault(key, []).append(mapper)
service_bus_receiver.complete_message(msg)
time.sleep(1)
return
Expand All @@ -148,7 +148,10 @@ def _prepare_events_recording(self) -> None:
file_path = self._get_test_event_file_name()
try:
with open(file_path, "r") as json_file:
self.event_store = json.load(json_file)
loaded_events = json.load(json_file)
self.event_store = {
key: value if isinstance(value, list) else [value] for key, value in loaded_events.items()
}
except IOError as e:
raise SystemExit(f"File write operation failed: {e}")

Expand All @@ -168,8 +171,11 @@ def check_for_event(self, event_type: str, call_connection_id: str, wait_time: t
key = self._event_key_gen(event_type)
time_out_time = datetime.now() + wait_time
while datetime.now() < time_out_time:
popped_event = self.event_store.pop(key, None)
if popped_event is not None:
events = self.event_store.get(key)
if events:
popped_event = events.pop(0)
if not events:
self.event_store.pop(key, None)
print(f"Matching Event Found [{key}]")
return popped_event
time.sleep(1)
Expand Down Expand Up @@ -318,8 +324,10 @@ def terminate_call(self, unique_id) -> None:
pass

def redact_by_key(self, data: Dict[str, Dict[str, any]], keys_to_redact: List[str]) -> Dict[str, Dict[str, any]]:
for _, inner_dict in data.items():
for key in keys_to_redact:
if key in inner_dict:
inner_dict[key] = "REDACTED"
for _, value in data.items():
events = value if isinstance(value, list) else [value]
for inner_dict in events:
for key in keys_to_redact:
if key in inner_dict:
inner_dict[key] = "REDACTED"
return data
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ def _message_awaiter(self, unique_id) -> None:
unique_id = self._unique_key_gen(caller, receiver)
key = self._event_key_gen("IncomingCall")
print("EventRegistration(IncomingCall):" + key)
self.event_store[key] = mapper
self.event_to_save[key] = mapper
self.event_store.setdefault(key, []).append(mapper)
self.event_to_save.setdefault(key, []).append(mapper)
else:
if isinstance(mapper, list):
mapper = mapper[0]
if mapper["type"]:
key = self._event_key_gen(mapper["type"].split(".")[-1])
print("EventRegistration:" + key)
self.event_store[key] = mapper
self.event_to_save[key] = mapper
self.event_store.setdefault(key, []).append(mapper)
self.event_to_save.setdefault(key, []).append(mapper)
service_bus_receiver.complete_message(msg)
time.sleep(1)
return
Expand All @@ -174,7 +174,10 @@ def _prepare_events_recording(self) -> None:
if not is_live():
file_path = self._get_test_event_file_name()
with open(file_path, "r") as json_file:
self.event_store = json.load(json_file)
loaded_events = json.load(json_file)
self.event_store = {
key: value if isinstance(value, list) else [value] for key, value in loaded_events.items()
}
except Exception as e:
# Don't fail test setup for file I/O issues
print(f"Warning: Event loading failed: {e}")
Expand All @@ -197,8 +200,11 @@ def check_for_event(self, event_type: str, call_connection_id: str, wait_time: t
key = self._event_key_gen(event_type)
time_out_time = datetime.now() + wait_time
while datetime.now() < time_out_time:
popped_event = self.event_store.pop(key, None)
if popped_event is not None:
events = self.event_store.get(key)
if events:
popped_event = events.pop(0)
if not events:
self.event_store.pop(key, None)
print(f"Matching Event Found [{key}]")
return popped_event
time.sleep(1)
Expand Down Expand Up @@ -349,8 +355,10 @@ async def terminate_call(self, unique_id) -> None:
pass

def redact_by_key(self, data: Dict[str, Dict[str, any]], keys_to_redact: List[str]) -> Dict[str, Dict[str, any]]:
for _, inner_dict in data.items():
for key in keys_to_redact:
if key in inner_dict:
inner_dict[key] = "REDACTED"
for _, value in data.items():
events = value if isinstance(value, list) else [value]
for inner_dict in events:
for key in keys_to_redact:
if key in inner_dict:
inner_dict[key] = "REDACTED"
return data
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"IncomingCall": [{"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405"}], "CallConnected": [{"id": "8c28bcd2-28bd-4f79-8f63-e568799d9534", "source": "calling/callConnections/14006580-99df-4c2e-9b8f-8a27d2d8e2b7", "type": "Microsoft.Communication.CallConnected", "data": {"resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2026-03-12", "callConnectionId": "14006580-99df-4c2e-9b8f-8a27d2d8e2b7", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2026-06-17T16:02:00.1738872+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/14006580-99df-4c2e-9b8f-8a27d2d8e2b7"}, {"id": "131212e5-49e0-4dfa-92c6-b5a920215794", "source": "calling/callConnections/14006580-7400-423c-938e-55c024d7f07f", "type": "Microsoft.Communication.CallConnected", "data": {"resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2026-03-12", "callConnectionId": "14006580-7400-423c-938e-55c024d7f07f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2026-06-17T16:02:04.3207832+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/14006580-7400-423c-938e-55c024d7f07f"}], "ParticipantsUpdated": [{"id": "3af6e672-95a9-4c50-af5b-4e874b5b24a8", "source": "calling/callConnections/14006580-99df-4c2e-9b8f-8a27d2d8e2b7", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2026-03-12", "callConnectionId": "14006580-99df-4c2e-9b8f-8a27d2d8e2b7", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2026-06-17T16:02:00.278608+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/14006580-99df-4c2e-9b8f-8a27d2d8e2b7"}, {"id": "16d27faa-543e-4d6b-8bee-cc7e8a9e0b7e", "source": "calling/callConnections/14006580-7400-423c-938e-55c024d7f07f", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 2, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2026-03-12", "callConnectionId": "14006580-7400-423c-938e-55c024d7f07f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2026-06-17T16:02:04.3168271+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/14006580-7400-423c-938e-55c024d7f07f"}, {"id": "5ead2177-f6e4-4918-88db-bed9e3d4afb4", "source": "calling/callConnections/14006580-7400-423c-938e-55c024d7f07f", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f320-e858-8b3a0d001d5d"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_0000002f-7632-f411-e858-8b3a0d001d5e"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 3, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2026-03-12", "callConnectionId": "14006580-7400-423c-938e-55c024d7f07f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2026-06-17T16:02:04.4023692+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/14006580-7400-423c-938e-55c024d7f07f"}], "CallDisconnected": [{"id": "e6589f64-d73f-46b6-ad98-ecad1dc497bf", "source": "calling/callConnections/14006580-99df-4c2e-9b8f-8a27d2d8e2b7", "type": "Microsoft.Communication.CallDisconnected", "data": {"resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "version": "2026-03-12", "callConnectionId": "14006580-99df-4c2e-9b8f-8a27d2d8e2b7", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi95b2YxdUpaNy0wMll5alBSdXB0VzZ3P2k9MTAtMTI4LTk2LTE1MCZlPTYzOTE3MTYwMDIxMTY0MzgyNw==", "correlationId": "556fd844-6c9c-4110-9082-b2b3b22df405", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2026-06-17T16:02:06.9079717+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/14006580-99df-4c2e-9b8f-8a27d2d8e2b7"}]}
Loading
Loading