Skip to content

Commit 4489128

Browse files
authored
Recorded live tests + GA5 changes (#41253)
1 parent c570649 commit 4489128

File tree

30 files changed

+103
-299
lines changed

30 files changed

+103
-299
lines changed

sdk/communication/azure-communication-callautomation/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/communication/azure-communication-callautomation",
5-
"Tag": "python/communication/azure-communication-callautomation_4be693f217"
5+
"Tag": "python/communication/azure-communication-callautomation_396e206eb1"
66
}

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_automation_client.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ def connect_call(
279279
callback_uri=callback_url,
280280
operation_context=kwargs.pop("operation_context", None),
281281
call_intelligence_options=call_intelligence_options,
282-
media_streaming_options=media_streaming_options._to_generated() if media_streaming_options else None,
283-
transcription_options=transcription_options._to_generated() if transcription_options else None
282+
media_streaming_options=media_streaming_options._to_generated() if media_streaming_options else None, # pylint:disable=protected-access
283+
transcription_options=transcription_options._to_generated() if transcription_options else None # pylint:disable=protected-access
284284
)
285285

286286
process_repeatability_first_sent(kwargs)
@@ -351,8 +351,8 @@ def create_call(
351351
targets = [serialize_identifier(p) for p in target_participant]
352352
except TypeError:
353353
targets = [serialize_identifier(target_participant)]
354-
media_config = media_streaming._to_generated() if media_streaming else None
355-
transcription_config = transcription._to_generated() if transcription else None
354+
media_config = media_streaming._to_generated() if media_streaming else None # pylint:disable=protected-access
355+
transcription_config = transcription._to_generated() if transcription else None # pylint:disable=protected-access
356356
create_call_request = CreateCallRequest(
357357
targets=targets,
358358
callback_uri=callback_url,
@@ -462,10 +462,8 @@ def answer_call(
462462
call_intelligence_options=call_intelligence_options,
463463
answered_by=serialize_communication_user_identifier(
464464
self.source) if self.source else None,
465-
media_streaming_options=media_streaming._to_generated(
466-
) if media_streaming else None,
467-
transcription_options=transcription._to_generated()
468-
if transcription else None,
465+
media_streaming_options=media_streaming._to_generated() if media_streaming else None, # pylint:disable=protected-access
466+
transcription_options=transcription._to_generated() if transcription else None, # pylint:disable=protected-access
469467
operation_context=operation_context
470468
)
471469

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_automation_client_async.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ async def connect_call(
293293
callback_uri=callback_url,
294294
operation_context=kwargs.pop("operation_context", None),
295295
call_intelligence_options=call_intelligence_options,
296-
media_streaming_options=media_streaming_options._to_generated() if media_streaming_options else None,
297-
transcription_options=transcription_options._to_generated() if transcription_options else None
296+
media_streaming_options=media_streaming_options._to_generated() if media_streaming_options else None, # pylint:disable=protected-access
297+
transcription_options=transcription_options._to_generated() if transcription_options else None # pylint:disable=protected-access
298298
)
299299

300300
process_repeatability_first_sent(kwargs)
@@ -365,8 +365,8 @@ async def create_call(
365365
targets = [serialize_identifier(p) for p in target_participant]
366366
except TypeError:
367367
targets = [serialize_identifier(target_participant)]
368-
media_config = media_streaming._to_generated() if media_streaming else None
369-
transcription_config = transcription._to_generated() if transcription else None
368+
media_config = media_streaming._to_generated() if media_streaming else None # pylint:disable=protected-access
369+
transcription_config = transcription._to_generated() if transcription else None # pylint:disable=protected-access
370370
create_call_request = CreateCallRequest(
371371
targets=targets,
372372
callback_uri=callback_url,
@@ -473,10 +473,8 @@ async def answer_call(
473473
answer_call_request = AnswerCallRequest(
474474
incoming_call_context=incoming_call_context,
475475
callback_uri=callback_url,
476-
media_streaming_options=media_streaming._to_generated(
477-
) if media_streaming else None,
478-
transcription_options=transcription._to_generated()
479-
if transcription else None,
476+
media_streaming_options=media_streaming._to_generated() if media_streaming else None, # pylint:disable=protected-access
477+
transcription_options=transcription._to_generated() if transcription else None, # pylint:disable=protected-access
480478
answered_by=serialize_communication_user_identifier(self.source) if self.source else None,
481479
call_intelligence_options=call_intelligence_options,
482480
operation_context=operation_context

sdk/communication/azure-communication-callautomation/tests/callautomation_test_case.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ def establish_callconnection_voip(self, caller, target, *, cognitive_service_ena
183183
def establish_callconnection_pstn(self, caller, target) -> tuple:
184184
return self._establish_callconnection(caller, target, is_pstn=True)
185185

186-
def establish_callconnection_voip_answercall_withcustomcontext(self, caller, target) -> tuple:
187-
return self._establish_callconnection(caller, target, custom_context=True)
188-
189186
def establish_callconnection_voip_with_streaming_options(self, caller, target, options, is_transcription) -> tuple:
190187
return self._establish_callconnection(
191188
caller, target, options=options, is_transcription=is_transcription
@@ -194,7 +191,7 @@ def establish_callconnection_voip_with_streaming_options(self, caller, target, o
194191
def establish_callconnection_voip_connect_call(self, caller, target) -> tuple:
195192
return self._establish_callconnection(caller, target, connect_call=True)
196193

197-
def _establish_callconnection(self, caller, target, cognitive_service_enabled: Optional[bool] = False, is_pstn: bool = False, custom_context: bool = False, options=None, is_transcription: bool = False, connect_call: bool = False) -> tuple:
194+
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:
198195
call_automation_client_caller = self._create_call_automation_client(caller)
199196
call_automation_client_target = self._create_call_automation_client(target)
200197

@@ -209,7 +206,7 @@ def _establish_callconnection(self, caller, target, cognitive_service_enabled: O
209206
caller_connection_id = self._validate_create_call_result(create_call_result)
210207

211208
incoming_call_context = self._wait_for_incoming_call(unique_id)
212-
answer_call_result = self._answer_call(call_automation_client_target, incoming_call_context, custom_context)
209+
answer_call_result = self._answer_call(call_automation_client_target, incoming_call_context)
213210

214211
call_connection_caller = self._create_call_connection_client(caller_connection_id)
215212
call_connection_target = self._create_call_connection_client(answer_call_result.call_connection_id)
@@ -274,15 +271,10 @@ def _wait_for_incoming_call(self, unique_id):
274271
raise ValueError("incoming_call_event is None")
275272
return incoming_call_event["incomingCallContext"]
276273

277-
def _answer_call(self, client, context, custom_context):
278-
if custom_context:
279-
result = client.answer_call(
280-
incoming_call_context=context, callback_url=self.dispatcher_callback, voip_headers={"foo": "bar"}
281-
)
282-
else:
283-
result = client.answer_call(
284-
incoming_call_context=context, callback_url=self.dispatcher_callback
285-
)
274+
def _answer_call(self, client, context):
275+
result = client.answer_call(
276+
incoming_call_context=context, callback_url=self.dispatcher_callback
277+
)
286278
if result is None:
287279
raise ValueError("Invalid answer_call result")
288280
return result
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f268-85f4-343a0d000338", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f268-85f4-343a0d000338"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f16b-85f4-343a0d000337", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f16b-85f4-343a0d000337"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LWpwZWEtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zb3haUEFtWFRVRy1OcDQzWWljTGZnP2k9MTAtNjAtMS04MyZlPTYzODc3NDA3OTU5ODEyODcxOQ==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "3d1b219c-677a-4a16-96c3-77cec088292a"}, "CallConnected": {"id": "b55ab8f8-38fb-473d-aa78-6c1fcda267d2", "source": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2024-09-01-preview", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "08002380-b89d-4304-a8dd-9f353482d7bf", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LWpwZWEtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zb3haUEFtWFRVRy1OcDQzWWljTGZnP2k9MTAtNjAtMS04MyZlPTYzODc3NDA3OTU5ODEyODcxOQ==", "correlationId": "3d1b219c-677a-4a16-96c3-77cec088292a", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-03-17T17:48:16.384762+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf"}, "ParticipantsUpdated": {"id": "3ebb5150-1436-4451-8c76-54dc3b9ec6b8", "source": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f16b-85f4-343a0d000337", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f16b-85f4-343a0d000337"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f268-85f4-343a0d000338", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f268-85f4-343a0d000338"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 3, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2024-09-01-preview", "callConnectionId": "08002380-b89d-4304-a8dd-9f353482d7bf", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LWpwZWEtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zb3haUEFtWFRVRy1OcDQzWWljTGZnP2k9MTAtNjAtMS04MyZlPTYzODc3NDA3OTU5ODEyODcxOQ==", "correlationId": "3d1b219c-677a-4a16-96c3-77cec088292a", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-03-17T17:48:20.1274372+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf"}, "CancelAddParticipantSucceeded": {"id": "522c611f-f4a1-4061-aaaa-629054d0dd75", "source": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf", "type": "Microsoft.Communication.CancelAddParticipantSucceeded", "data": {"invitationId": "ec414aa2-e017-452e-a077-3d188382a0aa", "version": "2024-09-01-preview", "resultInformation": {"code": 200, "subCode": 5300, "message": "addParticipants failed for participant 8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000026-4519-f35e-85f4-343a0d000339. Underlying reason: The conversation has ended. DiagCode: 0#5300.@"}, "callConnectionId": "08002380-b89d-4304-a8dd-9f353482d7bf", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LWpwZWEtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zb3haUEFtWFRVRy1OcDQzWWljTGZnP2k9MTAtNjAtMS04MyZlPTYzODc3NDA3OTU5ODEyODcxOQ==", "correlationId": "3d1b219c-677a-4a16-96c3-77cec088292a", "publicEventType": "Microsoft.Communication.CancelAddParticipantSucceeded"}, "time": "2025-03-17T17:48:22.0638623+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf"}, "CallDisconnected": {"id": "50806cde-a554-4e8c-8b05-e4bdd3bca645", "source": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2024-09-01-preview", "resultInformation": {"code": 200, "subCode": 7000, "message": "The conversation has ended. DiagCode: 0#7000.@"}, "callConnectionId": "08002380-b89d-4304-a8dd-9f353482d7bf", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LWpwZWEtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9zb3haUEFtWFRVRy1OcDQzWWljTGZnP2k9MTAtNjAtMS04MyZlPTYzODc3NDA3OTU5ODEyODcxOQ==", "correlationId": "3d1b219c-677a-4a16-96c3-77cec088292a", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-03-17T17:48:23.1850512+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08002380-b89d-4304-a8dd-9f353482d7bf"}}
1+
{"IncomingCall": {"to": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-72ac-2c8a-0848220052c4", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-72ac-2c8a-0848220052c4"}}, "from": {"kind": "communicationUser", "rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-726f-2c8a-0848220052c3", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-726f-2c8a-0848220052c3"}}, "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LNlVWblpEOC0wYVR6VEZqNmJ3QkJ3P2k9MTAtNjAtMTI0LTE1NSZlPTYzODgzMjgxMjU3NzI1MzEwNQ==", "callerDisplayName": "REDACTED", "incomingCallContext": "REDACTED", "correlationId": "35b55b00-a44e-411d-a584-d5e8099f9176"}, "ParticipantsUpdated": {"id": "4d7818db-bdb7-414f-a797-1a2abfc4e181", "source": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03", "type": "Microsoft.Communication.ParticipantsUpdated", "data": {"participants": [{"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-72ac-2c8a-0848220052c4", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-72ac-2c8a-0848220052c4"}}, "isMuted": false, "isOnHold": false}, {"identifier": {"rawId": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-726f-2c8a-0848220052c3", "kind": "communicationUser", "communicationUser": {"id": "8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-726f-2c8a-0848220052c3"}}, "isMuted": false, "isOnHold": false}], "sequenceNumber": 3, "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "version": "2025-05-15", "callConnectionId": "08006680-05dd-489b-b379-c8e32c401f03", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LNlVWblpEOC0wYVR6VEZqNmJ3QkJ3P2k9MTAtNjAtMTI0LTE1NSZlPTYzODgzMjgxMjU3NzI1MzEwNQ==", "correlationId": "35b55b00-a44e-411d-a584-d5e8099f9176", "publicEventType": "Microsoft.Communication.ParticipantsUpdated"}, "time": "2025-05-21T21:50:54.3761624+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03"}, "CallConnected": {"id": "0dacad35-fcad-44d6-b502-c45388d05a7d", "source": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03", "type": "Microsoft.Communication.CallConnected", "data": {"version": "2025-05-15", "resultInformation": {"code": 200, "subCode": 0, "message": ""}, "callConnectionId": "08006680-05dd-489b-b379-c8e32c401f03", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LNlVWblpEOC0wYVR6VEZqNmJ3QkJ3P2k9MTAtNjAtMTI0LTE1NSZlPTYzODgzMjgxMjU3NzI1MzEwNQ==", "correlationId": "35b55b00-a44e-411d-a584-d5e8099f9176", "publicEventType": "Microsoft.Communication.CallConnected"}, "time": "2025-05-21T21:50:51.2004761+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03"}, "CancelAddParticipantSucceeded": {"id": "2eccf15d-839e-48c3-b9d5-0ea24cd08336", "source": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03", "type": "Microsoft.Communication.CancelAddParticipantSucceeded", "data": {"invitationId": "42e87e78-34c6-44c0-93c4-c30506bfc2db", "version": "2025-05-15", "resultInformation": {"code": 487, "subCode": 5234, "message": "addParticipants failed for participant 8:acs:6d889502-3d7a-41a8-befa-d21fd80e8767_00000027-94b5-72ea-2c8a-0848220052c5. Underlying reason: The Call Has Been Cancelled. DiagCode: 487#5234.@"}, "callConnectionId": "08006680-05dd-489b-b379-c8e32c401f03", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LNlVWblpEOC0wYVR6VEZqNmJ3QkJ3P2k9MTAtNjAtMTI0LTE1NSZlPTYzODgzMjgxMjU3NzI1MzEwNQ==", "correlationId": "35b55b00-a44e-411d-a584-d5e8099f9176", "publicEventType": "Microsoft.Communication.CancelAddParticipantSucceeded"}, "time": "2025-05-21T21:50:56.2951141+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03"}, "CallDisconnected": {"id": "69024f11-baf3-43cd-a3bf-3cc989d88f78", "source": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03", "type": "Microsoft.Communication.CallDisconnected", "data": {"version": "2025-05-15", "resultInformation": {"code": 200, "subCode": 7000, "message": "The conversation has ended. DiagCode: 0#7000.@"}, "callConnectionId": "08006680-05dd-489b-b379-c8e32c401f03", "serverCallId": "aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LXVzd2UtMDMtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LNlVWblpEOC0wYVR6VEZqNmJ3QkJ3P2k9MTAtNjAtMTI0LTE1NSZlPTYzODgzMjgxMjU3NzI1MzEwNQ==", "correlationId": "35b55b00-a44e-411d-a584-d5e8099f9176", "publicEventType": "Microsoft.Communication.CallDisconnected"}, "time": "2025-05-21T21:50:57.3457146+00:00", "specversion": "1.0", "datacontenttype": "application/json", "subject": "calling/callConnections/08006680-05dd-489b-b379-c8e32c401f03"}}

0 commit comments

Comments
 (0)