Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added enhancements on top of Calling Server preview 1 #21686

Merged
merged 36 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3a31cac
Clean up clients comments.
zihzhan-msft Jun 8, 2021
2aac1b8
Models updates to introduce CallConnection and Server.
navali-msft Jun 8, 2021
89e1158
callState updated to callConnectionState, replace sourceAlternateIden…
navali-msft Jun 8, 2021
2cdc4b8
Update to the test sample.
navali-msft Jun 8, 2021
8c07b7b
Updated the swagger path, removed delete operation, updated unit test…
navali-msft Jun 8, 2021
e6322ed
Updates based on comments
navali-msft Jun 8, 2021
09a1452
Merge branch 'feature/CallingServer-changes' into feature/callingServ…
zihzhan-msft Jun 9, 2021
bf54682
Zihzhan/fix (#21727)
zihzhan-msft Jun 9, 2021
f1efa58
Merge branch 'feature/callingServer-preview1-enhancement' of https://…
zihzhan-msft Jun 10, 2021
f3aebeb
pull master without Downloader merge.
zihzhan-msft Jun 10, 2021
720d59c
Zihzhan/fix (#21764)
zihzhan-msft Jun 10, 2021
0161219
Model name updates (Suffix for responses models now has Result instea…
navali-msft Jun 10, 2021
c310ffe
Zihzhan/fix (#21805)
zihzhan-msft Jun 10, 2021
37c4531
The changes which are done: (#21863)
navali-msft Jun 15, 2021
37c39d4
Fix build Anaylse.
zihzhan-msft Jun 15, 2021
29ce1ed
fix(tests): improve code coverage
chrwhit Jun 15, 2021
1717a69
Merge branch 'feature/callingServer-preview1-enhancement' of https://…
chrwhit Jun 15, 2021
20e4121
Added AddParticipantResult, Re-added communication error, updated swa…
navali-msft Jun 15, 2021
e829b98
Analysis fix
navali-msft Jun 15, 2021
162c75e
Updated event type for add participant
navali-msft Jun 15, 2021
1a9464f
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
zihzhan-msft Jun 16, 2021
58ffcc3
Fix build issue.
zihzhan-msft Jun 16, 2021
2e163e6
Zihzhan/fix (#21905)
zihzhan-msft Jun 16, 2021
f93d076
Zihzhan/fix (#21931)
zihzhan-msft Jun 17, 2021
1657f3e
Zihzhan/fix (#21950)
zihzhan-msft Jun 18, 2021
0a76c1a
Address comments.
zihzhan-msft Jun 18, 2021
e264d03
Naming changes.
zihzhan-msft Jun 18, 2021
fbc6d87
Change to static connection string.
zihzhan-msft Jun 18, 2021
b5d2464
Add methods that support Live Test.
zihzhan-msft Jun 18, 2021
beaae94
Moved Recorded value inside the test method.
zihzhan-msft Jun 19, 2021
c5670ab
Updated models definition based on new swagger plus updated events pr…
navali-msft Jun 19, 2021
6d505c9
Update auto gen apis.
zihzhan-msft Jun 19, 2021
072566e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
zihzhan-msft Jun 19, 2021
4d49521
Rewrite the event tests and fixed json for other tests (#21983)
navali-msft Jun 19, 2021
5b86515
Disable AddParticipant test in Live mode.
zihzhan-msft Jun 19, 2021
1efe0fd
Moved modelfactory to .models namespace (#22021)
navali-msft Jun 21, 2021
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
12 changes: 6 additions & 6 deletions sdk/communication/Azure.Communication.CallingServer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You need an [Azure subscription][azure_sub] and a [Communication Service Resourc
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].

### Key concepts
`CallClient` provides the functionality to make call related operations.
`CallingServerClient` provides the functionality to make call connection, join call connection or initialize a server call.

### Using statements
```C# Snippet:Azure_Communication_ServerCalling_Tests_UsingStatements
Expand All @@ -28,16 +28,16 @@ using Azure.Communication.CallingServer;
```

### Authenticate the client
Server Calling clients can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal].
Calling server client can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal].

```C# Snippet:Azure_Communication_ServerCalling_Tests_Samples_CreateServerCallingClient
var connectionString = "<connection_string>"; // Find your Communication Services resource in the Azure portal
CallClient client = new CallClient(connectionString);
CallingServerClient client = new CallingServerClient(connectionString);
```

## Examples
### Make a call to a phone number recipient
To make a call, call the `CreateCall` or `CreateCallAsync` function from the `CallClient`.
To make an outbound call, call the `CreateCallConnection` or `CreateCallConnectionAsync` function from the `CallingServerClient`.
```C# Snippet:Azure_Communication_Call_Tests_CreateCallOptions
var createCallOption = new CreateCallOptions(
new Uri(TestEnvironment.AppCallbackUrl),
Expand All @@ -49,12 +49,12 @@ var createCallOption = new CreateCallOptions(
});
```
```C# Snippet:Azure_Communication_Call_Tests_CreateCallAsync
CreateCallResponse createCallResponse = await callClient.CreateCallAsync(
var callConnection = await callClient.CreateCallConnectionAsync(
source: new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
targets: new List<CommunicationIdentifier>() { new PhoneNumberIdentifier("<targets-phone-number>") }, // E.164 formatted recipient phone number
options: createCallOption // The options for creating a call.
);
Console.WriteLine($"Call Leg id: {createCallResponse.CallLegId}");
Console.WriteLine($"Call Leg id: {callConnection.Value.CallConnectionId}");
```

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This sample demonstrates how to make a call to a phone number recipient.

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

## Creating an `ServerCallingClient`
## Creating an `CallingServerClient`
Copy link
Member

@ajaych-ms ajaych-ms Jun 9, 2021

Choose a reason for hiding this comment

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

an

a #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

Copy link
Member

Choose a reason for hiding this comment

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

I still see an?

Copy link
Member

Choose a reason for hiding this comment

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

Still see "an" as well

Copy link
Member

Choose a reason for hiding this comment

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

Addressed now.

Copy link
Member

Choose a reason for hiding this comment

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

still see an :)

Copy link
Member

Choose a reason for hiding this comment

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

No more "an"


Server Calling clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
Calling server client can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.

```C# Snippet:Azure_Communication_ServerCalling_Tests_Samples_CreateServerCallingClient
var connectionString = "<connection_string>"; // Find your Communication Services resource in the Azure portal
CallClient client = new CallClient(connectionString);
CallingServerClient callingServerClient = new CallingServerClient(connectionString);
```

## Make a call to a phone number recipient
Expand All @@ -27,12 +27,12 @@ var createCallOption = new CreateCallOptions(
});
```
```C# Snippet:Azure_Communication_Call_Tests_CreateCall
CreateCallResponse createCallResponse = callClient.CreateCall(
var callConnection = callingServerClient.CreateCallConnection(
source: new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
targets: new List<CommunicationIdentifier>() { new PhoneNumberIdentifier("<targets-phone-number>") }, // E.164 formatted recipient phone number
options: createCallOption // The options for creating a call.
);
Console.WriteLine($"Call Leg id: {createCallResponse.CallLegId}");
Console.WriteLine($"Call connection id: {callConnection.Value.CallConnectionId}");
Copy link
Member

Choose a reason for hiding this comment

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

.Value

why do we need .Value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apis are returning Response object which kind of wrapped http response object. The Value property contain the return value.

Copy link
Member

Choose a reason for hiding this comment

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

then variable should be named differently - something like callConnectionResponse

```

To see the full example source files, see:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
namespace Azure.Communication.CallingServer
{
/// <summary>
/// The options for communication <see cref="CallClient"/>.
/// The options for communication <see cref="CallConnection"/> and <see cref="ServerCall"/>.
/// </summary>
public class CallClientOptions : ClientOptions
public class CallingServerClientOptions : ClientOptions
{
/// <summary>
/// The latest version of the CallingServer service.
/// </summary>
public const ServiceVersion LatestVersion = ServiceVersion.V2021_04_15_Preview1;
public const ServiceVersion LatestVersion = ServiceVersion.V2021_06_15_Preview;

internal string ApiVersion { get; }

/// <summary>
/// Initializes a new instance of the <see cref="CallClientOptions"/>.
/// Initializes a new instance of the <see cref="CallingServerClientOptions"/>.
/// </summary>
public CallClientOptions(ServiceVersion version = LatestVersion)
public CallingServerClientOptions(ServiceVersion version = LatestVersion)
{
ApiVersion = version switch
{
ServiceVersion.V2021_04_15_Preview1 => "2021-04-15-preview1",
ServiceVersion.V2021_06_15_Preview => "2021-06-15-preview",
_ => throw new ArgumentOutOfRangeException(nameof(version)),
};
}
Expand All @@ -39,7 +39,7 @@ public enum ServiceVersion
/// The Beta of the CallingServer service.
/// </summary>
#pragma warning disable CA1707 // Identifiers should not contain underscores
V2021_04_15_Preview1 = 0
V2021_06_15_Preview = 0
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
}
Expand Down
Loading