Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ com.azure:azure-analytics-synapse-spark;1.0.0-beta.5;1.0.0-beta.6
com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.5;1.0.0-beta.6
com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.4;1.0.0-beta.5
com.azure:azure-code-customization-parent;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-communication-callautomation;1.5.2;1.6.0-beta.2
com.azure:azure-communication-callautomation;1.5.2;1.6.0
com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5
com.azure:azure-communication-chat;1.6.4;1.7.0-beta.1
com.azure:azure-communication-common;1.4.4;1.5.0-beta.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Release History

## 1.6.0-beta.2 (Unreleased)
## 1.6.0 (2026-01-26)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Support for MicrosoftTeamsAppIdentifier CommunicationIdentifier

## 1.5.2 (2025-10-27)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This package contains a Java SDK for Azure Communication Call Automation Service
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-communication-callautomation</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<groupId>com.azure</groupId>
<artifactId>azure-communication-callautomation</artifactId>
<packaging>jar</packaging>
<version>1.6.0-beta.2</version> <!-- {x-version-update;com.azure:azure-communication-callautomation;current} -->
<version>1.6.0</version> <!-- {x-version-update;com.azure:azure-communication-callautomation;current} -->

<name>Microsoft Azure client library for Call Automation service</name>
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.azure.communication.common.CommunicationIdentifier;
import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.common.MicrosoftTeamsAppIdentifier;
import com.azure.communication.common.MicrosoftTeamsUserIdentifier;
import com.azure.communication.common.PhoneNumberIdentifier;
import com.azure.communication.common.TeamsExtensionUserIdentifier;
Expand Down Expand Up @@ -65,6 +66,16 @@ public CallInvite(TeamsExtensionUserIdentifier targetIdentity) {
this.customCallingContext = new CustomCallingContext(null, new HashMap<>());
}

/**
* Create a CallInvite object with MicrosoftTeamsAppIdentifier
* @param targetIdentity Target's MicrosoftTeamsAppIdentifier
*/
public CallInvite(MicrosoftTeamsAppIdentifier targetIdentity) {
this.targetParticipant = targetIdentity;
this.sourceCallerIdNumber = null;
this.customCallingContext = new CustomCallingContext(null, new HashMap<>());
}

/**
* Get target's CommunicationIdentifier
* @return target's CommunicationIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.azure.communication.common.CommunicationIdentifier;
import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.common.MicrosoftTeamsAppIdentifier;
import com.azure.communication.common.MicrosoftTeamsUserIdentifier;
import com.azure.communication.common.PhoneNumberIdentifier;
import com.azure.communication.common.TeamsExtensionUserIdentifier;
Expand Down Expand Up @@ -90,6 +91,17 @@ public TransferCallToParticipantOptions(TeamsExtensionUserIdentifier targetParti
this.customCallingContext = new CustomCallingContext(null, new HashMap<>());
}

/**
* Constructor
*
* @param targetParticipant {@link MicrosoftTeamsAppIdentifier} contains information for TransferTarget(to whom the call is transferred).
*/
public TransferCallToParticipantOptions(MicrosoftTeamsAppIdentifier targetParticipant) {
this.targetParticipant = targetParticipant;
this.sourceCallerIdNumber = null;
this.customCallingContext = new CustomCallingContext(null, new HashMap<>());
}

