diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java index 7ed499ce6b5b0..b943b2a0bbd13 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java @@ -3,6 +3,11 @@ package com.azure.communication.callautomation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + import com.azure.communication.callautomation.models.events.AddParticipantFailed; import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; import com.azure.communication.callautomation.models.events.AnswerFailed; @@ -27,6 +32,9 @@ import com.azure.communication.callautomation.models.events.DialogStarted; import com.azure.communication.callautomation.models.events.DialogTransfer; import com.azure.communication.callautomation.models.events.HoldFailed; +import com.azure.communication.callautomation.models.events.MediaStreamingFailed; +import com.azure.communication.callautomation.models.events.MediaStreamingStarted; +import com.azure.communication.callautomation.models.events.MediaStreamingStopped; import com.azure.communication.callautomation.models.events.ParticipantsUpdated; import com.azure.communication.callautomation.models.events.PlayCanceled; import com.azure.communication.callautomation.models.events.PlayCompleted; @@ -38,26 +46,19 @@ import com.azure.communication.callautomation.models.events.RecordingStateChanged; import com.azure.communication.callautomation.models.events.RemoveParticipantFailed; import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; +import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; +import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; +import com.azure.communication.callautomation.models.events.StartRecordingFailed; import com.azure.communication.callautomation.models.events.TranscriptionFailed; import com.azure.communication.callautomation.models.events.TranscriptionResumed; import com.azure.communication.callautomation.models.events.TranscriptionStarted; import com.azure.communication.callautomation.models.events.TranscriptionStopped; -import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; -import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; import com.azure.communication.callautomation.models.events.TranscriptionUpdated; -import com.azure.communication.callautomation.models.events.MediaStreamingStarted; -import com.azure.communication.callautomation.models.events.MediaStreamingStopped; -import com.azure.communication.callautomation.models.events.MediaStreamingFailed; import com.azure.core.models.CloudEvent; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonProviders; import com.azure.json.JsonReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - /** * Event handler for taking care of event related tasks. */ @@ -127,6 +128,8 @@ private static CallAutomationEventBase parseSingleCloudEvent(String data, String ret = ParticipantsUpdated.fromJson(jsonReader); } else if (Objects.equals(eventType, "Microsoft.Communication.RecordingStateChanged")) { ret = RecordingStateChanged.fromJson(jsonReader); + }else if (Objects.equals(eventType, "Microsoft.Communication.StartRecordingFailed")) { + ret = StartRecordingFailed.fromJson(jsonReader); } else if (Objects.equals(eventType, "Microsoft.Communication.PlayCompleted")) { ret = PlayCompleted.fromJson(jsonReader); } else if (Objects.equals(eventType, "Microsoft.Communication.PlayFailed")) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java index f31440fae4ecd..c5290114fd79d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java @@ -3,6 +3,22 @@ package com.azure.communication.callautomation; +import java.io.IOException; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.channels.AsynchronousFileChannel; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.security.InvalidParameterException; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + import com.azure.communication.callautomation.implementation.CallRecordingsImpl; import com.azure.communication.callautomation.implementation.accesshelpers.RecordingStateResponseConstructorProxy; import com.azure.communication.callautomation.implementation.converters.CommunicationIdentifierConverter; @@ -24,8 +40,8 @@ import com.azure.communication.callautomation.models.GroupCallLocator; import com.azure.communication.callautomation.models.ParallelDownloadOptions; import com.azure.communication.callautomation.models.RecordingStateResult; -import com.azure.communication.callautomation.models.ServerCallLocator; import com.azure.communication.callautomation.models.RoomCallLocator; +import com.azure.communication.callautomation.models.ServerCallLocator; import com.azure.communication.callautomation.models.StartRecordingOptions; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; @@ -38,29 +54,13 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; +import static com.azure.core.util.FluxUtil.monoError; +import static com.azure.core.util.FluxUtil.withContext; import com.azure.core.util.logging.ClientLogger; + import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.io.IOException; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.ByteBuffer; -import java.nio.channels.AsynchronousFileChannel; -import java.nio.file.OpenOption; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.security.InvalidParameterException; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -import static com.azure.core.util.FluxUtil.monoError; -import static com.azure.core.util.FluxUtil.withContext; - /** * CallRecordingAsync. */ @@ -126,23 +126,24 @@ Mono> startWithResponseInternal(StartRecordingOpt } private StartCallRecordingRequestInternal getStartCallRecordingRequest(StartRecordingOptions options) { - CallLocator callLocator = options.getCallLocator(); - CallLocatorInternal callLocatorInternal - = new CallLocatorInternal().setKind(CallLocatorKindInternal.fromString(callLocator.getKind().toString())); - - if (callLocator.getKind() == CallLocatorKind.GROUP_CALL_LOCATOR) { - callLocatorInternal.setGroupCallId(((GroupCallLocator) callLocator).getGroupCallId()); - } else if (callLocator.getKind() == CallLocatorKind.SERVER_CALL_LOCATOR) { - callLocatorInternal.setServerCallId(((ServerCallLocator) callLocator).getServerCallId()); - } else if (callLocator.getKind() == CallLocatorKind.ROOM_CALL_LOCATOR) { - callLocatorInternal.setRoomId(((RoomCallLocator) callLocator).getRoomId()); - } else { - throw logger.logExceptionAsError(new InvalidParameterException("callLocator has invalid kind.")); + StartCallRecordingRequestInternal request = new StartCallRecordingRequestInternal(); + if (options.getCallLocator() != null) { + CallLocator callLocator = options.getCallLocator(); + CallLocatorInternal callLocatorInternal = new CallLocatorInternal() + .setKind(CallLocatorKindInternal.fromString(callLocator.getKind().toString())); + + if (callLocator.getKind() == CallLocatorKind.GROUP_CALL_LOCATOR) { + callLocatorInternal.setGroupCallId(((GroupCallLocator) callLocator).getGroupCallId()); + } else if (callLocator.getKind() == CallLocatorKind.SERVER_CALL_LOCATOR) { + callLocatorInternal.setServerCallId(((ServerCallLocator) callLocator).getServerCallId()); + } else if (callLocator.getKind() == CallLocatorKind.ROOM_CALL_LOCATOR) { + callLocatorInternal.setRoomId(((RoomCallLocator) callLocator).getRoomId()); + } else { + throw logger.logExceptionAsError(new InvalidParameterException("callLocator has invalid kind.")); + } + request.setCallLocator(callLocatorInternal); } - StartCallRecordingRequestInternal request - = new StartCallRecordingRequestInternal().setCallLocator(callLocatorInternal); - if (options.getRecordingContent() != null) { request .setRecordingContentType(RecordingContentInternal.fromString(options.getRecordingContent().toString())); @@ -185,7 +186,9 @@ private StartCallRecordingRequestInternal getStartCallRecordingRequest(StartReco if (options.isPauseOnStart() != null) { request.setPauseOnStart(options.isPauseOnStart()); } - + if (options.getCallConnectionId() != null) { + request.setCallConnectionId(options.getCallConnectionId()); + } return request; } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java index 3ce0f9593793d..4a37801ffcfd6 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/CreateCallRequestInternal.java @@ -54,9 +54,9 @@ public final class CreateCallRequestInternal implements JsonSerializable { + /* + * The communication identifier of the target user. + */ + private CommunicationIdentifierModel to; + + /* + * The communication identifier of the user who initiated the call. + */ + private CommunicationIdentifierModel from; + + /* + * Display name of caller. + */ + private String callerDisplayName; + + /* + * The server call id. + */ + private String serverCallId; + + /* + * Custom Context of Incoming Call + */ + private CustomCallingContext customContext; + + /* + * Incoming call context. + */ + private String incomingCallContext; + + /* + * The communication identifier of the user on behalf of whom the call is made. + */ + private CommunicationIdentifierModel onBehalfOfCallee; + + /* + * Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + */ + private String correlationId; + + /** + * Creates an instance of IncomingCall class. + */ + public IncomingCall() { + } + + /** + * Get the to property: The communication identifier of the target user. + * + * @return the to value. + */ + public CommunicationIdentifierModel getTo() { + return this.to; + } + + /** + * Get the from property: The communication identifier of the user who initiated the call. + * + * @return the from value. + */ + public CommunicationIdentifierModel getFrom() { + return this.from; + } + + /** + * Get the callerDisplayName property: Display name of caller. + * + * @return the callerDisplayName value. + */ + public String getCallerDisplayName() { + return this.callerDisplayName; + } + + /** + * Get the serverCallId property: The server call id. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Get the customContext property: Custom Context of Incoming Call. + * + * @return the customContext value. + */ + public CustomCallingContext getCustomContext() { + return this.customContext; + } + + /** + * Get the incomingCallContext property: Incoming call context. + * + * @return the incomingCallContext value. + */ + public String getIncomingCallContext() { + return this.incomingCallContext; + } + + /** + * Get the onBehalfOfCallee property: The communication identifier of the user on behalf of whom the call is made. + * + * @return the onBehalfOfCallee value. + */ + public CommunicationIdentifierModel getOnBehalfOfCallee() { + return this.onBehalfOfCallee; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingCall if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IncomingCall. + */ + public static IncomingCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingCall deserializedIncomingCall = new IncomingCall(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("to".equals(fieldName)) { + deserializedIncomingCall.to = CommunicationIdentifierModel.fromJson(reader); + } else if ("from".equals(fieldName)) { + deserializedIncomingCall.from = CommunicationIdentifierModel.fromJson(reader); + } else if ("callerDisplayName".equals(fieldName)) { + deserializedIncomingCall.callerDisplayName = reader.getString(); + } else if ("serverCallId".equals(fieldName)) { + deserializedIncomingCall.serverCallId = reader.getString(); + } else if ("customContext".equals(fieldName)) { + deserializedIncomingCall.customContext = CustomCallingContext.fromJson(reader); + } else if ("incomingCallContext".equals(fieldName)) { + deserializedIncomingCall.incomingCallContext = reader.getString(); + } else if ("onBehalfOfCallee".equals(fieldName)) { + deserializedIncomingCall.onBehalfOfCallee = CommunicationIdentifierModel.fromJson(reader); + } else if ("correlationId".equals(fieldName)) { + deserializedIncomingCall.correlationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingCall; + }); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java index e0b92ff693569..69c842a039e7d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/StartRecordingOptions.java @@ -3,12 +3,11 @@ package com.azure.communication.callautomation.models; +import java.util.List; + import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.annotation.Fluent; -import java.util.List; -import java.util.Objects; - /** * The options for creating a call. */ @@ -17,7 +16,7 @@ public final class StartRecordingOptions { /** * Either a {@link GroupCallLocator} or {@link ServerCallLocator} for locating the call. */ - private final CallLocator callLocator; + private CallLocator callLocator; private String recordingStateCallbackUrl; @@ -35,13 +34,22 @@ public final class StartRecordingOptions { private RecordingStorage recordingStorage; + private String callConnectionId; + + /** + * Constructor + * + */ + public StartRecordingOptions() { + } + /** * Constructor * * @param callLocator Either a {@link GroupCallLocator} or {@link ServerCallLocator} for locating the call. */ public StartRecordingOptions(CallLocator callLocator) { - Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); + // Objects.requireNonNull(callLocator, "'callLocator' cannot be null."); this.callLocator = callLocator; } @@ -226,4 +234,23 @@ public StartRecordingOptions setChannelAffinity(List channelAff this.channelAffinity = channelAffinity; return this; } + + /** + * Set the callConnectionId + * + * @param callConnectionId to send state change callbacks. + * @return the {@link callConnectionId} + */ + public StartRecordingOptions setCallConnectionId(String callConnectionId) { + this.callConnectionId = callConnectionId; + return this; + } + + /** + * Get callConnectionId for the call + * @return callConnectionId for the call + */ + public String getCallConnectionId() { + return callConnectionId; + } } diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/StartRecordingFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/StartRecordingFailed.java new file mode 100644 index 0000000000000..39616d313e210 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/StartRecordingFailed.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.communication.callautomation.models.events; + +import java.io.IOException; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; + +/** + * The StartRecordingFailed model. + */ +@Immutable +public final class StartRecordingFailed extends CallAutomationEventBase { + + private StartRecordingFailed() { + + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + super.writeFields(jsonWriter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StartRecordingFailed from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StartRecordingFailed if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StartRecordingFailed. + */ + public static StartRecordingFailed fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + final StartRecordingFailed event = new StartRecordingFailed(); + while (jsonReader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if (!event.readField(fieldName, reader)) { + reader.skipChildren(); + } + } + return event; + }); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java index 90daf237cc3ca..b68814ba55026 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java @@ -45,6 +45,24 @@ public void recordingOperationsTest() { assertThrows(HttpResponseException.class, () -> callRecording.getState(RECORDING_ID).block()); } + @Test + public void recordingOperationsWithCallConnectionIdTest() { + CallAutomationAsyncClient callingServerClient + = CallAutomationUnitTestBase.getCallAutomationAsyncClient(recordingOperationsResponses); + callRecording = callingServerClient.getCallRecordingAsync(); + + validateRecordingState(callRecording.start(new StartRecordingOptions() + .setCallConnectionId(CALL_CONNECTION_ID) + .setRecordingStateCallbackUrl("https://localhost/")), RecordingState.ACTIVE); + + validateOperationWithRecordingState(callRecording.pause(RECORDING_ID), RecordingState.INACTIVE); + + validateOperationWithRecordingState(callRecording.resume(RECORDING_ID), RecordingState.ACTIVE); + + validateOperation(callRecording.stop(RECORDING_ID)); + assertThrows(HttpResponseException.class, () -> callRecording.getState(RECORDING_ID).block()); + } + private void validateRecordingState(Publisher publisher, RecordingState status) { StepVerifier.create(publisher) .consumeNextWith(recordingStateResponse -> validateRecording(recordingStateResponse, status)) diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java index 7dd21d7fb41bd..8e003381c2193 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java @@ -214,4 +214,93 @@ public void createACSCallUnmixedAudioAffinityTest(HttpClient httpClient) { fail("Unexpected exception received", ex); } } + + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void createACSCallAndStartRecordingWithCallConnectionIdAndUnmixedAudioTest(HttpClient httpClient) { + /* Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. create a call from source to one ACS target. + * 3. get updated call properties and check for the connected state. + * 4. start recording with callConnectionId and the call without channel affinity + * 5. stop recording the call + * 6. hang up the call. + * 7. once call is hung up, verify disconnected event + */ + CommunicationIdentityClient communicationIdentityClient + = getCommunicationIdentityClientUsingConnectionString(httpClient).buildClient(); + + String callConnectionId = ""; + try { + // Create caller and receiver + CommunicationUserIdentifier source = communicationIdentityClient.createUser(); + CommunicationUserIdentifier target = communicationIdentityClient.createUser(); + + // Create call automation client and use source as the caller. + CallAutomationClient callerClient = getCallAutomationClientUsingConnectionString(httpClient) + .addPolicy((context, next) -> logHeaders("recordingOperations", next)) + .sourceIdentity(source) + .buildClient(); + + // Create call automation client for receivers. + CallAutomationClient receiverClient = getCallAutomationClientUsingConnectionString(httpClient) + .addPolicy((context, next) -> logHeaders("recordingOperations", next)) + .buildClient(); + + // setup service bus + String uniqueId = serviceBusWithNewCall(source, target); + + // create call and assert response + CreateGroupCallOptions createCallOptions = new CreateGroupCallOptions(Arrays.asList(target), + String.format("%s?q=%s", DISPATCHER_CALLBACK, uniqueId)); + CreateCallResult createCallResult + = callerClient.createGroupCallWithResponse(createCallOptions, null).getValue(); + callConnectionId = createCallResult.getCallConnectionProperties().getCallConnectionId(); + assertNotNull(callConnectionId); + + // wait for incoming call context + String incomingCallContext = waitForIncomingCallContext(uniqueId, Duration.ofSeconds(10)); + assertNotNull(incomingCallContext); + + // answer the call + AnswerCallOptions answerCallOptions = new AnswerCallOptions(incomingCallContext, DISPATCHER_CALLBACK); + AnswerCallResult answerCallResult + = receiverClient.answerCallWithResponse(answerCallOptions, null).getValue(); + assertNotNull(answerCallResult); + + // wait for callConnected + CallConnected callConnected = waitForEvent(CallConnected.class, callConnectionId, Duration.ofSeconds(10)); + assertNotNull(callConnected); + + // get properties + CallConnectionProperties callConnectionProperties + = createCallResult.getCallConnection().getCallProperties(); + assertEquals(CallConnectionState.CONNECTED, callConnectionProperties.getCallConnectionState()); + + // start recording + RecordingStateResult recordingStateResult = callerClient.getCallRecording() + .start(new StartRecordingOptions() + .setRecordingChannel(RecordingChannel.UNMIXED) + .setRecordingContent(RecordingContent.AUDIO) + .setRecordingFormat(RecordingFormat.WAV) + .setRecordingStateCallbackUrl(DISPATCHER_CALLBACK) + .setCallConnectionId(callConnectionId)); + + assertNotNull(recordingStateResult.getRecordingId()); + + // stop recording + callerClient.getCallRecording().stop(recordingStateResult.getRecordingId()); + + // hangup + if (!callConnectionId.isEmpty()) { + CallConnection callConnection = callerClient.getCallConnection(callConnectionId); + callConnection.hangUp(true); + CallDisconnected callDisconnected + = waitForEvent(CallDisconnected.class, callConnectionId, Duration.ofSeconds(10)); + assertNotNull(callDisconnected); + } + } catch (Exception ex) { + fail("Unexpected exception received", ex); + } + } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTestBase.java index f567e8a82ac81..ecaae567aa685 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTestBase.java @@ -20,6 +20,7 @@ public class CallRecordingUnitTestBase { = "aHR0cHM6Ly9jb252LXVzd2UtMDguY29udi5za3lwZS5jb20vY29udi8tby1FWjVpMHJrS3RFTDBNd0FST1J3P2k9ODgmZT02Mzc1Nzc0MTY4MDc4MjQyOTM"; static final String RECORDING_ID = "recordingId"; + static final String CALL_CONNECTION_ID = "callConnectionId"; private final RecordingStateResponseInternal recordingState = new RecordingStateResponseInternal().setRecordingId(RECORDING_ID); diff --git a/sdk/communication/azure-communication-callautomation/swagger/README.md b/sdk/communication/azure-communication-callautomation/swagger/README.md index 315b16c0365f5..29fd46e35cd78 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/README.md +++ b/sdk/communication/azure-communication-callautomation/swagger/README.md @@ -32,7 +32,7 @@ autorest README.md --java --v4 tag: package-2024-09-01-preview use: '@autorest/java@4.1.29' require: - - https://github.com/Azure/azure-rest-api-specs/blob/7347874bc2794b2770c3e7618bd1a5ccab53cb54/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/691fea3efb9ff22b20904e92d5116223f452a3b1/specification/communication/data-plane/CallAutomation/readme.md java: true output-folder: ../ license-header: MICROSOFT_MIT_SMALL