Skip to content

Commit 91141c6

Browse files
juntuchen-msftcochi2williamzhao87
authored
Feature/communication interaction controller (Azure#30301)
* Checking in ServerCalling V3 code as it is now named InteractionController * Moved actions in callConnection into serverClient and make callConnection a POCO * added listParticipants * bug fixing * updated the version to beta6 * Added Media team's SDK * fixed some checkstyle issues * Adding Content Capabilities (Azure#29721) * Adding Recording Operations (Azure#29737) * Polished the code to meet Azure SDK guidelines. Changes are for meeting the guideline and fix errors and warnings during the build. Now the project can be built * Added error handling * updated README.md * deleted callConnectionAsync~ * This is the commit for easy testing. * Fixing checkystyle issue * updated SDK * Updated SDK with review feedback - part 1 * SDK update - part 2 * CallRecording/CallMedia changes (Azure#30062) * Moving ProgressReporter to azure.core * Using PlaySource instead of PlaySourceType * Fixing RecordingResponse * Adding StartRecordingResponse proxy * Renaming StartRecordingResponse to the right RecordingStatusResponse * Finishing to clean the different errors * cleaning * Fixing Proxy * Fixing some checkstyle bugs * Moving ContentClient to CallConnection. Changing PlaySource for FileSource * Delete returns Void * PlaySource instead of FileSource * Adding DownloadToFileOptions. Fixing Play. Fixing Recording. * Fixed optional params * Fixing ParallelDownloadsOptions * Fixing javadoc * Fixing fluent options * event handling * Adding CancelAllMediaOperations methods (Azure#30063) * events update * event update * Added configuration for testing * resolved some mvn deploy issues * Adding unit testing for Recording/Media operations (Azure#30101) * Adding DownloadContent unit tests * Adding DownloadContentLiveTests * Adding DownloadContentAsyncLiveTests * Adding Delete tests * Adding CallMedia unit tests * Adding Recording unit tests * Refactoring Recording Tests * deleted internal events as they are not used * Added event handler * Adding Play Options (Azure#30108) Adding a Play Options object that includes the new operationContext string optional parameter for PlayRequest. * Updated event handler * updated version for deploying * bug fixes * changed package naming * Removing context from Async methods. (Azure#30264) * Initial commit * Checkstyle fix * Changed exception handling * changed the version * fixed versioning pipeline issue * fixed some pipeline building issues * Updated changelog * Sync communication.common back to the main branch * updated client builder as pma updated * updated unit tests to adapt builder changes * Fixing tests (Azure#30329) * change the version back due to previous typo * Fixing the naming of PlayToAll (Azure#30369) * updated sdk according to github feedback * removed AcsEventType as discussed * updated versioning * removed nextLink in ListPartcipantResponse as it is not supported now * updated SDK according to feedback on github draft PR * removed eventgrid events support from the eventParser * Added some unit tests, also fixed some bugs got catched during running unit tests * Added more unit tests * Adding Recording/Play events. (Azure#30422) * Updating Swagger * Adding Recording/Play events * Fixing recording status * Fixing name of Recording state event * Fixing naming for RecordingStatus all over the project * Making build to succeed * Adding RecordingStateChanged tests * Adding Play Test * Updating swagger * Adding Play Events tests * Adding Live Tests for Recording use cases (Azure#30452) * Adding Recording Live Test * Adding Async tests for Recording * Renaming to CallAutomation * Adding Media Live Test * Adding Media Async Live Test * Fixing exceptions on tests * Not doing Play tests * Updating Swagger * Adding Recording/Play events * Fixing recording status * Fixing name of Recording state event * Fixing naming for RecordingStatus all over the project * Making build to succeed * Adding RecordingStateChanged tests * Adding Play Test * Updating swagger * Adding Play Events tests * Merging all updates * Add channel affinity to recording (Azure#30487) * Add channel affinity to recording * Fix bug Co-authored-by: Franko Morales <67804607+cochi2@users.noreply.github.com> Co-authored-by: williamzhao87 <williamzhao87@users.noreply.github.com>
1 parent bc55b2b commit 91141c6

File tree

278 files changed

+12605
-14268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+12605
-14268
lines changed

eng/jacoco-test-coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<dependency>
9999
<groupId>com.azure</groupId>
100100
<artifactId>azure-communication-callingserver</artifactId>
101-
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-communication-callingserver;current} -->
101+
<version>1.0.0-alpha.20220805.1</version> <!-- {x-version-update;com.azure:azure-communication-callingserver;current} -->
102102
</dependency>
103103
<dependency>
104104
<groupId>com.azure</groupId>