/**
* Get the operationContext.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import com.azure.communication.callautomation.models.ConnectCallOptions;
import com.azure.communication.callautomation.models.ConnectCallResult;
import com.azure.communication.callautomation.models.RoomCallLocator;
import com.azure.communication.common.CommunicationCloudEnvironment;
import com.azure.communication.common.CommunicationIdentifier;
import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.common.MicrosoftTeamsAppIdentifier;
import com.azure.core.http.rest.Response;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -177,6 +179,67 @@ public void rejectCallWithResponse() {
assertEquals(204, rejectCallResponse.getStatusCode());
}

@Test
public void createCallWithMicrosoftTeamsAppIdentifier() {
CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>(
Collections.singletonList(new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID,
CALL_SERVER_CALL_ID, CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE,
CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201))));
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite callInvite = new CallInvite(teamsAppIdentifier);

CreateCallResult createCallResult = callAutomationAsyncClient.createCall(callInvite, CALL_CALLBACK_URL).block();
assertNotNull(createCallResult);
}

@Test
public void createCallWithResponseMicrosoftTeamsAppIdentifier() {
CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>(
Collections.singletonList(new AbstractMap.SimpleEntry<>(generateCallProperties(CALL_CONNECTION_ID,
CALL_SERVER_CALL_ID, CALL_CALLER_ID, CALL_CALLER_DISPLAY_NAME, CALL_TARGET_ID, CALL_CONNECTION_STATE,
CALL_SUBJECT, CALL_CALLBACK_URL, null, null), 201))));
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite callInvite = new CallInvite(teamsAppIdentifier);
CreateCallOptions callOptions = new CreateCallOptions(callInvite, CALL_CALLBACK_URL);
callOptions.setOperationContext(CALL_SUBJECT);

Response<CreateCallResult> createCallResult
= callAutomationAsyncClient.createCallWithResponse(callOptions).block();

assertNotNull(createCallResult);
assertEquals(201, createCallResult.getStatusCode());
assertNotNull(createCallResult.getValue());
}

@Test
public void redirectCallWithMicrosoftTeamsAppIdentifier() {
CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(
new ArrayList<>(Collections.singletonList(new AbstractMap.SimpleEntry<>("", 204))));

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite target = new CallInvite(teamsAppIdentifier);

callAutomationAsyncClient.redirectCall(CALL_INCOMING_CALL_CONTEXT, target);
}

@Test
public void redirectCallWithResponseMicrosoftTeamsAppIdentifier() {
CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(
new ArrayList<>(Collections.singletonList(new AbstractMap.SimpleEntry<>("", 204))));
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite target = new CallInvite(teamsAppIdentifier);
RedirectCallOptions redirectCallOptions = new RedirectCallOptions(CALL_INCOMING_CALL_CONTEXT, target);
Response<Void> redirectCallResponse
= callAutomationAsyncClient.redirectCallWithResponse(redirectCallOptions).block();

assertNotNull(redirectCallResponse);
assertEquals(204, redirectCallResponse.getStatusCode());
}

@Test
public void connect() {
CallAutomationAsyncClient callAutomationAsyncClient = getCallAutomationAsyncClient(new ArrayList<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import com.azure.communication.callautomation.models.CreateCallResult;
import com.azure.communication.callautomation.models.RedirectCallOptions;
import com.azure.communication.callautomation.models.RejectCallOptions;
import com.azure.communication.common.CommunicationCloudEnvironment;
import com.azure.communication.common.CommunicationIdentifier;
import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.common.MicrosoftTeamsAppIdentifier;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -119,6 +121,32 @@ public void redirectCallWithResponse() {
assertEquals(204, redirectCallResponse.getStatusCode());
}

@Test
public void redirectCallWithMicrosoftTeamsAppIdentifier() {
CallAutomationClient callAutomationClient
= getCallAutomationClient(new ArrayList<>(Collections.singletonList(new SimpleEntry<>("", 204))));
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite target = new CallInvite(teamsAppIdentifier);

callAutomationClient.redirectCall(CALL_INCOMING_CALL_CONTEXT, target);
}

@Test
public void redirectCallWithResponseMicrosoftTeamsAppIdentifier() {
CallAutomationClient callAutomationClient
= getCallAutomationClient(new ArrayList<>(Collections.singletonList(new SimpleEntry<>("", 204))));
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite target = new CallInvite(teamsAppIdentifier);
RedirectCallOptions redirectCallOptions = new RedirectCallOptions(CALL_INCOMING_CALL_CONTEXT, target);

Response<Void> redirectCallResponse
= callAutomationClient.redirectCallWithResponse(redirectCallOptions, Context.NONE);

assertEquals(204, redirectCallResponse.getStatusCode());
}
Comment on lines +124 to +148
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage appears incomplete. The CallAutomationAsyncClientUnitTests includes tests for createCall and createCallWithResponse using MicrosoftTeamsAppIdentifier (lines 183-214 in the async tests), but the CallAutomationClientUnitTests does not include equivalent tests for the synchronous createCall APIs. For consistency and completeness, consider adding corresponding tests in CallAutomationClientUnitTests.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback


@Test
public void rejectCall() {
CallAutomationClient callAutomationClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import com.azure.communication.callautomation.models.RemoveParticipantResult;
import com.azure.communication.callautomation.models.TransferCallResult;
import com.azure.communication.callautomation.models.TransferCallToParticipantOptions;
import com.azure.communication.common.CommunicationCloudEnvironment;
import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.common.MicrosoftTeamsAppIdentifier;
import com.azure.communication.common.PhoneNumberIdentifier;
import com.azure.core.http.rest.Response;
import com.azure.core.exception.HttpResponseException;
Expand Down Expand Up @@ -163,6 +165,40 @@ public void transferToParticipantCallPhoneNumberIdentifier() {
assertEquals(CALL_OPERATION_CONTEXT, transferCallResult.getOperationContext());
}

@Test
public void transferToParticipantCallMicrosoftTeamsAppIdentifier() {
CallConnectionAsync callConnectionAsync
= getCallAutomationAsyncClient(new ArrayList<>(Collections.singletonList(new SimpleEntry<>(
serializeObject(new TransferCallResponseInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))))
.getCallConnectionAsync(CALL_CONNECTION_ID);

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
TransferCallResult transferCallResult
= callConnectionAsync.transferCallToParticipant(teamsAppIdentifier).block();
assertNotNull(transferCallResult);
assertEquals(CALL_OPERATION_CONTEXT, transferCallResult.getOperationContext());
}

@Test
public void transferToParticipantCallWithResponseMicrosoftTeamsAppIdentifier() {
CallConnectionAsync callConnectionAsync
= getCallAutomationAsyncClient(new ArrayList<>(Collections.singletonList(new SimpleEntry<>(
serializeObject(new TransferCallResponseInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))))
.getCallConnectionAsync(CALL_CONNECTION_ID);

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
TransferCallToParticipantOptions transferCallToParticipantOptions
= new TransferCallToParticipantOptions(teamsAppIdentifier).setOperationContext(CALL_OPERATION_CONTEXT);
Response<TransferCallResult> transferCallResultResponse
= callConnectionAsync.transferCallToParticipantWithResponse(transferCallToParticipantOptions).block();

assertNotNull(transferCallResultResponse);
assertEquals(202, transferCallResultResponse.getStatusCode());
assertNotNull(transferCallResultResponse.getValue());
}

@Test
public void transferToParticipantCallWithResponse() {
CallConnectionAsync callConnectionAsync
Expand Down Expand Up @@ -309,6 +345,38 @@ public void addParticipantsWithResponse() {
assertNotNull(addParticipantsResultResponse.getValue());
}

@Test
public void addParticipantWithMicrosoftTeamsAppIdentifier() {
CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(
new ArrayList<>(Collections.singletonList(new SimpleEntry<>(generateAddParticipantsResponse(), 202))))
.getCallConnectionAsync(CALL_CONNECTION_ID);

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
AddParticipantResult addParticipantsResult
= callConnectionAsync.addParticipant(new CallInvite(teamsAppIdentifier)).block();

assertNotNull(addParticipantsResult);
}

@Test
public void addParticipantWithResponseMicrosoftTeamsAppIdentifier() {
CallConnectionAsync callConnectionAsync = getCallAutomationAsyncClient(
new ArrayList<>(Collections.singletonList(new SimpleEntry<>(generateAddParticipantsResponse(), 202))))
.getCallConnectionAsync(CALL_CONNECTION_ID);

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
AddParticipantOptions addParticipantsOptions
= new AddParticipantOptions(new CallInvite(teamsAppIdentifier)).setOperationContext(CALL_OPERATION_CONTEXT);
Response<AddParticipantResult> addParticipantsResultResponse
= callConnectionAsync.addParticipantWithResponse(addParticipantsOptions).block();

assertNotNull(addParticipantsResultResponse);
assertEquals(202, addParticipantsResultResponse.getStatusCode());
assertNotNull(addParticipantsResultResponse.getValue());
}

@Test
public void removeParticipants() {
CallConnectionAsync callConnectionAsync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import com.azure.communication.callautomation.models.TransferCallResult;
import com.azure.communication.callautomation.models.TransferCallToParticipantOptions;
import com.azure.communication.callautomation.models.SipHeaderPrefix;
import com.azure.communication.common.CommunicationCloudEnvironment;
import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.common.MicrosoftTeamsAppIdentifier;
import com.azure.communication.common.PhoneNumberIdentifier;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
Expand Down Expand Up @@ -165,6 +167,37 @@ public void transferToParticipantCallPhoneNumberIdentifier() {
assertEquals(CALL_OPERATION_CONTEXT, transferCallResult.getOperationContext());
}

@Test
public void transferToParticipantCallMicrosoftTeamsAppIdentifier() {
CallConnection callConnection
= getCallAutomationClient(new ArrayList<>(Collections.singletonList(new SimpleEntry<>(
serializeObject(new TransferCallResponseInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))))
.getCallConnection(CALL_CONNECTION_ID);
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
TransferCallResult transferCallResult = callConnection.transferCallToParticipant(teamsAppIdentifier);

assertNotNull(transferCallResult);
assertEquals(CALL_OPERATION_CONTEXT, transferCallResult.getOperationContext());
}

@Test
public void transferToParticipantCallWithResponseMicrosoftTeamsAppIdentifier() {
CallConnection callConnection
= getCallAutomationClient(new ArrayList<>(Collections.singletonList(new SimpleEntry<>(
serializeObject(new TransferCallResponseInternal().setOperationContext(CALL_OPERATION_CONTEXT)), 202))))
.getCallConnection(CALL_CONNECTION_ID);
MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
Response<TransferCallResult> transferCallResultResponse = callConnection.transferCallToParticipantWithResponse(
new TransferCallToParticipantOptions(teamsAppIdentifier).setOperationContext(CALL_OPERATION_CONTEXT),
Context.NONE);

assertNotNull(transferCallResultResponse);
assertEquals(202, transferCallResultResponse.getStatusCode());
assertNotNull(transferCallResultResponse.getValue());
}

@Test
public void transferToParticipantCallWithResponse() {
CallConnection callConnection
Expand Down Expand Up @@ -247,6 +280,35 @@ public void addParticipantsWithResponse() {
assertNotNull(addParticipantsResultResponse.getValue());
}

@Test
public void addParticipantWithMicrosoftTeamsAppIdentifier() {
CallConnection callConnection = getCallAutomationClient(
new ArrayList<>(Collections.singletonList(new SimpleEntry<>(generateAddParticipantsResponse(), 202))))
.getCallConnection(CALL_CONNECTION_ID);

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
AddParticipantResult addParticipantsResult = callConnection.addParticipant(new CallInvite(teamsAppIdentifier));
assertNotNull(addParticipantsResult);
}

@Test
public void addParticipantWithResponseMicrosoftTeamsAppIdentifier() {
CallConnection callConnection = getCallAutomationClient(
new ArrayList<>(Collections.singletonList(new SimpleEntry<>(generateAddParticipantsResponse(), 202))))
.getCallConnection(CALL_CONNECTION_ID);

MicrosoftTeamsAppIdentifier teamsAppIdentifier
= new MicrosoftTeamsAppIdentifier(CALL_TARGET_ID, CommunicationCloudEnvironment.PUBLIC);
CallInvite callInvite = new CallInvite(teamsAppIdentifier);
Response<AddParticipantResult> addParticipantsResultResponse = callConnection.addParticipantWithResponse(
new AddParticipantOptions(callInvite).setOperationContext(CALL_OPERATION_CONTEXT), Context.NONE);

assertNotNull(addParticipantsResultResponse);
assertEquals(202, addParticipantsResultResponse.getStatusCode());
assertNotNull(addParticipantsResultResponse.getValue());
}

@Test
public void removeParticipants() {
CallConnection callConnection
Expand Down