Skip to content

Commit b78b706

Browse files
committed
Reconcile TOC titles and headings
Also check content and update as needed.
1 parent 1a6d1df commit b78b706

File tree

6 files changed

+283
-211
lines changed

6 files changed

+283
-211
lines changed

articles/communication-services/how-tos/calling-sdk/includes/manage-calls/manage-calls-android.md

Lines changed: 93 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
author: probableprime
33
ms.service: azure-communication-services
44
ms.topic: include
5-
ms.date: 09/08/2021
6-
ms.author: rifox
5+
ms.date: 06/05/2025
6+
ms.author: micahvivion
77
---
88
[!INCLUDE [Install SDK](../install-sdk/install-sdk-android.md)]
99

1010
## Place a call
1111

12-
To create and start a call you need to call the `CallAgent.startCall()` method and provide the `Identifier` of the callee(s).
13-
To join a group call you need to call the `CallAgent.join()` method and provide the groupId. Group IDs must be in GUID or UUID format.
12+
To create and start a call, you need to call the `CallAgent.startCall()` method and provide the `Identifier` of the recipient or recipients.
1413

15-
Call creation and start are synchronous. The call instance allows you to subscribe to all events on the call.
14+
To join a group call, you need to call the `CallAgent.join()` method and provide the `groupId`. Group IDs must be in GUID or UUID format.
15+
16+
Call creation and start are synchronous. The call instance enables you to subscribe to all events on the call.
1617

1718
### Place a 1:1 call to a user
19+
1820
To place a call to another Communication Services user, invoke the `call` method on `callAgent` and pass an object with `communicationUserId` key.
21+
1922
```java
2023
StartCallOptions startCallOptions = new StartCallOptions();
2124
Context appContext = this.getApplicationContext();
@@ -25,11 +28,14 @@ call oneToOneCall = callAgent.startCall(appContext, participants, startCallOptio
2528
```
2629

