Skip to content

Commit 349a906

Browse files
Feedback Update 2 (#30378)
* Feedback Update 2 - Chagned all names into Call Automation (Except namespace) - CallingServerEventBase -> CallAutomationEventBase - CallAutomationEventBase to have common properties of ccid, scid, CorrelationId - CallAutomationEventBase Setter to internal set - Hangup -> HangUp (Feedback from review) - ServerCallingModelFactory -> CallAutomationModelFactory - All Models (Such as FileSource, CallSource, ...Options) required property now have private settter (Guidelines from Azure) - Updated Samples * - Added events to model factory - All model factory method to take default values * - Hiding AcsEventType * - Updated APIDoc Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com>
1 parent d00e82a commit 349a906

39 files changed

+369
-412
lines changed

sdk/communication/Azure.Communication.CallingServer/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- Downloading a recording from a different region no longer fails authentication
2424

2525
## 1.0.0-beta.1 (2021-06-24)
26-
This is the first release of Azure Communication Service Calling Server. For more information, please see the [README][read_me].
26+
This is the first release of Azure Communication Service Call Automation. For more information, please see the [README][read_me].
2727

2828
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 .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).
2929

sdk/communication/Azure.Communication.CallingServer/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Azure Communication CallingServer client library for .NET
1+
# Azure Communication CallAutomation client library for .NET
22

3-
This package contains a C# SDK for Azure Communication Services for Calling.
3+
This package contains a C# SDK for Azure Communication Call Automation.
44

55
[Source code][source] |[Product documentation][product_docs]
66
## Getting started
77

88
### Install the package
9-
Install the Azure Communication CallingServer client library for .NET with [NuGet][nuget]:
9+
Install the Azure Communication CallAutomation client library for .NET with [NuGet][nuget]:
1010

