Skip to content

Commit ec100a3

Browse files
v-pivamshiVinothini Dharmaraj
andauthored
Added call connection Id for recording and live and unit test code. (Azure#47646)
* Added call connection Id for recording and live and unit test code. * Added start recording failed event. * Updating the PR with minor changes * updating the api changes * fixing the live test * updating the live test * fixing the media recording failed * reverting playback mode set * pushing the test records for recording --------- Co-authored-by: Vinothini Dharmaraj <[email protected]>
1 parent 61f9e88 commit ec100a3

26 files changed

+1408
-33
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ public static partial class CallAutomationModelFactory
257257
public static Azure.Communication.CallAutomation.SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
258258
public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; }
259259
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; }
260+
public static Azure.Communication.CallAutomation.StartRecordingFailed StartRecordingFailed(string callConnectionId = null, string correlationId = null, string recordingId = null) { throw null; }
260261
public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
261262
public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
262263
public static Azure.Communication.CallAutomation.TranscriptionStopped TranscriptionStopped(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
@@ -1775,9 +1776,17 @@ internal StartRecognizingEventResult() { }
17751776
public bool IsSuccess { get { throw null; } }
17761777
public Azure.Communication.CallAutomation.RecognizeCompleted SuccessResult { get { throw null; } }
17771778
}
1779+
public partial class StartRecordingFailed : Azure.Communication.CallAutomation.CallAutomationEventBase
1780+
{
1781+
internal StartRecordingFailed() { }
1782+
public Azure.Communication.CallAutomation.MediaEventReasonCode ReasonCode { get { throw null; } }
1783+
public string RecordingId { get { throw null; } }
1784+
public static Azure.Communication.CallAutomation.StartRecordingFailed Deserialize(string content) { throw null; }
1785+
}
17781786
public partial class StartRecordingOptions
17791787
{
17801788
public StartRecordingOptions(Azure.Communication.CallAutomation.CallLocator callLocator) { }
1789+
public StartRecordingOptions(string callConnectionId) { }
17811790
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
17821791
public System.Collections.Generic.IList<Azure.Communication.CallAutomation.ChannelAffinity> ChannelAffinity { get { throw null; } set { } }
17831792
public bool PauseOnStart { get { throw null; } set { } }

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ public static partial class CallAutomationModelFactory
257257
public static Azure.Communication.CallAutomation.SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
258258
public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; }
259259
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; }
260+
public static Azure.Communication.CallAutomation.StartRecordingFailed StartRecordingFailed(string callConnectionId = null, string correlationId = null, string recordingId = null) { throw null; }
260261
public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
261262
public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
262263
public static Azure.Communication.CallAutomation.TranscriptionStopped TranscriptionStopped(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; }
@@ -1774,9 +1775,17 @@ internal StartRecognizingEventResult() { }
17741775
public bool IsSuccess { get { throw null; } }
17751776
public Azure.Communication.CallAutomation.RecognizeCompleted SuccessResult { get { throw null; } }
17761777
}
1778+
public partial class StartRecordingFailed : Azure.Communication.CallAutomation.CallAutomationEventBase
1779+
{
1780+
internal StartRecordingFailed() { }
1781+
public Azure.Communication.CallAutomation.MediaEventReasonCode ReasonCode { get { throw null; } }
1782+
public string RecordingId { get { throw null; } }
1783+
public static Azure.Communication.CallAutomation.StartRecordingFailed Deserialize(string content) { throw null; }
1784+
}
17771785
public partial class StartRecordingOptions
17781786
{
17791787
public StartRecordingOptions(Azure.Communication.CallAutomation.CallLocator callLocator) { }
1788+
public StartRecordingOptions(string callConnectionId) { }
17801789
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
17811790
public System.Collections.Generic.IList<Azure.Communication.CallAutomation.ChannelAffinity> ChannelAffinity { get { throw null; } set { } }
17821791
public bool PauseOnStart { get { throw null; } set { } }

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

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
using System;
5-
using System.Collections.Generic;
65
using System.IO;
76
using System.Linq;
87
using System.Threading;
@@ -56,16 +55,24 @@ public virtual Response<RecordingStateResult> Start(StartRecordingOptions option
5655
scope.Start();
5756
try
5857
{
59-
StartCallRecordingRequestInternal request = new()
58+
StartCallRecordingRequestInternal request = new StartCallRecordingRequestInternal()
6059
{
61-
CallLocator = CallLocatorSerializer.Serialize(options.CallLocator),
6260
RecordingStateCallbackUri = options.RecordingStateCallbackUri?.AbsoluteUri,
6361
RecordingChannelType = options.RecordingChannel,
6462
RecordingContentType = options.RecordingContent,
6563
RecordingFormatType = options.RecordingFormat,
66-
PauseOnStart = options.PauseOnStart,
64+
PauseOnStart = options.PauseOnStart
6765
};
6866

67+
if (options.CallLocator != null)
68+
{
69+
request.CallLocator = CallLocatorSerializer.Serialize(options.CallLocator);
70+
}
71+
else if (options.CallConnectionId != null)
72+
{
73+
request.CallConnectionId = options.CallConnectionId;
74+
}
75+
6976
if (options.AudioChannelParticipantOrdering != null && options.AudioChannelParticipantOrdering.Any())
7077
{
7178
foreach (var c in options.AudioChannelParticipantOrdering)
@@ -119,16 +126,24 @@ public virtual async Task<Response<RecordingStateResult>> StartAsync(StartRecord
119126
scope.Start();
120127
try
121128
{
122-
StartCallRecordingRequestInternal request = new()
129+
StartCallRecordingRequestInternal request = new StartCallRecordingRequestInternal()
123130
{
124-
CallLocator = CallLocatorSerializer.Serialize(options.CallLocator),
125131
RecordingStateCallbackUri = options.RecordingStateCallbackUri?.AbsoluteUri,
126132
RecordingChannelType = options.RecordingChannel,
127133
RecordingContentType = options.RecordingContent,
128134
RecordingFormatType = options.RecordingFormat,
129-
PauseOnStart = options.PauseOnStart,
135+
PauseOnStart = options.PauseOnStart
130136
};
131137

138+
if (options.CallLocator != null)
139+
{
140+
request.CallLocator = CallLocatorSerializer.Serialize(options.CallLocator);
141+
}
142+
else if (options.CallConnectionId != null)
143+
{
144+
request.CallConnectionId = options.CallConnectionId;
145+
}
146+
132147
if (options.AudioChannelParticipantOrdering != null && options.AudioChannelParticipantOrdering.Any())
133148
{
134149
foreach (var c in options.AudioChannelParticipantOrdering)

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

Lines changed: 10 additions & 0 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/CallRecordingRestClient.cs

Lines changed: 2 additions & 0 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/Models/CallIntelligenceOptionsInternal.Serialization.cs

Lines changed: 5 additions & 0 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/Models/CallIntelligenceOptionsInternal.cs

Lines changed: 5 additions & 1 deletion
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/Models/CallLocatorKindInternal.cs

Lines changed: 0 additions & 3 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/Models/StartRecordingFailed.Serialization.cs

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

0 commit comments

Comments
 (0)