Skip to content

Commit 1548f84

Browse files
authored
Teams Phone Call Details issue resolved. (#42670)
* TeamsPhoneCallDetails issue resolved. * resolved the issue
1 parent 8a75bd3 commit 1548f84

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def transfer_call_to_participant(
250250
"""
251251
user_custom_context = (
252252
CustomCallingContext(voip_headers=voip_headers, sip_headers=sip_headers,
253-
teams_phone_call_details=teams_phone_call_details)
253+
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details else None)
254254
if sip_headers or voip_headers or teams_phone_call_details
255255
else None
256256
)
@@ -320,8 +320,11 @@ def add_participant(
320320

321321
user_custom_context = None
322322
if sip_headers or voip_headers or teams_phone_call_details:
323-
user_custom_context = CustomCallingContext(voip_headers=voip_headers, sip_headers=sip_headers,
324-
teams_phone_call_details=teams_phone_call_details)
323+
user_custom_context = CustomCallingContext(
324+
voip_headers=voip_headers,
325+
sip_headers=sip_headers,
326+
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details else None,
327+
)
325328
add_participant_request = AddParticipantRequest(
326329
participant_to_add=serialize_identifier(target_participant),
327330
source_caller_id_number=serialize_phone_identifier(source_caller_id_number),

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,8 +1110,8 @@ def __init__(self, *,
11101110

11111111
def _to_generated(self):
11121112
return TeamsPhoneCallDetailsInternal(
1113-
teams_phone_caller_details=self.teams_phone_caller,
1114-
teams_phone_source_details=self.teams_phone_source,
1113+
teams_phone_caller_details=self.teams_phone_caller._to_generated() if self.teams_phone_caller else None,
1114+
teams_phone_source_details=self.teams_phone_source._to_generated() if self.teams_phone_source else None,
11151115
session_id=self.session_id,
11161116
intent=self.intent,
11171117
call_topic=self.call_topic,
@@ -1173,7 +1173,7 @@ def __init__(
11731173

11741174
def _to_generated(self):
11751175
return TeamsPhoneCallerDetailsInternal(
1176-
caller=self.caller,
1176+
caller=serialize_identifier(self.caller),
11771177
name=self.name,
11781178
phone_number=self.phone_number,
11791179
record_id=self.record_id,
@@ -1219,7 +1219,7 @@ def _to_generated(self):
12191219
source=serialize_identifier(self.source),
12201220
language=self.language,
12211221
status=self.status,
1222-
intended_targets=[serialize_identifier(p) for p in self.intended_targets.values()]
1222+
intended_targets={k: serialize_identifier(v) for k, v in self.intended_targets.items()} if self.intended_targets else None
12231223
)
12241224

12251225
class SummarizationOptions:

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ async def transfer_call_to_participant(
253253
"""
254254
user_custom_context = (
255255
CustomCallingContext(voip_headers=voip_headers, sip_headers=sip_headers,
256-
teams_phone_call_details=teams_phone_call_details)
256+
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details else None)
257257
if sip_headers or voip_headers or teams_phone_call_details
258258
else None
259259
)
@@ -323,16 +323,19 @@ async def add_participant(
323323

324324
user_custom_context = None
325325
if sip_headers or voip_headers or teams_phone_call_details:
326-
user_custom_context = CustomCallingContext(voip_headers=voip_headers, sip_headers=sip_headers,
327-
teams_phone_call_details=teams_phone_call_details)
326+
user_custom_context = CustomCallingContext(
327+
voip_headers=voip_headers,
328+
sip_headers=sip_headers,
329+
teams_phone_call_details=teams_phone_call_details._to_generated() if teams_phone_call_details else None,
330+
)
328331
add_participant_request = AddParticipantRequest(
329332
participant_to_add=serialize_identifier(target_participant),
330333
source_caller_id_number=serialize_phone_identifier(source_caller_id_number),
331334
source_display_name=source_display_name,
332-
invitation_timeout_in_seconds=invitation_timeout,
335+
invitation_timeout_in_seconds=invitation_timeout,
333336
operation_context=operation_context,
334337
operation_callback_uri=operation_callback_url,
335-
custom_calling_context=user_custom_context,
338+
custom_calling_context=user_custom_context,
336339
)
337340
process_repeatability_first_sent(kwargs)
338341
response = await self._call_connection_client.add_participant(

0 commit comments

Comments
 (0)