Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes how to integrate TelecomManager with your Android application.
Prerequisites
- An Azure account with an active subscription. Create an account for free.
- A deployed Communication Services resource. Create a Communication Services resource.
- A user access token to enable the calling client. For more information, see Create and manage access tokens.
- Optional: Complete the quickstart to add voice calling to your application.
TelecomManager integration
Important
This feature of Azure Communication Services is currently in preview. Features in preview are publicly available and can be used by all new and existing Microsoft customers.
Preview APIs and SDKs are provided without a service-level agreement. We recommend that you don't use them for production workloads. Certain features might not be supported or capabilities might be constrained.
For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
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
.
Configure TelecomConnectionService
Add TelecomConnectionService
to your App AndroidManifest.xml
.
<application>
...
<service
android:name="com.azure.android.communication.calling.TelecomConnectionService"
android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
android:exported="true">
<intent-filter>
<action android:name="android.telecom.ConnectionService" />
</intent-filter>
</service>
</application>
Initialize call agent with TelecomManagerOptions
With configured instance of TelecomManagerOptions
, we can create the CallAgent
with TelecomManager
enabled.
CallAgentOptions options = new CallAgentOptions();
TelecomManagerOptions telecomManagerOptions = new TelecomManagerOptions("<your app's phone account id>");
options.setTelecomManagerOptions(telecomManagerOptions);
CallAgent callAgent = callClient.createCallAgent(context, credential, options).get();
all call = callAgent.join(context, locator, joinCallOptions);
Configure audio output device
When TelecomManager integration is enabled for the App, the audio output device must be selected via telecom manager API only.
call.setTelecomManagerAudioRoute(android.telecom.CallAudioState.ROUTE_SPEAKER);
Configure call resume behavior
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.
telecomManagerOptions.setResumeCallAutomatically(true);