Skip to content

Commit e29f71b

Browse files
Alpha4 Changes (Azure#47198)
* Adding the alpha4 changes * adding alpha 4 changes * Added alpha4 changes. (Azure#47387) * Updating the beta5 changes * Fixing the build analyze issu * recording tests * Fixing the live tests * recording the dialog tests * api update --------- Co-authored-by: v-pivamshi <[email protected]>
1 parent 43fa107 commit e29f71b

File tree

332 files changed

+19289
-3169
lines changed

Some content is hidden

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

332 files changed

+19289
-3169
lines changed

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

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.3.0-beta.1 (Unreleased)
3+
## 1.4.0-beta.2 (Unreleased)
44

55
### Features Added
66

@@ -10,6 +10,54 @@
1010

1111
### Other Changes
1212

13+
## 1.4.0-beta.1 (2024-11-22)
14+
15+
### Features Added
16+
17+
- Added support for ConnectAPI to enable streaming and real-time transcription
18+
- Enhanced media streaming with bidirectional capabilities, enabling support for audio formats in both directions. Currently, it supports sample rates of 24kHz and 16kHz
19+
20+
### Other Changes
21+
22+
- Introduced audio streaming and transcription data parsing capabilities.
23+
24+
## 1.3.0 (2024-11-22)
25+
26+
### Features Added
27+
28+
- Support multiple play sources for Play and Recognize
29+
- Support for PlayStarted event in Play/Recognize
30+
- Hold and Unhold the participant
31+
- CallDisconnected now includes more information on why the call has ended
32+
- Support to manage the rooms/servercall/group call using connect API
33+
- Expose original PSTN number target from incoming call event in call connection properties
34+
- Support for VoIP to PSTN transfer scenario
35+
36+
### Other Changes
37+
38+
- Added CreateCallFailed event to signify when create call API fails to establish a call
39+
- Added AnswerFailed event to signify when answer call API fails to answer a call
40+
41+
## 1.3.0-beta.2 (2024-10-28)
42+
43+
### Features Added
44+
45+
- Added CreateCallFailed event to signify when create call API fails to establish a call
46+
47+
## 1.3.0-beta.1 (2024-08-02)
48+
49+
### Features Added
50+
51+
- Support multiple play sources for Play and Recognize
52+
- Support for PlayStarted event in Play/Recognize
53+
- Support for the real time transcription
54+
- Monetization for real-time transcription and audio streaming
55+
- Hold and Unhold the participant
56+
- Support to manage the rooms/servercall/group call using connect API
57+
- Support for the audio streaming
58+
- Expose original PSTN number target from incoming call event in call connection properties
59+
- Support for VoIP to PSTN transfer scenario
60+
1361
## 1.2.0 (2024-04-15)
1462

1563
### Features Added

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

Lines changed: 262 additions & 68 deletions
Large diffs are not rendered by default.

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

Lines changed: 262 additions & 68 deletions
Large diffs are not rendered by default.

sdk/communication/Azure.Communication.CallAutomation/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/communication/Azure.Communication.CallAutomation",
5-
"Tag": "net/communication/Azure.Communication.CallAutomation_a7eb7ffb4a"
5+
"Tag": "net/communication/Azure.Communication.CallAutomation_c4f60a9554"
66
}

sdk/communication/Azure.Communication.CallAutomation/src/Azure.Communication.CallAutomation.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Microsoft Azure Communication Call Automation quickstart - https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions?pivots=programming-language-csharp
77
</Description>
88
<AssemblyTitle>Azure Communication CallAutomation Service</AssemblyTitle>
9-
<Version>1.3.0-beta.1</Version>
9+
<Version>1.4.0-beta.2</Version>
1010
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
1111
<PackageTags>Microsoft Azure Communication CallAutomation Service;Microsoft;Azure;Azure Communication Service;Azure Communication CallAutomation Service;Calling;Communication;$(PackageCommonTags)</PackageTags>
1212
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>

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

Lines changed: 145 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ public virtual async Task<Response<AnswerCallResult>> AnswerCallAsync(AnswerCall
179179
scope.Start();
180180
try
181181
{
182-
if (options == null) throw new ArgumentNullException(nameof(options));
182+
if (options == null)
183+
throw new ArgumentNullException(nameof(options));
183184

184185
AnswerCallRequestInternal request = CreateAnswerCallRequest(options);
185186

@@ -226,7 +227,8 @@ public virtual Response<AnswerCallResult> AnswerCall(AnswerCallOptions options,
226227
scope.Start();
227228
try
228229
{
229-
if (options == null) throw new ArgumentNullException(nameof(options));
230+
if (options == null)
231+
throw new ArgumentNullException(nameof(options));
230232

231233
AnswerCallRequestInternal request = CreateAnswerCallRequest(options);
232234

@@ -259,8 +261,8 @@ private AnswerCallRequestInternal CreateAnswerCallRequest(AnswerCallOptions opti
259261
};
260262
}
261263

262-
request.MediaStreamingConfiguration = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
263-
request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
264+
request.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
265+
request.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
264266
request.AnsweredBy = Source == null ? null : new CommunicationUserIdentifierModel(Source.Id);
265267
request.OperationContext = options.OperationContext;
266268
request.CustomCallingContext = new CustomCallingContextInternal(
@@ -344,8 +346,8 @@ public virtual Response RedirectCall(RedirectCallOptions options, CancellationTo
344346
RedirectCallRequestInternal request = new RedirectCallRequestInternal(options.IncomingCallContext, CommunicationIdentifierSerializer.Serialize(options.CallInvite.Target));
345347

346348
request.CustomCallingContext = new CustomCallingContextInternal(
347-
options.CallInvite.CustomCallingContext.SipHeaders == null ? new ChangeTrackingDictionary<string, string>() : options.CallInvite.CustomCallingContext.SipHeaders,
348-
options.CallInvite.CustomCallingContext.VoipHeaders == null ? new ChangeTrackingDictionary<string, string>() : options.CallInvite.CustomCallingContext.VoipHeaders);
349+
options.CallInvite.CustomCallingContext.SipHeaders == null ? new ChangeTrackingDictionary<string, string>() : options.CallInvite.CustomCallingContext.SipHeaders,
350+
options.CallInvite.CustomCallingContext.VoipHeaders == null ? new ChangeTrackingDictionary<string, string>() : options.CallInvite.CustomCallingContext.VoipHeaders);
349351

350352
return AzureCommunicationServicesRestClient.RedirectCall(request, cancellationToken);
351353
}
@@ -519,7 +521,8 @@ public virtual Response<CreateCallResult> CreateCall(CreateCallOptions options,
519521
scope.Start();
520522
try
521523
{
522-
if (options == null) throw new ArgumentNullException(nameof(options));
524+
if (options == null)
525+
throw new ArgumentNullException(nameof(options));
523526

524527
CreateCallRequestInternal request = CreateCallRequest(options);
525528

@@ -618,6 +621,107 @@ public virtual Response<CreateCallResult> CreateGroupCall(CreateGroupCallOptions
618621
}
619622
}
620623

624+
/// <summary>
625+
/// Create a connect request.
626+
/// </summary>
627+
/// <param name="callLocator"></param>
628+
/// <param name="callbackUri"></param>
629+
/// <param name="cancellationToken"></param>
630+
/// <exception cref="ArgumentNullException"><paramref name="callLocator"/> is null.</exception>
631+
/// <exception cref="ArgumentException"><paramref name="callbackUri"/> callbackUrl is not formatted correctly or empty. </exception>
632+
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
633+
/// <returns></returns>
634+
public virtual async Task<Response<ConnectCallResult>> ConnectCallAsync(CallLocator callLocator, Uri callbackUri, CancellationToken cancellationToken = default)
635+
{
636+
ConnectCallOptions options = new ConnectCallOptions(callLocator, callbackUri);
637+
638+
return await ConnectCallAsync(options, cancellationToken).ConfigureAwait(false);
639+
}
640+
641+
/// <summary>
642+
/// Create a connect request.
643+
/// </summary>
644+
/// <param name="connectCallOptions">ConnectOptions for connect request.</param>
645+
/// <param name="cancellationToken">The cancellation token.</param>
646+
/// <exception cref="ArgumentNullException"><paramref name="connectCallOptions"/> is null.</exception>
647+
/// <exception cref="ArgumentException"><paramref name="connectCallOptions"/> CallbackUrl is not formatted correctly. </exception>
648+
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
649+
/// <returns></returns>
650+
public virtual async Task<Response<ConnectCallResult>> ConnectCallAsync(ConnectCallOptions connectCallOptions, CancellationToken cancellationToken = default)
651+
{
652+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(ConnectCall)}");
653+
scope.Start();
654+
try
655+
{
656+
if (connectCallOptions == null)
657+
throw new ArgumentNullException(nameof(connectCallOptions));
658+
659+
ConnectRequestInternal connectRequest = ConnectRequest(connectCallOptions);
660+
Response<CallConnectionPropertiesInternal> response = await AzureCommunicationServicesRestClient.ConnectAsync(connectRequest).ConfigureAwait(false);
661+
662+
var callConnection = GetCallConnection(response.Value.CallConnectionId);
663+
ConnectCallResult connectResult = new ConnectCallResult(new CallConnectionProperties(response.Value), callConnection);
664+
connectResult.SetEventProcessor(EventProcessor, response.Value.CallConnectionId);
665+
666+
return Response.FromValue(connectResult, response.GetRawResponse());
667+
}
668+
catch (Exception ex)
669+
{
670+
scope.Failed(ex);
671+
throw;
672+
}
673+
}
674+
675+
/// <summary>
676+
/// Create a connect request.
677+
/// </summary>
678+
/// <param name="callLocator"></param>
679+
/// <param name="callbackUri"></param>
680+
/// <param name="cancellationToken"></param>
681+
/// <exception cref="ArgumentNullException"><paramref name="callLocator"/> is null.</exception>
682+
/// <exception cref="ArgumentException"><paramref name="callbackUri"/> callbackUrl is not formatted correctly or empty. </exception>
683+
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
684+
/// <returns></returns>
685+
public virtual Response<ConnectCallResult> ConnectCall(CallLocator callLocator, Uri callbackUri, CancellationToken cancellationToken = default)
686+
{
687+
ConnectCallOptions options = new ConnectCallOptions(callLocator, callbackUri);
688+
689+
return ConnectCall(options, cancellationToken);
690+
}
691+
692+
/// <summary>
693+
/// Create a connect request.
694+
/// </summary>
695+
/// <param name="connectCallOptions">ConnectOptions for connect request.</param>
696+
/// <param name="cancellationToken">The cancellation token.</param>
697+
/// <exception cref="ArgumentNullException"><paramref name="connectCallOptions"/> is null.</exception>
698+
/// <exception cref="ArgumentException"><paramref name="connectCallOptions"/> CallbackUrl is not formatted correctly. </exception>
699+
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
700+
/// <returns></returns>
701+
public virtual Response<ConnectCallResult> ConnectCall(ConnectCallOptions connectCallOptions, CancellationToken cancellationToken = default)
702+
{
703+
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(ConnectCall)}");
704+
scope.Start();
705+
try
706+
{
707+
if (connectCallOptions == null)
708+
throw new ArgumentNullException(nameof(connectCallOptions));
709+
710+
ConnectRequestInternal connectRequest = ConnectRequest(connectCallOptions);
711+
Response<CallConnectionPropertiesInternal> response = AzureCommunicationServicesRestClient.Connect(connectRequest);
712+
713+
var callConnection = GetCallConnection(response.Value.CallConnectionId);
714+
ConnectCallResult connectResult = new ConnectCallResult(new CallConnectionProperties(response.Value), callConnection);
715+
connectResult.SetEventProcessor(EventProcessor, response.Value.CallConnectionId);
716+
717+
return Response.FromValue(connectResult, response.GetRawResponse());
718+
}
719+
catch (Exception ex)
720+
{
721+
scope.Failed(ex);
722+
throw;
723+
}
724+
}
621725
private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options)
622726
{
623727
CreateCallRequestInternal request = new(
@@ -647,8 +751,8 @@ private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options)
647751
}
648752

649753
request.OperationContext = options.OperationContext;
650-
request.MediaStreamingConfiguration = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
651-
request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
754+
request.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
755+
request.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
652756

653757
return request;
654758
}
@@ -682,18 +786,39 @@ private CreateCallRequestInternal CreateCallRequest(CreateGroupCallOptions optio
682786
}
683787

684788
request.OperationContext = options.OperationContext;
685-
request.MediaStreamingConfiguration = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
686-
request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
789+
request.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
790+
request.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
687791

688792
return request;
689793
}
690794