2730
### Place a 1:n call with users and PSTN
31+
2832
> [!NOTE]
29-
> Please check [details of PSTN calling offering](../../../../concepts/numbers/sub-eligibility-number-capability.md). For preview program access, [apply to the early adopter program](https://aka.ms/ACS-EarlyAdopter).
33+
> See [details of PSTN calling offering](../../../../concepts/numbers/sub-eligibility-number-capability.md). For preview program access, [apply to the early adopter program](https://aka.ms/ACS-EarlyAdopter).
34+
35+
To place a 1:n call to a user and a public switched telephone network (PSTN) number, you need to specify the phone number of the recipient or recipients.
36+
37+
Your Communication Services resource must be configured to enable PSTN calling:
3038

31-
To place a 1:n call to a user and a PSTN number you have to specify the phone number of callee.
32-
Your Communication Services resource must be configured to allow PSTN calling:
3339
```java
3440
CommunicationUserIdentifier acsUser1 = new CommunicationUserIdentifier(<USER_ID>);
3541
PhoneNumberIdentifier acsUser2 = new PhoneNumberIdentifier("<PHONE_NUMBER>");
@@ -40,7 +46,8 @@ Call groupCall = callAgent.startCall(participants, startCallOptions);
4046
```
4147

4248
## Accept a call
43-
To accept a call, call the 'accept' method on a call object.
49+
50+
To accept a call, call the `accept` method on a call object.
4451

4552
```java
4653
Context appContext = this.getApplicationContext();
@@ -59,7 +66,7 @@ acceptCallOptions.setVideoOptions(new VideoOptions(new LocalVideoStream(desiredC
5966
Call call = incomingCall.accept(context, acceptCallOptions).get();
6067
```
6168

62-
The incoming call can be obtained by subscribing to the `onIncomingCall` event on the `callAgent` object:
69+
Obtain the incoming call by subscribing to the `onIncomingCall` event on the `callAgent` object:
6370

6471
```java
6572
// Assuming "callAgent" is an instance property obtained by calling the 'createCallAgent' method on CallClient instance
@@ -77,17 +84,19 @@ public Call retrieveIncomingCall() {
7784

7885
## Join a room call
7986

80-
Use the `CallAgent` and `RoomCallLocator` to join a room call by specifying a `roomId`. The `CallAgent.join` method will return a `Call` object:
87+
Use the `CallAgent` and `RoomCallLocator` to join a room call by specifying a `roomId`. The `CallAgent.join` method returns a `Call` object:
8188

8289
```Java
8390
val roomCallLocator = RoomCallLocator(roomId)
8491
call = callAgent.join(applicationContext, roomCallLocator, joinCallOptions)
8592
```
8693

87-
A `room` offers application developers better control over **who** can join a call, **when** they meet and **how** they collaborate. To learn more about `rooms`, you can read the [conceptual documentation](../../../../concepts/rooms/room-concept.md) or follow the [quick start guide](../../../../quickstarts/rooms/join-rooms-call.md).
94+
A `room` offers application developers better control over *who* can join a call, *when* they meet and *how* they collaborate. For more information about rooms, see [Rooms API for structured meetings](../../../../concepts/rooms/room-concept.md) and [Join a room call](../../../../quickstarts/rooms/join-rooms-call.md).
8895

8996
## Join a group call
90-
To start a new group call or join an ongoing group call you have to call the 'join' method and pass an object with a `groupId` property. The value has to be a GUID.
97+
98+
To start a new group call or join an ongoing group call, you need to call the `join` method and pass an object with a `groupId` property. The value has to be a GUID.
99+
91100
```java
92101
Context appContext = this.getApplicationContext();
93102
GroupCallLocator groupCallLocator = new GroupCallLocator("<GUID>");
@@ -123,16 +132,16 @@ CallState callState = call.getState();
123132
```
124133

125134
It returns a string representing the current state of a call:
126-
* 'NONE' - initial call state
127-
* 'EARLY_MEDIA' - indicates a state in which an announcement is played before call is connected
128-
* 'CONNECTING' - initial transition state once call is placed or accepted
129-
* 'RINGING' - for an outgoing call - indicates call is ringing for remote participants
130-
* 'CONNECTED' - call is connected
131-
* 'LOCAL_HOLD' - call is put on hold by local participant, no media is flowing between local endpoint and remote participant(s)
132-
* 'REMOTE_HOLD' - call is put on hold by a remote participant, no media is flowing between local endpoint and remote participant(s)
133-
* 'DISCONNECTING' - transition state before call goes to 'Disconnected' state
134-
* 'DISCONNECTED' - final call state
135-
* 'IN_LOBBY' - in lobby for a Teams meeting interoperability
135+
* `NONE` - initial call state
136+
* `EARLY_MEDIA` - indicates a state in which an announcement is played before call is connected
137+
* `CONNECTING` - initial transition state once call is placed or accepted
138+
* `RINGING` - for an outgoing call - indicates call is ringing for remote participants
139+
* `CONNECTED` - call connected
140+
* `LOCAL_HOLD` - call placed on hold by local participant with no media flowing between local endpoint and remote participants
141+
* `REMOTE_HOLD` - call placed on hold by a remote participant with no media flowing between local endpoint and remote participants
142+
* `DISCONNECTING` - transition state before call goes to `Disconnected` state
143+
* `DISCONNECTED` - final call state
144+
* `IN_LOBBY` - in lobby for a Teams meeting interoperability
136145

137146
To learn why a call ended, inspect `callEndReason` property. It contains code/subcode:
138147

@@ -164,7 +173,7 @@ List<LocalVideoStream> localVideoStreams = call.getLocalVideoStreams();
164173

165174
## Mute and unmute
166175

167-
To mute or unmute the local endpoint you can use the `mute` and `unmute` asynchronous APIs:
176+
To mute or unmute the local endpoint, you can use the `mute` and `unmute` asynchronous APIs:
168177

169178
```java
170179
Context appContext = this.getApplicationContext();
@@ -174,10 +183,11 @@ call.unmute(appContext).get();
174183

175184
## Change the volume of the call
176185

177-
While you are in a call, the hardware volume keys on the phone should allow the user to change the call volume.
178-
This is done by using the method `setVolumeControlStream` with the stream type `AudioManager.STREAM_VOICE_CALL` on the Activity where the call is being placed.
179-
This allows the hardware volume keys to change the volume of the call (denoted by a phone icon or something similar on the volume slider), preventing changing the volume for other sound profiles, like alarms, media or system wide volume. For more information, you can check [Handling changes in audio output
180-
| Android Developers](https://developer.android.com/guide/topics/media-apps/volume-and-earphones).
186+
While participants are in a call, the hardware volume keys on the phone should enable the user to change the call volume.
187+
188+
Use the method `setVolumeControlStream` with the stream type `AudioManager.STREAM_VOICE_CALL` on the Activity where the call is happening.
189+
190+
This method enables the hardware volume keys to change the volume of the call, denoted by a phone icon or something similar on the volume slider. It also prevents changes to volume by other sound profiles, like alarms, media, or system wide volume. For more information, see [Handling changes in audio output | Android Developers](https://developer.android.com/guide/topics/media-apps/volume-and-earphones).
181191

182192
```java
183193
@Override
@@ -189,18 +199,21 @@ protected void onCreate(Bundle savedInstanceState) {
189199

190200
## Remote participants management
191201

192-
All remote participants are represented by `RemoteParticipant` type and are available through the `remoteParticipants` collection on a call instance.
202+
All remote participants have the `RemoteParticipant` type and are available through the `remoteParticipants` collection on a call instance.
193203

194204
### List participants in a call
205+
195206
The `remoteParticipants` collection returns a list of remote participants in given call:
207+
196208
```java
197209
List<RemoteParticipant> remoteParticipants = call.getRemoteParticipants(); // [remoteParticipant, remoteParticipant....]
198210
```
199211

200212
### Add a participant to a call
201213

202-
To add a participant to a call (either a user or a phone number) you can invoke `addParticipant`.
203-
This will synchronously return the remote participant instance.
214+
To add a participant to a call (either a user or a phone number), you can call the `addParticipant` operation.
215+
216+
This operation synchronously returns the remote participant instance.
204217

205218
```java
206219
const acsUser = new CommunicationUserIdentifier("<acs user id>");
@@ -211,9 +224,13 @@ RemoteParticipant remoteParticipant2 = call.addParticipant(acsPhone, addPhoneNum
211224
```
212225

213226
### Remove participant from a call
214-
To remove a participant from a call (either a user or a phone number) you can invoke `removeParticipant`.
215-
This will resolve asynchronously once the participant is removed from the call.
216-
The participant will also be removed from `remoteParticipants` collection.
227+
228+
To remove a participant from a call (either a user or a phone number), you can call the `removeParticipant` operation.
229+
230+
This operation resolves asynchronously once the participant is removed from the call.
231+
232+
The participant is also removed from `remoteParticipants` collection.
233+
217234
```java
218235
RemoteParticipant acsUserRemoteParticipant = call.getParticipants().get(0);
219236
RemoteParticipant acsPhoneRemoteParticipant = call.getParticipants().get(1);
@@ -222,91 +239,102 @@ call.removeParticipant(acsPhoneRemoteParticipant).get();
222239
```
223240

224241
### Remote participant properties
225-
Any given remote participant has a set of properties and collections associated with it:
226242

227-
* Get the identifier for this remote participant.
228-
Identity is one of the 'Identifier' types
229-
```java
230-
CommunicationIdentifier participantIdentifier = remoteParticipant.getIdentifier();
231-
```
243+
Any given remote participant has a set of associated properties and collections:
232244

233-
* Get state of this remote participant.
234-
```java
235-
ParticipantState state = remoteParticipant.getState();
236-
```
237-
State can be one of
238-
* 'IDLE' - initial state
239-
* 'EARLY_MEDIA' - announcement is played before participant is connected to the call
240-
* 'RINGING' - participant call is ringing
241-
* 'CONNECTING' - transition state while participant is connecting to the call
242-
* 'CONNECTED' - participant is connected to the call
243-
* 'HOLD' - participant is on hold
244-
* 'IN_LOBBY' - participant is waiting in the lobby to be admitted. Currently only used in Teams interop scenario
245-
* 'DISCONNECTED' - final state - participant is disconnected from the call
245+
- Get the identifier for this remote participant.
246+
247+
Identity is one of the `Identifier` types:
248+
249+
```java
250+
CommunicationIdentifier participantIdentifier = remoteParticipant.getIdentifier();
251+
```
252+
253+
- Get the state of this remote participant.
254+
255+
```java
256+
ParticipantState state = remoteParticipant.getState();
257+
```
258+
259+
State can be one of:
260+
261+
* `IDLE` - initial state
262+
* `EARLY_MEDIA` - announcement is played before participant is connected to the call
263+
* `RINGING` - participant call is ringing
264+
* `CONNECTING` - transition state while participant is connecting to the call
265+
* `CONNECTED` - participant is connected to the call
266+
* `HOLD` - participant is on hold
267+
* `IN_LOBBY` - participant is waiting in the lobby to be admitted. Currently only used in Teams interop scenario
268+
* `DISCONNECTED` - final state - participant is disconnected from the call
246269

247270
* To learn why a participant left the call, inspect `callEndReason` property:
271+
248272
```java
249273
CallEndReason callEndReason = remoteParticipant.getCallEndReason();
250274
```
251275

252276
* To check whether this remote participant is muted or not, inspect the `isMuted` property:
277+
253278
```java
254279
boolean isParticipantMuted = remoteParticipant.isMuted();
255280
```
256281

257282
* To check whether this remote participant is speaking or not, inspect the `isSpeaking` property:
283+
258284
```java
259285
boolean isParticipantSpeaking = remoteParticipant.isSpeaking();
260286
```
261287

262288
* To inspect all video streams that a given participant is sending in this call, check the `videoStreams` collection:
289+
263290
```java
264291
List<RemoteVideoStream> videoStreams = remoteParticipant.getVideoStreams(); // [RemoteVideoStream, RemoteVideoStream, ...]
265292
```
266293
### Mute other participants
294+
267295
> [!NOTE]
268-
> To use this API please use the Azure Communication Services Calling Android SDK version 2.11.0 or higher.
296+
> Use the Azure Communication Services Calling Android SDK version 2.11.0 or higher.
269297

270-
Now when a PSTN participant is muted, they should get an announcement that they have been muted and that they can press a key combination (e.g. *6) to unmute themselves. When they press *6, they should be unmuted.
298+
When a PSTN participant is muted, they receive an announcement that they're muted and that they can press a key combination (such as **\*6**) to unmute themselves. When they press **\*6**, they are unmuted.
271299
272-
To mute all other participants in a call, use the `muteAllRemoteParticipants` API on the call.
300+
To mute all other participants in a call, use the `muteAllRemoteParticipants` API operation.
273301
274302
```java
275303
call.muteAllRemoteParticipants();
276304
```
277305
278-
To mute a specific remote participant, use the `mute` API on a given remote participant.
306+
To mute a specific remote participant, use the `mute` API operation on a given remote participant.
279307
280308
```java
281309
remoteParticipant.mute();
282310
```
283311
284-
To notify the local participant they have been muted by others, subscribe to the `onMutedByOthers` event.
312+
To notify the local participant that they're muted by others, subscribe to the `onMutedByOthers` event.
285313

286314
## Using Foreground Services
287315

288-
In cases when you want to run a user visible task even when your application is in background, you can use [Foreground Services](https://developer.android.com/guide/components/foreground-services).
316+
If you want to run a user-visible task even when your application is in background, you can use [Foreground Services](https://developer.android.com/guide/components/foreground-services).
289317

290-
Using Foreground Services, you can for example, keeps a user visible notification when your application has an active call. This way, even if the user goes to the homescreen or removes the application from the [recent's screen](https://developer.android.com/guide/components/activities/recents), the call will continue to be active.
318+
Use Foreground Services, for example, to provide users with a visible notification when your application has an active call. This way, even if the user goes to the homescreen or removes the application from the [recents screen](https://developer.android.com/guide/components/activities/recents), the call continues to be active.
291319

292320
If you don't use a Foreground Service while in a call, navigating to the homescreen can keep the call active, but removing the application from the recent's screen can stop the call if the Android OS kills your application's process.
293321
294-
You should start the Foreground Service when you start/join a call, for example:
322+
You should start the Foreground Service when a user starts or joins a call, for example:
295323
296324
```java
297325
call = callAgent.startCall(context, participants, options);
298326
startService(yourForegroundServiceIntent);
299327
```
300328
301-
And stop the Foreground Service when you hang up the call or the call's status is Disconnected, for example:
329+
You should also stop the Foreground Service when you hang up the call or the call's status is Disconnected, for example:
302330

303331
```java
304332
call.hangUp(new HangUpOptions()).get();
305333
stopService(yourForegroundServiceIntent);
306334
```
307335

308-
### Notes on using Foreground Services
336+
### Foreground Service details
309337

310-
Keep in mind that scenarios like stopping an already running Foreground Service when the app is removed from the recent's list, will remove the user visible notification and the Android OS can keep your application process alive for some extra period of time, meaning that the call can still be active during this period.
338+
Keep in mind that scenarios like stopping an already running Foreground Service when the app is removed from the recent's list removes the user-visible notification. In this case the Android OS can keep your application process alive for some extra period of time, meaning that the call can remain active during this period.
311339
312-
If your application is stopping the Foreground Service on the service `onTaskRemoved` method for example, your application can start/stop audio and video according to your [Activity Lifecycle](https://developer.android.com/guide/components/activities/activity-lifecycle) like stopping audio and video when your activity is destroyed with the `onDestroy` method override.
340+
If your application is stopping the Foreground Service on the service `onTaskRemoved` method, for example, your application can start or stop audio and video according to your [Activity Lifecycle](https://developer.android.com/guide/components/activities/activity-lifecycle). Such as stopping audio and video when your activity is destroyed with the `onDestroy` method override.

0 commit comments

Comments
 (0)