Skip to content

Commit 8569230

Browse files
richardcho-msfthuachuandengminwoolee-msftyyw-msft
authored
Feature/callautomation/callinvite (Azure#34337)
* add customContext to AddParticipant in ACS CallAutomation (Azure#33786) * add customContext to AddParticipant in ACS CallAutomation * revert: change on autorest.md to point to local file * rerun autorest * fix uri bug * add Call Invite class (Azure#33929) * fixing build with autorest * fixing build by removing sip headers for now * api file update * make repeatabilityHeaders internal and generated automatically (Azure#33965) * make repeatabilityHeaders internal and generated automatically * remove repeatability in README * fix tests * Create call improvements (Azure#33932) * add Call Invite class * integrate call invite to create call * fix tests * add Call Invite class (Azure#33929) * fixing build with autorest * fixing build by removing sip headers for now * api file update * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * remove comment * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * fix tests * remove validation related unit tests * fix tests * remove comment * resolve conflit * fix merge conflicts * make repeatabilityHeaders internal and generated automatically (Azure#33965) * make repeatabilityHeaders internal and generated automatically * remove repeatability in README * fix tests * integrate call invite to create call * update auto gen --------- Co-authored-by: Min Woo Lee 🧊 <[email protected]> Co-authored-by: Yingying Wu <[email protected]> * use call invite in redirect and fix tests (Azure#34037) * use call invite in transfer (Azure#34083) * use call invite in transfer * adding unit tests for simple methods * Remove call source for create call request (Azure#34039) * add Call Invite class * integrate call invite to create call * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * remove comment * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * remove comment * resolve conflit * fix merge conflicts * integrate call invite to create call * fix tests * remove validation related unit tests * integrate call invite to create call * remove comment * fix merge conflicts * update swagger endpoint * generate code from swagger * Merge branch 'richardcho/create-call' of https://github.com/richardcho-msft/azure-sdk-for-net into richardcho/create-call * fix linter * update autogen' * fix auto gen * update autogen * merge conflict * remove duplicate code * use call invite in transfer (Azure#34083) * use call invite in transfer * adding unit tests for simple methods * integrate call invite to create call * fix tests * integrate call invite to create call * remove comment * fix merge conflicts * update swagger endpoint * generate code from swagger * Merge branch 'richardcho/create-call' of https://github.com/richardcho-msft/azure-sdk-for-net into richardcho/create-call * fix linter * update autogen' * fix auto gen * update autogen * update swagger * Revert "update swagger" This reverts commit ac523d7. * update swagger ref * fix build * remove call source --------- Co-authored-by: Yingying Wu <[email protected]> * Update AddParticipant & RemoveParticipant (Azure#34155) * update add participant logic * generate code based on new swagger * remove obsolete fils * add CallInvite options * fix build * add custom context * generate latest code * update remove participant * fix tests * fix tests * fix tests * update api * fix failed test * use sipheaders and voipheaders for transfer (Azure#34190) * update based on latest swagger (Azure#34197) * update based on latest swagger * api changes * fix transfer logic (Azure#34263) * fix uri (Azure#34267) * Address CreateCall bugs (Azure#34273) * fix transfer logic * fix createCall issues * updates (Azure#34281) * add customContext to AddParticipant in ACS CallAutomation (Azure#33786) * add customContext to AddParticipant in ACS CallAutomation * revert: change on autorest.md to point to local file * rerun autorest * fix uri bug * add Call Invite class (Azure#33929) * fixing build with autorest * fixing build by removing sip headers for now * api file update * make repeatabilityHeaders internal and generated automatically (Azure#33965) * make repeatabilityHeaders internal and generated automatically * remove repeatability in README * fix tests * Create call improvements (Azure#33932) * add Call Invite class * integrate call invite to create call * fix tests * add Call Invite class (Azure#33929) * fixing build with autorest * fixing build by removing sip headers for now * api file update * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * remove comment * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * fix tests * remove validation related unit tests * fix tests * remove comment * resolve conflit * fix merge conflicts * make repeatabilityHeaders internal and generated automatically (Azure#33965) * make repeatabilityHeaders internal and generated automatically * remove repeatability in README * fix tests * integrate call invite to create call * update auto gen --------- Co-authored-by: Min Woo Lee 🧊 <[email protected]> Co-authored-by: Yingying Wu <[email protected]> * use call invite in redirect and fix tests (Azure#34037) * use call invite in transfer (Azure#34083) * use call invite in transfer * adding unit tests for simple methods * Remove call source for create call request (Azure#34039) * add Call Invite class * integrate call invite to create call * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * remove comment * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * integrate call invite to create call * fix tests * remove validation related unit tests * fix tests * remove comment * resolve conflit * fix merge conflicts * integrate call invite to create call * fix tests * remove validation related unit tests * integrate call invite to create call * remove comment * fix merge conflicts * update swagger endpoint * generate code from swagger * Merge branch 'richardcho/create-call' of https://github.com/richardcho-msft/azure-sdk-for-net into richardcho/create-call * fix linter * update autogen' * fix auto gen * update autogen * merge conflict * remove duplicate code * use call invite in transfer (Azure#34083) * use call invite in transfer * adding unit tests for simple methods * integrate call invite to create call * fix tests * integrate call invite to create call * remove comment * fix merge conflicts * update swagger endpoint * generate code from swagger * Merge branch 'richardcho/create-call' of https://github.com/richardcho-msft/azure-sdk-for-net into richardcho/create-call * fix linter * update autogen' * fix auto gen * update autogen * update swagger * Revert "update swagger" This reverts commit ac523d7. * update swagger ref * fix build * remove call source --------- Co-authored-by: Yingying Wu <[email protected]> * Update AddParticipant & RemoveParticipant (Azure#34155) * update add participant logic * generate code based on new swagger * remove obsolete fils * add CallInvite options * fix build * add custom context * generate latest code * update remove participant * fix tests * fix tests * fix tests * update api * fix failed test * use sipheaders and voipheaders for transfer (Azure#34190) * update based on latest swagger (Azure#34197) * update based on latest swagger * api changes * fix transfer logic (Azure#34263) * fix uri (Azure#34267) * Address CreateCall bugs (Azure#34273) * fix transfer logic * fix createCall issues * updates (Azure#34281) * update call invite constructor (Azure#34334) * update callInvite constructor * create customcontext for callInvite by default * James/update call invite (Azure#34341) * modify customContextInternal Constructor * generate code * fix unit test * fix codecheck * Fixing automated tests (Azure#34348) Co-authored-by: Min Woo Lee 🧊 <[email protected]> --------- Co-authored-by: huachuandeng <[email protected]> Co-authored-by: Min Woo Lee 🧊 <[email protected]> Co-authored-by: Yingying Wu <[email protected]> Co-authored-by: minwoolee-msft <[email protected]>
1 parent 326dd27 commit 8569230

File tree

106 files changed

+2427
-5903
lines changed

Some content is hidden

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

106 files changed

+2427
-5903
lines changed

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

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,41 +113,6 @@ Your app will receive mid-connection call back events via the callbackEndpoint y
113113
return Ok();
114114
}
115115
```
116-
### Idempotent Requests
117-
An operation is idempotent if it can be performed multiple times and have the same result as a single execution.
118-
119-
The following operations are idempotent:
120-
- `AnswerCall`
121-
- `RedirectCall`
122-
- `RejectCall`
123-
- `CreateCall`
124-
- `HangUp` when terminating the call for everyone, ie. `forEveryone` parameter is set to `true`.
125-
- `TransferCallToParticipant`
126-
- `AddParticipants`
127-
- `RemoveParticipants`
128-
- `StartRecording`
129-
130-
By default, SDK generates a new `RepeatabilityHeaders` object every time the above operation is called. If you would
131-
like to provide your own `RepeatabilityHeaders` for your application (eg. for your own retry mechanism), you can do so by specifying
132-
the `RepeatabilityHeaders` in the operation's `Options` object. If this is not set by user, then the SDK will generate
133-
it. You can also disable this by setting `RepeatabilityHeaders` to NULL in the option.
134-
135-
The parameters for the `RepeatabilityHeaders` class are `repeatabilityRequestId` and `repeatabilityFirstSent`. Two or
136-
more requests are considered the same request **if and only if** both repeatability parameters are the same.
137-
- `repeatabilityRequestId`: an opaque string representing a client-generated unique identifier for the request.
138-
It is a version 4 (random) UUID.
139-
- `repeatabilityFirstSent`: The value should be the date and time at which the request was **first** created.
140-
141-
To set repeatability parameters, see below C# code snippet as an example:
142-
```C#
143-
var createCallOptions = new CreateCallOptions(callSource, new CommunicationIdentifier[] { target }, new Uri("https://exmaple.com/callback")) {
144-
RepeatabilityHeaders = new RepeatabilityHeaders(Guid.NewGuid(), DateTimeOffset.UtcNow);
145-
};
146-
CreateCallResult response1 = await callAutomationClient.CreateCallAsync(createCallOptions).ConfigureAwait(false);
147-
await Task.Delay(5000);
148-
CreateCallResult response2 = await callAutomationClient.CreateCallAsync(createCallOptions).ConfigureAwait(false);
149-
// response1 and response2 will have the same CallConnectionId as they have the same reapeatability parameters which means that the CreateCall operation was only executed once.
150-
```
151116

152117
## Troubleshooting
153118
A `RequestFailedException` is thrown as a service response for any unsuccessful requests. The exception contains information about what response code was returned from the service.
@@ -188,4 +153,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
188153
[build3]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/play-action?pivots=programming-language-csharp
189154
[build4]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/recognize-action?pivots=programming-language-csharp
190155
[recording1]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording
191-
[recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-csharp
156+
[recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-csharp

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

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

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

Lines changed: 211 additions & 61 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ public class CallAutomationClientOptions : ClientOptions
2020

2121
internal string ApiVersion { get; }
2222

23+
internal CommunicationUserIdentifier Source { get; }
24+
2325
/// <summary>
2426
/// Initializes a new instance of the <see cref="CallAutomationClientOptions"/>.
2527
/// </summary>
26-
public CallAutomationClientOptions(ServiceVersion version = LatestVersion)
28+
public CallAutomationClientOptions(ServiceVersion version = LatestVersion, CommunicationUserIdentifier source = null)
2729
{
2830
ApiVersion = version switch
2931
{
3032
ServiceVersion.V2023_01_15_Preview => "2023-01-15-preview",
3133
_ => throw new ArgumentOutOfRangeException(nameof(version)),
3234
};
35+
Source = source;
3336
}
3437

3538
/// <summary>

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

Lines changed: 136 additions & 103 deletions
Large diffs are not rendered by default.

sdk/communication/Azure.Communication.CallAutomation/src/CallRecording.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ public virtual Response<RecordingStateResult> StartRecording(StartRecordingOptio
7474
}
7575
};
7676

77-
options.RepeatabilityHeaders?.GenerateIfRepeatabilityHeadersNotProvided();
77+
var repeatabilityHeaders = new RepeatabilityHeaders();
7878
return _callRecordingRestClient.StartRecording(request,
79-
options.RepeatabilityHeaders?.RepeatabilityRequestId,
80-
options.RepeatabilityHeaders?.GetRepeatabilityFirstSentString(),
79+
repeatabilityHeaders.RepeatabilityRequestId,
80+
repeatabilityHeaders.GetRepeatabilityFirstSentString(),
8181
cancellationToken: cancellationToken);
8282
}
8383
catch (Exception ex)
@@ -119,10 +119,10 @@ public virtual async Task<Response<RecordingStateResult>> StartRecordingAsync(St
119119
}
120120
};
121121

122-
options.RepeatabilityHeaders?.GenerateIfRepeatabilityHeadersNotProvided();
122+
var repeatabilityHeaders = new RepeatabilityHeaders();
123123
return await _callRecordingRestClient.StartRecordingAsync(request,
124-
options.RepeatabilityHeaders?.RepeatabilityRequestId,
125-
options.RepeatabilityHeaders?.GetRepeatabilityFirstSentString(),
124+
repeatabilityHeaders.RepeatabilityRequestId,
125+
repeatabilityHeaders.GetRepeatabilityFirstSentString(),
126126
cancellationToken: cancellationToken).ConfigureAwait(false);
127127
}
128128
catch (Exception ex)

sdk/communication/Azure.Communication.CallAutomation/src/EventProcessor/EventResult/AddParticipantsEventResult.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33

44
namespace Azure.Communication.CallAutomation
55
{
6-
/// <summary><see cref="AddParticipantsEventResult"/> is returned from WaitForEvent of <see cref="AddParticipantsResult"/>.</summary>
6+
/// <summary><see cref="AddParticipantsEventResult"/> is returned from WaitForEvent of <see cref="AddParticipantResult"/>.</summary>
77
public class AddParticipantsEventResult : EventResultBase
88
{
99
/// <summary>
10-
/// <see cref="AddParticipantsSucceeded"/> event will be returned when the participant joined the call successfully.
10+
/// <see cref="AddParticipantSucceeded"/> event will be returned when the participant joined the call successfully.
1111
/// </summary>
12-
public AddParticipantsSucceeded SuccessEvent { get; }
12+
public AddParticipantSucceeded SuccessEvent { get; }
1313

1414
/// <summary>
15-
/// <see cref="AddParticipantsFailed"/> event will be returned when the participant did not join the call.
15+
/// <see cref="AddParticipantFailed"/> event will be returned when the participant did not join the call.
1616
/// </summary>
17-
public AddParticipantsFailed FailureEvent { get; }
17+
public AddParticipantFailed FailureEvent { get; }
1818

19-
internal AddParticipantsEventResult(bool isSuccessEvent, AddParticipantsSucceeded successEvent, AddParticipantsFailed failureEvent)
19+
internal AddParticipantsEventResult(bool isSuccessEvent, AddParticipantSucceeded successEvent, AddParticipantFailed failureEvent)
2020
{
2121
IsSuccessEvent = isSuccessEvent;
2222
SuccessEvent = successEvent;

sdk/communication/Azure.Communication.CallAutomation/src/Generated/AzureCommunicationServicesRestClient.cs

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

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

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

0 commit comments

Comments
 (0)