Skip to content

Commit 5f271fd

Browse files
Update teams-interop-call-automation.md
1 parent 554a0d9 commit 5f271fd

File tree

1 file changed

+64
-22
lines changed

1 file changed

+64
-22
lines changed

articles/communication-services/how-tos/call-automation/teams-interop-call-automation.md

Lines changed: 64 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ ms.subservice: call-automation
99
ms.topic: include
1010
ms.date: 03/28/2023
1111
ms.author: visho
12-
ms.custom: private_preview
12+
ms.custom: devx-track-extended-java, devx-track-js, devx-track-python
13+
zone_pivot_groups: acs-js-csharp-java-python
1314
services: azure-communication-services
1415
---
1516

@@ -78,7 +79,8 @@ Response:
7879
## Step 3: Add a Teams user to an existing Communication Services call controlled by Call Automation APIs
7980
You need to complete the prerequisite step and have a web service app to control a Communication Services call. Using the callConnection object, add a participant to the call.
8081

81-
## [csharp](#tab/csharp)
82+
::: zone pivot="programming-language-csharp"
83+
8284
```csharp
8385
CallAutomationClient client = new CallAutomationClient('<Connection_String>');
8486
AnswerCallResult answer = await client.AnswerCallAsync(incomingCallContext, new Uri('<Callback_URI>'));
@@ -89,24 +91,46 @@ await answer.Value.CallConnection.AddParticipantAsync(
8991
});
9092
```
9193

92-
## [Java](#tab/java)
94+
::: zone-end
95+
96+
::: zone pivot="programming-language-java"
9397

9498
```java
95-
CallAutomationClient client = new CallAutomationClientBuilder().connectionString("<resource_connection_string>").buildClient();
99+
CallAutomationClient client = new CallAutomationClientBuilder().connectionString("<resource_connection_string>").buildClient();
100+
AnswerCallResult answer = client.answerCall(incomingCallContext, "<Callback_URI>"));
101+
answer.getCallConnection().addParticipant(
102+
new CallInvite(new MicrosoftTeamsUserIdentifier("<Teams_User_Guid>"))
103+
.setSourceDisplayName("Jack (Contoso Tech Support)"));
96104
```
97105

98-
## [JavaScript](#tab/javascript)
106+
::: zone-end
107+
108+
::: zone pivot="programming-language-javascript"
99109

100-
```javascript
110+
```typescript
101111
const client = new CallAutomationClient("<resource_connection_string>");
112+
const answer = await client.answerCall(incomingCallContext, "<Callback_URI>"));
113+
answer.callConnection.addParticipant({
114+
targetParticipant: { microsoftTeamsUserId: "<Teams_User_Guid>" },
115+
sourceDisplayName: "Jack (Contoso Tech Support)"
116+
});
102117
```
103118

104-
## [Python](#tab/python)
119+
::: zone-end
120+
121+
::: zone pivot="programming-language-python"
105122

106123
```python
107124
call_automation_client = CallAutomationClient.from_connection_string("<resource_connection_string>")
125+
answer = call_automation_client.answer_call(incoming_call_context = incoming_call_context, callback_url = "<Callback_URI>")
126+
call_connection_client = call_automation_client.get_call_connection(answer.call_connection_id)
127+
call_connection_client.add_participant(target_participant = CallInvite(
128+
target = MicrosoftTeamsUserIdentifier(user_id="<USER_ID>"),
129+
source_display_name = "Jack (Contoso Tech Support)"))
108130
```
109131

132+
::: zone-end
133+
110134
-----
111135

112136
On the Microsoft Teams desktop client, Jack's call will be sent to the Microsoft Teams user through an incoming call toast notification.
@@ -117,57 +141,75 @@ After the Microsoft Teams user accepts the call, the in-call experience for the
117141
![Screenshot of Microsoft Teams user accepting the call and entering the in-call experience for the Microsoft Teams user.](./media/active-call-teams-user.png)
118142

119143
## Step 4: Remove a Teams user from an existing Communication Services call controlled by Call Automation APIs
120-
## [csharp](#tab/csharp)
144+
145+
::: zone pivot="programming-language-csharp"
121146

122147
```csharp
123148
await answer.Value.CallConnection.RemoveParticipantAsync(new MicrosoftTeamsUserIdentifier('<Teams_User_Guid>'));
124149
```
125150

126-
## [Java](#tab/java)
151+
::: zone-end
127152

128-
```java
153+
::: zone pivot="programming-language-java"
129154

155+
```java
156+
answer.getCallConnection().removeParticipant(new MicrosoftTeamsUserIdentifier("<Teams_User_Guid>"));
130157
```
131158

132-
## [JavaScript](#tab/javascript)
159+
::: zone-end
133160

134-
```javascript
161+
::: zone pivot="programming-language-javascript"
135162

163+
```typescript
164+
answer.callConnection.removeParticipant({ microsoftTeamsUserId: "<Teams_User_Guid>" });
136165
```
137166

138-
## [Python](#tab/python)
167+
::: zone-end
139168

140-
```python
169+
::: zone pivot="programming-language-python"
141170

171+
```python
172+
call_connection_client.remove_participant(target_participant = MicrosoftTeamsUserIdentifier(user_id="<USER_ID>"))
142173
```
143174

175+
::: zone-end
176+
144177
-----
145178

146179
### Optional feature: Transfer to a Teams user from an existing Communication Services call controlled by Call Automation APIs
147-
## [csharp](#tab/csharp)
180+
181+
::: zone pivot="programming-language-csharp"
148182

149183
```csharp
150-
await answer.Value.CallConnection.TransferCallToParticipantAsync(new CallInvite(new MicrosoftTeamsUserIdentifier('<Teams_User_Guid>')));
184+
await answer.Value.CallConnection.TransferCallToParticipantAsync(new MicrosoftTeamsUserIdentifier('<Teams_User_Guid>'));
151185
```
152186

153-
## [Java](#tab/java)
187+
::: zone-end
154188

155-
```java
189+
::: zone pivot="programming-language-java"
156190

191+
```java
192+
answer.getCallConnection().transferCallToParticipant(new MicrosoftTeamsUserIdentifier("<Teams_User_Guid>"));
157193
```
158194

159-
## [JavaScript](#tab/javascript)
195+
::: zone-end
160196

161-
```javascript
197+
::: zone pivot="programming-language-javascript"
162198

199+
```typescript
200+
answer.callConnection.transferCallToParticipant({ microsoftTeamsUserId: "<Teams_User_Guid>" });
163201
```
164202

165-
## [Python](#tab/python)
203+
::: zone-end
166204

167-
```python
205+
::: zone pivot="programming-language-python"
168206

207+
```python
208+
call_connection_client.transfer_call_to_participant(target_participant = MicrosoftTeamsUserIdentifier(user_id = "<USER_ID>"))
169209
```
170210

211+
::: zone-end
212+
171213
-----
172214

173215
### How to tell if your Tenant isn't enabled for this preview?

0 commit comments

Comments
 (0)