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