795+
private ConnectRequestInternal ConnectRequest(ConnectCallOptions options)
796+
{
797+
CallLocatorInternal callLocatorInternal = CallLocatorSerializer.Serialize(options.CallLocator);
798+
ConnectRequestInternal connectRequest = new ConnectRequestInternal(callLocatorInternal, options.CallbackUri?.AbsoluteUri);
799+
connectRequest.OperationContext = options.OperationContext;
800+
connectRequest.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions);
801+
connectRequest.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
802+
803+
if (options.CallIntelligenceOptions != null && options.CallIntelligenceOptions.CognitiveServicesEndpoint != null)
804+
{
805+
CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = new CallIntelligenceOptionsInternal
806+
{
807+
CognitiveServicesEndpoint = options.CallIntelligenceOptions?.CognitiveServicesEndpoint?.AbsoluteUri
808+
};
809+
connectRequest.CallIntelligenceOptions = callIntelligenceOptionsInternal;
810+
}
811+
812+
return connectRequest;
813+
}
814+
691815
/// <summary>
692816
/// Validates an Https Uri.
693817
/// </summary>
694818
/// <param name="uri"></param>
695819
/// <returns></returns>
696-
private static bool IsValidHttpsUri(Uri uri) {
820+
private static bool IsValidHttpsUri(Uri uri)
821+
{
697822
if (uri == null)
698823
return false;
699824
var uriString = uri.AbsoluteUri;
@@ -704,15 +829,20 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal
704829
{
705830
return configuration == default
706831
? default
707-
: new MediaStreamingOptionsInternal(configuration.TransportUri.AbsoluteUri, configuration.MediaStreamingTransport, configuration.MediaStreamingContent,
708-
configuration.MediaStreamingAudioChannel);
832+
: new MediaStreamingOptionsInternal(configuration.TransportUri.AbsoluteUri, configuration.MediaStreamingTransport,
833+
configuration.MediaStreamingContent, configuration.MediaStreamingAudioChannel, configuration.StartMediaStreaming,
834+
configuration.EnableBidirectional, configuration.AudioFormat == null ? AudioFormat.Pcm24KMono : configuration.AudioFormat);
709835
}
710836
private static TranscriptionOptionsInternal CreateTranscriptionOptionsInternal(TranscriptionOptions configuration)
711837
{
712838
return configuration == default
713839
? default
714840
: new TranscriptionOptionsInternal(configuration.TransportUrl.AbsoluteUri, configuration.TranscriptionTransport, configuration.Locale,
715-
configuration.StartTranscription);
841+
configuration.StartTranscription.GetValueOrDefault())
842+
{
843+
EnableIntermediateResults = configuration.EnableIntermediateResults,
844+
SpeechRecognitionModelEndpointId = configuration.SpeechRecognitionModelEndpointId
845+
};
716846
}
717847

718848
/// <summary> Initializes a new instance of CallConnection. <see cref="CallConnection"/>.</summary>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class CallAutomationClientOptions : ClientOptions
1616
/// <summary>
1717
/// The latest version of the CallAutomation service.
1818
/// </summary>
19-
internal const ServiceVersion LatestVersion = ServiceVersion.V2023_10_03_Preview;
19+
internal const ServiceVersion LatestVersion = ServiceVersion.V2024_09_01_Preview;
2020

2121
internal string ApiVersion { get; }
2222

@@ -43,6 +43,7 @@ public CallAutomationClientOptions(ServiceVersion version = LatestVersion)
4343
ServiceVersion.V2023_06_15_Preview => "2023-06-15-preview",
4444
ServiceVersion.V2023_10_15 => "2023-10-15",
4545
ServiceVersion.V2023_10_03_Preview => "2023-10-03-preview",
46+
ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview",
4647
_ => throw new ArgumentOutOfRangeException(nameof(version)),
4748
};
4849
}
@@ -71,7 +72,12 @@ public enum ServiceVersion
7172
/// <summary>
7273
/// Latest ALPHA3 (1.2.0-alpha) preview of the CallAutomation service.
7374
/// </summary>
74-
V2023_10_03_Preview = 4
75+
V2023_10_03_Preview = 4,
76+
77+
/// <summary>
78+
/// Latest ALPHA4 (1.4.0-alpha) preview of the CallAutomation service.
79+
/// </summary>
80+
V2024_09_01_Preview = 5
7581
#pragma warning restore CA1707 // Identifiers should not contain underscores
7682
}
7783
}

sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AnswerCallEventResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class AnswerCallEventResult
1717
public CallConnected SuccessResult { get; }
1818

1919
/// <summary>
20-
/// <see cref="AnswerFailed"/> evnet will be returned when the call was not answered.
20+
/// <see cref="AnswerFailed"/> event will be returned once the call is established with AnswerCall.
2121
/// </summary>
2222
/// <value></value>
2323
public AnswerFailed FailureResult { get; }

0 commit comments

Comments
 (0)