Skip to content

Commit 3397960

Browse files
committed
add connect api to how to and remove not supporting room
1 parent afce34a commit 3397960

File tree

3 files changed

+119
-6
lines changed

3 files changed

+119
-6
lines changed

articles/communication-services/concepts/call-automation/call-automation.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ ms.author: askaur
1313

1414
Azure Communication Services Call Automation provides developers the ability to build server-based, intelligent call workflows, and call recording for voice and Public Switched Telephone Network(PSTN) channels. The SDKs, available in C#, Java, JavaScript and Python, use an action-event model to help you build personalized customer interactions. Your communication applications can listen to real-time call events and perform control plane actions (like answer, transfer, play audio, start recording, etc.) to steer and control calls based on your business logic.
1515

16-
> [!NOTE]
17-
> Call Automation currently doesn't support [Rooms](../rooms/room-concept.md) calls.
18-
1916
## Common use cases
2017

2118
Some of the common use cases that can be built using Call Automation include:

articles/communication-services/how-tos/call-automation/actions-for-call-control.md

Lines changed: 119 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Call Automation uses a REST API interface to receive requests for actions and pr
1818

1919
Call Automation supports various other actions to manage call media and recording that have separate guides.
2020

21-
> [!NOTE]
22-
> Call Automation currently doesn't support [Rooms](../../concepts/rooms/room-concept.md) calls.
23-
2421
As a prerequisite, we recommend you to read these articles to make the most of this guide:
2522

2623
1. Call Automation [concepts guide](../../concepts/call-automation/call-automation.md#call-actions) that describes the action-event programming model and event callbacks.
@@ -169,6 +166,125 @@ The response provides you with CallConnection object that you can use to take fu
169166
2. `ParticipantsUpdated` event that contains the latest list of participants in the call.
170167
![Sequence diagram for placing an outbound call.](media/make-call-flow.png)
171168

169+
## Connect to a call
170+
171+
You can connect to a call using a call locator. When connecting a call, it's necessary to provide a callback url. Communication Services post all subsequent events about this call to that url.
172+
173+
Currently, we have 3 different CallLocators:
174+
175+
Connecting to a call using ServerCallLocator
176+
### [csharp](#tab/csharp)
177+
178+
```csharp
179+
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
180+
CallLocator serverCallLocator = new ServerCallLocator("<ServerCallId>");
181+
ConnctCallResult response = await client.ConnectAsync(serverCallLocator, callbackUri);
182+
```
183+
184+
### [Java](#tab/java)
185+
186+
```java
187+
String callbackUri = "https://<myendpoint>/Events"; //the callback endpoint where you want to receive subsequent events
188+
CallLocator serverCallLocator = new ServerCallLocator("<ServerCallId>");
189+
ConnectCallResult response = client.connectCall(serverCallLocator, callbackUri).block();
190+
```
191+
192+
### [JavaScript](#tab/javascript)
193+
194+
```javascript
195+
const callbackUri = "https://<myendpoint>/Events"; // the callback endpoint where you want to receive subsequent events
196+
const serverCallLocator = { kind: "serverCallLocator", id: "<serverCallId>" };
197+
const response = await client.connectCall(serverCallLocator, callbackUri);
198+
```
199+
200+
### [Python](#tab/python)
201+
202+
```python
203+
callback_uri = "https://<myendpoint>/Events" # the callback endpoint where you want to receive subsequent events
204+
server_call_locator = ServerCallLocator("<server_call_id>")
205+
call_connection_properties = client.connect_call(call_locator=server_call_locator, callback_url=callback_uri)
206+
```
207+
208+
-----
209+
210+
Connecting to a call using GroupCallLocator
211+
### [csharp](#tab/csharp)
212+
213+
```csharp
214+
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
215+
CallLocator groupCallLocator = new GroupCallLocator("<GroupCallId>");
216+
ConnctCallResult response = await client.ConnectAsync(groupCallLocator, callbackUri);
217+
```
218+
219+
### [Java](#tab/java)
220+
221+
```java
222+
String callbackUri = "https://<myendpoint>/Events"; //the callback endpoint where you want to receive subsequent events
223+
CallLocator groupCallLocator = new GroupCallLocator("<GroupCallId>");
224+
ConnectCallResult response = client.connectCall(groupCallLocator, callbackUri).block();
225+
```
226+
227+
### [JavaScript](#tab/javascript)
228+
229+
```javascript
230+
const callbackUri = "https://<myendpoint>/Events"; // the callback endpoint where you want to receive subsequent events
231+
const groupCallLocator = { kind: "groupCallLocator", id: "<groupCallId>" };
232+
const response = await client.connectCall(groupCallLocator, callbackUri);
233+
```
234+
235+
### [Python](#tab/python)
236+
237+
```python
238+
callback_uri = "https://<myendpoint>/Events" # the callback endpoint where you want to receive subsequent events
239+
group_call_locator = GroupCallLocator("<group_call_id>")
240+
call_connection_properties = client.connect_call(call_locator=group_call_locator, callback_url=callback_uri)
241+
```
242+
243+
-----
244+
245+
Connecting to a call using RoomCallLocator
246+
### [csharp](#tab/csharp)
247+
248+
```csharp
249+
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
250+
CallLocator roomCallLocator = new GroupCallLocator("<RoomId>");
251+
ConnctCallResult response = await client.ConnectAsync(roomCallLocator, callbackUri);
252+
```
253+
254+
### [Java](#tab/java)
255+
256+
```java
257+
String callbackUri = "https://<myendpoint>/Events"; //the callback endpoint where you want to receive subsequent events
258+
CallLocator roomCallLocator = new RoomCallLocator("<RoomId>");
259+
ConnectCallResult response = client.connectCall(roomCallLocator, callbackUri).block();
260+
```
261+
262+
### [JavaScript](#tab/javascript)
263+
264+
```javascript
265+
const roomCallLocator = { kind: "roomCallLocator", id: "<RoomId>" };
266+
const callbackUri = "https://<myendpoint>/Events"; // the callback endpoint where you want to receive subsequent events
267+
const response = await client.connectCall(roomCallLocator, callbackUri);
268+
```
269+
270+
### [Python](#tab/python)
271+
272+
```python
273+
callback_uri = "https://<myendpoint>/Events" # the callback endpoint where you want to receive subsequent events
274+
room_call_locator = RoomCallLocator("<room_id>")
275+
call_connection_properties = client.connect_call(call_locator=room_call_locator, callback_url=callback_uri)
276+
```
277+
278+
-----
279+
280+
The response provides you with CallConnection object that you can use to take further actions on this call once it's connected. Once it connects to the call, two events are published to the callback endpoint you provided earlier:
281+
282+
1. `CallConnected` event notifying that you have connected to the call.
283+
2. `ParticipantsUpdated` event that contains the latest list of participants in the call.
284+
285+
![Sequence diagram for connecting to call.](media/connect-call-flow.png)
286+
287+
172288
## Answer an incoming call
173289

174290
Once you've subscribed to receive [incoming call notifications](../../concepts/call-automation/incoming-call-notification.md) to your resource, you will answer an incoming call. When answering a call, it's necessary to provide a callback url. Communication Services post all subsequent events about this call to that url.
15 KB
Loading

0 commit comments

Comments
 (0)