Skip to content

Commit 0f72179

Browse files
[ACS][CallAutomation][Answer]update autorest to update Answer api with custom context (Azure#46075)
* update autorest to update Answer api with custom context * add custom context in Answer api * Updating tests --------- Co-authored-by: minwoolee-msft <[email protected]>
1 parent be22cfb commit 0f72179

24 files changed

+450
-384
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public AnswerCallOptions(string incomingCallContext, System.Uri callbackUri) { }
5050
public Azure.Communication.CommunicationUserIdentifier AnsweredBy { get { throw null; } set { } }
5151
public System.Uri CallbackUri { get { throw null; } }
5252
public Azure.Communication.CallAutomation.CallIntelligenceOptions CallIntelligenceOptions { get { throw null; } set { } }
53+
public Azure.Communication.CallAutomation.CustomCallingContext CustomCallingContext { get { throw null; } }
5354
public string IncomingCallContext { get { throw null; } }
5455
public Azure.Communication.CallAutomation.MediaStreamingOptions MediaStreamingOptions { get { throw null; } set { } }
5556
public string OperationContext { 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_31b05fb06e"
5+
"Tag": "net/communication/Azure.Communication.CallAutomation_a7eb7ffb4a"
66
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ private AnswerCallRequestInternal CreateAnswerCallRequest(AnswerCallOptions opti
254254
request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions);
255255
request.AnsweredBy = Source == null ? null : new CommunicationUserIdentifierModel(Source.Id);
256256
request.OperationContext = options.OperationContext;
257+
request.CustomCallingContext = new CustomCallingContextInternal(
258+
options.CustomCallingContext?.SipHeaders ?? new ChangeTrackingDictionary<string, string>(),
259+
options.CustomCallingContext?.VoipHeaders ?? new ChangeTrackingDictionary<string, string>());
257260

258261
return request;
259262
}

sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.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/AnswerCallRequestInternal.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/Models/AnswerCallOptions.cs

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

44
using System;
5+
using System.Collections.Generic;
56

67
namespace Azure.Communication.CallAutomation
78
{
@@ -19,6 +20,7 @@ public AnswerCallOptions(string incomingCallContext, Uri callbackUri)
1920
{
2021
IncomingCallContext = incomingCallContext;
2122
CallbackUri = callbackUri;
23+
CustomCallingContext = new CustomCallingContext(sipHeaders: new Dictionary<string, string>(), voipHeaders: new Dictionary<string, string>());
2224
}
2325

2426
/// <summary>
@@ -55,5 +57,10 @@ public AnswerCallOptions(string incomingCallContext, Uri callbackUri)
5557
/// The operation context.
5658
/// </summary>
5759
public string OperationContext { get; set; }
60+
61+
/// <summary>
62+
/// The Custom Context which contains SIP and voip headers.
63+
/// </summary>
64+
public CustomCallingContext CustomCallingContext { get; }
5865
}
5966
}

sdk/communication/Azure.Communication.CallAutomation/src/autorest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ model-namespace: false
1010
tag: package-2023-10-03-preview
1111

1212
require:
13-
- https://github.com/Azure/azure-rest-api-specs/blob/156ff363e44f764ddd8a0a6adcd371610240ba15/specification/communication/data-plane/CallAutomation/readme.md
13+
- https://github.com/Azure/azure-rest-api-specs/blob/73e737262249936932d2f7a3e3c400ce2b14a92c/specification/communication/data-plane/CallAutomation/readme.md
1414

1515

1616
title: Azure Communication Services

sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ public async Task DialogOperationsTest_AzureOpenAI()
362362
}
363363

364364
[RecordedTest]
365+
[Ignore("Currently does not work - need service fix?")]
365366
public async Task IdenticalDialogsTest()
366367
{
367368
// ignores test if botAppId or PMA Endpoint is not set in environment variables

sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallAutomationClientAutomatedLiveTests/CreateCallAndReject.json

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

sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallAutomationClientAutomatedLiveTests/CreateCallAndRejectAsync.json

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

0 commit comments

Comments
 (0)