Skip to content

Commit fc094ec

Browse files
Updates suggested from Azure Board SDK review (Azure#29953)
* Updates suggested from Azure Board SDK review: - CallConnectionClient and CallRecordingClient suffix 'Client' removed - Azure.Communication.CallingServer.Models namespace removed - CallConnectionClient and CallContentClient combined - Hangup and Terminate combined. Hangup now expects boolean to either hangup, or terminate the call - GetCallConnectionProperties now under CallConnectionClient - GetCallConnectionProperties renamed to GetProperties - ...Response suffix updated to be ...Result suffix (i.e. TransferCallToParticipantResponse -> TransferCallToParticipantResult) - AlternateCallerId renamed - All Options constructor doesn't take optional value as input - GetParticipants now accepts participantMri string - OperationResponse removed - PlayMedia updated to accept PlaySource's derived class (FileSource) - Added many Internal models to hide generated models that contoso do not need - AnswerCall and CreateCall now returns Result. This object now contains both CallProperties & CallConnectionClient - CreateCall now accepts subject instead of option that contains only 1 value - ...Type suffix now dropped. (i.e. RecordingContentType -> RecordingContent) - ServerCallingModelFactory to include all read-only models - Autorest regenerated with latest swagger - Tests updated to accomodate latest changes - Summaries of each methods updated to accomodate latest changes - README.md updated to accomodate latest changes * regenerated clients (rebase from main) Co-authored-by: Min Woo Lee 🧊 <[email protected]>
1 parent e80a7c9 commit fc094ec

File tree

93 files changed

+2780
-2946
lines changed

Some content is hidden

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

93 files changed

+2780
-2946
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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 make call connection, join call connection, answer incoming call or initialize a server call.
21+
`CallingServerClient` provides the functionality to answer incoming call or initialize an outbound call.
2222

2323
### Using statements
2424
```C#
@@ -44,20 +44,20 @@ var client = new CallingServerClient(endpoint, tokenCredential);
4444

4545
## Examples
4646
### Make a call to a phone number recipient
47-
To make an outbound call, call the `CreateCallConnection` or `CreateCallConnectionAsync` function from the `CallingServerClient`.
47+
To make an outbound call, call the `CreateCall` or `CreateCallAsync` function from the `CallingServerClient`.
4848
```C#
49-
var createCallOption = new CreateCallOptions(
50-
AlternateCallerId: new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
49+
CallSource callSource = new CallSource(
50+
new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
5151
);
52+
callSource.CallerId = new PhoneNumberIdentifier("<caller-id-phonenumber>") // E.164 formatted recipient phone number
5253
```
5354
```C#
54-
var callConnection = await callingServerClient.CreateCallAsync(
55-
source: new CommunicationUserIdentifier("<source-identifier>"), // Your Azure Communication Resource Guid Id used to make a Call
55+
CreateCallResult createCallResult = await callingServerClient.CreateCallAsync(
56+
source: callSource,
5657
targets: new List<CommunicationIdentifier>() { new PhoneNumberIdentifier("<targets-phone-number>") }, // E.164 formatted recipient phone number
57-
callbackUri: new Uri(TestEnvironment.AppCallbackUrl),
58-
options: createCallOption // The options for creating a call.
58+
callbackUri: new Uri(TestEnvironment.AppCallbackUrl)
5959
);
60-
Console.WriteLine($"Call connection id: {callConnection.Value.CallConnectionId}");
60+
Console.WriteLine($"Call connection id: {createCallResult.CallProperties.CallConnectionId}");
6161
```
6262

6363
## Troubleshooting

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

Lines changed: 173 additions & 237 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Azure.Communication.CallingServer
88
{
99
internal static class AmsDirectRequestHelpers
1010
{
11-
internal static HttpMessage GetHttpMessage(CallRecordingClient client, Uri requestEndpoint, RequestMethod requestMethod, HttpRange? rangeHeader = null)
11+
internal static HttpMessage GetHttpMessage(CallRecording client, Uri requestEndpoint, RequestMethod requestMethod, HttpRange? rangeHeader = null)
1212
{
1313
Argument.CheckNotNull(client, nameof(client));
1414
Argument.CheckNotNull(requestEndpoint, nameof(requestEndpoint));

sdk/communication/Azure.Communication.CallingServer/src/CallConnectionClient.cs renamed to sdk/communication/Azure.Communication.CallingServer/src/CallConnection.cs

Lines changed: 210 additions & 66 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 137 deletions
This file was deleted.

sdk/communication/Azure.Communication.CallingServer/src/CallRecordingClient.cs renamed to sdk/communication/Azure.Communication.CallingServer/src/CallRecording.cs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Linq;
88
using System.Threading;
99
using System.Threading.Tasks;
10-
using Azure.Communication.CallingServer.Models;
1110
using Azure.Core;
1211
using Azure.Core.Pipeline;
1312

@@ -16,7 +15,7 @@ namespace Azure.Communication.CallingServer
1615
/// <summary>
1716
/// The Azure Communication Services Call Recording client.
1817
/// </summary>
19-
public class CallRecordingClient
18+
public class CallRecording
2019
{
2120
internal readonly string _resourceEndpoint;
2221
internal readonly ContentDownloader _contentDownloader;
@@ -26,7 +25,7 @@ public class CallRecordingClient
2625
internal ServerCallsRestClient serverCallsRestClient { get; }
2726
internal ContentRestClient contentRestClient { get; }
2827

29-
internal CallRecordingClient(string ResourceEndpoint, ServerCallsRestClient ServerCallsRestClient, ContentRestClient ContentRestClient, ClientDiagnostics ClientDiagnostics, HttpPipeline HttpPipeline)
28+
internal CallRecording(string ResourceEndpoint, ServerCallsRestClient ServerCallsRestClient, ContentRestClient ContentRestClient, ClientDiagnostics ClientDiagnostics, HttpPipeline HttpPipeline)
3029
{
3130
_resourceEndpoint = ResourceEndpoint;
3231
serverCallsRestClient = ServerCallsRestClient;
@@ -36,8 +35,8 @@ internal CallRecordingClient(string ResourceEndpoint, ServerCallsRestClient Serv
3635
_pipeline = HttpPipeline;
3736
}
3837

39-
/// <summary>Initializes a new instance of <see cref="CallRecordingClient"/> for mocking.</summary>
40-
protected CallRecordingClient()
38+
/// <summary>Initializes a new instance of <see cref="CallRecording"/> for mocking.</summary>
39+
protected CallRecording()
4140
{
4241
_resourceEndpoint = null;
4342
serverCallsRestClient = null;
@@ -56,9 +55,9 @@ protected CallRecordingClient()
5655
/// <param name="content">content for recording.</param>
5756
/// <param name="channel">channel for recording.</param>
5857
/// <param name="format">format for recording.</param>
59-
public virtual Response<StartCallRecordingResponse> StartRecording(CallLocator callLocator, Uri recordingStateCallbackUri, RecordingContentType? content = null, RecordingChannelType? channel = null, RecordingFormatType? format = null, CancellationToken cancellationToken = default)
58+
public virtual Response<RecordingStatusResult> StartRecording(CallLocator callLocator, Uri recordingStateCallbackUri, RecordingContent? content = null, RecordingChannel? channel = null, RecordingFormat? format = null, CancellationToken cancellationToken = default)
6059
{
61-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(StartRecording)}");
60+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(StartRecording)}");
6261
scope.Start();
6362
try
6463
{
@@ -88,9 +87,9 @@ public virtual Response<StartCallRecordingResponse> StartRecording(CallLocator c
8887
/// <param name="content">content for recording.</param>
8988
/// <param name="channel">channel for recording.</param>
9089
/// <param name="format">format for recording.</param>
91-
public virtual async Task<Response<StartCallRecordingResponse>> StartRecordingAsync(CallLocator callLocator, Uri recordingStateCallbackUri, RecordingContentType? content = null, RecordingChannelType? channel = null, RecordingFormatType? format = null, CancellationToken cancellationToken = default)
90+
public virtual async Task<Response<RecordingStatusResult>> StartRecordingAsync(CallLocator callLocator, Uri recordingStateCallbackUri, RecordingContent? content = null, RecordingChannel? channel = null, RecordingFormat? format = null, CancellationToken cancellationToken = default)
9291
{
93-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(StartRecording)}");
92+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(StartRecording)}");
9493
scope.Start();
9594
try
9695
{
@@ -115,9 +114,9 @@ public virtual async Task<Response<StartCallRecordingResponse>> StartRecordingAs
115114
/// </summary>
116115
/// <param name="recordingId">The recording id to get the state of.</param>
117116
/// <param name="cancellationToken">The cancellation token.</param>
118-
public virtual Response<GetCallRecordingStateResponse> GetRecordingState(string recordingId, CancellationToken cancellationToken = default)
117+
public virtual Response<RecordingStatusResult> GetRecordingState(string recordingId, CancellationToken cancellationToken = default)
119118
{
120-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(GetRecordingState)}");
119+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(GetRecordingState)}");
121120
scope.Start();
122121
try
123122
{
@@ -138,9 +137,9 @@ public virtual Response<GetCallRecordingStateResponse> GetRecordingState(string
138137
/// </summary>
139138
/// <param name="recordingId">The recording id to get the state of.</param>
140139
/// <param name="cancellationToken">The cancellation token.</param>
141-
public virtual async Task<Response<GetCallRecordingStateResponse>> GetRecordingStateAsync(string recordingId, CancellationToken cancellationToken = default)
140+
public virtual async Task<Response<RecordingStatusResult>> GetRecordingStateAsync(string recordingId, CancellationToken cancellationToken = default)
142141
{
143-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(GetRecordingState)}");
142+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(GetRecordingState)}");
144143
scope.Start();
145144
try
146145
{
@@ -163,7 +162,7 @@ public virtual async Task<Response<GetCallRecordingStateResponse>> GetRecordingS
163162
/// <param name="cancellationToken">The cancellation token.</param>
164163
public virtual Response StopRecording(string recordingId, CancellationToken cancellationToken = default)
165164
{
166-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(StopRecording)}");
165+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(StopRecording)}");
167166
scope.Start();
168167
try
169168
{
@@ -186,7 +185,7 @@ public virtual Response StopRecording(string recordingId, CancellationToken canc
186185
/// <param name="cancellationToken">The cancellation token.</param>
187186
public virtual async Task<Response> StopRecordingAsync(string recordingId, CancellationToken cancellationToken = default)
188187
{
189-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(StopRecording)}");
188+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(StopRecording)}");
190189
scope.Start();
191190
try
192191
{
@@ -209,7 +208,7 @@ public virtual async Task<Response> StopRecordingAsync(string recordingId, Cance
209208
/// <param name="cancellationToken">The cancellation token.</param>
210209
public virtual async Task<Response> PauseRecordingAsync(string recordingId, CancellationToken cancellationToken = default)
211210
{
212-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(PauseRecording)}");
211+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(PauseRecording)}");
213212
scope.Start();
214213
try
215214
{
@@ -232,7 +231,7 @@ public virtual async Task<Response> PauseRecordingAsync(string recordingId, Canc
232231
/// <param name="cancellationToken">The cancellation token.</param>
233232
public virtual Response PauseRecording(string recordingId, CancellationToken cancellationToken = default)
234233
{
235-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(PauseRecording)}");
234+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(PauseRecording)}");
236235
scope.Start();
237236
try
238237
{
@@ -255,7 +254,7 @@ public virtual Response PauseRecording(string recordingId, CancellationToken can
255254
/// <param name="cancellationToken">The cancellation token.</param>
256255
public virtual async Task<Response> ResumeRecordingAsync(string recordingId, CancellationToken cancellationToken = default)
257256
{
258-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(ResumeRecording)}");
257+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(ResumeRecording)}");
259258
scope.Start();
260259
try
261260
{
@@ -278,7 +277,7 @@ public virtual async Task<Response> ResumeRecordingAsync(string recordingId, Can
278277
/// <param name="cancellationToken">The cancellation token.</param>
279278
public virtual Response ResumeRecording(string recordingId, CancellationToken cancellationToken = default)
280279
{
281-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(ResumeRecording)}");
280+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(ResumeRecording)}");
282281
scope.Start();
283282
try
284283
{
@@ -511,7 +510,7 @@ public virtual async Task<Response> DownloadToAsync(Uri sourceEndpoint, string d
511510
/// </remarks>
512511
public virtual Response DeleteRecording(Uri deleteEndpoint, CancellationToken cancellationToken = default)
513512
{
514-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(DeleteRecording)}");
513+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(DeleteRecording)}");
515514
scope.Start();
516515
try
517516
{
@@ -554,7 +553,7 @@ public virtual Response DeleteRecording(Uri deleteEndpoint, CancellationToken ca
554553
/// </remarks>
555554
public virtual async Task<Response> DeleteRecordingAsync(Uri deleteEndpoint, CancellationToken cancellationToken = default)
556555
{
557-
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecordingClient)}.{nameof(DeleteRecording)}");
556+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallRecording)}.{nameof(DeleteRecording)}");
558557
scope.Start();
559558
try
560559
{

0 commit comments

Comments
 (0)