eng/versioning/version_client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.2;1.0.0-beta.3
5858
com.azure:azure-aot-graalvm-samples;1.0.0-beta.1;1.0.0-beta.1
5959
com.azure:azure-aot-graalvm-perf;1.0.0-beta.1;1.0.0-beta.1
6060
com.azure:azure-communication-chat;1.2.4;1.3.0
61-
com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5
61+
com.azure:azure-communication-callingserver;1.0.0-alpha.20220805.1;1.0.0-alpha.20220805.1
6262
com.azure:azure-communication-common;1.2.0;1.3.0-beta.2
6363
com.azure:azure-communication-common-perf;1.0.0-beta.1;1.0.0-beta.1
6464
com.azure:azure-communication-sms;1.1.5;1.2.0-beta.1

sdk/communication/azure-communication-callingserver/CHANGELOG.md

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,7 @@
11
# Release History
22

3-
## 1.0.0-beta.5 (Unreleased)
4-
- Added interfaces from `com.azure.core.client.traits` to `CallingServerClientBuilder`
5-
- Added `retryOptions` to `CallingServerClientBuilder`
6-
7-
### Features Added
8-
9-
### Breaking Changes
10-
11-
### Bugs Fixed
12-
13-
### Other Changes
14-
15-
## 1.0.0-beta.4 (2021-10-06)
16-
### Features Added
17-
- Add support for TokenCredential authentication with CallingServerClientBuilder.
18-
- Added support for custom options(Recordingcontenttype, Recordingchanneltype, Recordingformattype) for Mixed Audio feature
19-
20-
### Bugs Fixed
21-
- Using released version of azure-communication-common.
22-
23-
### Other Changes
24-
#### Dependency updates
25-
- Upgraded `azure-communication-common` to 1.0.4
26-
27-
## 1.0.0-beta.3 (2021-07-26)
28-
### Features Added
29-
- Added RedirectPolicy as a new HttpPolicy to redirect requests based on the HttpResponse.
30-
31-
## 1.0.0-beta.2 (2021-06-25)
32-
- Updated sdk and apis documentation.
33-
34-
### Bug Fixes
35-
- Fixed bug with AddParticipant api.
36-
37-
## 1.0.0-beta.1 (2021-06-24)
38-
This is the first release of Azure Communication Service Calling Server. For more information, please see the [README][read_me].
3+
## 1.0.0-alpha.20220805.1 (2022-08-05)
4+
This is the first version of the restart of Azure Communication Service Calling Server. For more information, please see the [README][read_me].
395

