Skip to content

Commit 862a105

Browse files
author
Vinothini Dharmaraj
committed
updating the changelog and recording new tests
1 parent 147b61b commit 862a105

File tree

35 files changed

+1522
-705
lines changed

35 files changed

+1522
-705
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
### Features Added
66

7+
- Support multiple play sources for Play and Recognize
8+
- Support for PlayStarted event in Play/Recognize
9+
- Support for the real time transcription
10+
- Monetization for real-time transcription (e.g. transcription, sentiment, nuance integration, etc)
11+
- Hold and Unhold the participant with/without the play source
12+
- Support to manage the rooms/servercall/group call using connect API
13+
- Support for the audio streaming
14+
- Expose original PSTN number target from incoming call event in call connection properties
15+
- Support for VoIP to PSTN transfer scenario
16+
717
### Breaking Changes
818

919
### Bugs Fixed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ protected CallAutomationClient() { }
9090
public CallAutomationClient(string connectionString) { }
9191
public CallAutomationClient(string connectionString, Azure.Communication.CallAutomation.CallAutomationClientOptions options) { }
9292
public CallAutomationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { }
93-
public CallAutomationClient(System.Uri pmaEndpoint, string connectionString, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { }
94-
public CallAutomationClient(System.Uri pmaEndpoint, System.Uri acsEndpoint, Azure.Core.TokenCredential credential, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { }
9593
public Azure.Communication.CommunicationUserIdentifier Source { get { throw null; } }
9694
public virtual Azure.Response<Azure.Communication.CallAutomation.AnswerCallResult> AnswerCall(Azure.Communication.CallAutomation.AnswerCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
9795
public virtual Azure.Response<Azure.Communication.CallAutomation.AnswerCallResult> AnswerCall(string incomingCallContext, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }

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_e620e9ab06"
5+
"Tag": "net/communication/Azure.Communication.CallAutomation_6663381936"
66
}

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

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,6 @@ public CallAutomationClient(Uri endpoint, TokenCredential credential, CallAutoma
6363
Argument.CheckNotNull(credential, nameof(credential)),
6464
options ?? new CallAutomationClientOptions())
6565
{ }
66-
67-
/// <summary> Initializes a new instance of <see cref="CallAutomationClient"/> with custom PMA endpoint.</summary>
68-
/// <param name="pmaEndpoint">Endpoint for PMA</param>
69-
/// <param name="connectionString">Connection string acquired from the Azure Communication Services resource.</param>
70-
/// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
71-
public CallAutomationClient(Uri pmaEndpoint, string connectionString, CallAutomationClientOptions options = default)
72-
: this(
73-
pmaEndpoint,
74-
options ?? new CallAutomationClientOptions(),
75-
ConnectionString.Parse(connectionString))
76-
{ }
77-
78-
/// <summary> Initializes a new instance of <see cref="CallAutomationClient"/>.</summary>
79-
/// <param name="pmaEndpoint">Endpoint for PMA</param>
80-
/// <param name="acsEndpoint">The URI of the Azure Communication Services resource.</param>
81-
/// <param name="credential">The TokenCredential used to authenticate requests, such as DefaultAzureCredential.</param>
82-
/// <param name="options">Client option exposing <see cref="ClientOptions.Diagnostics"/>, <see cref="ClientOptions.Retry"/>, <see cref="ClientOptions.Transport"/>, etc.</param>
83-
public CallAutomationClient(Uri pmaEndpoint, Uri acsEndpoint, TokenCredential credential, CallAutomationClientOptions options = default)
84-
: this(
85-
pmaEndpoint,
86-
acsEndpoint,
87-
options ?? new CallAutomationClientOptions(),
88-
credential
89-
)
90-
{ }
9166
#endregion
9267

9368
#region private constructors
@@ -99,13 +74,6 @@ private CallAutomationClient(string endpoint, TokenCredential tokenCredential, C
9974
: this(new Uri(endpoint), options.BuildHttpPipeline(tokenCredential), options)
10075
{ }
10176

102-
private CallAutomationClient(Uri endpoint, CallAutomationClientOptions options, ConnectionString connectionString)
103-
: this(
104-
endpoint: endpoint,
105-
httpPipeline: options.CustomBuildHttpPipeline(connectionString),
106-
options: options)
107-
{ }
108-
10977
private CallAutomationClient(Uri endpoint, HttpPipeline httpPipeline, CallAutomationClientOptions options)
11078
{
11179
_pipeline = httpPipeline;
@@ -118,14 +86,6 @@ private CallAutomationClient(Uri endpoint, HttpPipeline httpPipeline, CallAutoma
11886
EventProcessor = new CallAutomationEventProcessor();
11987
Source = options.Source;
12088
}
121-
122-
private CallAutomationClient(
123-
Uri pmaEndpoint,
124-
Uri acsEndpoint,
125-
CallAutomationClientOptions options,
126-
TokenCredential tokenCredential)
127-
: this(pmaEndpoint, options.CustomBuildHttpPipeline(acsEndpoint, tokenCredential), options)
128-
{ }
12989
#endregion
13090

13191
/// <summary>Initializes a new instance of <see cref="CallAutomationClient"/> for mocking.</summary>

sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs

Lines changed: 145 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,78 @@ public async Task PlayInvalidFileSourceWithPlayMediaTest()
647647
}
648648
}
649649

650+
[RecordedTest]
651+
public async Task PlayInvalidAndValidFileSourceWithPlayMediaTest()
652+
{
653+
// create caller and receiver
654+
CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false);
655+
CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false);
656+
CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user);
657+
CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target);
658+
string? callConnectionId = null;
659+
try
660+
{
661+
try
662+
{
663+
// setup service bus
664+
var uniqueId = await ServiceBusWithNewCall(user, target);
665+
var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false);
666+
callConnectionId = result.CallerCallConnectionId;
667+
var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false);
668+
var callConnection = client.GetCallConnection(callConnectionId);
669+
670+
// Assert multiple Text Source with wrong file source play failed event
671+
var playMultipleSources = new List<PlaySource>() {
672+
new FileSource(new Uri(TestEnvironment.FileSourceUrl) ),
673+
new FileSource(new Uri("https://dummy.com/dummyurl.wav"))
674+
};
675+
676+
PlayOptions options = new PlayOptions(playMultipleSources, new List<CommunicationUserIdentifier>() { target }) { OperationContext = "context" };
677+
678+
// Assert the Play with multiple Text Sources
679+
await callConnection.GetCallMedia().PlayAsync(options).ConfigureAwait(false);
680+
var playFailedEvent = await WaitForEvent<PlayFailed>(callConnectionId, TimeSpan.FromSeconds(20));
681+
Assert.IsNotNull(playFailedEvent);
682+
Assert.IsTrue(playFailedEvent is PlayFailed);
683+
Assert.AreEqual(callConnectionId, ((PlayFailed)playFailedEvent!).CallConnectionId);
684+
Assert.AreEqual(1, ((PlayFailed)playFailedEvent!).FailedPlaySourceIndex);
685+
686+
// try hangup
687+
await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false);
688+
var disconnectedEvent = await WaitForEvent<CallDisconnected>(callConnectionId, TimeSpan.FromSeconds(20));
689+
Assert.IsNotNull(disconnectedEvent);
690+
Assert.IsTrue(disconnectedEvent is CallDisconnected);
691+
Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId);
692+
693+
try
694+
{
695+
// test get properties
696+
Response<CallConnectionProperties> properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false);
697+
}
698+
catch (RequestFailedException ex)
699+
{
700+
if (ex.Status == 404)
701+
{
702+
callConnectionId = null;
703+
return;
704+
}
705+
}
706+
}
707+
catch (Exception)
708+
{
709+
throw;
710+
}
711+
}
712+
catch (Exception ex)
713+
{
714+
Assert.Fail($"Unexpected error: {ex}");
715+
}
716+
finally
717+
{
718+
await CleanUpCall(client, callConnectionId);
719+
}
720+
}
721+
650722
[RecordedTest]
651723
public async Task PlayInvalidFileSourceWithPlayMediaAllTest()
652724
{
@@ -674,9 +746,8 @@ public async Task PlayInvalidFileSourceWithPlayMediaAllTest()
674746

675747
PlayToAllOptions options = new PlayToAllOptions(playMultipleSources) { OperationContext = "context" };
676748

677-
// Assert the Play with multiple Text Sources
749+
// Assert the Play with invalid file source
678750
await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false);
679-
680751
var playFailedEvent = await WaitForEvent<PlayFailed>(callConnectionId, TimeSpan.FromSeconds(20));
681752
Assert.IsNotNull(playFailedEvent);
682753
Assert.IsTrue(playFailedEvent is PlayFailed);
@@ -719,6 +790,78 @@ public async Task PlayInvalidFileSourceWithPlayMediaAllTest()
719790
}
720791
}
721792

