diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs index 5913ea29e2fd..36e38e5f58e9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs @@ -62,6 +62,17 @@ public CallAutomationClient(Uri endpoint, TokenCredential credential, CallAutoma Argument.CheckNotNull(credential, nameof(credential)), options ?? new CallAutomationClientOptions()) { } + + /// Initializes a new instance of with custom PMA endpoint. + /// Endpoint for PMA + /// Connection string acquired from the Azure Communication Services resource. + /// Client option exposing , , , etc. + public CallAutomationClient(Uri pmaEndpoint, string connectionString, CallAutomationClientOptions options = default) + : this( + pmaEndpoint, + options ?? new CallAutomationClientOptions(), + ConnectionString.Parse(connectionString)) + { } #endregion #region private constructors @@ -85,6 +96,13 @@ private CallAutomationClient(Uri endpoint, HttpPipeline httpPipeline, CallAutoma EventProcessor = new CallAutomationEventProcessor(); Source = options.Source; } + + private CallAutomationClient(Uri endpoint, CallAutomationClientOptions options, ConnectionString connectionString) + : this( + endpoint: endpoint, + httpPipeline: options.CustomBuildHttpPipeline(connectionString), + options: options) + { } #endregion /// Initializes a new instance of for mocking. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs index 065865ae72f1..96d212f23936 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs @@ -34,9 +34,9 @@ public CallAutomationClientOptions(ServiceVersion version = LatestVersion) { ServiceVersion.V2023_03_06 => "2023-03-06", ServiceVersion.V2023_10_15 => "2023-10-15", - ServiceVersion.V2024_04_15 => "2024_04_15", - ServiceVersion.V2024_09_15 => "2024_09_15", - ServiceVersion.V2025_05_15 => "2025_05_15", + ServiceVersion.V2024_04_15 => "2024-04-15", + ServiceVersion.V2024_09_15 => "2024-09-15", + ServiceVersion.V2025_05_15 => "2025-05-15", _ => throw new ArgumentOutOfRangeException(nameof(version)), }; }