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

Feature/callautomation/callinvite #34337

Merged
merged 39 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
185a22e
add customContext to AddParticipant in ACS CallAutomation (#33786)
huachuandeng Feb 6, 2023
d43ca2f
add Call Invite class (#33929)
richardcho-msft Feb 7, 2023
a33fa62
fixing build with autorest
minwoolee-msft Feb 7, 2023
acbc69c
fixing build by removing sip headers for now
minwoolee-msft Feb 7, 2023
8824b54
api file update
minwoolee-msft Feb 7, 2023
2d1d092
make repeatabilityHeaders internal and generated automatically (#33965)
yyw-msft Feb 8, 2023
e9e7040
Create call improvements (#33932)
richardcho-msft Feb 8, 2023
3c43834
use call invite in redirect and fix tests (#34037)
yyw-msft Feb 9, 2023
dbb5a62
use call invite in transfer (#34083)
yyw-msft Feb 10, 2023
6fde027
Remove call source for create call request (#34039)
richardcho-msft Feb 13, 2023
fa8a2cf
Update AddParticipant & RemoveParticipant (#34155)
richardcho-msft Feb 15, 2023
f52cd65
use sipheaders and voipheaders for transfer (#34190)
yyw-msft Feb 15, 2023
8253dc6
update based on latest swagger (#34197)
richardcho-msft Feb 16, 2023
1a5a7a1
fix transfer logic (#34263)
richardcho-msft Feb 16, 2023
a6ea118
fix uri (#34267)
yyw-msft Feb 16, 2023
f3f8290
Address CreateCall bugs (#34273)
richardcho-msft Feb 16, 2023
8a591b3
updates (#34281)
yyw-msft Feb 17, 2023
1cfd828
add customContext to AddParticipant in ACS CallAutomation (#33786)
huachuandeng Feb 6, 2023
497bdac
add Call Invite class (#33929)
richardcho-msft Feb 7, 2023
f5fd524
fixing build with autorest
minwoolee-msft Feb 7, 2023
9022840
fixing build by removing sip headers for now
minwoolee-msft Feb 7, 2023
ec78182
api file update
minwoolee-msft Feb 7, 2023
b51dc44
make repeatabilityHeaders internal and generated automatically (#33965)
richardcho-msft Feb 17, 2023
c0d7735
Create call improvements (#33932)
richardcho-msft Feb 8, 2023
ab16b2c
use call invite in redirect and fix tests (#34037)
yyw-msft Feb 9, 2023
cad15b3
use call invite in transfer (#34083)
yyw-msft Feb 10, 2023
0338da2
Remove call source for create call request (#34039)
richardcho-msft Feb 17, 2023
afc1572
Update AddParticipant & RemoveParticipant (#34155)
richardcho-msft Feb 17, 2023
bf8cc4c
use sipheaders and voipheaders for transfer (#34190)
yyw-msft Feb 15, 2023
2c6a227
update based on latest swagger (#34197)
richardcho-msft Feb 16, 2023
dc138a9
fix transfer logic (#34263)
richardcho-msft Feb 16, 2023
074431d
fix uri (#34267)
yyw-msft Feb 16, 2023
ffac496
Address CreateCall bugs (#34273)
richardcho-msft Feb 16, 2023
2abc11c
updates (#34281)
yyw-msft Feb 17, 2023
4093741
Merge branch 'feature/callautomation/callinvite' of https://github.co…
richardcho-msft Feb 17, 2023
5a36621
update call invite constructor (#34334)
huachuandeng Feb 17, 2023
38b5712
James/update call invite (#34341)
huachuandeng Feb 17, 2023
71c45d0
fix codecheck
yyw-msft Feb 17, 2023
87d1753
Fixing automated tests (#34348)
minwoolee-msft Feb 17, 2023
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
37 changes: 1 addition & 36 deletions sdk/communication/Azure.Communication.CallAutomation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,41 +113,6 @@ Your app will receive mid-connection call back events via the callbackEndpoint y
return Ok();
}
```
### Idempotent Requests
An operation is idempotent if it can be performed multiple times and have the same result as a single execution.

The following operations are idempotent:
- `AnswerCall`
- `RedirectCall`
- `RejectCall`
- `CreateCall`
- `HangUp` when terminating the call for everyone, ie. `forEveryone` parameter is set to `true`.
- `TransferCallToParticipant`
- `AddParticipants`
- `RemoveParticipants`
- `StartRecording`

By default, SDK generates a new `RepeatabilityHeaders` object every time the above operation is called. If you would
like to provide your own `RepeatabilityHeaders` for your application (eg. for your own retry mechanism), you can do so by specifying
the `RepeatabilityHeaders` in the operation's `Options` object. If this is not set by user, then the SDK will generate
it. You can also disable this by setting `RepeatabilityHeaders` to NULL in the option.

The parameters for the `RepeatabilityHeaders` class are `repeatabilityRequestId` and `repeatabilityFirstSent`. Two or
more requests are considered the same request **if and only if** both repeatability parameters are the same.
- `repeatabilityRequestId`: an opaque string representing a client-generated unique identifier for the request.
It is a version 4 (random) UUID.
- `repeatabilityFirstSent`: The value should be the date and time at which the request was **first** created.

To set repeatability parameters, see below C# code snippet as an example:
```C#
var createCallOptions = new CreateCallOptions(callSource, new CommunicationIdentifier[] { target }, new Uri("https://exmaple.com/callback")) {
RepeatabilityHeaders = new RepeatabilityHeaders(Guid.NewGuid(), DateTimeOffset.UtcNow);
};
CreateCallResult response1 = await callAutomationClient.CreateCallAsync(createCallOptions).ConfigureAwait(false);
await Task.Delay(5000);
CreateCallResult response2 = await callAutomationClient.CreateCallAsync(createCallOptions).ConfigureAwait(false);
// 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.
```

## Troubleshooting
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.
Expand Down Expand Up @@ -188,4 +153,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[build3]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/play-action?pivots=programming-language-csharp
[build4]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/recognize-action?pivots=programming-language-csharp
[recording1]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording
[recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-csharp
[recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-csharp

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 @@ -20,16 +20,19 @@ public class CallAutomationClientOptions : ClientOptions

internal string ApiVersion { get; }

internal CommunicationUserIdentifier Source { get; }

/// <summary>
/// Initializes a new instance of the <see cref="CallAutomationClientOptions"/>.
/// </summary>
public CallAutomationClientOptions(ServiceVersion version = LatestVersion)
public CallAutomationClientOptions(ServiceVersion version = LatestVersion, CommunicationUserIdentifier source = null)
{
ApiVersion = version switch
{
ServiceVersion.V2023_01_15_Preview => "2023-01-15-preview",
_ => throw new ArgumentOutOfRangeException(nameof(version)),
};
Source = source;
}

/// <summary>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public virtual Response<RecordingStateResult> StartRecording(StartRecordingOptio
}
};

options.RepeatabilityHeaders?.GenerateIfRepeatabilityHeadersNotProvided();
var repeatabilityHeaders = new RepeatabilityHeaders();
return _callRecordingRestClient.StartRecording(request,
options.RepeatabilityHeaders?.RepeatabilityRequestId,
options.RepeatabilityHeaders?.GetRepeatabilityFirstSentString(),
repeatabilityHeaders.RepeatabilityRequestId,
repeatabilityHeaders.GetRepeatabilityFirstSentString(),
cancellationToken: cancellationToken);
}
catch (Exception ex)
Expand Down Expand Up @@ -119,10 +119,10 @@ public virtual async Task<Response<RecordingStateResult>> StartRecordingAsync(St
}
};

options.RepeatabilityHeaders?.GenerateIfRepeatabilityHeadersNotProvided();
var repeatabilityHeaders = new RepeatabilityHeaders();
return await _callRecordingRestClient.StartRecordingAsync(request,
options.RepeatabilityHeaders?.RepeatabilityRequestId,
options.RepeatabilityHeaders?.GetRepeatabilityFirstSentString(),
repeatabilityHeaders.RepeatabilityRequestId,
repeatabilityHeaders.GetRepeatabilityFirstSentString(),
cancellationToken: cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

namespace Azure.Communication.CallAutomation
{
/// <summary><see cref="AddParticipantsEventResult"/> is returned from WaitForEvent of <see cref="AddParticipantsResult"/>.</summary>
/// <summary><see cref="AddParticipantsEventResult"/> is returned from WaitForEvent of <see cref="AddParticipantResult"/>.</summary>
public class AddParticipantsEventResult : EventResultBase
{
/// <summary>
/// <see cref="AddParticipantsSucceeded"/> event will be returned when the participant joined the call successfully.
/// <see cref="AddParticipantSucceeded"/> event will be returned when the participant joined the call successfully.
/// </summary>
public AddParticipantsSucceeded SuccessEvent { get; }
public AddParticipantSucceeded SuccessEvent { get; }

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

internal AddParticipantsEventResult(bool isSuccessEvent, AddParticipantsSucceeded successEvent, AddParticipantsFailed failureEvent)
internal AddParticipantsEventResult(bool isSuccessEvent, AddParticipantSucceeded successEvent, AddParticipantFailed failureEvent)
{
IsSuccessEvent = isSuccessEvent;
SuccessEvent = successEvent;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading