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

Added call connection Id for recording and live and unit test code. #47646

Merged
merged 12 commits into from
Jan 29, 2025
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