406
This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for Java GitHub repo](https://github.com/Azure/azure-sdk-for-java/issues).
417

sdk/communication/azure-communication-callingserver/README.md

Lines changed: 6 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Azure Communication CallingServer Service client library for Java
22

3-
This package contains a Java SDK for Azure Communication CallingServer Service.
3+
This package contains a Java SDK for Azure Communication CallingServer Service. Server Test
44

55
[Source code][source] | [Package (Maven)][package] | [API reference documentation][api_documentation]
66
| [Product documentation][product_docs]
@@ -21,158 +21,20 @@ This package contains a Java SDK for Azure Communication CallingServer Service.
2121
<dependency>
2222
<groupId>com.azure</groupId>
2323
<artifactId>azure-communication-callingserver</artifactId>
24-
<version>1.0.0-beta.4</version>
24+
<version>1.0.0-alpha.20220805.1</version>
2525
</dependency>
2626
```
2727
[//]: # ({x-version-update-end})
2828

2929
## Key concepts
3030

31-
At a high level the Azure Communication CallingServer API will support two kinds of scenarios:
31+
`CallAutomationClient` provides the functionality to make call connection, join call connection, answer incoming call or initialize a server call.
3232

33-
- In-call app: Contoso server app is a participant in the call.
34-
35-
- Out-call app: Contoso server app is not a participant in the call - Server app can subscribe to events for calls between specific users or even all users belonging to the ACS azure resource.
36-
37-
Based on if the Contoso app join a call or not, APIs can be divided into two categories:
38-
39-
- In-call APIs: Contoso app is one of the participant in a call. It can be applicable for app to person (A2P) or person to app (P2A) case, or multi-party/group calls that server apps joined as a participant to provide audio/prompt.
40-
41-
- Out-of-call APIs: Contoso app can invoke these set of APIs without joining a call. It is applicable for actions on P2P calls, A2P calls, P2A calls and group calls.
33+
`EventHandler` provides the functionality to handle event grid events as well as callback events from the ACS resource.
4234

4335
## Examples
4436

45-
### Authenticate the client
46-
47-
48-
You can provide the connection string using the connectionString() function of `CallingServerClientBuilder`. Once you initialized a `CallingServerClient` class, you can do the different server calling operations.
49-
50-
```java readme-sample-createCallingServerClient
51-
// Your connectionString retrieved from your Azure Communication Service
52-
String connectionString = "endpoint=https://<resource-name>.communication.azure.com/;accesskey=<access-key>";
53-
54-
// Initialize the calling server client
55-
final CallingServerClientBuilder builder = new CallingServerClientBuilder();
56-
builder.connectionString(connectionString);
57-
CallingServerClient callingServerClient = builder.buildClient();
58-
```
59-
60-
Alternatively, calling clients can also be authenticated using a valid token credential. With this option,
61-
`AZURE_CLIENT_SECRET`, `AZURE_CLIENT_ID` and `AZURE_TENANT_ID` environment variables need to be set up for authentication.
62-
63-
```java readme-sample-createCallingServerClientWithTokenCredential
64-
// Your endpoint retrieved from your Azure Communication Service
65-
String endpoint = "https://<resource-name>.communication.azure.com";
66-
67-
// Token credential used for managed identity authentication. Depends on `AZURE_CLIENT_SECRET`,
68-
// `AZURE_CLIENT_ID`, and `AZURE_TENANT_ID` environment variables to be set up.
69-
TokenCredential tokenCredential = new DefaultAzureCredentialBuilder().build();
70-
71-
// Initialize the calling server client
72-
CallingServerClient callingServerClient = new CallingServerClientBuilder()
73-
.endpoint(endpoint)
74-
.credential(tokenCredential)
75-
.buildClient();
76-
```
77-
78-
### Create call, Add participant and Hangup a call
79-
80-
#### Create a Call:
81-
82-
```java readme-sample-createCallConnection
83-
CommunicationIdentifier source = new CommunicationUserIdentifier("<acs-user-identity>");
84-
CommunicationIdentifier firstCallee = new CommunicationUserIdentifier("<acs-user-identity-1>");
85-
CommunicationIdentifier secondCallee = new CommunicationUserIdentifier("<acs-user-identity-2>");
86-
87-
List<CommunicationIdentifier> targets = Arrays.asList(firstCallee, secondCallee);
88-
89-
String callbackUri = "<callback-uri-for-notification>";
90-
91-
List<MediaType> requestedMediaTypes = Arrays.asList(MediaType.AUDIO, MediaType.VIDEO);
92-
93-
List<EventSubscriptionType> requestedCallEvents = Arrays.asList(
94-
EventSubscriptionType.DTMF_RECEIVED,
95-
EventSubscriptionType.PARTICIPANTS_UPDATED);
96-
97-
CreateCallOptions createCallOptions = new CreateCallOptions(
98-
callbackUri,
99-
requestedMediaTypes,
100-
requestedCallEvents);
101-
102-
CallConnection callConnection = callingServerClient.createCallConnection(source, targets, createCallOptions);
103-
```
104-
105-
#### Add a participant to a Call:
106-
107-
```java readme-sample-addParticipant
108-
CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier("<acs-user-identity-3>");
109-
callConnection.addParticipant(thirdCallee, "ACS User 3", "<string-for-tracing-responses>");
110-
```
111-
112-
#### Hangup a Call:
113-
114-
```java readme-sample-hangupCallConnection
115-
callConnection.hangup();
116-
```
117-
118-
### Start, Pause, Resume, Stop and Get a recording
119-
120-
#### Start a Recording:
121-
122-
```java readme-sample-startRecording
123-
String serverCallId = "<serverCallId received from starting call>";
124-
String recordingStateCallbackUri = "<webhook endpoint to which calling service can report status>";
125-
ServerCall serverCall = callingServerClient.initializeServerCall(serverCallId);
126-
StartCallRecordingResult result = serverCall.startRecording(recordingStateCallbackUri);
127-
String recordingId = result.getRecordingId();
128-
```
129-
130-
#### Pause a Recording:
131-
132-
```java readme-sample-pauseRecording
133-
serverCall.pauseRecording(recordingId);
134-
```
135-
136-
#### Resume a Recording:
137-
138-
```java readme-sample-resumeRecording
139-
serverCall.resumeRecording(recordingId);
140-
```
141-
142-
#### Stop a Recording:
143-
144-
```java readme-sample-stopRecording
145-
serverCall.stopRecording(recordingId);
146-
```
147-
148-
#### Get the Recording State:
149-
150-
```java readme-sample-getRecordingState
151-
CallRecordingState callRecordingState = callRecordingStateResult.getRecordingState();
152-
```
153-
154-
#### Download a Recording into a file:
155-
156-
```java readme-sample-getRecordingStream
157-
callingServerClient.downloadTo(
158-
recordingUrl,
159-
Paths.get(filePath),
160-
null,
161-
true
162-
);
163-
```
164-
### Play Audio in Call
165-
166-
#### Play Audio:
167-
168-
```java readme-sample-playAudio
169-
String audioFileUri = "<uri of the file to play>";
170-
String audioFileId = "<a name to use for caching the audio file>";
171-
String callbackUri = "<webhook endpoint to which calling service can report status>";
172-
String context = "<Identifier for correlating responses>";
173-
ServerCall serverCall = callingServerClient.initializeServerCall(serverCallId);
174-
PlayAudioResult playAudioResult = serverCall.playAudio(audioFileUri, audioFileId, callbackUri, context);
175-
```
37+
To be Determined
17638

17739
## Troubleshooting
17840

@@ -202,7 +64,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
20264
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
20365
[coc_contact]: mailto:opencode@microsoft.com
20466
[product_docs]: https://docs.microsoft.com/azure/communication-services/
205-
[package]: https://search.maven.org/artifact/com.azure/azure-communication-callingserver
67+
[package]: https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-java-communication-interaction
20668
[api_documentation]: https://aka.ms/java-docs
20769
[call_automation_apis_overview]:https://docs.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation-apis
20870
[call_recording_overview]:https://docs.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording

sdk/communication/azure-communication-callingserver/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trigger:
1111
- sdk/communication/azure-communication-callingserver
1212
exclude:
1313
- sdk/communication/azure-communication-callingserver/pom.xml
14-
14+
1515
pr:
1616
branches:
1717
include:
@@ -29,7 +29,6 @@ extends:
2929
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
3030
parameters:
3131
ServiceDirectory: communication
32-
EnableBatchRelease: true
3332
Artifacts:
3433
- name: azure-communication-callingserver
3534
groupId: com.azure

sdk/communication/azure-communication-callingserver/pom.xml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<groupId>com.azure</groupId>
1616
<artifactId>azure-communication-callingserver</artifactId>
1717
<packaging>jar</packaging>
18-
<version>1.0.0-beta.5</version> <!-- {x-version-update;com.azure:azure-communication-callingserver;current} -->
18+
<version>1.0.0-alpha.20220805.1</version> <!-- {x-version-update;com.azure:azure-communication-callingserver;current} -->
1919

2020
<name>Microsoft Azure client library for CallingServer service</name>
2121
<description>
@@ -24,11 +24,54 @@
2424
</description>
2525
<url>https://github.com/Azure/azure-sdk-for-java</url>
2626

27+
<repositories>
28+
<!-- <repository>-->
29+
<!-- <id>azure-sdk-for-java-communication</id>-->
30+
<!-- <url>https://pkgs.dev.azure.com/azure-sdk/internal/_packaging/azure-sdk-for-java-communication/maven/v1</url>-->
31+
<!-- <releases>-->
32+
<!-- <enabled>true</enabled>-->
33+
<!-- </releases>-->
34+
<!-- <snapshots>-->
35+
<!-- <enabled>true</enabled>-->
36+
<!-- </snapshots>-->
37+
<!-- </repository>-->
38+
<repository>
39+
<id>azure-sdk-for-java-communication-interaction</id>
40+
<url>https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java-communication-interaction/maven/v1</url>
41+
<releases>
42+
<enabled>true</enabled>
43+
</releases>
44+
<snapshots>
45+
<enabled>true</enabled>
46+
</snapshots>
47+
</repository>
48+
</repositories>
49+
2750
<distributionManagement>
2851
<site>
2952
<id>azure-java-build-docs</id>
3053
<url>${site.url}/site/${project.artifactId}</url>
3154
</site>
55+
<!-- <repository>-->
56+
<!-- <id>azure-sdk-for-java-communication</id>-->
57+
<!-- <url>https://pkgs.dev.azure.com/azure-sdk/internal/_packaging/azure-sdk-for-java-communication/maven/v1</url>-->
58+
<!-- <releases>-->
59+
<!-- <enabled>true</enabled>-->
60+
<!-- </releases>-->
61+
<!-- <snapshots>-->
62+
<!-- <enabled>true</enabled>-->
63+
<!-- </snapshots>-->
64+
<!-- </repository>-->
65+
<repository>
66+
<id>azure-sdk-for-java-communication-interaction</id>
67+
<url>https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java-communication-interaction/maven/v1</url>
68+
<releases>
69+
<enabled>true</enabled>
70+
</releases>
71+
<snapshots>
72+
<enabled>true</enabled>
73+
</snapshots>
74+
</repository>
3275
</distributionManagement>
3376

3477
<scm>
@@ -40,12 +83,13 @@
4083
<properties>
4184
<src.dir>src/main</src.dir>
4285
<test.dir>src/test</test.dir>
43-
<jacoco.min.linecoverage>0.70</jacoco.min.linecoverage>
44-
<jacoco.min.branchcoverage>0.70</jacoco.min.branchcoverage>
86+
<jacoco.min.linecoverage>0.75</jacoco.min.linecoverage>
87+
<jacoco.min.branchcoverage>0.65</jacoco.min.branchcoverage>
4588
<jacoco.skip>false</jacoco.skip>
4689
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
4790
<javaModulesSurefireArgLine>
4891
--add-opens com.azure.communication.callingserver/com.azure.communication.callingserver.implementation=ALL-UNNAMED
92+
--add-opens com.azure.communication.common/com.azure.communication.common.implementation=ALL-UNNAMED
4993
</javaModulesSurefireArgLine>
5094
</properties>
5195

@@ -126,9 +170,16 @@
126170
<version>1.5.4</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
127171
<scope>test</scope>
128172
</dependency>
173+
<dependency>
174+
<groupId>org.jacoco</groupId>
175+
<artifactId>org.jacoco.agent</artifactId>
176+
<classifier>runtime</classifier>
177+
<scope>test</scope>
178+
<version>0.8.8</version> <!-- {x-version-update;org.jacoco:org.jacoco.agent;external_dependency} -->
179+
</dependency>
129180
</dependencies>
130181
<build>
131-
<plugins>
182+
<plugins>
132183
<plugin>
133184
<groupId>org.jacoco</groupId>
134185
<artifactId>jacoco-maven-plugin</artifactId>

0 commit comments

Comments
 (0)