1111
```dotnetcli
1212
dotnet add package Azure.Communication.CallingServer --prerelease
@@ -18,7 +18,7 @@ You need an [Azure subscription][azure_sub] and a [Communication Service Resourc
1818
To create a new Communication Service, you can use the [Azure Portal][communication_resource_create_portal], the [Azure PowerShell][communication_resource_create_power_shell], or the [.NET management client library][communication_resource_create_net].
1919

2020
### Key concepts
21-
`CallingServerClient` provides the functionality to answer incoming call or initialize an outbound call.
21+
`CallAutomationClient` provides the functionality to answer incoming call or initialize an outbound call.
2222

2323
### Using statements
2424
```C#
@@ -28,31 +28,31 @@ using Azure.Communication.CallingServer;
2828
```
2929

3030
### Authenticate the client
31-
Calling server client can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal].
31+
Call Automation client can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal].
3232

3333
```C#
3434
var connectionString = "<connection_string>"; // Find your Communication Services resource in the Azure portal
35-
CallingServerClient callingServerClient = new CallingServerClient(connectionString);
35+
CallAutomationClient callAutomationClient = new CallAutomationClient(connectionString);
3636
```
3737

3838
Or alternatively using a valid Active Directory token.
3939
```C#
4040
var endpoint = new Uri("https://my-resource.communication.azure.com");
4141
TokenCredential tokenCredential = new DefaultAzureCredential();
42-
var client = new CallingServerClient(endpoint, tokenCredential);
42+
var client = new CallAutomationClient(endpoint, tokenCredential);
4343
```
4444

4545
## Examples
4646
### Make a call to a phone number recipient
47-
To make an outbound call, call the `CreateCall` or `CreateCallAsync` function from the `CallingServerClient`.
47+
To make an outbound call, call the `CreateCall` or `CreateCallAsync` function from the `CallAutomationClient`.
4848
```C#
4949
CallSource callSource = new CallSource(
5050
new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
5151
);
5252
callSource.CallerId = new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
5353
```
5454
```C#
55-
CreateCallResult createCallResult = await callingServerClient.CreateCallAsync(
55+
CreateCallResult createCallResult = await callAutomationClient.CreateCallAsync(
5656
source: callSource,
5757
targets: new List<CommunicationIdentifier>() { new PhoneNumberIdentifier("<targets-phone-number>") }, // E.164 formatted recipient phone number
5858
callbackEndpoint: new Uri(TestEnvironment.AppCallbackUrl)

sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs

Lines changed: 38 additions & 77 deletions
Large diffs are not rendered by default.

sdk/communication/Azure.Communication.CallingServer/samples/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ languages:
55
products:
66
- azure
77
- azure-communication-services
8-
name: Azure Communication CallingServer samples for .NET
8+
name: Azure Communication CallAutomation samples for .NET
99
description: Samples for the Azure.Communication.CallingServer client library
1010
---
1111

12-
# Azure Communication CallingServer SDK samples
12+
# Azure Communication CallAutomation SDK samples
1313

14-
Azure Communication CallingServer is a client library that provides the functionality to make call between user identities.
14+
Azure Communication CallAutomation is a client library that provides the functionality to make call between user identities.
1515
To get started you will need to have an Azure Subscription. Once you have this you can go into the Azure portal and create Azure Communication Services resource. The page will give you necessary information to be able to use the sample codes here such as connections string, shared access key, etc.
1616

1717
This client library allows to do following operations:
1818
- Create a Call from a Azure Communication Resource identity to a phone number
1919
- Specify request payload for the created call.
2020

2121
#### You can find samples for each of these functions below.
22-
- CreateCall [synchronously][sample_servercalling] or [asynchronously][sample_servercalling_async]
22+
- CreateCall [synchronously][sample_callautomation] or [asynchronously][sample_callautomation_async]
2323

2424
<!-- LINKS -->
25-
[sample_servercalling]: https://github.com/Azure/azure-sdk-for-net/blob/a20e269162fa88a43e5ba0e5bb28f2e76c74a484/sdk/communication/Azure.Communication.CallingServer/samples/Sample1_CreateCall.md
26-
[sample_servercalling_async]: https://github.com/Azure/azure-sdk-for-net/blob/a20e269162fa88a43e5ba0e5bb28f2e76c74a484/sdk/communication/Azure.Communication.CallingServer/samples/Sample1_CreateCallAsync.md
25+
[sample_callautomation]: https://github.com/Azure/azure-sdk-for-net/blob/a20e269162fa88a43e5ba0e5bb28f2e76c74a484/sdk/communication/Azure.Communication.CallingServer/samples/Sample1_CreateCall.md
26+
[sample_callautomation_async]: https://github.com/Azure/azure-sdk-for-net/blob/a20e269162fa88a43e5ba0e5bb28f2e76c74a484/sdk/communication/Azure.Communication.CallingServer/samples/Sample1_CreateCallAsync.md

sdk/communication/Azure.Communication.CallingServer/samples/Sample1_CreateCall.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ This sample demonstrates how to make a call to a phone number recipient.
44

55
To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions.
66

7-
## Creating a `CallingServerClient`
7+
## Creating a `CallAutomationClient`
88

9-
CallingServer client can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
9+
CallAutomation client can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
1010

1111
```C#
1212
var connectionString = "<connection_string>"; // Find your Communication Services resource in the Azure portal
13-
CallingServerClient callingServerClient = new CallingServerClient(connectionString);
13+
CallAutomationClient callAutomationClient = new CallAutomationClient(connectionString);
1414
```
1515

1616
## Make a call to a phone number recipient
1717

18-
To make a call, call the `CreateCall` or `CreateCallAsync` function from the `CallClient`. The returned value is `CreateCallResponse` objects that contains the created Call's Id if succeed, else throws a RequestFailedException.
18+
To make a call, call the `CreateCall` function from the `CallAutomationClient`. The returned value is `CreateCallResult` objects that contains the created Call's Id if succeed, else throws a RequestFailedException.
1919
```C#
20-
var createCallOption = new CreateCallOptions(
21-
AlternateCallerId: new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
20+
CallSource callSource = new CallSource(
21+
new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
2222
);
23+
callSource.CallerId = new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
2324
```
2425
```C#
25-
var callConnection = await callingServerClient.CreateCall(
26-
source: new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
26+
CreateCallResult createCallResult = callAutomationClient.CreateCall(
27+
source: callSource,
2728
targets: new List<CommunicationIdentifier>() { new PhoneNumberIdentifier("<targets-phone-number>") }, // E.164 formatted recipient phone number
28-
callbackEndpoint: new Uri(TestEnvironment.AppCallbackUrl),
29-
options: createCallOption // The options for creating a call.
29+
callbackEndpoint: new Uri(TestEnvironment.AppCallbackUrl)
3030
);
31-
Console.WriteLine($"Call connection id: {callConnection.Value.CallConnectionId}");
31+
Console.WriteLine($"Call connection id: {createCallResult.CallProperties.CallConnectionId}");
3232
```
3333

3434
To see the full example source files, see:

sdk/communication/Azure.Communication.CallingServer/samples/Sample1_CreateCallAsync.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ This sample demonstrates how to make a call to a recipient phone number.
44

55
To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions.
66

7-
## Creating a `CallingServerClient`
7+
## Creating a `CallAutomationClient`
88

9-
CallingServer client can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
9+
CallAutomation client can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
1010

1111
```C#
1212
var connectionString = "<connection_string>"; // Find your Communication Services resource in the Azure portal
13-
CallingServerClient callingServerClient = new CallingServerClient(connectionString);
13+
CallAutomationClient callAutomationClient = new CallAutomationClient(connectionString);
1414
```
1515

1616
## Make a call to a phone number recipient
1717

18-
To make a Call, call the `CreateCall` or `CreateCallAsync` function from the `CallClient`. The returned value is `CreateCallResponse` objects that contains the created Call's Id if succeed, else throws a RequestFailedException.
18+
To make a Call, call the `CreateCallAsync` function from the `CallClient`. The returned value is `CreateCallResult` objects that contains the created Call's Id if succeed, else throws a RequestFailedException.
1919
```C#
20-
var createCallOption = new CreateCallOptions(
21-
AlternateCallerId: new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
20+
CallSource callSource = new CallSource(
21+
new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
2222
);
23+
callSource.CallerId = new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
2324
```
24-
```C
25-
var callConnection = await callingServerClient.CreateCallAsync(
26-
source: new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
25+
```C#
26+
CreateCallResult createCallResult = await callAutomationClient.CreateCallAsync(
27+
source: callSource,
2728
targets: new List<CommunicationIdentifier>() { new PhoneNumberIdentifier("<targets-phone-number>") }, // E.164 formatted recipient phone number
28-
callbackEndpoint: new Uri(TestEnvironment.AppCallbackUrl),
29-
options: createCallOption // The options for creating a call.
29+
callbackEndpoint: new Uri(TestEnvironment.AppCallbackUrl)
3030
);
31-
Console.WriteLine($"Call connection id: {callConnection.Value.CallConnectionId}");
31+
Console.WriteLine($"Call connection id: {createCallResult.CallProperties.CallConnectionId}");
3232
```
3333

3434
To see the full example source files, see:

sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClient.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace Azure.Communication.CallingServer
1414
{
1515
/// <summary>
16-
/// The Azure Communication Services Calling Server client.
16+
/// The Azure Communication Services Call Automation client.
1717
/// </summary>
1818
public class CallAutomationClient
1919
{
@@ -54,6 +54,17 @@ public CallAutomationClient(Uri endpoint, TokenCredential credential, CallAutoma
5454
Argument.CheckNotNull(credential, nameof(credential)),
5555
options ?? new CallAutomationClientOptions())
5656
{ }
57+
58+
/// <summary> Initializes a new instance of <see cref="CallAutomationClient"/> with custom PMA endpoint.</summary>
59+
/// <param name="pmaEndpoint">Endpoint for PMA</param>
60+
/// <param name="connectionString">Connection string acquired from the Azure Communication Services resource.</param>
61+
/// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
62+
public CallAutomationClient(Uri pmaEndpoint, string connectionString, CallAutomationClientOptions options = default)
63+
: this(
64+
pmaEndpoint,
65+
options ?? new CallAutomationClientOptions(),
66+
ConnectionString.Parse(connectionString))
67+
{ }
5768
#endregion
5869

5970
#region private constructors

sdk/communication/Azure.Communication.CallingServer/src/CallAutomationClientOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
namespace Azure.Communication.CallingServer
1010
{
1111
/// <summary>
12-
/// The latest version of the Calling Server.
12+
/// The latest version of the Call Automation.
1313
/// </summary>
1414
public class CallAutomationClientOptions : ClientOptions
1515
{
1616
/// <summary>
17-
/// The latest version of the CallingServer service.
17+
/// The latest version of the CallAutomation service.
1818
/// </summary>
1919
internal const ServiceVersion LatestVersion = ServiceVersion.V2022_04_07_Preview;
2020

@@ -33,12 +33,12 @@ public CallAutomationClientOptions(ServiceVersion version = LatestVersion)
3333
}
3434

3535
/// <summary>
36-
/// The CallingServer service version.
36+
/// The CallAutomation service version.
3737
/// </summary>
3838
public enum ServiceVersion
3939
{
4040
/// <summary>
41-
/// The Beta of the CallingServer service.
41+
/// The Beta of the CallAutomation service.
4242
/// </summary>
4343
#pragma warning disable CA1707 // Identifiers should not contain underscores
4444
V2022_04_07_Preview = 1

sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public virtual Response<CallConnectionProperties> GetProperties(CancellationToke
8787
/// <param name="forEveryone"> If true, this will terminate the call and hang up on all participants in this call. </param>
8888
/// <param name="cancellationToken"> The cancellation token. </param>
8989
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
90-
public virtual async Task<Response> HangupAsync(bool forEveryone, CancellationToken cancellationToken = default)
90+
public virtual async Task<Response> HangUpAsync(bool forEveryone, CancellationToken cancellationToken = default)
9191
{
92-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallConnection)}.{nameof(Hangup)}");
92+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallConnection)}.{nameof(HangUp)}");
9393
scope.Start();
9494
try
9595
{
@@ -119,9 +119,9 @@ public virtual async Task<Response> HangupAsync(bool forEveryone, CancellationTo
119119
/// <param name="forEveryone"> If true, this will terminate the call and hang up on all participants in this call. </param>
120120
/// <param name="cancellationToken"> The cancellation token. </param>
121121
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
122-
public virtual Response Hangup(bool forEveryone, CancellationToken cancellationToken = default)
122+
public virtual Response HangUp(bool forEveryone, CancellationToken cancellationToken = default)
123123
{
124-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallConnection)}.{nameof(Hangup)}");
124+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallConnection)}.{nameof(HangUp)}");
125125
scope.Start();
126126
try
127127
{

sdk/communication/Azure.Communication.CallingServer/src/Generated/CallAutomationModelFactory.cs

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)