793+
[RecordedTest]
794+
public async Task PlayInvalidAndInvalidFileSourceWithPlayMediaAllTest()
795+
{
796+
// create caller and receiver
797+
CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false);
798+
CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false);
799+
CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user);
800+
CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target);
801+
string? callConnectionId = null;
802+
try
803+
{
804+
try
805+
{
806+
// setup service bus
807+
var uniqueId = await ServiceBusWithNewCall(user, target);
808+
var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false);
809+
callConnectionId = result.CallerCallConnectionId;
810+
var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false);
811+
var callConnection = client.GetCallConnection(callConnectionId);
812+
813+
// Assert multiple Text Source with wrong file source play failed event
814+
var playMultipleSources = new List<PlaySource>() {
815+
new FileSource(new Uri(TestEnvironment.FileSourceUrl) ),
816+
new FileSource(new Uri("https://dummy.com/dummyurl.wav"))
817+
};
818+
819+
PlayToAllOptions options = new PlayToAllOptions(playMultipleSources) { OperationContext = "context" };
820+
821+
// Assert the Play with multiple Text Sources
822+
await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false);
823+
var playFailedEvent = await WaitForEvent<PlayFailed>(callConnectionId, TimeSpan.FromSeconds(20));
824+
Assert.IsNotNull(playFailedEvent);
825+
Assert.IsTrue(playFailedEvent is PlayFailed);
826+
Assert.AreEqual(callConnectionId, ((PlayFailed)playFailedEvent!).CallConnectionId);
827+
Assert.AreEqual(1, ((PlayFailed)playFailedEvent!).FailedPlaySourceIndex);
828+
829+
// try hangup
830+
await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false);
831+
var disconnectedEvent = await WaitForEvent<CallDisconnected>(callConnectionId, TimeSpan.FromSeconds(20));
832+
Assert.IsNotNull(disconnectedEvent);
833+
Assert.IsTrue(disconnectedEvent is CallDisconnected);
834+
Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId);
835+
836+
try
837+
{
838+
// test get properties
839+
Response<CallConnectionProperties> properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false);
840+
}
841+
catch (RequestFailedException ex)
842+
{
843+
if (ex.Status == 404)
844+
{
845+
callConnectionId = null;
846+
return;
847+
}
848+
}
849+
}
850+
catch (Exception)
851+
{
852+
throw;
853+
}
854+
}
855+
catch (Exception ex)
856+
{
857+
Assert.Fail($"Unexpected error: {ex}");
858+
}
859+
finally
860+
{
861+
await CleanUpCall(client, callConnectionId);
862+
}
863+
}
864+
722865
[Ignore(reason: "Receiving bad request on the cognitive service will investigate and enable")]
723866
[RecordedTest]
724867
public async Task DtmfRecognizeWithMultipleSourcesTest()

0 commit comments

Comments
 (0)