diff --git a/sdk/communication/azure-communication-callautomation/assets.json b/sdk/communication/azure-communication-callautomation/assets.json index f7266f85f088..10c8004784dd 100644 --- a/sdk/communication/azure-communication-callautomation/assets.json +++ b/sdk/communication/azure-communication-callautomation/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/communication/azure-communication-callautomation", - "Tag": "python/communication/azure-communication-callautomation_60418f7fa6" + "Tag": "python/communication/azure-communication-callautomation_166bc3dec4" } diff --git a/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case.py b/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case.py index c2fbfdc305fd..a5a6d151dc6f 100644 --- a/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case.py +++ b/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case.py @@ -201,7 +201,7 @@ def _establish_callconnection(self, caller, target, cognitive_service_enabled: O callback_url = f"{self.dispatcher_callback}?q={unique_id}" create_call_result = self._create_call( - call_automation_client_caller, target, unique_id, cognitive_service_enabled, is_pstn, options, is_transcription + call_automation_client_caller, caller, target, unique_id, cognitive_service_enabled, is_pstn, options, is_transcription ) caller_connection_id = self._validate_create_call_result(create_call_result) @@ -233,7 +233,7 @@ def _subscribe_to_dispatcher(self, unique_id): thread = threading.Thread(target=self._message_awaiter, args=(unique_id,)) thread.start() - def _create_call(self, client, target, unique_id, cognitive_service_enabled, is_pstn, options, is_transcription): + def _create_call(self, client, caller, target, unique_id, cognitive_service_enabled, is_pstn, options, is_transcription): if is_pstn: return client.create_call( target_participant=target, diff --git a/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case_async.py b/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case_async.py new file mode 100644 index 000000000000..7542cf8cf175 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/callautomation_test_case_async.py @@ -0,0 +1,309 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import json +import threading +import time +import os +import inspect +from datetime import datetime, timedelta +from typing import Dict, Any, List, Optional + +import requests +from azure.servicebus import ServiceBusClient +from azure.identity import AzureCliCredential +from devtools_testutils import AzureRecordedTestCase, is_live +from devtools_testutils.helpers import get_test_id + +from azure.communication.callautomation import ( + CommunicationIdentifierKind, + CommunicationIdentifier +) +from azure.communication.callautomation.aio import ( + CallAutomationClient, + CallConnectionClient +) +from azure.communication.callautomation._shared.models import identifier_from_raw_id +from azure.communication.identity import CommunicationIdentityClient +from azure.communication.phonenumbers import PhoneNumbersClient + +class CallAutomationRecordedTestCaseAsync(AzureRecordedTestCase): + @classmethod + def setup_class(cls): + if is_live(): + print("Live Test") + cls.connection_str = os.environ.get('COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING') + cls.servicebus_str = os.environ.get('SERVICEBUS_STRING') + cls.dispatcher_endpoint = os.environ.get('DISPATCHER_ENDPOINT') + cls.file_source_url = os.environ.get('FILE_SOURCE_URL') + cls.cognitive_service_endpoint = os.environ.get('COGNITIVE_SERVICE_ENDPOINT') + cls.transport_url = os.environ.get('TRANSPORT_URL') + else: + print("Recorded Test") + cls.connection_str = "endpoint=https://someEndpoint/;accesskey=someAccessKeyw==" + cls.servicebus_str = "redacted.servicebus.windows.net" + cls.dispatcher_endpoint = "https://REDACTED.azurewebsites.net" + cls.file_source_url = "https://REDACTED/prompt.wav" + cls.cognitive_service_endpoint = "https://sanitized/" + cls.transport_url ="wss://sanitized/ws" + + + cls.credential = AzureCliCredential() + cls.dispatcher_callback = cls.dispatcher_endpoint + "/api/servicebuscallback/events" + cls.identity_client = CommunicationIdentityClient.from_connection_string(cls.connection_str) + cls.phonenumber_client = PhoneNumbersClient.from_connection_string(cls.connection_str) + cls.service_bus_client = ServiceBusClient( + fully_qualified_namespace=cls.servicebus_str, + credential=cls.credential) + + cls.wait_for_event_flags = [] + cls.event_store: Dict[str, Dict[str, Any]] = {} + cls.event_to_save: Dict[str, Dict[str, Any]] = {} + cls.open_call_connections: Dict[str, CallConnectionClient] = {} + + @classmethod + def teardown_class(cls): + cls.wait_for_event_flags.clear() + for cc in cls.open_call_connections.values(): + cc.hang_up(is_for_everyone=True) + + def setup_method(self, method): + self.test_name = get_test_id().split("/")[-1] + self.event_store: Dict[str, Dict[str, Any]] = {} + self.event_to_save: Dict[str, Dict[str, Any]] = {} + self._prepare_events_recording() + pass + + def teardown_method(self, method): + self._record_method_events() + self.event_store: Dict[str, Dict[str, Any]] = {} + self.event_to_save: Dict[str, Dict[str, Any]] = {} + pass + + @staticmethod + def _format_string(s) -> str: + s1 = f"{s[:12]}-{s[12:16]}-{s[16:20]}-{s[20:24]}-{s[24:36]}" + s2 = f"{s[36:44]}-{s[44:48]}-{s[48:52]}-{s[52:56]}-{s[56:]}" + return f"{s1}_{s2}" + + @staticmethod + def _parse_ids_from_identifier(identifier: CommunicationIdentifier) -> str: + if identifier is None: + raise ValueError("Identifier cannot be None") + elif identifier.kind == CommunicationIdentifierKind.COMMUNICATION_USER: + return CallAutomationRecordedTestCaseAsync._format_string("".join(filter(str.isalnum, identifier.raw_id))) + elif identifier.kind == CommunicationIdentifierKind.PHONE_NUMBER: + return identifier.raw_id + else: + raise ValueError("Identifier type not supported") + + @staticmethod + def _event_key_gen(event_type: str) -> str: + return event_type + + @staticmethod + def _unique_key_gen( + caller_identifier: CommunicationIdentifier, receiver_identifier: CommunicationIdentifier + ) -> str: + return CallAutomationRecordedTestCaseAsync._parse_ids_from_identifier( + caller_identifier + ) + CallAutomationRecordedTestCaseAsync._parse_ids_from_identifier(receiver_identifier) + + def _get_test_event_file_name(self): + script_dir = os.path.dirname(os.path.realpath(__file__)) + file_path = os.path.join(script_dir, "events", f"{self.test_name}.event.json") + return file_path + + def _message_awaiter(self, unique_id) -> None: + service_bus_receiver = self.service_bus_client.get_queue_receiver(queue_name=unique_id) + while unique_id in self.wait_for_event_flags: + received_messages = service_bus_receiver.receive_messages(max_wait_time=20) + for msg in received_messages: + body_bytes = b"".join(msg.body) + body_str = body_bytes.decode("utf-8") + mapper = json.loads(body_str) + if "incomingCallContext" in mapper: + caller = identifier_from_raw_id(mapper["from"]["rawId"]) + receiver = identifier_from_raw_id(mapper["to"]["rawId"]) + 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 + 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 + service_bus_receiver.complete_message(msg) + time.sleep(1) + return + + def _prepare_events_recording(self) -> None: + # only load during playback + if not is_live(): + file_path = self._get_test_event_file_name() + try: + with open(file_path, "r") as json_file: + self.event_store = json.load(json_file) + except IOError as e: + raise SystemExit(f"File write operation failed: {e}") + + def _record_method_events(self) -> None: + # only save during live + if is_live(): + file_path = self._get_test_event_file_name() + try: + keys_to_redact = ["incomingCallContext", "callerDisplayName"] + redacted_dict = self.redact_by_key(self.event_to_save, keys_to_redact) + with open(file_path, "w") as json_file: + json.dump(redacted_dict, json_file) + except IOError as e: + raise SystemExit(f"File write operation failed: {e}") + + def check_for_event(self, event_type: str, call_connection_id: str, wait_time: timedelta) -> Any: + 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: + print(f"Matching Event Found [{key}]") + return popped_event + time.sleep(1) + return None + + async def establish_callconnection_voip(self, caller, target, *, cognitive_service_enabled: Optional[bool] = False) -> tuple: + return await self._establish_callconnection( + caller, target, cognitive_service_enabled=cognitive_service_enabled + ) + + async def establish_callconnection_pstn(self, caller, target) -> tuple: + return await self._establish_callconnection(caller, target, is_pstn=True) + + + + async def establish_callconnection_voip_with_streaming_options(self, caller, target, options, is_transcription) -> tuple: + return await self._establish_callconnection( + caller, target, options=options, is_transcription=is_transcription + ) + + async def establish_callconnection_voip_connect_call(self, caller, target) -> tuple: + return await self._establish_callconnection(caller, target, connect_call=True) + + async def _establish_callconnection(self, caller, target, cognitive_service_enabled: Optional[bool] = False, is_pstn: bool = False, options=None, is_transcription: bool = False, connect_call: bool = False) -> tuple: + call_automation_client_caller = self._create_call_automation_client(caller) + call_automation_client_target = self._create_call_automation_client(target) + + unique_id = self._unique_key_gen(caller, target) + if is_live(): + self._subscribe_to_dispatcher(unique_id) + + callback_url = f"{self.dispatcher_callback}?q={unique_id}" + create_call_result = await self._create_call( + call_automation_client_caller, caller, target, unique_id, cognitive_service_enabled, is_pstn, options, is_transcription + ) + caller_connection_id = self._validate_create_call_result(create_call_result) + + incoming_call_context = self._wait_for_incoming_call(unique_id) + answer_call_result = await self._answer_call(call_automation_client_target, incoming_call_context) + + call_connection_caller = self._create_call_connection_client(caller_connection_id) + call_connection_target = self._create_call_connection_client(answer_call_result.call_connection_id) + self.open_call_connections[unique_id] = call_connection_caller + + if connect_call: + return unique_id, call_connection_caller, call_connection_target, call_automation_client_caller, callback_url + + return unique_id, call_connection_caller, call_connection_target + + def _create_call_automation_client(self, source): + return CallAutomationClient.from_connection_string(self.connection_str, source=source) + + def _subscribe_to_dispatcher(self, unique_id): + dispatcher_url = f"{self.dispatcher_endpoint}/api/servicebuscallback/subscribe?q={unique_id}" + response = requests.post(dispatcher_url) + + if response is None: + raise ValueError("Response cannot be None") + + print(f"Subscription to dispatcher of {unique_id}: {response.status_code}") + + self.wait_for_event_flags.append(unique_id) + thread = threading.Thread(target=self._message_awaiter, args=(unique_id,)) + thread.start() + + async def _create_call(self, client, caller, target, unique_id, cognitive_service_enabled, is_pstn, options, is_transcription): + if is_pstn: + return await client.create_call( + target_participant=target, + source_caller_id_number=caller, + callback_url=f"{self.dispatcher_callback}?q={unique_id}", + ) + elif options: + return await client.create_call( + target_participant=target, + callback_url=f"{self.dispatcher_callback}?q={unique_id}", + media_streaming=options if not is_transcription else None, + transcription=options if is_transcription else None, + cognitive_services_endpoint=self.cognitive_service_endpoint if is_transcription else None + ) + else: + return await client.create_call( + target_participant=target, + callback_url=f"{self.dispatcher_callback}?q={unique_id}", + cognitive_services_endpoint=self.cognitive_service_endpoint if cognitive_service_enabled else None + ) + + def _validate_create_call_result(self, result): + if result is None: + raise ValueError("Invalid create_call_result") + + caller_connection_id = result.call_connection_id + if caller_connection_id is None: + raise ValueError("Caller connection ID is None") + + return caller_connection_id + + def _wait_for_incoming_call(self, unique_id): + incoming_call_event = self.check_for_event("IncomingCall", unique_id, timedelta(seconds=30)) + if incoming_call_event is None: + raise ValueError("incoming_call_event is None") + return incoming_call_event["incomingCallContext"] + + async def _answer_call(self, client, context): + result = await client.answer_call( + incoming_call_context=context, callback_url=self.dispatcher_callback + ) + if result is None: + raise ValueError("Invalid answer_call result") + return result + + def _create_call_connection_client(self, connection_id): + return CallConnectionClient.from_connection_string(self.connection_str, connection_id) + + async def terminate_call(self, unique_id) -> None: + try: + call_connection = self.open_call_connections.pop(unique_id, None) + if call_connection is not None: + await call_connection.hang_up(is_for_everyone=True) + disconnected_event = self.check_for_event( + "CallDisconnected", call_connection._call_connection_id, timedelta(seconds=15) + ) + if disconnected_event is None: + raise ValueError("Receiver CallDisconnected event is None") + finally: + while unique_id in self.wait_for_event_flags: + self.wait_for_event_flags.remove(unique_id) + 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" + return data \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_add_participant_then_cancel_request_async.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_add_participant_then_cancel_request_async.event.json new file mode 100644 index 000000000000..217a78f17ee1 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_add_participant_then_cancel_request_async.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b234-c3f7-3a3a0d007074", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b234-c3f7-3a3a0d007074"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b1c8-c3f7-3a3a0d007073", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b1c8-c3f7-3a3a0d007073"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vNzJqWG44VTRVU05sRC1IalBDbU93P2k9MTAtNjAtMTA2LTI5JmU9NjM4ODc3ODAwMzQxNDYyOTE3", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "760a5639-c810-4c0e-aa7c-e2bb711752b5"}, "CallConnected": {"id": "8916ce50-22ef-4df5-a7c6-0ee941e65afc", "source": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "20006180-3fab-453e-bd64-b2a6ae4015d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vNzJqWG44VTRVU05sRC1IalBDbU93P2k9MTAtNjAtMTA2LTI5JmU9NjM4ODc3ODAwMzQxNDYyOTE3", "correlationId": "760a5639-c810-4c0e-aa7c-e2bb711752b5", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:00:14.7653469+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5"}, "ParticipantsUpdated": {"id": "7f455ade-2b12-4940-8f00-9ab576d189e0", "source": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b234-c3f7-3a3a0d007074", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b234-c3f7-3a3a0d007074"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b1c8-c3f7-3a3a0d007073", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b1c8-c3f7-3a3a0d007073"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 3, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "20006180-3fab-453e-bd64-b2a6ae4015d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vNzJqWG44VTRVU05sRC1IalBDbU93P2k9MTAtNjAtMTA2LTI5JmU9NjM4ODc3ODAwMzQxNDYyOTE3", "correlationId": "760a5639-c810-4c0e-aa7c-e2bb711752b5", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:00:17.8986001+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5"}, "CancelAddParticipantSucceeded": {"id": "a97da4e4-6b21-4acd-8fe7-123a696c31c7", "source": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5", "type": "Microsoft.Communication.CancelAddParticipantSucceeded", "data": {"invitationId": "eb1cf01b-aa66-458b-b824-9e389cb7b4dc", "version": "2025-06-15", "resultInformation": {"code": 487, "subCode": 5234, "message": "addParticipants failed for participant 8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-b299-c3f7-3a3a0d007075. Underlying reason: The Call Has Been Cancelled. DiagCode: 487#5234.@"}, "callConnectionId": "20006180-3fab-453e-bd64-b2a6ae4015d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vNzJqWG44VTRVU05sRC1IalBDbU93P2k9MTAtNjAtMTA2LTI5JmU9NjM4ODc3ODAwMzQxNDYyOTE3", "correlationId": "760a5639-c810-4c0e-aa7c-e2bb711752b5", "publicEventType": "Microsoft.Communication.CancelAddParticipantSucceeded"}, "time": "2025-07-16T00:00:19.8835164+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5"}, "CallDisconnected": {"id": "3d7793dd-3513-423b-95bc-8537c51c7ab1", "source": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "20006180-3fab-453e-bd64-b2a6ae4015d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vNzJqWG44VTRVU05sRC1IalBDbU93P2k9MTAtNjAtMTA2LTI5JmU9NjM4ODc3ODAwMzQxNDYyOTE3", "correlationId": "760a5639-c810-4c0e-aa7c-e2bb711752b5", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:00:20.9938093+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3fab-453e-bd64-b2a6ae4015d5"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_create_VOIP_call_and_answer_then_hangup.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_create_VOIP_call_and_answer_then_hangup.event.json new file mode 100644 index 000000000000..ae1776db1478 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_create_VOIP_call_and_answer_then_hangup.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7ffc-c3f7-3a3a0d007071", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7ffc-c3f7-3a3a0d007071"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7f69-c3f7-3a3a0d007070", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7f69-c3f7-3a3a0d007070"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Cblh2d3ZOUERFYVliYWM3MzE5YXhRP2k9MTAtNjAtMTYzLTIyNSZlPTYzODg3Njk0NDczODExOTk1Nw==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "23833f6d-436e-46db-ad01-416dffcaf52b"}, "CallConnected": {"id": "96955e07-35f6-433f-bc1e-3245d3e34dd4", "source": "calling/callConnections/1c006280-a857-4ea2-a378-cfc0d2bb4e35", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "1c006280-a857-4ea2-a378-cfc0d2bb4e35", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Cblh2d3ZOUERFYVliYWM3MzE5YXhRP2k9MTAtNjAtMTYzLTIyNSZlPTYzODg3Njk0NDczODExOTk1Nw==", "correlationId": "23833f6d-436e-46db-ad01-416dffcaf52b", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:00:04.3152645+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/1c006280-a857-4ea2-a378-cfc0d2bb4e35"}, "ParticipantsUpdated": {"id": "2c3e3923-021f-48d6-9049-1796db5cc824", "source": "calling/callConnections/1c006280-a857-4ea2-a378-cfc0d2bb4e35", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7f69-c3f7-3a3a0d007070", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7f69-c3f7-3a3a0d007070"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7ffc-c3f7-3a3a0d007071", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-7ffc-c3f7-3a3a0d007071"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "1c006280-a857-4ea2-a378-cfc0d2bb4e35", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Cblh2d3ZOUERFYVliYWM3MzE5YXhRP2k9MTAtNjAtMTYzLTIyNSZlPTYzODg3Njk0NDczODExOTk1Nw==", "correlationId": "23833f6d-436e-46db-ad01-416dffcaf52b", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:00:04.3835805+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/1c006280-a857-4ea2-a378-cfc0d2bb4e35"}, "CallDisconnected": {"id": "d918603f-f5de-41a2-aa9e-fb8e2130ee36", "source": "calling/callConnections/1c006280-a857-4ea2-a378-cfc0d2bb4e35", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "1c006280-a857-4ea2-a378-cfc0d2bb4e35", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Cblh2d3ZOUERFYVliYWM3MzE5YXhRP2k9MTAtNjAtMTYzLTIyNSZlPTYzODg3Njk0NDczODExOTk1Nw==", "correlationId": "23833f6d-436e-46db-ad01-416dffcaf52b", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:00:06.9133276+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/1c006280-a857-4ea2-a378-cfc0d2bb4e35"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_create_VOIP_call_and_connect_call_then_hangup_async.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_create_VOIP_call_and_connect_call_then_hangup_async.event.json new file mode 100644 index 000000000000..d71fa3ce7386 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_create_VOIP_call_and_connect_call_then_hangup_async.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e77e-c3f7-3a3a0d00707c", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e77e-c3f7-3a3a0d00707c"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e736-c3f7-3a3a0d00707a", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e736-c3f7-3a3a0d00707a"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9lbENwRldBOTFVQ0xEcVN3Y0swWjVBP2k9MTAtNjAtMTQ2LTIwMSZlPTYzODg3NzgwMzE0NzM1MTMxMQ==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "9d9ddd5a-3274-4a76-bb08-7d157cd1069b"}, "CallConnected": {"id": "ba5a81c3-672b-468d-9159-330f70809d74", "source": "calling/callConnections/20006180-5012-4411-80e3-05ced02211ed", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "20006180-5012-4411-80e3-05ced02211ed", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9lbENwRldBOTFVQ0xEcVN3Y0swWjVBP2k9MTAtNjAtMTQ2LTIwMSZlPTYzODg3NzgwMzE0NzM1MTMxMQ==", "correlationId": "9d9ddd5a-3274-4a76-bb08-7d157cd1069b", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:00:33.3260762+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-5012-4411-80e3-05ced02211ed"}, "ParticipantsUpdated": {"id": "fa3dc403-56ae-4998-a7b8-95d864f958de", "source": "calling/callConnections/20006180-5012-4411-80e3-05ced02211ed", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e736-c3f7-3a3a0d00707a", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e736-c3f7-3a3a0d00707a"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e77e-c3f7-3a3a0d00707c", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b069-e77e-c3f7-3a3a0d00707c"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 3, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "20006180-5012-4411-80e3-05ced02211ed", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9lbENwRldBOTFVQ0xEcVN3Y0swWjVBP2k9MTAtNjAtMTQ2LTIwMSZlPTYzODg3NzgwMzE0NzM1MTMxMQ==", "correlationId": "9d9ddd5a-3274-4a76-bb08-7d157cd1069b", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:00:33.5755764+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-5012-4411-80e3-05ced02211ed"}, "CallDisconnected": {"id": "afdc2ad3-87da-4277-95cd-f1f83ffbf167", "source": "calling/callConnections/20006180-b972-408a-b607-38742815ded7", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "20006180-b972-408a-b607-38742815ded7", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9lbENwRldBOTFVQ0xEcVN3Y0swWjVBP2k9MTAtNjAtMTQ2LTIwMSZlPTYzODg3NzgwMzE0NzM1MTMxMQ==", "correlationId": "9d9ddd5a-3274-4a76-bb08-7d157cd1069b", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:00:36.0691472+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-b972-408a-b607-38742815ded7"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_start_recording_with_call_connection_id_async.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_start_recording_with_call_connection_id_async.event.json new file mode 100644 index 000000000000..f1d9c74b8d4d --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_start_recording_with_call_connection_id_async.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-23ba-c3f7-3a3a0d007083", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-23ba-c3f7-3a3a0d007083"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-236a-c3f7-3a3a0d007082", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-236a-c3f7-3a3a0d007082"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "b0551679-64cb-4d69-8121-d630b56c073c"}, "CallConnected": {"id": "e58b9d13-0c6f-407d-8bab-2434d3384262", "source": "calling/callConnections/20006180-533e-4751-9e42-42e38083dbe1", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "20006180-533e-4751-9e42-42e38083dbe1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1", "correlationId": "b0551679-64cb-4d69-8121-d630b56c073c", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:00:46.1667003+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-533e-4751-9e42-42e38083dbe1"}, "ParticipantsUpdated": {"id": "98a4018b-b8bb-4e11-9c53-e055de8345dc", "source": "calling/callConnections/20006180-533e-4751-9e42-42e38083dbe1", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-23ba-c3f7-3a3a0d007083", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-23ba-c3f7-3a3a0d007083"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-236a-c3f7-3a3a0d007082", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-236a-c3f7-3a3a0d007082"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 13, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "20006180-533e-4751-9e42-42e38083dbe1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1", "correlationId": "b0551679-64cb-4d69-8121-d630b56c073c", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:00:53.7179498+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-533e-4751-9e42-42e38083dbe1"}, "RecordingStateChanged": {"id": "fe7d6062-be1a-4e6e-8936-3feda3d6ce8d", "source": "calling/recordings/aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyMDAwNjE4MC01MzNlLTQ3NTEtOWU0Mi00MmUzODA4M2RiZTEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJkNzE3MGM5NS1lODUzLTRlN2MtYjE4OC05OTZjZGM5NzI5YTUifQ/RecordingStateChanged", "type": "Microsoft.Communication.RecordingStateChanged", "data": {"recordingId": "eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyMDAwNjE4MC01MzNlLTQ3NTEtOWU0Mi00MmUzODA4M2RiZTEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJkNzE3MGM5NS1lODUzLTRlN2MtYjE4OC05OTZjZGM5NzI5YTUifQ", "state": "active", "startDateTime": "2025-07-16T00:00:51.2245014+00:00", "recordingKind": "azureCommunicationServices", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "20006180-533e-4751-9e42-42e38083dbe1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1", "correlationId": "b0551679-64cb-4d69-8121-d630b56c073c", "publicEventType": "Microsoft.Communication.RecordingStateChanged"}, "time": "2025-07-16T00:00:51.4910047+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/recordings/aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyMDAwNjE4MC01MzNlLTQ3NTEtOWU0Mi00MmUzODA4M2RiZTEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJkNzE3MGM5NS1lODUzLTRlN2MtYjE4OC05OTZjZGM5NzI5YTUifQ/RecordingStateChanged"}, "CallDisconnected": {"id": "66de10dc-3b09-4f21-bae7-772561010350", "source": "calling/callConnections/20006180-533e-4751-9e42-42e38083dbe1", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "20006180-533e-4751-9e42-42e38083dbe1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80ZVNpTER1MUxrcTJhUi1rOGhxTE9nP2k9MTAtNjAtMTYwLTIzJmU9NjM4ODc3ODAxNjM0NzQ4MjA1", "correlationId": "b0551679-64cb-4d69-8121-d630b56c073c", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:00:56.5228086+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-533e-4751-9e42-42e38083dbe1"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_start_recording_with_server_call_id_async.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_start_recording_with_server_call_id_async.event.json new file mode 100644 index 000000000000..baaa44c3fecc --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_callautomation_client_async.pyTestCallAutomationClientAutomatedLiveTestAsynctest_start_recording_with_server_call_id_async.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-92c7-c3f7-3a3a0d00708c", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-92c7-c3f7-3a3a0d00708c"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-9284-c3f7-3a3a0d00708b", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-9284-c3f7-3a3a0d00708b"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "bfc2130a-8d48-489b-aa37-83791ea80790"}, "CallConnected": {"id": "915b9ed1-ef53-413c-a3c2-7e825ba2cc1e", "source": "calling/callConnections/20006180-3ce2-427c-9073-60ad1b1d436f", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "20006180-3ce2-427c-9073-60ad1b1d436f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx", "correlationId": "bfc2130a-8d48-489b-aa37-83791ea80790", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:01:13.7285799+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3ce2-427c-9073-60ad1b1d436f"}, "ParticipantsUpdated": {"id": "a0fb9906-768c-49f8-8f4f-ea25ba3ffba4", "source": "calling/callConnections/20006180-3ce2-427c-9073-60ad1b1d436f", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-92c7-c3f7-3a3a0d00708c", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-92c7-c3f7-3a3a0d00708c"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-9284-c3f7-3a3a0d00708b", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b06a-9284-c3f7-3a3a0d00708b"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 11, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "20006180-3ce2-427c-9073-60ad1b1d436f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx", "correlationId": "bfc2130a-8d48-489b-aa37-83791ea80790", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:01:24.5064316+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3ce2-427c-9073-60ad1b1d436f"}, "RecordingStateChanged": {"id": "522031fb-eb84-4a71-ac3f-df21e25ad8ac", "source": "calling/recordings/aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyMDAwNjE4MC1lMzViLTQ1M2ItYjJjNC01N2UwZmRiZjVhNzciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJkYjA5NzY5OC1hZTMxLTQ0ZGYtOWM2Mi03NWUzM2FlM2E3NDAifQ/RecordingStateChanged", "type": "Microsoft.Communication.RecordingStateChanged", "data": {"recordingId": "eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyMDAwNjE4MC1lMzViLTQ1M2ItYjJjNC01N2UwZmRiZjVhNzciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJkYjA5NzY5OC1hZTMxLTQ0ZGYtOWM2Mi03NWUzM2FlM2E3NDAifQ", "state": "active", "startDateTime": "2025-07-16T00:01:19.0722945+00:00", "recordingKind": "azureCommunicationServices", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "20006180-e35b-453b-b2c4-57e0fdbf5a77", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx", "correlationId": "bfc2130a-8d48-489b-aa37-83791ea80790", "publicEventType": "Microsoft.Communication.RecordingStateChanged"}, "time": "2025-07-16T00:01:19.5434496+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/recordings/aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyMDAwNjE4MC1lMzViLTQ1M2ItYjJjNC01N2UwZmRiZjVhNzciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJkYjA5NzY5OC1hZTMxLTQ0ZGYtOWM2Mi03NWUzM2FlM2E3NDAifQ/RecordingStateChanged"}, "CallDisconnected": {"id": "4a838679-449b-4c6e-a38f-b5207bbff97f", "source": "calling/callConnections/20006180-3ce2-427c-9073-60ad1b1d436f", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "20006180-3ce2-427c-9073-60ad1b1d436f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9EM2t3M0czN29VdWZ3YWNfNHdvTWdnP2k9MTAtNjAtMTUxLTM4JmU9NjM4ODc2OTQxNjcwNzQzMzUx", "correlationId": "bfc2130a-8d48-489b-aa37-83791ea80790", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:01:27.9031242+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/20006180-3ce2-427c-9073-60ad1b1d436f"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_combined_file_and_text_sources_with_play_media.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_combined_file_and_text_sources_with_play_media.event.json new file mode 100644 index 000000000000..09f91a2dc788 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_combined_file_and_text_sources_with_play_media.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0260-ce48-04bd45607199", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0260-ce48-04bd45607199"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0206-ce48-04bd45607198", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0206-ce48-04bd45607198"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9nZFhZV2pGak1reU9sRjJiNDd5MjJnP2k9MTAtMTI4LTE1Ni0yMzUmZT02Mzg4ODEyNDgyNTczNTEzOTc=", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "fe5e9810-c48b-4c60-9e1a-262e196492c0"}, "CallConnected": {"id": "b5efc008-7395-47bc-9f9b-b7e1719a0117", "source": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-3891-40a2-ab77-0a5b25a31827", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9nZFhZV2pGak1reU9sRjJiNDd5MjJnP2k9MTAtMTI4LTE1Ni0yMzUmZT02Mzg4ODEyNDgyNTczNTEzOTc=", "correlationId": "fe5e9810-c48b-4c60-9e1a-262e196492c0", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:23:32.9871774+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827"}, "ParticipantsUpdated": {"id": "8ff46cb6-0319-43e8-86c3-b562d799e688", "source": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0206-ce48-04bd45607198", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0206-ce48-04bd45607198"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0260-ce48-04bd45607199", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-0260-ce48-04bd45607199"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 5, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-3891-40a2-ab77-0a5b25a31827", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9nZFhZV2pGak1reU9sRjJiNDd5MjJnP2k9MTAtMTI4LTE1Ni0yMzUmZT02Mzg4ODEyNDgyNTczNTEzOTc=", "correlationId": "fe5e9810-c48b-4c60-9e1a-262e196492c0", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:23:44.193449+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827"}, "PlayStarted": {"id": "353467d2-c990-4751-9ba5-c27aa4a0a825", "source": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-3891-40a2-ab77-0a5b25a31827", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9nZFhZV2pGak1reU9sRjJiNDd5MjJnP2k9MTAtMTI4LTE1Ni0yMzUmZT02Mzg4ODEyNDgyNTczNTEzOTc=", "correlationId": "fe5e9810-c48b-4c60-9e1a-262e196492c0", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:23:37.7685713+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827"}, "PlayCompleted": {"id": "bd9c9d0a-e24b-4424-b987-1245903f432d", "source": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-3891-40a2-ab77-0a5b25a31827", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9nZFhZV2pGak1reU9sRjJiNDd5MjJnP2k9MTAtMTI4LTE1Ni0yMzUmZT02Mzg4ODEyNDgyNTczNTEzOTc=", "correlationId": "fe5e9810-c48b-4c60-9e1a-262e196492c0", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:23:44.1446167+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827"}, "CallDisconnected": {"id": "85f5e67a-51eb-4760-b955-72d4d02f1336", "source": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-3891-40a2-ab77-0a5b25a31827", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9nZFhZV2pGak1reU9sRjJiNDd5MjJnP2k9MTAtMTI4LTE1Ni0yMzUmZT02Mzg4ODEyNDgyNTczNTEzOTc=", "correlationId": "fe5e9810-c48b-4c60-9e1a-262e196492c0", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:23:44.6353753+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-3891-40a2-ab77-0a5b25a31827"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_combined_file_and_text_sources_with_play_media_all.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_combined_file_and_text_sources_with_play_media_all.event.json new file mode 100644 index 000000000000..7517547aa89a --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_combined_file_and_text_sources_with_play_media_all.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-55a7-ce48-04bd4560719e", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-55a7-ce48-04bd4560719e"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-555f-ce48-04bd4560719d", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-555f-ce48-04bd4560719d"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80YVd0clFvRmtFR0tRRjRxOWtaSkpnP2k9MTAtNjAtMTA5LTEzNyZlPTYzODg3Njk0MTIxMjk2MTQ5MQ==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "6e3198e3-ad9c-486c-9ed7-5913794cbe86"}, "CallConnected": {"id": "00aebe2d-091b-4e25-ae52-8e7e022030dd", "source": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-41a8-4a20-904a-760ff80c1ee9", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80YVd0clFvRmtFR0tRRjRxOWtaSkpnP2k9MTAtNjAtMTA5LTEzNyZlPTYzODg3Njk0MTIxMjk2MTQ5MQ==", "correlationId": "6e3198e3-ad9c-486c-9ed7-5913794cbe86", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:23:54.112382+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9"}, "ParticipantsUpdated": {"id": "6747cf4b-5ab2-4bb7-a088-0a94ca7dcdf1", "source": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-55a7-ce48-04bd4560719e", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-55a7-ce48-04bd4560719e"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-555f-ce48-04bd4560719d", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-555f-ce48-04bd4560719d"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-41a8-4a20-904a-760ff80c1ee9", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80YVd0clFvRmtFR0tRRjRxOWtaSkpnP2k9MTAtNjAtMTA5LTEzNyZlPTYzODg3Njk0MTIxMjk2MTQ5MQ==", "correlationId": "6e3198e3-ad9c-486c-9ed7-5913794cbe86", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:23:54.2183828+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9"}, "PlayStarted": {"id": "ed5df3f1-aba2-4e40-a8f0-c15aefeacfeb", "source": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-41a8-4a20-904a-760ff80c1ee9", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80YVd0clFvRmtFR0tRRjRxOWtaSkpnP2k9MTAtNjAtMTA5LTEzNyZlPTYzODg3Njk0MTIxMjk2MTQ5MQ==", "correlationId": "6e3198e3-ad9c-486c-9ed7-5913794cbe86", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:23:56.0470685+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9"}, "PlayCompleted": {"id": "21d2af1c-c930-40ea-9915-d3de3054ba4f", "source": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-41a8-4a20-904a-760ff80c1ee9", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80YVd0clFvRmtFR0tRRjRxOWtaSkpnP2k9MTAtNjAtMTA5LTEzNyZlPTYzODg3Njk0MTIxMjk2MTQ5MQ==", "correlationId": "6e3198e3-ad9c-486c-9ed7-5913794cbe86", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:24:02.3369754+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9"}, "CallDisconnected": {"id": "b439860a-8d5e-490b-a85c-2afc73258d03", "source": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-41a8-4a20-904a-760ff80c1ee9", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80YVd0clFvRmtFR0tRRjRxOWtaSkpnP2k9MTAtNjAtMTA5LTEzNyZlPTYzODg3Njk0MTIxMjk2MTQ5MQ==", "correlationId": "6e3198e3-ad9c-486c-9ed7-5913794cbe86", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:24:03.0558373+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-41a8-4a20-904a-760ff80c1ee9"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_media_in_a_call.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_media_in_a_call.event.json new file mode 100644 index 000000000000..b2c0ef535a0d --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_media_in_a_call.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e4b5-ce48-04bd45607168", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e4b5-ce48-04bd45607168"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e463-ce48-04bd45607167", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e463-ce48-04bd45607167"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80el8tTFA1UHIwcS1NZ25nU0sybFJRP2k9MTAtMTI4LTkzLTIwNiZlPTYzODg4MTI0NjEwOTQwNTg5Mw==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "6be907d2-d32a-482c-afb4-e1143969eb26"}, "CallConnected": {"id": "3fca5127-8a69-4cab-89b7-f32807f8cc5d", "source": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "00006180-6050-483c-8d12-6ecd712cda1b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80el8tTFA1UHIwcS1NZ25nU0sybFJRP2k9MTAtMTI4LTkzLTIwNiZlPTYzODg4MTI0NjEwOTQwNTg5Mw==", "correlationId": "6be907d2-d32a-482c-afb4-e1143969eb26", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:20:09.7664204+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b"}, "ParticipantsUpdated": {"id": "cca2f992-da72-44be-b60b-668522825e56", "source": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e4b5-ce48-04bd45607168", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e4b5-ce48-04bd45607168"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e463-ce48-04bd45607167", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07b-e463-ce48-04bd45607167"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "00006180-6050-483c-8d12-6ecd712cda1b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80el8tTFA1UHIwcS1NZ25nU0sybFJRP2k9MTAtMTI4LTkzLTIwNiZlPTYzODg4MTI0NjEwOTQwNTg5Mw==", "correlationId": "6be907d2-d32a-482c-afb4-e1143969eb26", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:20:09.8928464+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b"}, "PlayStarted": {"id": "48d3a061-faf0-4f23-817b-b3594b0ab99d", "source": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "00006180-6050-483c-8d12-6ecd712cda1b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80el8tTFA1UHIwcS1NZ25nU0sybFJRP2k9MTAtMTI4LTkzLTIwNiZlPTYzODg4MTI0NjEwOTQwNTg5Mw==", "correlationId": "6be907d2-d32a-482c-afb4-e1143969eb26", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:20:12.1757959+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b"}, "PlayCompleted": {"id": "a08cfc4a-6a3a-4e75-b01a-d1387cb8c591", "source": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "00006180-6050-483c-8d12-6ecd712cda1b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80el8tTFA1UHIwcS1NZ25nU0sybFJRP2k9MTAtMTI4LTkzLTIwNiZlPTYzODg4MTI0NjEwOTQwNTg5Mw==", "correlationId": "6be907d2-d32a-482c-afb4-e1143969eb26", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:20:16.3681371+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b"}, "CallDisconnected": {"id": "fc427fe3-597d-483a-94c0-dc658a84de9b", "source": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "00006180-6050-483c-8d12-6ecd712cda1b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi80el8tTFA1UHIwcS1NZ25nU0sybFJRP2k9MTAtMTI4LTkzLTIwNiZlPTYzODg4MTI0NjEwOTQwNTg5Mw==", "correlationId": "6be907d2-d32a-482c-afb4-e1143969eb26", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:20:17.8970254+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/00006180-6050-483c-8d12-6ecd712cda1b"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_operationcallbackurl_with_play_media.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_operationcallbackurl_with_play_media.event.json new file mode 100644 index 000000000000..ad4d05986950 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_operationcallbackurl_with_play_media.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f0e5-ce48-04bd45607186", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f0e5-ce48-04bd45607186"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f086-ce48-04bd45607185", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f086-ce48-04bd45607185"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Qek5aRGljTHVVZUkzRkJMaUwyT0h3P2k9MTAtNjAtMTQ2LTkwJmU9NjM4ODc3ODAxNTcyMDU3Mzkw", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "cbde54b7-51ac-4e94-84a6-aead03531f16"}, "ParticipantsUpdated": {"id": "08cfaa7c-a98b-493d-8689-2f0f7f1d68bf", "source": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f086-ce48-04bd45607185", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f086-ce48-04bd45607185"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f0e5-ce48-04bd45607186", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-f0e5-ce48-04bd45607186"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 5, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-036c-4be2-aab9-6425328bcc07", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Qek5aRGljTHVVZUkzRkJMaUwyT0h3P2k9MTAtNjAtMTQ2LTkwJmU9NjM4ODc3ODAxNTcyMDU3Mzkw", "correlationId": "cbde54b7-51ac-4e94-84a6-aead03531f16", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:22:40.9043769+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07"}, "CallConnected": {"id": "6bea8478-b50d-4a79-befc-b30074208dcf", "source": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-036c-4be2-aab9-6425328bcc07", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Qek5aRGljTHVVZUkzRkJMaUwyT0h3P2k9MTAtNjAtMTQ2LTkwJmU9NjM4ODc3ODAxNTcyMDU3Mzkw", "correlationId": "cbde54b7-51ac-4e94-84a6-aead03531f16", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:22:22.6962177+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07"}, "PlayStarted": {"id": "b261d291-1dda-44b2-9c46-82ec9ae67b93", "source": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-036c-4be2-aab9-6425328bcc07", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Qek5aRGljTHVVZUkzRkJMaUwyT0h3P2k9MTAtNjAtMTQ2LTkwJmU9NjM4ODc3ODAxNTcyMDU3Mzkw", "correlationId": "cbde54b7-51ac-4e94-84a6-aead03531f16", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:22:27.9888709+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07"}, "PlayCompleted": {"id": "63d22360-a9b0-4754-826a-75fe7fdf9931", "source": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-036c-4be2-aab9-6425328bcc07", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Qek5aRGljTHVVZUkzRkJMaUwyT0h3P2k9MTAtNjAtMTQ2LTkwJmU9NjM4ODc3ODAxNTcyMDU3Mzkw", "correlationId": "cbde54b7-51ac-4e94-84a6-aead03531f16", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:22:40.8706406+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07"}, "CallDisconnected": {"id": "92489bd8-d235-446d-8ff8-d1cb5a0e2b22", "source": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-036c-4be2-aab9-6425328bcc07", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9Qek5aRGljTHVVZUkzRkJMaUwyT0h3P2k9MTAtNjAtMTQ2LTkwJmU9NjM4ODc3ODAxNTcyMDU3Mzkw", "correlationId": "cbde54b7-51ac-4e94-84a6-aead03531f16", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:22:41.870263+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-036c-4be2-aab9-6425328bcc07"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_operationcallbackurl_with_play_media_all.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_operationcallbackurl_with_play_media_all.event.json new file mode 100644 index 000000000000..e668ffd50bee --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_operationcallbackurl_with_play_media_all.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-91d8-ce48-04bd45607182", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-91d8-ce48-04bd45607182"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-918d-ce48-04bd45607181", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-918d-ce48-04bd45607181"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi84NWhvWkJleWNrbWMzNzhab0VNMUF3P2k9MTAtMTI4LTExNS0yNDUmZT02Mzg4ODIxNjY0OTI1ODAxMjE=", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "57f6dda1-2b9f-48b2-8aef-ab7520c62674"}, "CallConnected": {"id": "b22464de-4219-4c4c-bdac-49831b7bd790", "source": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-bb13-48f5-8fab-0cda9e09748f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi84NWhvWkJleWNrbWMzNzhab0VNMUF3P2k9MTAtMTI4LTExNS0yNDUmZT02Mzg4ODIxNjY0OTI1ODAxMjE=", "correlationId": "57f6dda1-2b9f-48b2-8aef-ab7520c62674", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:21:58.3149026+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f"}, "ParticipantsUpdated": {"id": "d6898891-ad3a-467a-b6ce-47d289d5d421", "source": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-91d8-ce48-04bd45607182", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-91d8-ce48-04bd45607182"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-918d-ce48-04bd45607181", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-918d-ce48-04bd45607181"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-bb13-48f5-8fab-0cda9e09748f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi84NWhvWkJleWNrbWMzNzhab0VNMUF3P2k9MTAtMTI4LTExNS0yNDUmZT02Mzg4ODIxNjY0OTI1ODAxMjE=", "correlationId": "57f6dda1-2b9f-48b2-8aef-ab7520c62674", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:21:58.3286538+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f"}, "PlayStarted": {"id": "0e602fe4-1ba1-4f25-925e-0d88788ba055", "source": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-bb13-48f5-8fab-0cda9e09748f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi84NWhvWkJleWNrbWMzNzhab0VNMUF3P2k9MTAtMTI4LTExNS0yNDUmZT02Mzg4ODIxNjY0OTI1ODAxMjE=", "correlationId": "57f6dda1-2b9f-48b2-8aef-ab7520c62674", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:22:00.0521749+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f"}, "PlayCompleted": {"id": "68bc8db6-e6e9-4466-81a0-b56c90f83f0f", "source": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-bb13-48f5-8fab-0cda9e09748f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi84NWhvWkJleWNrbWMzNzhab0VNMUF3P2k9MTAtMTI4LTExNS0yNDUmZT02Mzg4ODIxNjY0OTI1ODAxMjE=", "correlationId": "57f6dda1-2b9f-48b2-8aef-ab7520c62674", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:22:12.8511983+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f"}, "CallDisconnected": {"id": "cc40327f-03b2-46be-850d-0bd90a2fac69", "source": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-bb13-48f5-8fab-0cda9e09748f", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi84NWhvWkJleWNrbWMzNzhab0VNMUF3P2k9MTAtMTI4LTExNS0yNDUmZT02Mzg4ODIxNjY0OTI1ODAxMjE=", "correlationId": "57f6dda1-2b9f-48b2-8aef-ab7520c62674", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:22:14.3780111+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-bb13-48f5-8fab-0cda9e09748f"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_play_media.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_play_media.event.json new file mode 100644 index 000000000000..4c4a8884fbc9 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_play_media.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2674-ce48-04bd4560717b", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2674-ce48-04bd4560717b"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2625-ce48-04bd4560717a", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2625-ce48-04bd4560717a"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9HUkpWMDVTS1JrUzFhdnB2cGxUOVZRP2k9MTAtMTI4LTEyNC01MyZlPTYzODg4MTI0ODE0MzIzNDYzMg==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "912f7e70-88f2-416d-9419-df04248e08b9"}, "ParticipantsUpdated": {"id": "97acc2f4-3776-4d72-9b7e-a1c24df20318", "source": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2625-ce48-04bd4560717a", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2625-ce48-04bd4560717a"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2674-ce48-04bd4560717b", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07d-2674-ce48-04bd4560717b"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 5, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-ecb2-4bfd-9c10-26811702f389", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9HUkpWMDVTS1JrUzFhdnB2cGxUOVZRP2k9MTAtMTI4LTEyNC01MyZlPTYzODg4MTI0ODE0MzIzNDYzMg==", "correlationId": "912f7e70-88f2-416d-9419-df04248e08b9", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:21:47.6419601+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389"}, "CallConnected": {"id": "48e64d4a-ea4d-4ec3-91ac-b0122fb4c8e9", "source": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-ecb2-4bfd-9c10-26811702f389", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9HUkpWMDVTS1JrUzFhdnB2cGxUOVZRP2k9MTAtMTI4LTEyNC01MyZlPTYzODg4MTI0ODE0MzIzNDYzMg==", "correlationId": "912f7e70-88f2-416d-9419-df04248e08b9", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:21:30.8602633+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389"}, "PlayStarted": {"id": "f15653f9-a5c9-482e-bb88-5f080a6fbc7e", "source": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-ecb2-4bfd-9c10-26811702f389", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9HUkpWMDVTS1JrUzFhdnB2cGxUOVZRP2k9MTAtMTI4LTEyNC01MyZlPTYzODg4MTI0ODE0MzIzNDYzMg==", "correlationId": "912f7e70-88f2-416d-9419-df04248e08b9", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:21:34.7141521+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389"}, "PlayCompleted": {"id": "85bb997e-503b-4e29-aea9-351f2ab6c2d0", "source": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-ecb2-4bfd-9c10-26811702f389", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9HUkpWMDVTS1JrUzFhdnB2cGxUOVZRP2k9MTAtMTI4LTEyNC01MyZlPTYzODg4MTI0ODE0MzIzNDYzMg==", "correlationId": "912f7e70-88f2-416d-9419-df04248e08b9", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:21:47.598872+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389"}, "CallDisconnected": {"id": "bd115d5e-1d33-4b64-bcea-79c90ac36077", "source": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-ecb2-4bfd-9c10-26811702f389", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9HUkpWMDVTS1JrUzFhdnB2cGxUOVZRP2k9MTAtMTI4LTEyNC01MyZlPTYzODg4MTI0ODE0MzIzNDYzMg==", "correlationId": "912f7e70-88f2-416d-9419-df04248e08b9", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:21:48.5722172+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-ecb2-4bfd-9c10-26811702f389"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_play_media_all.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_play_media_all.event.json new file mode 100644 index 000000000000..86c94cd23d3d --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_file_sources_with_play_media_all.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c713-ce48-04bd45607179", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c713-ce48-04bd45607179"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c6ba-ce48-04bd45607178", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c6ba-ce48-04bd45607178"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vdGtrbU5vTUQweS1vd01BZzdNc1lRP2k9MTAtNjAtMTktNzImZT02Mzg4Nzg2NDEwOTU0ODE3NDk=", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "b6efa947-b64c-4569-bb31-4370c870bfea"}, "ParticipantsUpdated": {"id": "1c3eea52-31d8-4b59-8e51-16cb585f7f86", "source": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c713-ce48-04bd45607179", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c713-ce48-04bd45607179"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c6ba-ce48-04bd45607178", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-c6ba-ce48-04bd45607178"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-cedf-4a36-9f1b-1131a5f2439b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vdGtrbU5vTUQweS1vd01BZzdNc1lRP2k9MTAtNjAtMTktNzImZT02Mzg4Nzg2NDEwOTU0ODE3NDk=", "correlationId": "b6efa947-b64c-4569-bb31-4370c870bfea", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:21:06.3279634+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b"}, "CallConnected": {"id": "911c2f0e-5223-45dc-b2f6-0e297319cece", "source": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-cedf-4a36-9f1b-1131a5f2439b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vdGtrbU5vTUQweS1vd01BZzdNc1lRP2k9MTAtNjAtMTktNzImZT02Mzg4Nzg2NDEwOTU0ODE3NDk=", "correlationId": "b6efa947-b64c-4569-bb31-4370c870bfea", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:21:06.3437503+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b"}, "PlayStarted": {"id": "e1c7f973-0c8b-4dc6-96f9-97ff2d8e3264", "source": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-cedf-4a36-9f1b-1131a5f2439b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vdGtrbU5vTUQweS1vd01BZzdNc1lRP2k9MTAtNjAtMTktNzImZT02Mzg4Nzg2NDEwOTU0ODE3NDk=", "correlationId": "b6efa947-b64c-4569-bb31-4370c870bfea", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:21:08.5486435+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b"}, "PlayCompleted": {"id": "1cefbdea-2971-4c24-b78e-9770d0d4d541", "source": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-cedf-4a36-9f1b-1131a5f2439b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vdGtrbU5vTUQweS1vd01BZzdNc1lRP2k9MTAtNjAtMTktNzImZT02Mzg4Nzg2NDEwOTU0ODE3NDk=", "correlationId": "b6efa947-b64c-4569-bb31-4370c870bfea", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:21:21.3295613+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b"}, "CallDisconnected": {"id": "91dcd0c5-4428-4358-a909-6f86ce651543", "source": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-cedf-4a36-9f1b-1131a5f2439b", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9vdGtrbU5vTUQweS1vd01BZzdNc1lRP2k9MTAtNjAtMTktNzImZT02Mzg4Nzg2NDEwOTU0ODE3NDk=", "correlationId": "b6efa947-b64c-4569-bb31-4370c870bfea", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:21:22.3847706+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-cedf-4a36-9f1b-1131a5f2439b"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_text_sources_with_play_media.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_text_sources_with_play_media.event.json new file mode 100644 index 000000000000..1751984909a9 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_text_sources_with_play_media.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-616a-ce48-04bd4560718d", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-616a-ce48-04bd4560718d"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-60ca-ce48-04bd4560718c", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-60ca-ce48-04bd4560718c"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9TWGQtazY5TTFrT1ZRVDlkRDE5UVRnP2k9MTAtNjAtMTYwLTEzNSZlPTYzODg3Njk0MjAyOTE4NDEwNg==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "cbf2ac5d-0979-4478-b57e-e7fc02f0ac02"}, "CallConnected": {"id": "3d6c59a7-2fab-481f-94a3-80db4f423616", "source": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-2913-4f85-94e3-6372801a9e89", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9TWGQtazY5TTFrT1ZRVDlkRDE5UVRnP2k9MTAtNjAtMTYwLTEzNSZlPTYzODg3Njk0MjAyOTE4NDEwNg==", "correlationId": "cbf2ac5d-0979-4478-b57e-e7fc02f0ac02", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:22:51.3525111+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89"}, "ParticipantsUpdated": {"id": "6b0b0229-6103-4380-b564-c2e2afea3834", "source": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-616a-ce48-04bd4560718d", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-616a-ce48-04bd4560718d"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-60ca-ce48-04bd4560718c", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-60ca-ce48-04bd4560718c"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 5, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-2913-4f85-94e3-6372801a9e89", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9TWGQtazY5TTFrT1ZRVDlkRDE5UVRnP2k9MTAtNjAtMTYwLTEzNSZlPTYzODg3Njk0MjAyOTE4NDEwNg==", "correlationId": "cbf2ac5d-0979-4478-b57e-e7fc02f0ac02", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:23:02.790326+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89"}, "PlayStarted": {"id": "e99da631-49b8-4b38-afcf-3edb73f18bea", "source": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-2913-4f85-94e3-6372801a9e89", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9TWGQtazY5TTFrT1ZRVDlkRDE5UVRnP2k9MTAtNjAtMTYwLTEzNSZlPTYzODg3Njk0MjAyOTE4NDEwNg==", "correlationId": "cbf2ac5d-0979-4478-b57e-e7fc02f0ac02", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:22:56.0220899+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89"}, "PlayCompleted": {"id": "6567c9e0-1d3e-4574-ad8b-5a804a8b574f", "source": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-2913-4f85-94e3-6372801a9e89", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9TWGQtazY5TTFrT1ZRVDlkRDE5UVRnP2k9MTAtNjAtMTYwLTEzNSZlPTYzODg3Njk0MjAyOTE4NDEwNg==", "correlationId": "cbf2ac5d-0979-4478-b57e-e7fc02f0ac02", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:23:02.7515741+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89"}, "CallDisconnected": {"id": "68737198-2804-42f8-9ce7-5377c0160907", "source": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-2913-4f85-94e3-6372801a9e89", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9TWGQtazY5TTFrT1ZRVDlkRDE5UVRnP2k9MTAtNjAtMTYwLTEzNSZlPTYzODg3Njk0MjAyOTE4NDEwNg==", "correlationId": "cbf2ac5d-0979-4478-b57e-e7fc02f0ac02", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:23:03.4488304+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-2913-4f85-94e3-6372801a9e89"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_text_sources_with_play_media_all.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_text_sources_with_play_media_all.event.json new file mode 100644 index 000000000000..5d900489ac41 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_multiple_text_sources_with_play_media_all.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b6c4-ce48-04bd45607193", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b6c4-ce48-04bd45607193"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b65e-ce48-04bd45607192", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b65e-ce48-04bd45607192"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94SnR2Nmk3eExFR2hHam1mMHBFWU5nP2k9MTAtNjAtMTctMjI5JmU9NjM4ODc4NjM1MjE1MTcxNTk4", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "1f804854-c414-4e83-8aad-ec0261f0f450"}, "CallConnected": {"id": "181b8029-d484-4735-9091-6d9df4975b2b", "source": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-7248-4bd7-987d-d9545063d2fb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94SnR2Nmk3eExFR2hHam1mMHBFWU5nP2k9MTAtNjAtMTctMjI5JmU9NjM4ODc4NjM1MjE1MTcxNTk4", "correlationId": "1f804854-c414-4e83-8aad-ec0261f0f450", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:23:13.5399108+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb"}, "ParticipantsUpdated": {"id": "a3438381-1f5d-4f99-bbf9-8af8a3efa235", "source": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b6c4-ce48-04bd45607193", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b6c4-ce48-04bd45607193"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b65e-ce48-04bd45607192", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07e-b65e-ce48-04bd45607192"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-7248-4bd7-987d-d9545063d2fb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94SnR2Nmk3eExFR2hHam1mMHBFWU5nP2k9MTAtNjAtMTctMjI5JmU9NjM4ODc4NjM1MjE1MTcxNTk4", "correlationId": "1f804854-c414-4e83-8aad-ec0261f0f450", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:23:13.6346992+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb"}, "PlayStarted": {"id": "2df0553a-94f3-41af-b582-258a99a9d221", "source": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-7248-4bd7-987d-d9545063d2fb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94SnR2Nmk3eExFR2hHam1mMHBFWU5nP2k9MTAtNjAtMTctMjI5JmU9NjM4ODc4NjM1MjE1MTcxNTk4", "correlationId": "1f804854-c414-4e83-8aad-ec0261f0f450", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:23:16.9633836+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb"}, "PlayCompleted": {"id": "1a7a8250-1832-4594-af4e-297f82179dca", "source": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb", "type": "Microsoft.Communication.PlayCompleted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-7248-4bd7-987d-d9545063d2fb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94SnR2Nmk3eExFR2hHam1mMHBFWU5nP2k9MTAtNjAtMTctMjI5JmU9NjM4ODc4NjM1MjE1MTcxNTk4", "correlationId": "1f804854-c414-4e83-8aad-ec0261f0f450", "publicEventType": "Microsoft.Communication.PlayCompleted"}, "time": "2025-07-16T00:23:23.5262642+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb"}, "CallDisconnected": {"id": "3fbe1021-c87c-4bfb-ba8c-3199f2f159d6", "source": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-7248-4bd7-987d-d9545063d2fb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94SnR2Nmk3eExFR2hHam1mMHBFWU5nP2k9MTAtNjAtMTctMjI5JmU9NjM4ODc4NjM1MjE1MTcxNTk4", "correlationId": "1f804854-c414-4e83-8aad-ec0261f0f450", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:23:24.4152925+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-7248-4bd7-987d-d9545063d2fb"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_and_valid_file_sources_with_play_media.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_and_valid_file_sources_with_play_media.event.json new file mode 100644 index 000000000000..a889314a9db5 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_and_valid_file_sources_with_play_media.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-495a-f6c7-593a0d007b6a", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-495a-f6c7-593a0d007b6a"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-486d-f6c7-593a0d007b69", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-486d-f6c7-593a0d007b69"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9maFZvMUF3UnZrRzI0MUdGTlpsemFnP2k9MTAtNjAtMTA2LTIyOSZlPTYzODg3NjkzOTMwNzIwMzA4Nw==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "0497d718-524e-43df-87b5-75f76acd1461"}, "CallConnected": {"id": "bfb84daf-8724-448e-bd4e-301b14436b30", "source": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "36006480-ab55-4f38-94f4-d0631e1336d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9maFZvMUF3UnZrRzI0MUdGTlpsemFnP2k9MTAtNjAtMTA2LTIyOSZlPTYzODg3NjkzOTMwNzIwMzA4Nw==", "correlationId": "0497d718-524e-43df-87b5-75f76acd1461", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:24:56.5513589+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5"}, "ParticipantsUpdated": {"id": "e3c050ee-9877-4942-8e64-db5a415dc479", "source": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-486d-f6c7-593a0d007b69", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-486d-f6c7-593a0d007b69"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-495a-f6c7-593a0d007b6a", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-495a-f6c7-593a0d007b6a"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 5, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "36006480-ab55-4f38-94f4-d0631e1336d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9maFZvMUF3UnZrRzI0MUdGTlpsemFnP2k9MTAtNjAtMTA2LTIyOSZlPTYzODg3NjkzOTMwNzIwMzA4Nw==", "correlationId": "0497d718-524e-43df-87b5-75f76acd1461", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:25:05.6460019+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5"}, "PlayStarted": {"id": "7d7a774f-2aa6-4fe8-8b57-ec65d7809879", "source": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "36006480-ab55-4f38-94f4-d0631e1336d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9maFZvMUF3UnZrRzI0MUdGTlpsemFnP2k9MTAtNjAtMTA2LTIyOSZlPTYzODg3NjkzOTMwNzIwMzA4Nw==", "correlationId": "0497d718-524e-43df-87b5-75f76acd1461", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:25:01.2001601+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5"}, "PlayFailed": {"id": "39666584-aec5-441a-b511-e169bdf103a8", "source": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5", "type": "Microsoft.Communication.PlayFailed", "data": {"failedPlaySourceIndex": 1, "version": "2025-06-15", "resultInformation": {"code": 400, "subCode": 8535, "message": "Action failed, file format is invalid."}, "callConnectionId": "36006480-ab55-4f38-94f4-d0631e1336d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9maFZvMUF3UnZrRzI0MUdGTlpsemFnP2k9MTAtNjAtMTA2LTIyOSZlPTYzODg3NjkzOTMwNzIwMzA4Nw==", "correlationId": "0497d718-524e-43df-87b5-75f76acd1461", "publicEventType": "Microsoft.Communication.PlayFailed"}, "time": "2025-07-16T00:25:05.5905105+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5"}, "CallDisconnected": {"id": "417f4da8-8293-4802-b1b2-662157cc6ed0", "source": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "36006480-ab55-4f38-94f4-d0631e1336d5", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9maFZvMUF3UnZrRzI0MUdGTlpsemFnP2k9MTAtNjAtMTA2LTIyOSZlPTYzODg3NjkzOTMwNzIwMzA4Nw==", "correlationId": "0497d718-524e-43df-87b5-75f76acd1461", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:25:06.061562+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-ab55-4f38-94f4-d0631e1336d5"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_and_valid_file_sources_with_play_media_all.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_and_valid_file_sources_with_play_media_all.event.json new file mode 100644 index 000000000000..41f14ff3c684 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_and_valid_file_sources_with_play_media_all.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb8c-f6c7-593a0d007b62", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb8c-f6c7-593a0d007b62"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb40-f6c7-593a0d007b61", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb40-f6c7-593a0d007b61"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9KMVNNNVA0OElrYWw5eU9vb09xT3lBP2k9MTAtNjAtMTAxLTcmZT02Mzg4NzY5NDIzOTY3NDIwNzA=", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "65d46984-ac37-4182-8b2f-de405d2d67dd"}, "CallConnected": {"id": "bc3746db-7ef7-457a-9dd1-0c741c66c36b", "source": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "36006480-e098-4fa8-8fda-18210f6fd649", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9KMVNNNVA0OElrYWw5eU9vb09xT3lBP2k9MTAtNjAtMTAxLTcmZT02Mzg4NzY5NDIzOTY3NDIwNzA=", "correlationId": "65d46984-ac37-4182-8b2f-de405d2d67dd", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:24:24.3924128+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649"}, "ParticipantsUpdated": {"id": "384cb047-d7b6-4d5f-8844-e69b943b1e0c", "source": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb8c-f6c7-593a0d007b62", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb8c-f6c7-593a0d007b62"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb40-f6c7-593a0d007b61", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-cb40-f6c7-593a0d007b61"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "36006480-e098-4fa8-8fda-18210f6fd649", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9KMVNNNVA0OElrYWw5eU9vb09xT3lBP2k9MTAtNjAtMTAxLTcmZT02Mzg4NzY5NDIzOTY3NDIwNzA=", "correlationId": "65d46984-ac37-4182-8b2f-de405d2d67dd", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:24:24.3704845+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649"}, "PlayStarted": {"id": "52134153-1719-4593-a5a6-c59214d6ddc7", "source": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649", "type": "Microsoft.Communication.PlayStarted", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "36006480-e098-4fa8-8fda-18210f6fd649", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9KMVNNNVA0OElrYWw5eU9vb09xT3lBP2k9MTAtNjAtMTAxLTcmZT02Mzg4NzY5NDIzOTY3NDIwNzA=", "correlationId": "65d46984-ac37-4182-8b2f-de405d2d67dd", "publicEventType": "Microsoft.Communication.PlayStarted"}, "time": "2025-07-16T00:24:27.3042307+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649"}, "PlayFailed": {"id": "60eb066c-8051-424a-a889-468f47deb832", "source": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649", "type": "Microsoft.Communication.PlayFailed", "data": {"failedPlaySourceIndex": 1, "version": "2025-06-15", "resultInformation": {"code": 400, "subCode": 8535, "message": "Action failed, file format is invalid."}, "callConnectionId": "36006480-e098-4fa8-8fda-18210f6fd649", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9KMVNNNVA0OElrYWw5eU9vb09xT3lBP2k9MTAtNjAtMTAxLTcmZT02Mzg4NzY5NDIzOTY3NDIwNzA=", "correlationId": "65d46984-ac37-4182-8b2f-de405d2d67dd", "publicEventType": "Microsoft.Communication.PlayFailed"}, "time": "2025-07-16T00:24:31.5165944+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649"}, "CallDisconnected": {"id": "056aa0be-3dc5-4435-8bf4-6e658933dce9", "source": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "36006480-e098-4fa8-8fda-18210f6fd649", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9KMVNNNVA0OElrYWw5eU9vb09xT3lBP2k9MTAtNjAtMTAxLTcmZT02Mzg4NzY5NDIzOTY3NDIwNzA=", "correlationId": "65d46984-ac37-4182-8b2f-de405d2d67dd", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:24:32.2363597+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-e098-4fa8-8fda-18210f6fd649"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_file_sources_with_play_media.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_file_sources_with_play_media.event.json new file mode 100644 index 000000000000..4ca5de2bc23e --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_file_sources_with_play_media.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b97-f6c7-593a0d007b66", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b97-f6c7-593a0d007b66"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b27-f6c7-593a0d007b65", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b27-f6c7-593a0d007b65"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi82RW1YZU1FQU0wR0JwZVR5UVYyUWZRP2k9MTAtNjAtMTAxLTIzNSZlPTYzODg3NjkzODgyMjc5ODU0MA==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "91513de3-1ed5-48c8-b5e7-63451e6268d4"}, "CallConnected": {"id": "b02ab544-41f7-49c0-a324-620eb2986ac0", "source": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "36006480-4b32-4bda-8d75-613a312f0e57", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi82RW1YZU1FQU0wR0JwZVR5UVYyUWZRP2k9MTAtNjAtMTAxLTIzNSZlPTYzODg3NjkzODgyMjc5ODU0MA==", "correlationId": "91513de3-1ed5-48c8-b5e7-63451e6268d4", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:24:40.6365463+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57"}, "ParticipantsUpdated": {"id": "779519e4-9e82-419a-a8c5-a2ac4a0d5134", "source": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b27-f6c7-593a0d007b65", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b27-f6c7-593a0d007b65"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b97-f6c7-593a0d007b66", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b080-0b97-f6c7-593a0d007b66"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 5, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "36006480-4b32-4bda-8d75-613a312f0e57", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi82RW1YZU1FQU0wR0JwZVR5UVYyUWZRP2k9MTAtNjAtMTAxLTIzNSZlPTYzODg3NjkzODgyMjc5ODU0MA==", "correlationId": "91513de3-1ed5-48c8-b5e7-63451e6268d4", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:24:45.1839979+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57"}, "PlayFailed": {"id": "f92b0a2e-d221-4f4d-b5ed-a281cd1165d0", "source": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57", "type": "Microsoft.Communication.PlayFailed", "data": {"failedPlaySourceIndex": 0, "version": "2025-06-15", "resultInformation": {"code": 400, "subCode": 8535, "message": "Action failed, file format is invalid."}, "callConnectionId": "36006480-4b32-4bda-8d75-613a312f0e57", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi82RW1YZU1FQU0wR0JwZVR5UVYyUWZRP2k9MTAtNjAtMTAxLTIzNSZlPTYzODg3NjkzODgyMjc5ODU0MA==", "correlationId": "91513de3-1ed5-48c8-b5e7-63451e6268d4", "publicEventType": "Microsoft.Communication.PlayFailed"}, "time": "2025-07-16T00:24:45.1479827+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57"}, "CallDisconnected": {"id": "afba730a-64a1-48ed-bb54-153dc8338656", "source": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "36006480-4b32-4bda-8d75-613a312f0e57", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi82RW1YZU1FQU0wR0JwZVR5UVYyUWZRP2k9MTAtNjAtMTAxLTIzNSZlPTYzODg3NjkzODgyMjc5ODU0MA==", "correlationId": "91513de3-1ed5-48c8-b5e7-63451e6268d4", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:24:46.9691075+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/36006480-4b32-4bda-8d75-613a312f0e57"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_file_sources_with_play_media_all.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_file_sources_with_play_media_all.event.json new file mode 100644 index 000000000000..b0e2382cf0c7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_play_with_invalid_file_sources_with_play_media_all.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-9afb-f6c7-593a0d007b5f", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-9afb-f6c7-593a0d007b5f"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-98fc-ce48-04bd456071a0", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-98fc-ce48-04bd456071a0"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9DQ285X2JrRF9VZWRPaWpaVkxCbGF3P2k9MTAtNjAtMTA1LTU5JmU9NjM4ODc3Nzk5NjcwNjI4MjU0", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "6ffe8e5d-8e24-4d1e-897d-ba6d5c3235c6"}, "CallConnected": {"id": "803b088e-d5c5-44eb-ad6c-a2187ace9d5e", "source": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-963b-46f6-b31f-a81845e98e85", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9DQ285X2JrRF9VZWRPaWpaVkxCbGF3P2k9MTAtNjAtMTA1LTU5JmU9NjM4ODc3Nzk5NjcwNjI4MjU0", "correlationId": "6ffe8e5d-8e24-4d1e-897d-ba6d5c3235c6", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:24:12.2740437+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85"}, "ParticipantsUpdated": {"id": "cd3a2933-317d-4168-a9e2-c05dbce6c18d", "source": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-98fc-ce48-04bd456071a0", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-98fc-ce48-04bd456071a0"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-9afb-f6c7-593a0d007b5f", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07f-9afb-f6c7-593a0d007b5f"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-963b-46f6-b31f-a81845e98e85", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9DQ285X2JrRF9VZWRPaWpaVkxCbGF3P2k9MTAtNjAtMTA1LTU5JmU9NjM4ODc3Nzk5NjcwNjI4MjU0", "correlationId": "6ffe8e5d-8e24-4d1e-897d-ba6d5c3235c6", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:24:12.3296403+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85"}, "PlayFailed": {"id": "66f7f629-a7a9-40a2-96e5-b9c969a6d2cf", "source": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85", "type": "Microsoft.Communication.PlayFailed", "data": {"failedPlaySourceIndex": 0, "version": "2025-06-15", "resultInformation": {"code": 400, "subCode": 8535, "message": "Action failed, file format is invalid."}, "callConnectionId": "2a006280-963b-46f6-b31f-a81845e98e85", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9DQ285X2JrRF9VZWRPaWpaVkxCbGF3P2k9MTAtNjAtMTA1LTU5JmU9NjM4ODc3Nzk5NjcwNjI4MjU0", "correlationId": "6ffe8e5d-8e24-4d1e-897d-ba6d5c3235c6", "publicEventType": "Microsoft.Communication.PlayFailed"}, "time": "2025-07-16T00:24:14.7280693+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85"}, "CallDisconnected": {"id": "f25ba404-8b5c-4be2-93a8-63f3841b2f64", "source": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-963b-46f6-b31f-a81845e98e85", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9DQ285X2JrRF9VZWRPaWpaVkxCbGF3P2k9MTAtNjAtMTA1LTU5JmU9NjM4ODc3Nzk5NjcwNjI4MjU0", "correlationId": "6ffe8e5d-8e24-4d1e-897d-ba6d5c3235c6", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:24:15.8629546+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-963b-46f6-b31f-a81845e98e85"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_start_stop_media_streaming_in_a_call.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_start_stop_media_streaming_in_a_call.event.json new file mode 100644 index 000000000000..1132a1d6b9f1 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_start_stop_media_streaming_in_a_call.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2b09-ce48-04bd45607170", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2b09-ce48-04bd45607170"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2ab4-ce48-04bd4560716f", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2ab4-ce48-04bd4560716f"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8xQ0V2YWx1U1pFZW5OaWNIWFdMdmd3P2k9MTAtMTI4LTExMC03MiZlPTYzODg4MjE2ODEwMDYzNjE4Nw==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "92ef2c2a-c40e-43f2-86c0-8352a4ca024b"}, "ParticipantsUpdated": {"id": "09417496-d6f4-46dd-b874-b4d8ecc12e8c", "source": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2b09-ce48-04bd45607170", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2b09-ce48-04bd45607170"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2ab4-ce48-04bd4560716f", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-2ab4-ce48-04bd4560716f"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-b0d2-4b84-9e6b-d897a82eebd1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8xQ0V2YWx1U1pFZW5OaWNIWFdMdmd3P2k9MTAtMTI4LTExMC03MiZlPTYzODg4MjE2ODEwMDYzNjE4Nw==", "correlationId": "92ef2c2a-c40e-43f2-86c0-8352a4ca024b", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:20:26.3292314+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1"}, "CallConnected": {"id": "a5e8e828-6178-4522-9372-6ed9edaf34d0", "source": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-b0d2-4b84-9e6b-d897a82eebd1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8xQ0V2YWx1U1pFZW5OaWNIWFdMdmd3P2k9MTAtMTI4LTExMC03MiZlPTYzODg4MjE2ODEwMDYzNjE4Nw==", "correlationId": "92ef2c2a-c40e-43f2-86c0-8352a4ca024b", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:20:26.4401657+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1"}, "MediaStreamingStarted": {"id": "d4fec9ce-d42b-419d-9514-ddb7cd5a82e1", "source": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1", "type": "Microsoft.Communication.MediaStreamingStarted", "data": {"mediaStreamingUpdate": {"contentType": "Audio", "mediaStreamingStatus": "mediaStreamingStarted", "mediaStreamingStatusDetails": "subscriptionStarted"}, "version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-b0d2-4b84-9e6b-d897a82eebd1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8xQ0V2YWx1U1pFZW5OaWNIWFdMdmd3P2k9MTAtMTI4LTExMC03MiZlPTYzODg4MjE2ODEwMDYzNjE4Nw==", "correlationId": "92ef2c2a-c40e-43f2-86c0-8352a4ca024b", "publicEventType": "Microsoft.Communication.MediaStreamingStarted"}, "time": "2025-07-16T00:20:28.6984582+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1"}, "MediaStreamingStopped": {"id": "87639cde-417d-4eec-ac66-658334659277", "source": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1", "type": "Microsoft.Communication.MediaStreamingStopped", "data": {"mediaStreamingUpdate": {"contentType": "Audio", "mediaStreamingStatus": "mediaStreamingStopped", "mediaStreamingStatusDetails": "subscriptionStopped"}, "version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-b0d2-4b84-9e6b-d897a82eebd1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8xQ0V2YWx1U1pFZW5OaWNIWFdMdmd3P2k9MTAtMTI4LTExMC03MiZlPTYzODg4MjE2ODEwMDYzNjE4Nw==", "correlationId": "92ef2c2a-c40e-43f2-86c0-8352a4ca024b", "publicEventType": "Microsoft.Communication.MediaStreamingStopped"}, "time": "2025-07-16T00:20:33.2229629+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1"}, "CallDisconnected": {"id": "887534b7-05a9-4de8-8737-42cd6428f88b", "source": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-b0d2-4b84-9e6b-d897a82eebd1", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDItcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi8xQ0V2YWx1U1pFZW5OaWNIWFdMdmd3P2k9MTAtMTI4LTExMC03MiZlPTYzODg4MjE2ODEwMDYzNjE4Nw==", "correlationId": "92ef2c2a-c40e-43f2-86c0-8352a4ca024b", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:20:34.8409195+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-b0d2-4b84-9e6b-d897a82eebd1"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_start_stop_transcription_in_call.event.json b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_start_stop_transcription_in_call.event.json new file mode 100644 index 000000000000..2c39080bdcb1 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/events/test_e2e_media_client_async.pyTestMediaAutomatedLiveTestAsynctest_start_stop_transcription_in_call.event.json @@ -0,0 +1 @@ +{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6dbd-ce48-04bd45607176", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6dbd-ce48-04bd45607176"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6d77-ce48-04bd45607175", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6d77-ce48-04bd45607175"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06"}, "CallConnected": {"id": "9be2eed2-00d5-4ecf-ba67-06b1e137820a", "source": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-07-16T00:20:43.0975431+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb"}, "ParticipantsUpdated": {"id": "88ce9e05-954e-4fea-97f5-204a23436f27", "source": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6dbd-ce48-04bd45607176", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6dbd-ce48-04bd45607176"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6d77-ce48-04bd45607175", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000028-b07c-6d77-ce48-04bd45607175"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 1, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-06-15", "callConnectionId": "2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-07-16T00:20:43.1942516+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb"}, "TranscriptionStarted": {"id": "5cc8e50d-1f34-4aac-a221-36a32c4b21a2", "source": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "type": "Microsoft.Communication.TranscriptionStarted", "data": {"transcriptionUpdate": {"transcriptionStatus": "transcriptionStarted", "transcriptionStatusDetails": "subscriptionStarted"}, "version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06", "publicEventType": "Microsoft.Communication.TranscriptionStarted"}, "time": "2025-07-16T00:20:45.9655063+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb"}, "TranscriptionUpdated": {"id": "5cae9b66-1ece-4c3e-bd50-dc171f247cde", "source": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "type": "Microsoft.Communication.TranscriptionUpdated", "data": {"transcriptionUpdate": {"transcriptionStatus": "transcriptionUpdated", "transcriptionStatusDetails": "transcriptionLocaleUpdated"}, "version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06", "publicEventType": "Microsoft.Communication.TranscriptionUpdated"}, "time": "2025-07-16T00:20:50.204526+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb"}, "TranscriptionStopped": {"id": "778d055f-d18a-4bd0-8e1f-f9f7073a24b9", "source": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "type": "Microsoft.Communication.TranscriptionStopped", "data": {"transcriptionUpdate": {"transcriptionStatus": "transcriptionStopped", "transcriptionStatusDetails": "subscriptionStopped"}, "version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 0, "message": "Action completed successfully."}, "callConnectionId": "2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06", "publicEventType": "Microsoft.Communication.TranscriptionStopped"}, "time": "2025-07-16T00:20:56.5081236+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb"}, "CallDisconnected": {"id": "6e07b50f-30d9-40b8-99cc-2873e0a7cd71", "source": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-06-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "Call was ended by Azure Communication Service Call Automation API or a server bot. DiagCode: 0#7000.@"}, "callConnectionId": "2a006280-0d6b-4f8f-b3df-638f13ef4bdb", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzY2UtMDUtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9IXzVBUUNBdEpVQ1JPaFBMZnF1Q1RnP2k9MTAtNjAtMzItMjIyJmU9NjM4ODc4NjMzNTk1Nzg4MjY2", "correlationId": "d2b63d33-1f29-4dd7-bb89-afb1046b0e06", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-07-16T00:20:57.887794+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/2a006280-0d6b-4f8f-b3df-638f13ef4bdb"}} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_connection_client_async.py b/sdk/communication/azure-communication-callautomation/tests/test_call_connection_client_async.py new file mode 100644 index 000000000000..9c26541cad2f --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_connection_client_async.py @@ -0,0 +1,243 @@ +import json +import pytest +from unittest import IsolatedAsyncioTestCase +from unittest.mock import AsyncMock, Mock + +from azure.core.credentials import AzureKeyCredential +from azure.communication.callautomation.aio import CallConnectionClient as AsyncCallConnectionClient +from azure.communication.callautomation import CommunicationUserIdentifier, TransferCallResult +from azure.core.async_paging import AsyncItemPaged + +from azure.communication.callautomation._generated.models import AddParticipantRequest +from unittest_helpers import mock_response +from azure.communication.callautomation._utils import serialize_identifier + +class TestCallConnectionClientAsync(IsolatedAsyncioTestCase): + call_connection_id = "10000000-0000-0000-0000-000000000000" + communication_user_id = "8:acs:123" + transferee_user_id = "8:acs:456" + operation_context = "operationContext" + call_participant = { + "identifier": {"rawId": communication_user_id, "communicationUser": {"id": communication_user_id}}, + "isMuted": False, + "isOnHold": False, + } + invitation_id = "invitationId" + + async def test_hangup(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=204) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + await call_connection.hang_up(False) + + async def test_terminate(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=204) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + await call_connection.hang_up(True) + + async def test_transfer_call_to_participant(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=202, json_payload={"operationContext": self.operation_context}) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + user = CommunicationUserIdentifier(self.communication_user_id) + + response = await call_connection.transfer_call_to_participant(user) + assert isinstance(response, TransferCallResult) + self.assertEqual(self.operation_context, response.operation_context) + + async def test_transfer_call_to_participant_with_transferee(self): + async def mock_send(*_, **__): + return mock_response(status_code=202, json_payload={"operationContext": self.operation_context}) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + user = CommunicationUserIdentifier(self.communication_user_id) + transferee = CommunicationUserIdentifier(self.transferee_user_id) + raised = False + try: + response = await call_connection.transfer_call_to_participant(user, transferee=transferee) + except Exception: + raised = True + raise + + self.assertFalse(raised, "Expected is no exception raised") + self.assertEqual(self.operation_context, response.operation_context) + + async def test_list_participants(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=200, json_payload={"values": [self.call_participant], "nextLink": ""}) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + + response = call_connection.list_participants() + assert isinstance(response, AsyncItemPaged) + + async def test_get_participants(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=200, json_payload=self.call_participant) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + response = await call_connection.get_participant(CommunicationUserIdentifier(self.call_connection_id)) + self.assertEqual(self.communication_user_id, response.identifier.raw_id) + + async def test_add_participant(self): + async def mock_send(request, **kwargs): + kwargs.pop("stream", None) + body = json.loads(request.content) + assert body["sourceDisplayName"] == "baz", "Parameter value not as expected" + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response( + status_code=202, + json_payload={"participant": self.call_participant, "operationContext": self.operation_context}, + ) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + user = CommunicationUserIdentifier(self.communication_user_id) + + response = await call_connection.add_participant( + target_participant=user, + voip_headers={"foo": "bar"}, + source_display_name="baz", + invitation_timeout=10, + operation_context="operationContext", + ) + self.assertEqual(self.communication_user_id, response.participant.identifier.raw_id) + self.assertEqual(self.operation_context, response.operation_context) + + response = await call_connection.add_participant(user, voip_headers={"foo": "bar"}, source_display_name="baz") + self.assertEqual(self.communication_user_id, response.participant.identifier.raw_id) + self.assertEqual(self.operation_context, response.operation_context) + + # checking input and request match here + mock_add = AsyncMock() + call_connection.add_participant = mock_add + + expected_add_request = AddParticipantRequest( + participant_to_add=serialize_identifier(user), + source_caller_id_number="123", + source_display_name="baz", + invitation_timeout_in_seconds=10, + operation_context="operationContext", + ) + + await call_connection.add_participant( + target_participant=user, + source_caller_id_number="123", + source_display_name="baz", + invitation_timeout=10, + operation_context="operationContext", + ) + + actual_request = dict(mock_add.call_args[1].items()) + self.assertEqual(expected_add_request.source_caller_id_number, actual_request["source_caller_id_number"]) + self.assertEqual(expected_add_request.source_display_name, actual_request["source_display_name"]) + self.assertEqual(expected_add_request.operation_context, actual_request["operation_context"]) + self.assertEqual(expected_add_request.invitation_timeout_in_seconds, actual_request["invitation_timeout"]) + + async def test_remove_participant(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=202, json_payload={"operationContext": self.operation_context}) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + user = CommunicationUserIdentifier(self.communication_user_id) + response = await call_connection.remove_participant(user) + self.assertEqual(self.operation_context, response.operation_context) + + async def test_mute_participant(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=200, json_payload={"operationContext": self.operation_context}) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + user = CommunicationUserIdentifier(self.communication_user_id) + response = await call_connection.mute_participant(user) + self.assertEqual(self.operation_context, response.operation_context) + + async def test_cancel_add_participant(self): + async def mock_send(*_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response( + status_code=202, + json_payload={"invitationId": self.invitation_id, "operationContext": self.operation_context}, + ) + + call_connection = AsyncCallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + transport=Mock(send=AsyncMock(side_effect=mock_send)), + ) + response = await call_connection.cancel_add_participant_operation(self.invitation_id) + self.assertEqual(self.invitation_id, response.invitation_id) + self.assertEqual(self.operation_context, response.operation_context) \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_async.py b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_async.py new file mode 100644 index 000000000000..559e0b651bc6 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_media_client_async.py @@ -0,0 +1,769 @@ +import unittest +import pytest + +from azure.communication.callautomation.aio import ( + CallConnectionClient +) +from azure.communication.callautomation._models import ( + FileSource, + TextSource, + SsmlSource, + PhoneNumberIdentifier, + RecognitionChoice, +) +from azure.communication.callautomation._generated.models import ( + PlayRequest, + PlayOptions, + RecognizeRequest, + RecognizeOptions, + DtmfOptions, + ContinuousDtmfRecognitionRequest, + SendDtmfTonesRequest, + StartTranscriptionRequest, + StopTranscriptionRequest, + UpdateTranscriptionRequest, + HoldRequest, + UnholdRequest, + StartMediaStreamingRequest, + StopMediaStreamingRequest + ) +from azure.communication.callautomation._generated.models._enums import RecognizeInputType, DtmfTone +from unittest.mock import AsyncMock, Mock +from azure.core.credentials import AzureKeyCredential +from azure.communication.callautomation._utils import serialize_identifier + +class TestCallMediaClientAsync(unittest.IsolatedAsyncioTestCase): + async def asyncSetUp(self): + self.call_connection_id = "10000000-0000-0000-0000-000000000000" + self.url = "https://file_source_url.com/audio_file.wav" + self.phone_number = "+12345678900" + self.target_user = PhoneNumberIdentifier(self.phone_number) + self.tones = [DtmfTone.ONE, DtmfTone.TWO, DtmfTone.THREE, DtmfTone.POUND] + self.operation_context = "test_operation_context" + self.locale = "en-US" + self.operation_callback_url = "https://localhost" + self.call_media_operations = AsyncMock() + + self.call_connection_client = CallConnectionClient( + endpoint="https://endpoint", + credential=AzureKeyCredential("fakeCredential=="), + call_connection_id=self.call_connection_id, + ) + + self.call_connection_client._call_media_client = self.call_media_operations + + async def test_play(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = FileSource(url=self.url) + + await self.call_connection_client.play_media(play_source=play_source, play_to=[self.target_user]) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], + play_to=[serialize_identifier(self.target_user)], + play_options=PlayOptions(loop=False) + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to[0]["raw_id"], actual_play_request.play_to[0]["raw_id"]) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + + async def test_play_multiple_play_sources(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_sources = [FileSource(url=self.url), TextSource(text='test test test')] + await self.call_connection_client.play_media(play_source=play_sources, play_to=[self.target_user]) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated() for play_source in play_sources], + play_to=[serialize_identifier(self.target_user)], + play_options=PlayOptions(loop=False) + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual(expected_play_request.play_sources[0].play_source_cache_id, actual_play_request.play_sources[0].play_source_cache_id) + self.assertEqual(expected_play_request.play_to[0]['raw_id'], actual_play_request.play_to[0]['raw_id']) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + + async def test_play_file_to_all_back_compat(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = FileSource(url=self.url) + + await self.call_connection_client.play_media_to_all(play_source=play_source) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], + play_to=[], + play_options=PlayOptions(loop=False), + interrupt_call_media_operation=False + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + self.assertEqual(expected_play_request.interrupt_call_media_operation, actual_play_request.interrupt_call_media_operation) + + async def test_play_file_to_all_via_play_back_compat_with_barge_in(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = FileSource(url=self.url) + + await self.call_connection_client.play_media(play_source=play_source, interrupt_call_media_operation=True) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], + play_to=[], + play_options=PlayOptions(loop=False), + interrupt_call_media_operation=True + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.interrupt_call_media_operation, actual_play_request.interrupt_call_media_operation) + + async def test_play_file_to_all_back_compat_with_barge_in(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = FileSource(url=self.url) + + await self.call_connection_client.play_media_to_all(play_source=play_source, interrupt_call_media_operation=True) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], + play_to=[], + play_options=PlayOptions(loop=False), + interrupt_call_media_operation=True + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.interrupt_call_media_operation, actual_play_request.interrupt_call_media_operation) + + async def test_play_file_to_all_back_compat_with_barge_in(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = FileSource(url=self.url) + + await self.call_connection_client.play_media_to_all(play_source=play_source, interrupt_call_media_operation=True) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], + play_to=[], + play_options=PlayOptions(loop=True), + interrupt_call_media_operation=True + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.interrupt_call_media_operation, actual_play_request.interrupt_call_media_operation) + + async def test_play_multiple_source_to_all(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_sources = [FileSource(url=self.url), TextSource(text='test test test')] + await self.call_connection_client.play_media_to_all(play_sources) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated() for play_source in play_sources], + play_to=[], + play_options=PlayOptions(loop=False) + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual(expected_play_request.play_sources[0].play_source_cache_id, actual_play_request.play_sources[0].play_source_cache_id) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + + async def test_play_file_to_all(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = FileSource(url=self.url) + + await self.call_connection_client.play_media(play_source=play_source) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], play_to=[], play_options=PlayOptions(loop=False) + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].file.uri, actual_play_request.play_sources[0].file.uri) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + + async def test_play_text_to_all(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = TextSource(text="test test test", custom_voice_endpoint_id="customVoiceEndpointId") + + await self.call_connection_client.play_media(play_source=play_source) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], play_to=[], play_options=PlayOptions(loop=False) + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual(expected_play_request.play_sources[0].text.text, actual_play_request.play_sources[0].text.text) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + + async def test_play_ssml_to_all(self): + mock_play = AsyncMock() + self.call_media_operations.play = mock_play + play_source = SsmlSource( + ssml_text='Recognize Choice Completed, played through SSML source.', + custom_voice_endpoint_id="customVoiceEndpointId", + ) + + await self.call_connection_client.play_media(play_source=play_source) + + expected_play_request = PlayRequest( + play_sources=[play_source._to_generated()], play_to=[], play_options=PlayOptions(loop=False) + ) + mock_play.assert_awaited_once() + actual_play_request = mock_play.call_args[0][1] + + self.assertEqual(expected_play_request.play_sources[0].kind, actual_play_request.play_sources[0].kind) + self.assertEqual( + expected_play_request.play_sources[0].ssml.ssml_text, actual_play_request.play_sources[0].ssml.ssml_text + ) + self.assertEqual( + expected_play_request.play_sources[0].play_source_cache_id, + actual_play_request.play_sources[0].play_source_cache_id, + ) + self.assertEqual(expected_play_request.play_to, actual_play_request.play_to) + self.assertEqual(expected_play_request.play_options.loop, actual_play_request.play_options.loop) + + async def test_recognize_dtmf_with_multiple_play_prompts(self): + mock_recognize = AsyncMock() + self.call_media_operations.recognize = mock_recognize + + test_input_type = "dtmf" + test_max_tones_to_collect = 3 + test_inter_tone_timeout = 10 + test_stop_dtmf_tones = [DtmfTone.FOUR] + test_interrupt_prompt = True + test_interrupt_call_media_operation = True + test_initial_silence_timeout = 5 + test_play_sources = [FileSource(url=self.url), TextSource(text='Testing multiple prompts')] + + await self.call_connection_client.start_recognizing_media( + target_participant=self.target_user, + input_type=test_input_type, + dtmf_max_tones_to_collect=test_max_tones_to_collect, + dtmf_inter_tone_timeout=test_inter_tone_timeout, + dtmf_stop_tones=test_stop_dtmf_tones, + interrupt_prompt=test_interrupt_prompt, + interrupt_call_media_operation=test_interrupt_call_media_operation, + initial_silence_timeout=test_initial_silence_timeout, + play_prompt=test_play_sources) + + mock_recognize.assert_awaited_once() + + actual_recognize_request = mock_recognize.call_args[0][1] + + expected_recognize_request = RecognizeRequest( + recognize_input_type=test_input_type, + play_prompts=[test_play_source._to_generated() for test_play_source in test_play_sources], + interrupt_call_media_operation=test_interrupt_call_media_operation, + recognize_options=RecognizeOptions( + target_participant=serialize_identifier( + self.target_user), + interrupt_prompt=test_interrupt_prompt, + initial_silence_timeout_in_seconds=test_initial_silence_timeout, + dtmf_options=DtmfOptions( + inter_tone_timeout_in_seconds=test_inter_tone_timeout, + max_tones_to_collect=test_max_tones_to_collect, + stop_tones=test_stop_dtmf_tones + ) + ) + ) + + self.assertEqual(expected_recognize_request.recognize_input_type, actual_recognize_request.recognize_input_type) + self.assertEqual(expected_recognize_request.play_prompts, actual_recognize_request.play_prompts) + self.assertEqual(expected_recognize_request.interrupt_call_media_operation, actual_recognize_request.interrupt_call_media_operation) + self.assertEqual(expected_recognize_request.operation_context, actual_recognize_request.operation_context) + self.assertEqual(expected_recognize_request.recognize_options.target_participant, actual_recognize_request.recognize_options.target_participant) + self.assertEqual(expected_recognize_request.recognize_options.interrupt_prompt, actual_recognize_request.recognize_options.interrupt_prompt) + self.assertEqual(expected_recognize_request.recognize_options.initial_silence_timeout_in_seconds, actual_recognize_request.recognize_options.initial_silence_timeout_in_seconds) + self.assertEqual(expected_recognize_request.recognize_options.dtmf_options.inter_tone_timeout_in_seconds, actual_recognize_request.recognize_options.dtmf_options.inter_tone_timeout_in_seconds) + self.assertEqual(expected_recognize_request.recognize_options.dtmf_options.max_tones_to_collect, actual_recognize_request.recognize_options.dtmf_options.max_tones_to_collect) + self.assertEqual(expected_recognize_request.recognize_options.dtmf_options.stop_tones, actual_recognize_request.recognize_options.dtmf_options.stop_tones) + + with pytest.raises(ValueError) as e: + await self.call_connection_client.start_recognizing_media( + target_participant=self.target_user, + input_type="foo" + ) + assert "'foo' is not supported." in str(e.value) + + async def test_recognize_dtmf(self): + mock_recognize = AsyncMock() + self.call_media_operations.recognize = mock_recognize + + test_input_type = "dtmf" + test_max_tones_to_collect = 3 + test_inter_tone_timeout = 10 + test_stop_dtmf_tones = [DtmfTone.FOUR] + test_interrupt_prompt = True + test_interrupt_call_media_operation = True + test_initial_silence_timeout = 5 + test_play_source = FileSource(url=self.url) + + await self.call_connection_client.start_recognizing_media( + target_participant=self.target_user, + input_type=test_input_type, + dtmf_max_tones_to_collect=test_max_tones_to_collect, + dtmf_inter_tone_timeout=test_inter_tone_timeout, + dtmf_stop_tones=test_stop_dtmf_tones, + interrupt_prompt=test_interrupt_prompt, + interrupt_call_media_operation=test_interrupt_call_media_operation, + initial_silence_timeout=test_initial_silence_timeout, + play_prompt=test_play_source, + ) + + mock_recognize.assert_awaited_once() + + actual_recognize_request = mock_recognize.call_args[0][1] + + expected_recognize_request = RecognizeRequest( + recognize_input_type=test_input_type, + play_prompt=test_play_source._to_generated(), + interrupt_call_media_operation=test_interrupt_call_media_operation, + recognize_options=RecognizeOptions( + target_participant=serialize_identifier(self.target_user), + interrupt_prompt=test_interrupt_prompt, + initial_silence_timeout_in_seconds=test_initial_silence_timeout, + dtmf_options=DtmfOptions( + inter_tone_timeout_in_seconds=test_inter_tone_timeout, + max_tones_to_collect=test_max_tones_to_collect, + stop_tones=test_stop_dtmf_tones, + ), + ), + ) + + self.assertEqual(expected_recognize_request.recognize_input_type, actual_recognize_request.recognize_input_type) + self.assertEqual(expected_recognize_request.play_prompt.kind, actual_recognize_request.play_prompt.kind) + self.assertEqual(expected_recognize_request.play_prompt.file.uri, actual_recognize_request.play_prompt.file.uri) + self.assertEqual( + expected_recognize_request.interrupt_call_media_operation, + actual_recognize_request.interrupt_call_media_operation, + ) + self.assertEqual(expected_recognize_request.operation_context, actual_recognize_request.operation_context) + self.assertEqual( + expected_recognize_request.recognize_options.target_participant, + actual_recognize_request.recognize_options.target_participant, + ) + self.assertEqual( + expected_recognize_request.recognize_options.interrupt_prompt, + actual_recognize_request.recognize_options.interrupt_prompt, + ) + self.assertEqual( + expected_recognize_request.recognize_options.initial_silence_timeout_in_seconds, + actual_recognize_request.recognize_options.initial_silence_timeout_in_seconds, + ) + self.assertEqual( + expected_recognize_request.recognize_options.dtmf_options.inter_tone_timeout_in_seconds, + actual_recognize_request.recognize_options.dtmf_options.inter_tone_timeout_in_seconds, + ) + self.assertEqual( + expected_recognize_request.recognize_options.dtmf_options.max_tones_to_collect, + actual_recognize_request.recognize_options.dtmf_options.max_tones_to_collect, + ) + self.assertEqual( + expected_recognize_request.recognize_options.dtmf_options.stop_tones, + actual_recognize_request.recognize_options.dtmf_options.stop_tones, + ) + + with pytest.raises(ValueError) as e: + await self.call_connection_client.start_recognizing_media(target_participant=self.target_user, input_type="foo") + assert "'foo' is not supported." in str(e.value) + + async def test_recognize_choices(self): + mock_recognize = AsyncMock() + self.call_media_operations.recognize = mock_recognize + test_choice = RecognitionChoice(label="choice1", phrases=["pass", "fail"]) + test_input_type = RecognizeInputType.CHOICES + test_choices = [test_choice] + test_interrupt_prompt = True + test_interrupt_call_media_operation = True + test_initial_silence_timeout = 5 + test_play_source = FileSource(url=self.url) + + await self.call_connection_client.start_recognizing_media( + target_participant=self.target_user, + input_type=test_input_type, + choices=test_choices, + interrupt_prompt=test_interrupt_prompt, + interrupt_call_media_operation=test_interrupt_call_media_operation, + initial_silence_timeout=test_initial_silence_timeout, + play_prompt=test_play_source, + ) + + mock_recognize.assert_awaited_once() + + actual_recognize_request = mock_recognize.call_args[0][1] + + expected_recognize_request = RecognizeRequest( + recognize_input_type=test_input_type, + play_prompt=test_play_source._to_generated(), + interrupt_call_media_operation=test_interrupt_call_media_operation, + recognize_options=RecognizeOptions( + target_participant=serialize_identifier(self.target_user), + interrupt_prompt=test_interrupt_prompt, + initial_silence_timeout_in_seconds=test_initial_silence_timeout, + choices=[test_choice], + ), + ) + + self.assertEqual(expected_recognize_request.recognize_input_type, actual_recognize_request.recognize_input_type) + self.assertEqual(expected_recognize_request.play_prompt.kind, actual_recognize_request.play_prompt.kind) + self.assertEqual(expected_recognize_request.play_prompt.file.uri, actual_recognize_request.play_prompt.file.uri) + self.assertEqual( + expected_recognize_request.interrupt_call_media_operation, + actual_recognize_request.interrupt_call_media_operation, + ) + self.assertEqual(expected_recognize_request.operation_context, actual_recognize_request.operation_context) + self.assertEqual( + expected_recognize_request.recognize_options.target_participant, + actual_recognize_request.recognize_options.target_participant, + ) + self.assertEqual( + expected_recognize_request.recognize_options.interrupt_prompt, + actual_recognize_request.recognize_options.interrupt_prompt, + ) + self.assertEqual( + expected_recognize_request.recognize_options.initial_silence_timeout_in_seconds, + actual_recognize_request.recognize_options.initial_silence_timeout_in_seconds, + ) + self.assertEqual( + expected_recognize_request.recognize_options.choices[0].label, + actual_recognize_request.recognize_options.choices[0].label, + ) + self.assertEqual( + expected_recognize_request.recognize_options.choices[0].phrases[0], + actual_recognize_request.recognize_options.choices[0].phrases[0], + ) + + async def test_cancel(self): + mock_cancel_all = AsyncMock() + self.call_media_operations.cancel_all_media_operations = mock_cancel_all + + await self.call_connection_client.cancel_all_media_operations() + + mock_cancel_all.assert_awaited_once() + actual_call_connection_id = mock_cancel_all.call_args[0][0] + self.assertEqual(self.call_connection_id, actual_call_connection_id) + + async def test_start_continuous_dtmf_recognition(self): + mock_start_continuous_dtmf_recognition = AsyncMock() + self.call_media_operations.start_continuous_dtmf_recognition = mock_start_continuous_dtmf_recognition + await self.call_connection_client.start_continuous_dtmf_recognition(target_participant=self.target_user) + + expected_continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( + target_participant=serialize_identifier(self.target_user) + ) + + mock_start_continuous_dtmf_recognition.assert_awaited_once() + actual_call_connection_id = mock_start_continuous_dtmf_recognition.call_args[0][0] + actual_start_continuous_dtmf_recognition = mock_start_continuous_dtmf_recognition.call_args[0][1] + + self.assertEqual(self.call_connection_id, actual_call_connection_id) + self.assertEqual( + expected_continuous_dtmf_recognition_request.target_participant, + actual_start_continuous_dtmf_recognition.target_participant, + ) + self.assertEqual( + expected_continuous_dtmf_recognition_request.operation_context, + actual_start_continuous_dtmf_recognition.operation_context, + ) + + async def test_stop_continuous_dtmf_recognition(self): + mock_stop_continuous_dtmf_recognition = AsyncMock() + self.call_media_operations.stop_continuous_dtmf_recognition = mock_stop_continuous_dtmf_recognition + await self.call_connection_client.stop_continuous_dtmf_recognition(target_participant=self.target_user) + + expected_continuous_dtmf_recognition_request = ContinuousDtmfRecognitionRequest( + target_participant=serialize_identifier(self.target_user) + ) + + mock_stop_continuous_dtmf_recognition.assert_awaited_once() + actual_call_connection_id = mock_stop_continuous_dtmf_recognition.call_args[0][0] + actual_stop_continuous_dtmf_recognition = mock_stop_continuous_dtmf_recognition.call_args[0][1] + + self.assertEqual(self.call_connection_id, actual_call_connection_id) + self.assertEqual( + expected_continuous_dtmf_recognition_request.target_participant, + actual_stop_continuous_dtmf_recognition.target_participant, + ) + self.assertEqual( + expected_continuous_dtmf_recognition_request.operation_context, + actual_stop_continuous_dtmf_recognition.operation_context, + ) + + async def test_send_dtmf_tones(self): + mock_send_dtmf_tones = AsyncMock() + self.call_media_operations.send_dtmf_tones = mock_send_dtmf_tones + await self.call_connection_client.send_dtmf_tones( + tones=self.tones, target_participant=self.target_user, operation_context=self.operation_context + ) + + expected_send_dtmf_tones_request = SendDtmfTonesRequest( + tones=self.tones, + target_participant=serialize_identifier(self.target_user), + operation_context=self.operation_context, + ) + + mock_send_dtmf_tones.assert_awaited_once() + actual_call_connection_id = mock_send_dtmf_tones.call_args[0][0] + actual_send_dtmf_tones_request = mock_send_dtmf_tones.call_args[0][1] + + self.assertEqual(self.call_connection_id, actual_call_connection_id) + self.assertEqual( + expected_send_dtmf_tones_request.target_participant, actual_send_dtmf_tones_request.target_participant + ) + self.assertEqual(expected_send_dtmf_tones_request.tones, actual_send_dtmf_tones_request.tones) + self.assertEqual( + expected_send_dtmf_tones_request.operation_context, actual_send_dtmf_tones_request.operation_context + ) + + async def test_start_transcription(self): + mock_start_transcription = AsyncMock() + self.call_media_operations.start_transcription = mock_start_transcription + await self.call_connection_client.start_transcription(locale=self.locale, operation_context=self.operation_context) + + expected_start_transcription_request = StartTranscriptionRequest( + locale=self.locale, operation_context=self.operation_context + ) + + mock_start_transcription.assert_awaited_once() + actual_call_connection_id = mock_start_transcription.call_args[0][0] + actual_start_transcription_request = mock_start_transcription.call_args[0][1] + + self.assertEqual(self.call_connection_id, actual_call_connection_id) + self.assertEqual(expected_start_transcription_request.locale, actual_start_transcription_request.locale) + self.assertEqual( + expected_start_transcription_request.operation_context, actual_start_transcription_request.operation_context + ) + + async def test_stop_transcription(self): + mock_stop_transcription = AsyncMock() + self.call_media_operations.stop_transcription = mock_stop_transcription + await self.call_connection_client.stop_transcription(operation_context=self.operation_context) + + expected_stop_transcription_request = StopTranscriptionRequest(operation_context=self.operation_context) + + mock_stop_transcription.assert_awaited_once() + actual_call_connection_id = mock_stop_transcription.call_args[0][0] + actual_stop_transcription_request = mock_stop_transcription.call_args[0][1] + + self.assertEqual(self.call_connection_id, actual_call_connection_id) + self.assertEqual( + expected_stop_transcription_request.operation_context, actual_stop_transcription_request.operation_context + ) + + async def test_update_transcription(self): + mock_update_transcription = AsyncMock() + self.call_media_operations.update_transcription = mock_update_transcription + await self.call_connection_client.update_transcription(locale=self.locale) + + expected_update_transcription_request = UpdateTranscriptionRequest(locale=self.locale) + + mock_update_transcription.assert_awaited_once() + actual_call_connection_id = mock_update_transcription.call_args[0][0] + actual_update_transcription_request = mock_update_transcription.call_args[0][1] + + self.assertEqual(self.call_connection_id, actual_call_connection_id) + self.assertEqual(expected_update_transcription_request.locale, actual_update_transcription_request.locale) + + async def test_hold_with_file_source(self): + mock_hold = AsyncMock() + self.call_media_operations.hold = mock_hold + play_source = FileSource(url=self.url) + operation_context = "context" + + await self.call_connection_client.hold( + target_participant=self.target_user, play_source=play_source, operation_context=operation_context + ) + + expected_hold_request = HoldRequest( + target_participant=[serialize_identifier(self.target_user)], + play_source_info=play_source._to_generated(), + operation_context=operation_context, + ) + mock_hold.assert_awaited_once() + actual_hold_request = mock_hold.call_args[0][1] + + self.assertEqual(expected_hold_request.play_source_info.file.uri, actual_hold_request.play_source_info.file.uri) + self.assertEqual(expected_hold_request.play_source_info.kind, actual_hold_request.play_source_info.kind) + self.assertEqual(expected_hold_request.operation_context, actual_hold_request.operation_context) + + async def test_hold_with_text_source(self): + mock_hold = AsyncMock() + self.call_media_operations.hold = mock_hold + play_source = TextSource(text="test test test") + operation_context = "with_operation_context" + + await self.call_connection_client.hold( + target_participant=self.target_user, play_source=play_source, operation_context=operation_context + ) + + expected_hold_request = HoldRequest( + target_participant=[serialize_identifier(self.target_user)], + play_source_info=play_source._to_generated(), + operation_context=operation_context, + ) + mock_hold.assert_awaited_once() + actual_hold_request = mock_hold.call_args[0][1] + + self.assertEqual( + expected_hold_request.play_source_info.text.text, actual_hold_request.play_source_info.text.text + ) + self.assertEqual(expected_hold_request.play_source_info.kind, actual_hold_request.play_source_info.kind) + self.assertEqual(expected_hold_request.operation_context, actual_hold_request.operation_context) + + async def test_hold_without_text_source(self): + mock_hold = AsyncMock() + self.call_media_operations.hold = mock_hold + operation_context = "context" + + await self.call_connection_client.hold(target_participant=self.target_user, operation_context=operation_context) + + expected_hold_request = HoldRequest( + target_participant=[serialize_identifier(self.target_user)], operation_context=operation_context + ) + mock_hold.assert_awaited_once() + actual_hold_request = mock_hold.call_args[0][1] + + self.assertEqual(expected_hold_request.operation_context, actual_hold_request.operation_context) + self.assertEqual(expected_hold_request.play_source_info, actual_hold_request.play_source_info) + self.assertEqual(expected_hold_request.operation_context, actual_hold_request.operation_context) + + async def test_unhold(self): + mock_unhold = AsyncMock() + self.call_media_operations.unhold = mock_unhold + operation_context = "context" + + await self.call_connection_client.unhold(target_participant=self.target_user, operation_context=operation_context) + + expected_hold_request = UnholdRequest( + target_participant=[serialize_identifier(self.target_user)], operation_context=operation_context + ) + mock_unhold.assert_awaited_once() + actual_hold_request = mock_unhold.call_args[0][1] + + self.assertEqual(expected_hold_request.operation_context, actual_hold_request.operation_context) + + async def test_start_media_streaming(self): + mock_start_media_streaming = AsyncMock() + self.call_media_operations.start_media_streaming = mock_start_media_streaming + + await self.call_connection_client.start_media_streaming( + operation_callback_url=self.operation_callback_url, + operation_context=self.operation_context) + + expected_start_media_streaming_request = StartMediaStreamingRequest( + operation_callback_uri=self.operation_callback_url, + operation_context=self.operation_context) + + mock_start_media_streaming.assert_awaited_once() + actual_call_connection_id = mock_start_media_streaming.call_args[0][0] + actual_start_media_streaming_request = mock_start_media_streaming.call_args[0][1] + self.assertEqual(self.call_connection_id,actual_call_connection_id) + self.assertEqual(expected_start_media_streaming_request.operation_callback_uri, + actual_start_media_streaming_request.operation_callback_uri) + self.assertEqual(expected_start_media_streaming_request.operation_context, + actual_start_media_streaming_request.operation_context) + + async def test_start_media_steaming_with_no_param(self): + mock_start_media_streaming = AsyncMock() + self.call_media_operations.start_media_streaming = mock_start_media_streaming + + await self.call_connection_client.start_media_streaming() + + mock_start_media_streaming.assert_awaited_once() + actual_call_connection_id = mock_start_media_streaming.call_args[0][0] + self.assertEqual(self.call_connection_id,actual_call_connection_id) + + async def test_stop_media_streaming(self): + mock_stop_media_streaming = AsyncMock() + self.call_media_operations.stop_media_streaming = mock_stop_media_streaming + + await self.call_connection_client.stop_media_streaming( + operation_callback_url=self.operation_callback_url) + + expected_stop_media_streaming_request = StopMediaStreamingRequest( + operation_callback_uri=self.operation_callback_url) + + mock_stop_media_streaming.assert_awaited_once() + + actual_call_connection_id = mock_stop_media_streaming.call_args[0][0] + actual_stop_media_streaming_request = mock_stop_media_streaming.call_args[0][1] + self.assertEqual(self.call_connection_id,actual_call_connection_id) + self.assertEqual(expected_stop_media_streaming_request.operation_callback_uri, + actual_stop_media_streaming_request.operation_callback_uri) + + async def test_stop_media_streaming_with_no_param(self): + mock_stop_media_streaming = AsyncMock() + self.call_media_operations.stop_media_streaming = mock_stop_media_streaming + + await self.call_connection_client.stop_media_streaming() + + mock_stop_media_streaming.assert_awaited_once() + actual_call_connection_id = mock_stop_media_streaming.call_args[0][0] + self.assertEqual(self.call_connection_id,actual_call_connection_id) + diff --git a/sdk/communication/azure-communication-callautomation/tests/test_call_recording_client_async.py b/sdk/communication/azure-communication-callautomation/tests/test_call_recording_client_async.py new file mode 100644 index 000000000000..0ce2028b011c --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_call_recording_client_async.py @@ -0,0 +1,105 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import json +import pytest +from unittest import IsolatedAsyncioTestCase +from unittest.mock import AsyncMock, Mock +from unittest_helpers import mock_response + +from azure.core.credentials import AzureKeyCredential +from azure.core.async_paging import AsyncItemPaged + +from azure.communication.callautomation.aio import ( + CallAutomationClient +) +from azure.communication.callautomation import ( + ServerCallLocator, + GroupCallLocator, + ChannelAffinity, + CommunicationUserIdentifier, +) +from azure.communication.callautomation._utils import serialize_identifier + +class TestCallRecordingClientAsync(IsolatedAsyncioTestCase): + recording_id = "123" + call_connection_id = "10000000-0000-0000-0000-000000000000" + + async def test_start_recording(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + kwargs.pop("call_locator", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=200, json_payload={"recording_id": "1", "recording_state": "2"}) + + callautomation_client = CallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=Mock(send=AsyncMock(side_effect=mock_send)) + ) + call_locator = ServerCallLocator(server_call_id="locatorId") + target_participant = CommunicationUserIdentifier("testId") + channel_affinity = ChannelAffinity(target_participant=target_participant, channel=0) + await callautomation_client.start_recording(call_locator=call_locator, channel_affinity=[channel_affinity]) + await callautomation_client.start_recording(group_call_id="locatorId", channel_affinity=[channel_affinity]) + await callautomation_client.start_recording(server_call_id="locatorId", channel_affinity=[channel_affinity]) + + with pytest.raises(ValueError): + call_locator = ServerCallLocator(server_call_id="locatorId") + await callautomation_client.start_recording(call_locator=call_locator, group_call_id="foo") + with pytest.raises(ValueError): + call_locator = GroupCallLocator(group_call_id="locatorId") + await callautomation_client.start_recording(call_locator=call_locator, server_call_id="foo") + with pytest.raises(ValueError): + await callautomation_client.start_recording(group_call_id="foo", server_call_id="bar") + + + async def test_stop_recording(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=204) + + callautomation_client = CallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=Mock(send=AsyncMock(side_effect=mock_send)) + ) + await callautomation_client.stop_recording(recording_id=self.recording_id) + + async def test_resume_recording(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=202) + + callautomation_client = CallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=Mock(send=AsyncMock(side_effect=mock_send)) + ) + await callautomation_client.resume_recording(recording_id=self.recording_id) + + async def test_pause_recording(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=202) + + callautomation_client = CallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=Mock(send=AsyncMock(side_effect=mock_send)) + ) + await callautomation_client.pause_recording(recording_id=self.recording_id) + + async def test_get_recording_properties(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=200, json_payload={"recording_id": "1", "recording_state": "2"}) + + callautomation_client = CallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=Mock(send=AsyncMock(side_effect=mock_send)) + ) + await callautomation_client.get_recording_properties(recording_id=self.recording_id) + diff --git a/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client.py b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client.py index 6f469dfb7c54..9fafba10aa63 100644 --- a/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client.py +++ b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client.py @@ -85,6 +85,53 @@ def mock_send(request, **kwargs): self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) self.assertEqual(self.callback_url, call_connection_properties.callback_url) + def test_ops_create_call(self): + def mock_send(request, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + body = json.loads(request.content) + return mock_response( + status_code=201, + json_payload={ + "callConnectionId": self.call_connection_id, + "serverCallId": self.server_callI_id, + "callbackUri": self.callback_url, + "targets": [ + { + "rawId": self.another_microsoft_teams_app_id, + "microsoftTeamsApp": {"app_id": self.another_microsoft_teams_app_id}, + } + ], + "source": { + "rawId": self.microsoft_teams_app_id, + "microsoftTeamsApp": {"app_id": self.microsoft_teams_app_id}, + }, + }, + ) + + # target endpoint for ACS User + user = MicrosoftTeamsAppIdentifier(self.another_microsoft_teams_app_id) + + # caller endpoint for OPS call + caller = MicrosoftTeamsAppIdentifier(self.microsoft_teams_app_id) + + # make invitation + call_invite = CallInvite(target=user) + call_automation_client = CallAutomationClient( + "https://endpoint", + AzureKeyCredential("fakeCredential=="), + transport=Mock(send=mock_send) + ) + call_connection_properties = call_automation_client.create_call(call_invite, + self.callback_url, + teams_app_source=caller) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + self.assertEqual(self.microsoft_teams_app_id, call_connection_properties.source.raw_id) + self.assertEqual(self.another_microsoft_teams_app_id, call_connection_properties.targets[0].raw_id) + def test_create_group_call(self): def mock_send(_, **kwargs): kwargs.pop("stream", None) @@ -179,7 +226,7 @@ def mock_send(_, **kwargs): self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) self.assertEqual(self.callback_url, call_connection_properties.callback_url) - + def test_redirect_call(self): def mock_send(_, **kwargs): kwargs.pop("stream", None) diff --git a/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_async.py b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_async.py new file mode 100644 index 000000000000..64545d7080d7 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_callautomation_client_async.py @@ -0,0 +1,260 @@ +import json +import pytest +import asyncio +from unittest import IsolatedAsyncioTestCase +from unittest.mock import AsyncMock, Mock, patch + +from azure.core.credentials import AzureKeyCredential +from azure.communication.callautomation.aio import ( + CallAutomationClient as AsyncCallAutomationClient, +) +from azure.communication.callautomation import ( + CallInvite, + CommunicationUserIdentifier, + MicrosoftTeamsAppIdentifier, +) +from unittest_helpers import mock_response + +class TestCallAutomationClientAsync(IsolatedAsyncioTestCase): + call_connection_id = "10000000-0000-0000-0000-000000000000" + server_callI_id = "12345" + callback_url = "https://contoso.com/event" + communication_user_id = "8:acs:123" + communication_user_source_id = "8:acs:456" + microsoft_teams_app_id = "28:acs:123456" + another_microsoft_teams_app_id = "28:acs:78910J" + incoming_call_context = "env2REDACTEDINCOMINGCALLCONTEXT" + + async def test_create_call(self): + async def mock_send(request, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + body = json.loads(request.content) + assert body["sourceDisplayName"] == "baz", "Parameter value not as expected" + return mock_response( + status_code=201, + json_payload={ + "callConnectionId": self.call_connection_id, + "serverCallId": self.server_callI_id, + "callbackUri": self.callback_url, + "targets": [ + {"rawId": self.communication_user_id, "communicationUser": {"id": self.communication_user_id}} + ], + "sourceIdentity": { + "rawId": self.communication_user_source_id, + "communicationUser": {"id": self.communication_user_source_id}, + }, + }, + ) + + user = CommunicationUserIdentifier(self.communication_user_id) + call_invite = CallInvite(target=user, source_display_name="baz") + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=transport + ) + call_connection_properties = await call_automation_client.create_call(call_invite, self.callback_url) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + + call_invite = CallInvite(target=user, source_display_name="WRONG") + call_connection_properties = await call_automation_client.create_call( + target_participant=call_invite, + callback_url=self.callback_url, + source_display_name="baz", + ) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + + call_connection_properties = await call_automation_client.create_call( + target_participant=user, + callback_url=self.callback_url, + source_display_name="baz", + ) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + + async def test_ops_create_call(self): + async def mock_send(request, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + body = json.loads(request.content) + return mock_response( + status_code=201, + json_payload={ + "callConnectionId": self.call_connection_id, + "serverCallId": self.server_callI_id, + "callbackUri": self.callback_url, + "targets": [ + { + "rawId": self.another_microsoft_teams_app_id, + "microsoftTeamsApp": {"app_id": self.another_microsoft_teams_app_id}, + } + ], + "source": { + "rawId": self.microsoft_teams_app_id, + "microsoftTeamsApp": {"app_id": self.microsoft_teams_app_id}, + }, + }, + ) + + user = MicrosoftTeamsAppIdentifier(self.another_microsoft_teams_app_id) + caller = MicrosoftTeamsAppIdentifier(self.microsoft_teams_app_id) + call_invite = CallInvite(target=user) + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", + AzureKeyCredential("fakeCredential=="), + transport=transport + ) + call_connection_properties = await call_automation_client.create_call( + call_invite, + self.callback_url, + teams_app_source=caller + ) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + self.assertEqual(self.microsoft_teams_app_id, call_connection_properties.source.raw_id) + self.assertEqual(self.another_microsoft_teams_app_id, call_connection_properties.targets[0].raw_id) + + async def test_create_group_call(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response( + status_code=201, + json_payload={ + "callConnectionId": self.call_connection_id, + "serverCallId": self.server_callI_id, + "callbackUri": self.callback_url, + "targets": [ + {"rawId": self.communication_user_id, "communicationUser": {"id": self.communication_user_id}} + ], + "source": { + "rawId": self.communication_user_source_id, + "communicationUser": {"id": self.communication_user_source_id}, + }, + }, + ) + + user = CommunicationUserIdentifier(self.communication_user_id) + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=transport + ) + call_connection_properties = await call_automation_client.create_call([user], self.callback_url) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + + async def test_create_group_call_back_compat(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response( + status_code=201, + json_payload={ + "callConnectionId": self.call_connection_id, + "serverCallId": self.server_callI_id, + "callbackUri": self.callback_url, + "targets": [ + {"rawId": self.communication_user_id, "communicationUser": {"id": self.communication_user_id}} + ], + "source": { + "rawId": self.communication_user_source_id, + "communicationUser": {"id": self.communication_user_source_id}, + }, + }, + ) + + user = CommunicationUserIdentifier(self.communication_user_id) + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=transport + ) + call_connection_properties = await call_automation_client.create_group_call([user], self.callback_url) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + + async def test_answer_call(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response( + status_code=200, + json_payload={ + "callConnectionId": self.call_connection_id, + "serverCallId": self.server_callI_id, + "callbackUri": self.callback_url, + "targets": [ + {"rawId": self.communication_user_id, "communicationUser": {"id": self.communication_user_id}} + ], + "source": { + "rawId": self.communication_user_source_id, + "communicationUser": {"id": self.communication_user_source_id}, + }, + }, + ) + + user = CommunicationUserIdentifier(self.communication_user_id) + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=transport + ) + call_connection_properties = await call_automation_client.answer_call(self.incoming_call_context, self.callback_url) + self.assertEqual(self.call_connection_id, call_connection_properties.call_connection_id) + self.assertEqual(self.server_callI_id, call_connection_properties.server_call_id) + self.assertEqual(self.callback_url, call_connection_properties.callback_url) + + + + async def test_redirect_call(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=204) + + user = CommunicationUserIdentifier(self.communication_user_id) + call_redirect_to = CallInvite(target=user, source_display_name="baz") + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=transport + ) + await call_automation_client.redirect_call(self.incoming_call_context, call_redirect_to) + await call_automation_client.redirect_call(self.incoming_call_context, user) + with pytest.raises(ValueError) as e: + await call_automation_client.redirect_call( + self.incoming_call_context, user, source_display_name="baz" + ) + assert "unexpected kwargs" in str(e.value) + + async def test_reject_call(self): + async def mock_send(_, **kwargs): + kwargs.pop("stream", None) + if kwargs: + raise ValueError(f"Received unexpected kwargs in transport: {kwargs}") + return mock_response(status_code=204) + + transport = Mock() + transport.send = AsyncMock(side_effect=mock_send) + call_automation_client = AsyncCallAutomationClient( + "https://endpoint", AzureKeyCredential("fakeCredential=="), transport=transport + ) + await call_automation_client.reject_call(self.incoming_call_context) \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_e2e_callautomation_client_async.py b/sdk/communication/azure-communication-callautomation/tests/test_e2e_callautomation_client_async.py new file mode 100644 index 000000000000..656eaa063c0c --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_e2e_callautomation_client_async.py @@ -0,0 +1,181 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from datetime import timedelta +import time +import pytest +import asyncio + +from azure.communication.callautomation._models import ChannelAffinity, ServerCallLocator +from azure.communication.callautomation._shared.models import CommunicationUserIdentifier, identifier_from_raw_id +from devtools_testutils.aio import recorded_by_proxy_async + +from callautomation_test_case_async import CallAutomationRecordedTestCaseAsync + +@pytest.mark.asyncio +class TestCallAutomationClientAutomatedLiveTestAsync(CallAutomationRecordedTestCaseAsync): + + @recorded_by_proxy_async + async def test_create_VOIP_call_and_answer_then_hangup(self): + # try to establish the call + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + # check returned events + connected_event = self.check_for_event( + "CallConnected", call_connection._call_connection_id, timedelta(seconds=15) + ) + participant_updated_event = self.check_for_event( + "ParticipantsUpdated", call_connection._call_connection_id, timedelta(seconds=15) + ) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_add_participant_then_cancel_request_async(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + participant_to_add = identifier_from_raw_id((self.identity_client.create_user()).raw_id) + call_connection_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event( + "CallConnected", call_connection_id, timedelta(seconds=15) + ) + participant_updated_event = self.check_for_event( + "ParticipantsUpdated", call_connection_id, timedelta(seconds=15) + ) + + assert connected_event is not None, "Caller CallConnected event is None" + assert participant_updated_event is not None, "Caller ParticipantsUpdated event is None" + + add_participant_result = await call_connection.add_participant(participant_to_add) + await asyncio.sleep(3) + await call_connection.cancel_add_participant_operation(add_participant_result.invitation_id) + + cancel_add_participant_succeeded_event = self.check_for_event( + "CancelAddParticipantSucceeded", call_connection_id, timedelta(seconds=15) + ) + + assert cancel_add_participant_succeeded_event is not None, "Caller CancelAddParticipantSucceeded event is None" + + await self.terminate_call(call_connection_id) + + @recorded_by_proxy_async + async def test_create_VOIP_call_and_connect_call_then_hangup_async(self): + # try to establish the call + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _, call_automation_client, callback_url = await self.establish_callconnection_voip_connect_call(caller, target) + + # check returned events + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + assert connected_event is not None, "Caller CallConnected event is None" + assert participant_updated_event is not None, "Caller ParticipantsUpdated event is None" + + call_connection_properties = await call_connection.get_call_properties() + server_call_id = call_connection_properties.server_call_id + + # connect call request. + connect_call_connection = await call_automation_client.connect_call( + server_call_id=server_call_id, + callback_url=callback_url, + ) + + # check returned call connected events + connect_call_connected_event = self.check_for_event('CallConnected', connect_call_connection.call_connection_id, timedelta(seconds=20)) + assert connect_call_connected_event is not None, "Caller CallConnected event is None" + + await self.terminate_call(unique_id) + return + + + + @recorded_by_proxy_async + async def test_start_recording_with_call_connection_id_async(self): + # try to establish the call + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _, call_automation_client, callback_url = await self.establish_callconnection_voip_connect_call(caller, target) + + # check returned events + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + call_connection_properties = await call_connection.get_call_properties() + call_connection_id = call_connection_properties.call_connection_id + + target_participant = CommunicationUserIdentifier("testId") + channel_affinity = ChannelAffinity(target_participant=target_participant, channel=0) + + # start recording request with call connection id. + start_recording = await call_automation_client.start_recording(call_connection_id=call_connection_id, recording_state_callback_url=callback_url, channel_affinity=[channel_affinity] + ) + await asyncio.sleep(5) + + # check for RecordingStateChanged event + recording_state_changed_event = self.check_for_event('RecordingStateChanged', call_connection_id, timedelta(seconds=30)) + if recording_state_changed_event is None: + raise ValueError("RecordingStateChanged event is None") + + # stop recording request + await call_automation_client.stop_recording(recording_id=start_recording.recording_id) + await asyncio.sleep(3) + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_start_recording_with_server_call_id_async(self): + # try to establish the call + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _, call_automation_client, callback_url = await self.establish_callconnection_voip_connect_call(caller, target) + + # check returned events + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + call_connection_properties = await call_connection.get_call_properties() + call_connection_id = call_connection_properties.call_connection_id + server_call_id = call_connection_properties.server_call_id + + target_participant = CommunicationUserIdentifier("testId") + channel_affinity = ChannelAffinity(target_participant=target_participant, channel=0) + + # start recording request with call connection id. + start_recording = await call_automation_client.start_recording(server_call_id = server_call_id, recording_state_callback_url=callback_url, channel_affinity=[channel_affinity] + ) + await asyncio.sleep(5) + + # check for RecordingStateChanged event + recording_state_changed_event = self.check_for_event('RecordingStateChanged', call_connection_id, timedelta(seconds=30)) + if recording_state_changed_event is None: + raise ValueError("RecordingStateChanged event is None") + + # stop recording request + await call_automation_client.stop_recording(recording_id=start_recording.recording_id) + await asyncio.sleep(3) + + await self.terminate_call(unique_id) + return \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/tests/test_e2e_media_client_async.py b/sdk/communication/azure-communication-callautomation/tests/test_e2e_media_client_async.py new file mode 100644 index 000000000000..3e035d868610 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/tests/test_e2e_media_client_async.py @@ -0,0 +1,659 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from datetime import timedelta +import pytest +import asyncio +import os +from typing import Dict, Any +from azure.identity.aio import AzureCliCredential +from azure.communication.callautomation import ( + FileSource, + MediaStreamingOptions, + MediaStreamingContentType, + StreamingTransportType, + MediaStreamingAudioChannelType, + TranscriptionOptions, + TextSource, +) +from azure.communication.callautomation._shared.models import identifier_from_raw_id +from azure.communication.callautomation.aio import ( + CallAutomationClient as CallAutomationClientAsync, + CallConnectionClient as CallConnectionClientAsync, +) +from azure.communication.callautomation._shared.models import CommunicationUserIdentifier, identifier_from_raw_id +from azure.communication.callautomation._models import ChannelAffinity +from azure.communication.identity import CommunicationIdentityClient +from devtools_testutils import AzureRecordedTestCase, is_live +from devtools_testutils.aio import recorded_by_proxy_async +from devtools_testutils.helpers import get_test_id + +from azure.communication.phonenumbers.aio import PhoneNumbersClient +from azure.servicebus.aio import ServiceBusClient + +from callautomation_test_case_async import CallAutomationRecordedTestCaseAsync + +@pytest.mark.asyncio +class TestMediaAutomatedLiveTestAsync(CallAutomationRecordedTestCaseAsync): + + @recorded_by_proxy_async + async def test_play_media_in_a_call(self): + caller = self.identity_client.create_user() + print(f"Caller User ID: {caller.raw_id}") + target = self.identity_client.create_user() + print(f"Target User ID: {target.raw_id}") + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + print(f"unique_id: {unique_id}") + connected_event = self.check_for_event( + "CallConnected", call_connection._call_connection_id, timedelta(seconds=15) + ) + participant_updated_event = self.check_for_event( + "ParticipantsUpdated", call_connection._call_connection_id, timedelta(seconds=15) + ) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + file_source = FileSource(url=self.file_source_url) + await call_connection.play_media_to_all( + play_source=file_source, + ) + + play_completed_event = self.check_for_event( + "PlayCompleted", call_connection._call_connection_id, timedelta(seconds=30) + ) + if play_completed_event is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + # Do not return anything from this test method + + @pytest.mark.skip(reason="Known issues - Bug 3949487: [GA4] [Python] [SDK] [Async] Get Participant fails with authentication error HMAC-SHA256, Bug 4182867: [SDK] Hmac Validation with ':' (GetParticipant) mismatch") + @recorded_by_proxy_async + async def test_add_and_mute_participant_in_a_call(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + new_user = self.identity_client.create_user() # Await here! + participant_to_add = identifier_from_raw_id(new_user.raw_id) + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event( + "CallConnected", call_connection._call_connection_id, timedelta(seconds=15) + ) + participant_updated_event = self.check_for_event( + "ParticipantsUpdated", call_connection._call_connection_id, timedelta(seconds=15) + ) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + add_participant_result = await call_connection.add_participant(participant_to_add) + if add_participant_result is None: + raise ValueError("Invalid add_participant_result") + + await asyncio.sleep(3) + + mute_participant_result = await call_connection.mute_participant( + target, operation_context="muting_add_target_participant" + ) + if mute_participant_result is None: + raise ValueError("Invalid mute_participant_result") + + await asyncio.sleep(2) + get_participant_result = await call_connection.get_participant(target) + if get_participant_result is None: + raise ValueError("Invalid get_participant_result") + + if get_participant_result.is_muted is False: + raise ValueError("Failed to mute participant") + + await self.terminate_call(unique_id) + + @pytest.mark.skip(reason="Known issues - Bug 3949487: [GA4] [Python] [SDK] [Async] Get Participant fails with authentication error HMAC-SHA256, Bug 4182867: [SDK] Hmac Validation with ':' (GetParticipant) mismatch") + @recorded_by_proxy_async + async def test_add_and_hold_unhold_participant_in_a_call(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + participant_to_add = identifier_from_raw_id(self.identity_client.create_user().raw_id) + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event( + "CallConnected", call_connection._call_connection_id, timedelta(seconds=15) + ) + participant_updated_event = self.check_for_event( + "ParticipantsUpdated", call_connection._call_connection_id, timedelta(seconds=15) + ) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + add_participant_result = await call_connection.add_participant(participant_to_add) + if add_participant_result is None: + raise ValueError("Invalid add_participant_result") + + await asyncio.sleep(3) + + await call_connection.hold(target, operation_context="hold_add_target_participant") + + await asyncio.sleep(2) + get_participant_result = await call_connection.get_participant(target) + if get_participant_result is None: + raise ValueError("Invalid get_participant_result") + + if get_participant_result.is_on_hold is False: + raise ValueError("Failed to hold participant") + + await call_connection.unhold(target, operation_context="unhold_add_target_participant") + + await asyncio.sleep(2) + get_participant_result = await call_connection.get_participant(target) + + if get_participant_result is None: + raise ValueError("Invalid get_participant_result") + + if get_participant_result.is_on_hold is True: + raise ValueError("Failed to unhold participant") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_start_stop_media_streaming_in_a_call(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + + media_streaming_options = MediaStreamingOptions( + transport_url=self.transport_url, + transport_type=StreamingTransportType.WEBSOCKET, + content_type=MediaStreamingContentType.AUDIO, + audio_channel_type=MediaStreamingAudioChannelType.MIXED, + start_media_streaming=False + ) + + unique_id, call_connection, _ = await self.establish_callconnection_voip_with_streaming_options( + caller, target, media_streaming_options, False + ) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + await call_connection.start_media_streaming() + + media_streaming_started = self.check_for_event('MediaStreamingStarted', call_connection._call_connection_id, timedelta(seconds=30)) + + if media_streaming_started is None: + raise ValueError("MediaStreamingStarted event is None") + + await asyncio.sleep(3) + + call_connection_properties = await call_connection.get_call_properties() + if call_connection_properties is None: + raise ValueError("call_connection_properties is None") + if call_connection_properties.media_streaming_subscription is None: + raise ValueError("call_connection_properties.media_streaming_subscription is None") + if call_connection_properties.media_streaming_subscription.state != 'active': + raise ValueError("media streaming state is invalid for MediaStreamingStarted event") + + await call_connection.stop_media_streaming() + + media_streaming_stopped = self.check_for_event('MediaStreamingStopped', call_connection._call_connection_id, timedelta(seconds=30)) + if media_streaming_stopped is None: + raise ValueError("MediaStreamingStopped event is None") + + call_connection_properties = await call_connection.get_call_properties() + if call_connection_properties is None: + raise ValueError("call_connection_properties is None") + if call_connection_properties.media_streaming_subscription is None: + raise ValueError("call_connection_properties.media_streaming_subscription is None") + if call_connection_properties.media_streaming_subscription.state != 'inactive': + raise ValueError("media streaming state is invalid for MediaStreamingStopped event") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_start_stop_transcription_in_call(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + + transcription_options = TranscriptionOptions( + transport_url=self.transport_url, + transport_type=StreamingTransportType.WEBSOCKET, + locale="en-US", + start_transcription=False + ) + + unique_id, call_connection, _ = await self.establish_callconnection_voip_with_streaming_options( + caller, target, transcription_options, True + ) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + await call_connection.start_transcription(locale="en-ca") + + transcription_started = self.check_for_event('TranscriptionStarted', call_connection._call_connection_id, timedelta(seconds=30)) + if transcription_started is None: + raise ValueError("TranscriptionStarted event is None") + + call_connection_properties = await call_connection.get_call_properties() + if call_connection_properties is None: + raise ValueError("call_connection_properties is None") + if call_connection_properties.transcription_subscription is None: + raise ValueError("call_connection_properties.transcription_subscription is None") + if call_connection_properties.transcription_subscription.state != 'active': + raise ValueError("transcription subscription state is invalid for TranscriptionStarted event") + + await asyncio.sleep(3) + await call_connection.update_transcription(locale="en-gb") + + transcription_updated = self.check_for_event('TranscriptionUpdated', call_connection._call_connection_id, timedelta(seconds=30)) + if transcription_updated is None: + raise ValueError("TranscriptionUpdated event is None") + + await asyncio.sleep(3) + + await call_connection.stop_transcription() + + transcription_stopped = self.check_for_event('TranscriptionStopped', call_connection._call_connection_id, timedelta(seconds=30)) + if transcription_stopped is None: + raise ValueError("TranscriptionStopped event is None") + + call_connection_properties = await call_connection.get_call_properties() + if call_connection_properties is None: + raise ValueError("call_connection_properties is None") + if call_connection_properties.transcription_subscription is None: + raise ValueError("call_connection_properties.transcription_subscription is None") + if call_connection_properties.transcription_subscription.state != 'inactive': + raise ValueError("transcription subscription state is invalid for TranscriptionStopped event") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_multiple_file_sources_with_play_media_all(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_file_source = [ + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url) + ] + + await call_connection.play_media_to_all( + play_source=play_multiple_file_source + ) + + play_completed_event_file_source = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_file_source is None: + raise ValueError("Play media all PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_multiple_file_sources_with_play_media(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_file_source = [ + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url) + ] + + await call_connection.play_media( + play_source=play_multiple_file_source, + play_to=[target] + ) + + play_completed_event_file_source_to_target = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_file_source_to_target is None: + raise ValueError("Play media PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_multiple_file_sources_with_operationcallbackurl_with_play_media_all(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_file_source = [ + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url) + ] + + random_unique_id = self._unique_key_gen(caller, target) + + await call_connection.play_media_to_all( + play_source=play_multiple_file_source, + operation_callback_url=(self.dispatcher_callback + "?q={}".format(random_unique_id)) + ) + + play_completed_event_file_source = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_file_source is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_multiple_file_sources_with_operationcallbackurl_with_play_media(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_file_source = [ + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url), + FileSource(url=self.file_source_url) + ] + + random_unique_id = self._unique_key_gen(caller, target) + + await call_connection.play_media( + play_source=play_multiple_file_source, + play_to=[target], + operation_callback_url=(self.dispatcher_callback + "?q={}".format(random_unique_id)) + ) + + play_completed_event_file_source_to_target = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_file_source_to_target is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_multiple_text_sources_with_play_media(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target, cognitive_service_enabled=True) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_text_source = [ + TextSource(text="this is test one", voice_name="en-US-NancyNeural"), + TextSource(text="this is test two", voice_name="en-US-NancyNeural"), + TextSource(text="this is test three", voice_name="en-US-NancyNeural") + ] + + await call_connection.play_media( + play_source=play_multiple_text_source, + play_to=[target] + ) + + play_completed_event_text_source_to_target = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_text_source_to_target is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_multiple_text_sources_with_play_media_all(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target, cognitive_service_enabled=True) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_text_source = [ + TextSource(text="this is test one", voice_name="en-US-NancyNeural"), + TextSource(text="this is test two", voice_name="en-US-NancyNeural"), + TextSource(text="this is test three", voice_name="en-US-NancyNeural") + ] + + await call_connection.play_media_to_all( + play_source=play_multiple_text_source + ) + + play_completed_event_text_source = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_text_source is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_combined_file_and_text_sources_with_play_media(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target, cognitive_service_enabled=True) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_source = [ + FileSource(url=self.file_source_url), + TextSource(text="this is test.", voice_name="en-US-NancyNeural"), + ] + + await call_connection.play_media( + play_source=play_multiple_source, + play_to=[target] + ) + + play_completed_event_multiple_source_to_target = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_multiple_source_to_target is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_combined_file_and_text_sources_with_play_media_all(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target, cognitive_service_enabled=True) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + play_multiple_source = [ + FileSource(url=self.file_source_url), + TextSource(text="this is test.", voice_name="en-US-NancyNeural"), + ] + + await call_connection.play_media_to_all( + play_source=play_multiple_source + ) + + play_completed_event_multiple_source = self.check_for_event('PlayCompleted', call_connection._call_connection_id, timedelta(seconds=30)) + if play_completed_event_multiple_source is None: + raise ValueError("PlayCompleted event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_with_invalid_file_sources_with_play_media_all(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + file_prompt = [FileSource(url="https://dummy.com/dummyurl.wav")] + + await call_connection.play_media_to_all( + play_source=file_prompt + ) + + play_failed_event = self.check_for_event('PlayFailed', call_connection._call_connection_id, timedelta(seconds=30)) + if play_failed_event is None: + raise ValueError("PlayFailed event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_with_invalid_and_valid_file_sources_with_play_media_all(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + file_prompt = [FileSource(url=self.file_source_url), FileSource(url="https://dummy.com/dummyurl.wav")] + + await call_connection.play_media_to_all( + play_source=file_prompt + ) + + play_failed_event = self.check_for_event('PlayFailed', call_connection._call_connection_id, timedelta(seconds=30)) + if play_failed_event is None: + raise ValueError("PlayFailed event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_with_invalid_file_sources_with_play_media(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + file_prompt = [FileSource(url="https://dummy.com/dummyurl.wav")] + + await call_connection._play_media( + play_source=file_prompt, + play_to=[target] + ) + + play_failed_event_to_target = self.check_for_event('PlayFailed', call_connection._call_connection_id, timedelta(seconds=30)) + if play_failed_event_to_target is None: + raise ValueError("PlayFailed event is None") + + await self.terminate_call(unique_id) + return + + @recorded_by_proxy_async + async def test_play_with_invalid_and_valid_file_sources_with_play_media(self): + caller = self.identity_client.create_user() + target = self.identity_client.create_user() + unique_id, call_connection, _ = await self.establish_callconnection_voip(caller, target) + + connected_event = self.check_for_event('CallConnected', call_connection._call_connection_id, timedelta(seconds=15)) + participant_updated_event = self.check_for_event('ParticipantsUpdated', call_connection._call_connection_id, timedelta(seconds=15)) + + if connected_event is None: + raise ValueError("Caller CallConnected event is None") + if participant_updated_event is None: + raise ValueError("Caller ParticipantsUpdated event is None") + + file_prompt = [FileSource(url=self.file_source_url), FileSource(url="https://dummy.com/dummyurl.wav")] + + await call_connection._play_media( + play_source=file_prompt, + play_to=[target] + ) + + play_failed_event_to_target = self.check_for_event('PlayFailed', call_connection._call_connection_id, timedelta(seconds=30)) + print(play_failed_event_to_target) + if play_failed_event_to_target is None: + raise ValueError("PlayFailed event is None") + + await self.terminate_call(unique_id) + return + + +