Skip to content

Commit 3b588b1

Browse files
author
Jill Grant
authored
Merge pull request #269868 from pavelprystinka/pavelprystinka/telecom_manager
Add TelecomManager how-to to Azure Calling for Android
2 parents f0e11a7 + d20b681 commit 3b588b1

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
ms.date: 03/20/2024
3+
ms.topic: how-to
4+
author: pavelprystinka
5+
ms.author: pprystinka
6+
title: TelecomManager integration in Azure Communication Services calling SDK
7+
ms.service: azure-communication-services
8+
ms.subservice: calling
9+
description: Steps on how to integrate TelecomManager with Azure Communication Services calling SDK
10+
---
11+
12+
# Integrate with TelecomManager
13+
14+
This document describes how to integrate TelecomManager with your Android application.
15+
16+
## Prerequisites
17+
18+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
19+
- A deployed Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
20+
- A user access token to enable the calling client. For more information, see [Create and manage access tokens](../../quickstarts/identity/access-tokens.md).
21+
- Optional: Complete the quickstart to [add voice calling to your application](../../quickstarts/voice-video-calling/getting-started-with-calling.md)
22+
23+
## TelecomManager integration
24+
25+
[!INCLUDE [Public Preview Notice](../../includes/public-preview-include.md)]
26+
27+
`TelecomManager` Integration in the Azure Communication Services Android SDK handles interaction with other VoIP and PSTN calling Apps that also integrated with `TelecomManager`.
28+
29+
### Configure `TelecomConnectionService`
30+
Add `TelecomConnectionService` to your App `AndroidManifest.xml`
31+
```
32+
<application>
33+
...
34+
<service
35+
android:name="com.azure.android.communication.calling.TelecomConnectionService"
36+
android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
37+
android:exported="true">
38+
<intent-filter>
39+
<action android:name="android.telecom.ConnectionService" />
40+
</intent-filter>
41+
</service>
42+
</application>
43+
```
44+
45+
### Initialize call agent with TelecomManagerOptions
46+
47+
With configured instance of `TelecomManagerOptions`, we can create the `CallAgent` with `TelecomManager` enabled.
48+
49+
```Java
50+
CallAgentOptions options = new CallAgentOptions();
51+
TelecomManagerOptions telecomManagerOptions = new TelecomManagerOptions("<your app's phone account id>");
52+
options.setTelecomManagerOptions(telecomManagerOptions);
53+
54+
CallAgent callAgent = callClient.createCallAgent(context, credential, options).get();
55+
Call call = callAgent.join(context, locator, joinCallOptions);
56+
```
57+
58+
59+
### Configure audio output device
60+
61+
When TelecomManager integration is enabled for the App, the audio output device has to be selected via telecom manager API only.
62+
63+
```Java
64+
call.setAudioRoute(android.telecom.CallAudioState.ROUTE_SPEAKER);
65+
```
66+
67+
### Configure call resume behavior
68+
69+
When call is interrupted with other call, for instance incoming PSTN call, ACS call is placed `OnHold`. You can configure what happens once PSTN call is over resume call automatically, or wait for user to request call resume.
70+
71+
72+
```Java
73+
telecomManagerOptions.setResumeCallAutomatically(true);
74+
````
75+
76+
## Next steps
77+
- [Learn how to manage video](./manage-video.md)
78+
- [Learn how to manage calls](./manage-calls.md)
79+
- [Learn how to record calls](./record-calls.md)

articles/communication-services/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ items:
404404
items:
405405
- name: Integrate with CallKit in iOS
406406
href: how-tos/calling-sdk/callkit-integration.md
407+
- name: Integrate with TelecomManager on Android
408+
href: how-tos/calling-sdk/telecommanager-integration.md
407409
- name: Enable push notifications
408410
href: how-tos/calling-sdk/push-notifications.md
409411
- name: Using the mobile UI Library for voice and video

0 commit comments

Comments
 (0)