Skip to content

Commit

Permalink
Added call connection Id for recording and live and unit test code. (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
v-pivamshi and v-vdharmaraj authored Jan 29, 2025
1 parent 61f9e88 commit ec100a3
Show file tree
Hide file tree
Showing 26 changed files with 1,408 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public static partial class CallAutomationModelFactory
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; }
public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; }
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; }
public static Azure.Communication.CallAutomation.StartRecordingFailed StartRecordingFailed(string callConnectionId = null, string correlationId = null, string recordingId = null) { throw null; }
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; }
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; }
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; }
Expand Down Expand Up @@ -1775,9 +1776,17 @@ internal StartRecognizingEventResult() { }
public bool IsSuccess { get { throw null; } }
public Azure.Communication.CallAutomation.RecognizeCompleted SuccessResult { get { throw null; } }
}
public partial class StartRecordingFailed : Azure.Communication.CallAutomation.CallAutomationEventBase
{
internal StartRecordingFailed() { }
public Azure.Communication.CallAutomation.MediaEventReasonCode ReasonCode { get { throw null; } }
public string RecordingId { get { throw null; } }
public static Azure.Communication.CallAutomation.StartRecordingFailed Deserialize(string content) { throw null; }
}
public partial class StartRecordingOptions
{
public StartRecordingOptions(Azure.Communication.CallAutomation.CallLocator callLocator) { }
public StartRecordingOptions(string callConnectionId) { }
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
public System.Collections.Generic.IList<Azure.Communication.CallAutomation.ChannelAffinity> ChannelAffinity { get { throw null; } set { } }
public bool PauseOnStart { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public static partial class CallAutomationModelFactory
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; }
public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; }
public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; }
public static Azure.Communication.CallAutomation.StartRecordingFailed StartRecordingFailed(string callConnectionId = null, string correlationId = null, string recordingId = null) { throw null; }
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; }
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; }
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; }
Expand Down Expand Up @@ -1774,9 +1775,17 @@ internal StartRecognizingEventResult() { }
public bool IsSuccess { get { throw null; } }
public Azure.Communication.CallAutomation.RecognizeCompleted SuccessResult { get { throw null; } }
}
public partial class StartRecordingFailed : Azure.Communication.CallAutomation.CallAutomationEventBase
{
internal StartRecordingFailed() { }
public Azure.Communication.CallAutomation.MediaEventReasonCode ReasonCode { get { throw null; } }
public string RecordingId { get { throw null; } }
public static Azure.Communication.CallAutomation.StartRecordingFailed Deserialize(string content) { throw null; }
}
public partial class StartRecordingOptions
{
public StartRecordingOptions(Azure.Communication.CallAutomation.CallLocator callLocator) { }
public StartRecordingOptions(string callConnectionId) { }
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
public System.Collections.Generic.IList<Azure.Communication.CallAutomation.ChannelAffinity> ChannelAffinity { get { throw null; } set { } }
public bool PauseOnStart { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/communication/Azure.Communication.CallAutomation",
"Tag": "net/communication/Azure.Communication.CallAutomation_c2ac7fa0db"
"Tag": "net/communication/Azure.Communication.CallAutomation_fdf269ce94"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -56,16 +55,24 @@ public virtual Response<RecordingStateResult> Start(StartRecordingOptions option
scope.Start();
try
{
StartCallRecordingRequestInternal request = new()
StartCallRecordingRequestInternal request = new StartCallRecordingRequestInternal()
{
CallLocator = CallLocatorSerializer.Serialize(options.CallLocator),
RecordingStateCallbackUri = options.RecordingStateCallbackUri?.AbsoluteUri,
RecordingChannelType = options.RecordingChannel,
RecordingContentType = options.RecordingContent,
RecordingFormatType = options.RecordingFormat,
PauseOnStart = options.PauseOnStart,
PauseOnStart = options.PauseOnStart
};

if (options.CallLocator != null)
{
request.CallLocator = CallLocatorSerializer.Serialize(options.CallLocator);
}
else if (options.CallConnectionId != null)
{
request.CallConnectionId = options.CallConnectionId;
}

if (options.AudioChannelParticipantOrdering != null && options.AudioChannelParticipantOrdering.Any())
{
foreach (var c in options.AudioChannelParticipantOrdering)
Expand Down Expand Up @@ -119,16 +126,24 @@ public virtual async Task<Response<RecordingStateResult>> StartAsync(StartRecord
scope.Start();
try
{
StartCallRecordingRequestInternal request = new()
StartCallRecordingRequestInternal request = new StartCallRecordingRequestInternal()
{
CallLocator = CallLocatorSerializer.Serialize(options.CallLocator),
RecordingStateCallbackUri = options.RecordingStateCallbackUri?.AbsoluteUri,
RecordingChannelType = options.RecordingChannel,
RecordingContentType = options.RecordingContent,
RecordingFormatType = options.RecordingFormat,
PauseOnStart = options.PauseOnStart,
PauseOnStart = options.PauseOnStart
};

if (options.CallLocator != null)
{
request.CallLocator = CallLocatorSerializer.Serialize(options.CallLocator);
}
else if (options.CallConnectionId != null)
{
request.CallConnectionId = options.CallConnectionId;
}

if (options.AudioChannelParticipantOrdering != null && options.AudioChannelParticipantOrdering.Any())
{
foreach (var c in options.AudioChannelParticipantOrdering)
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.

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.

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.

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

Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ private static CallAutomationEventBase Deserialize(string eventData, string type
return ParticipantsUpdated.Deserialize(eventData);
case nameof(RecordingStateChanged):
return RecordingStateChanged.Deserialize(eventData);
case nameof(StartRecordingFailed):
return StartRecordingFailed.Deserialize(eventData);
case nameof(PlayCompleted):
return PlayCompleted.Deserialize(eventData);
case nameof(PlayFailed):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Text.Json;
using Azure.Core;

namespace Azure.Communication.CallAutomation
{
/// <summary>
/// The StartRecordingFailed event.
/// </summary>

[CodeGenModel("StartRecordingFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })]
public partial class StartRecordingFailed : CallAutomationEventBase
{
/// <summary>
/// Reason code.
/// </summary>
public MediaEventReasonCode ReasonCode { get; internal set; }

/// <summary>
/// Deserialize <see cref="StartRecordingFailed"/> event.
/// </summary>
/// <param name="content">The json content.</param>
/// <returns>The new <see cref="StartRecordingFailed"/> object.</returns>
public static StartRecordingFailed Deserialize(string content)
{
using var document = JsonDocument.Parse(content);
JsonElement element = document.RootElement;

return DeserializeStartRecordingFailed(element);
}
}
}
Loading

0 comments on commit ec100a3

Please sign in to comment.