From 0b9b6d2f77227e389e4fec606f9b56615894d584 Mon Sep 17 00:00:00 2001 From: Vanshika Sinha Date: Tue, 20 Apr 2021 09:23:50 -0700 Subject: [PATCH 1/6] Adding Telephony preview package, this includes Call Transfer Activity currently and it will be a place for all telephony extentions for composer --- .../Actions/CallTransferDialog.cs | 53 +++++++++++++++++++ .../Microsoft.Bot.Components.Telephony.csproj | 50 +++++++++++++++++ .../Schemas/CallTransferDialog.schema | 18 +++++++ .../Schemas/CallTransferDialog.uischema | 26 +++++++++ .../TelephonyBotComponent.cs | 21 ++++++++ packages/Microsoft.Bot.Components.sln | 6 +++ 6 files changed, 174 insertions(+) create mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs create mode 100644 packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj create mode 100644 packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema create mode 100644 packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema create mode 100644 packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs new file mode 100644 index 0000000000..002df0e22f --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using AdaptiveExpressions.Properties; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Dialogs; +using Newtonsoft.Json; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Bot.Components.Telephony.Actions +{ + public class CallTransferDialog : Dialog + { + [JsonConstructor] + public CallTransferDialog([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) + : base() + { + // enable instances of this command as debug break point + this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); + } + + [JsonProperty("$kind")] + public const string Kind = "CallTransferDialog"; + + [JsonProperty("targetPhoneNumber")] + public StringExpression TargetPhoneNumber { get; set; } + + public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) + { + var targetPhoneNumber = TargetPhoneNumber.GetValue(dc.State); + + await dc.Context.SendActivityAsync($"Transferring to \"{targetPhoneNumber}\"..."); + + // Create handoff event, passing the phone number to transfer to as context. + var poContext = new { TargetPhoneNumber = targetPhoneNumber }; + var poHandoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, poContext); + + try + { + await dc.Context.SendActivityAsync(poHandoffEvent, cancellationToken); + await dc.Context.SendActivityAsync($"Call transfer initiation succeeded"); + } + catch + { + await dc.Context.SendActivityAsync($"Call transfer failed"); + } + + return await dc.EndDialogAsync(result: 0, cancellationToken: cancellationToken); + } + } +} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj new file mode 100644 index 0000000000..2535dc32a3 --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj @@ -0,0 +1,50 @@ + + + + $(LocalPackageVersion) + $(PreviewPackageVersion) + $(LocalPackageVersion) + $(PreviewPackageVersion) + Debug;Release + bin\$(Configuration)\netstandard2.0\Microsoft.Bot.Builder.Dialogs.Adaptive.xml + + + + netstandard2.0 + Microsoft.Bot.Components.Telephony + This library implements .NET support for adaptive dialogs with Telephony + This library implements .NET support for adaptive dialogs with Microsoft Telephony + content + msbot-action;msbot-trigger;msbot-component + + + + Full + true + + + + + $(NoWarn);CS1591 + 1.0.0-preview + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema new file mode 100644 index 0000000000..2475f68ddd --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema @@ -0,0 +1,18 @@ +{ + "$schema": "https://schemas.botframework.com/schemas/component/v1.0/component.schema", + "$role": "implements(Microsoft.IDialog)", + "title": "Call Transfer", + "description": "Phone number to transfer the call to (in E.164 format such as +1425123456)", + "type": "object", + "additionalProperties": false, + "properties": { + "targetPhoneNumber": { + "$ref": "schema:#/definitions/stringExpression", + "title": "Target Phone Number", + "description": "Phone number to transfer the call to", + "examples": [ + "in E.164 format such as +1425123456" + ] + } + } +} diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema new file mode 100644 index 0000000000..1e65630305 --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema @@ -0,0 +1,26 @@ +{ + "$schema": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema", + "form": { + "label": "Transfer a call", + "subtitle": "Call Transfer", + "order": [ + "targetPhoneNumber", + "*" + ], + "properties": { + "targetPhoneNumber": { + "intellisenseScopes": [ + "variable-scopes" + ] + } + } + }, + "menu": { + "label": "Transfer a call", + "submenu": [ "Channels", "Telephony" ] + }, + "flow": { + "widget": "ActionCard", + "body": "=action.targetPhoneNumber" + } +} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs new file mode 100644 index 0000000000..18be688bf1 --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.Bot.Components.Telephony.Actions; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Bot.Builder; + +namespace Microsoft.Bot.Components.Telephony +{ + public class TeamsBotComponent : BotComponent + { + /// + public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) + { + // Conditionals + services.AddSingleton(sp => new DeclarativeType(CallTransferDialog.Kind)); + } + } +} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.sln b/packages/Microsoft.Bot.Components.sln index a1352f774d..c1f3d8fcde 100644 --- a/packages/Microsoft.Bot.Components.sln +++ b/packages/Microsoft.Bot.Components.sln @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Ad EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Teams", "Teams\Microsoft.Bot.Components.Teams.csproj", "{FD29CBA6-C18F-498B-9F00-A3C34C1BEC5F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Components.Telephony", "Microsoft.Bot.Components.Telephony\Microsoft.Bot.Components.Telephony.csproj", "{A854B5EC-3A34-4D1F-8080-F0846DEDF63F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {FD29CBA6-C18F-498B-9F00-A3C34C1BEC5F}.Debug|Any CPU.Build.0 = Debug|Any CPU {FD29CBA6-C18F-498B-9F00-A3C34C1BEC5F}.Release|Any CPU.ActiveCfg = Release|Any CPU {FD29CBA6-C18F-498B-9F00-A3C34C1BEC5F}.Release|Any CPU.Build.0 = Release|Any CPU + {A854B5EC-3A34-4D1F-8080-F0846DEDF63F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A854B5EC-3A34-4D1F-8080-F0846DEDF63F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A854B5EC-3A34-4D1F-8080-F0846DEDF63F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A854B5EC-3A34-4D1F-8080-F0846DEDF63F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 410c06fa740fca04d8ae2781002391a19c6701b2 Mon Sep 17 00:00:00 2001 From: Vanshika Sinha Date: Thu, 22 Apr 2021 16:22:35 -0700 Subject: [PATCH 2/6] addressing comments/error handling/stylecop issues --- .../config/applicationhost.config | 1021 +++++++++++++++++ .../Actions/CallTransfer.cs | 66 ++ .../Actions/CallTransferDialog.cs | 53 - .../Microsoft.Bot.Components.Telephony.csproj | 49 +- ...> Microsoft.Telephony.CallTransfer.schema} | 9 +- ...Microsoft.Telephony.CallTransfer.uischema} | 6 +- .../TelephonyBotComponent.cs | 19 +- 7 files changed, 1128 insertions(+), 95 deletions(-) create mode 100644 packages/.vs/Microsoft.Bot.Components/config/applicationhost.config create mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs delete mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs rename packages/Microsoft.Bot.Components.Telephony/Schemas/{CallTransferDialog.schema => Microsoft.Telephony.CallTransfer.schema} (75%) rename packages/Microsoft.Bot.Components.Telephony/Schemas/{CallTransferDialog.uischema => Microsoft.Telephony.CallTransfer.uischema} (81%) diff --git a/packages/.vs/Microsoft.Bot.Components/config/applicationhost.config b/packages/.vs/Microsoft.Bot.Components/config/applicationhost.config new file mode 100644 index 0000000000..269dc55dcf --- /dev/null +++ b/packages/.vs/Microsoft.Bot.Components/config/applicationhost.config @@ -0,0 +1,1021 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs new file mode 100644 index 0000000000..2551644ea9 --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Components.Telephony.Actions +{ + using System.Runtime.CompilerServices; + using System.Threading; + using System.Threading.Tasks; + using AdaptiveExpressions.Properties; + using Microsoft.Bot.Builder; + using Microsoft.Bot.Builder.Dialogs; + using Newtonsoft.Json; + + /// + /// Transfers call to given phone number. + /// + public class CallTransfer : Dialog + { + /// + /// Class identifier. + /// + [JsonProperty("$kind")] + public const string Kind = "Microsoft.Telephony.CallTransfer"; + + /// + /// Initializes a new instance of the class. + /// + /// Optional, source file full path. + /// Optional, line number in source file. + [JsonConstructor] + public CallTransfer([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) + : base() + { + // enable instances of this command as debug break point + this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); + } + + /// + /// Gets or sets the phone number to be included when sending the handoff activity. + /// + /// + /// . + /// + [JsonProperty("phoneNumber")] + public StringExpression PhoneNumber { get; set; } + + /// + /// Called when the dialog is started and pushed onto the dialog stack. + /// + /// The for the current turn of conversation. + /// Optional, initial information to pass to the dialog. + /// A cancellation token that can be used by other objects + /// or threads to receive notice of cancellation. + /// A representing the asynchronous operation. + public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) + { + var phoneNumber = this.PhoneNumber?.GetValue(dc.State); + + // Create handoff event, passing the phone number to transfer to as context. + var context = new { TargetPhoneNumber = phoneNumber }; + var handoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, context); + await dc.Context.SendActivityAsync(handoffEvent, cancellationToken).ConfigureAwait(false); + return await dc.EndDialogAsync(result: null, cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs deleted file mode 100644 index 002df0e22f..0000000000 --- a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using AdaptiveExpressions.Properties; -using Microsoft.Bot.Builder; -using Microsoft.Bot.Builder.Dialogs; -using Newtonsoft.Json; -using System.Runtime.CompilerServices; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Bot.Components.Telephony.Actions -{ - public class CallTransferDialog : Dialog - { - [JsonConstructor] - public CallTransferDialog([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) - : base() - { - // enable instances of this command as debug break point - this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); - } - - [JsonProperty("$kind")] - public const string Kind = "CallTransferDialog"; - - [JsonProperty("targetPhoneNumber")] - public StringExpression TargetPhoneNumber { get; set; } - - public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) - { - var targetPhoneNumber = TargetPhoneNumber.GetValue(dc.State); - - await dc.Context.SendActivityAsync($"Transferring to \"{targetPhoneNumber}\"..."); - - // Create handoff event, passing the phone number to transfer to as context. - var poContext = new { TargetPhoneNumber = targetPhoneNumber }; - var poHandoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, poContext); - - try - { - await dc.Context.SendActivityAsync(poHandoffEvent, cancellationToken); - await dc.Context.SendActivityAsync($"Call transfer initiation succeeded"); - } - catch - { - await dc.Context.SendActivityAsync($"Call transfer failed"); - } - - return await dc.EndDialogAsync(result: 0, cancellationToken: cancellationToken); - } - } -} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj index 2535dc32a3..b1ee4749a3 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj +++ b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj @@ -1,34 +1,29 @@  - $(LocalPackageVersion) - $(PreviewPackageVersion) - $(LocalPackageVersion) - $(PreviewPackageVersion) - Debug;Release - bin\$(Configuration)\netstandard2.0\Microsoft.Bot.Builder.Dialogs.Adaptive.xml + Library + netstandard2.0 - netstandard2.0 Microsoft.Bot.Components.Telephony - This library implements .NET support for adaptive dialogs with Telephony - This library implements .NET support for adaptive dialogs with Microsoft Telephony + 1.0.0-preview + This library implements .NET support for adaptive dialogs with Telephony. + This library implements .NET support for adaptive dialogs with Telephony. + true + ..\..\build\35MSSharedLib1024.snk + true content - msbot-action;msbot-trigger;msbot-component - - Full - true - + + - - - $(NoWarn);CS1591 - 1.0.0-preview - true - + + all + runtime; build; native; contentfiles; analyzers + + @@ -39,12 +34,10 @@ - - - - - - - - + + + + $(NoWarn),SA0001,SA1649 + + \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema similarity index 75% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema rename to packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema index 2475f68ddd..4666c744e9 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema @@ -4,12 +4,15 @@ "title": "Call Transfer", "description": "Phone number to transfer the call to (in E.164 format such as +1425123456)", "type": "object", + "required": [ + "phoneNumber" + ], "additionalProperties": false, "properties": { - "targetPhoneNumber": { + "phoneNumber": { "$ref": "schema:#/definitions/stringExpression", - "title": "Target Phone Number", - "description": "Phone number to transfer the call to", + "title": "Phone Number", + "description": "Phone number to transfer the call to.", "examples": [ "in E.164 format such as +1425123456" ] diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema similarity index 81% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema rename to packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema index 1e65630305..ba73979ccc 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema @@ -4,11 +4,11 @@ "label": "Transfer a call", "subtitle": "Call Transfer", "order": [ - "targetPhoneNumber", + "phoneNumber", "*" ], "properties": { - "targetPhoneNumber": { + "phoneNumber": { "intellisenseScopes": [ "variable-scopes" ] @@ -21,6 +21,6 @@ }, "flow": { "widget": "ActionCard", - "body": "=action.targetPhoneNumber" + "body": "=action.phoneNumber" } } \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs index 18be688bf1..969ec1be33 100644 --- a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs +++ b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs @@ -1,21 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Bot.Components.Telephony.Actions; -using Microsoft.Bot.Builder.Dialogs.Declarative; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Bot.Builder; - namespace Microsoft.Bot.Components.Telephony { - public class TeamsBotComponent : BotComponent + using Microsoft.Bot.Builder; + using Microsoft.Bot.Builder.Dialogs.Declarative; + using Microsoft.Bot.Components.Telephony.Actions; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + + /// + /// Telephony actions registration. + /// + public class TelephonyBotComponent : BotComponent { /// public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { // Conditionals - services.AddSingleton(sp => new DeclarativeType(CallTransferDialog.Kind)); + services.AddSingleton(sp => new DeclarativeType(CallTransfer.Kind)); } } } \ No newline at end of file From d45c6d9f7397f04cdd04034f218247523406ce1b Mon Sep 17 00:00:00 2001 From: Vanshika Sinha Date: Thu, 22 Apr 2021 16:23:18 -0700 Subject: [PATCH 3/6] Revert "addressing comments/error handling/stylecop issues" This reverts commit 410c06fa740fca04d8ae2781002391a19c6701b2. --- .../config/applicationhost.config | 1021 ----------------- .../Actions/CallTransfer.cs | 66 -- .../Actions/CallTransferDialog.cs | 53 + .../Microsoft.Bot.Components.Telephony.csproj | 49 +- ...nsfer.schema => CallTransferDialog.schema} | 9 +- ...r.uischema => CallTransferDialog.uischema} | 6 +- .../TelephonyBotComponent.cs | 19 +- 7 files changed, 95 insertions(+), 1128 deletions(-) delete mode 100644 packages/.vs/Microsoft.Bot.Components/config/applicationhost.config delete mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs create mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs rename packages/Microsoft.Bot.Components.Telephony/Schemas/{Microsoft.Telephony.CallTransfer.schema => CallTransferDialog.schema} (75%) rename packages/Microsoft.Bot.Components.Telephony/Schemas/{Microsoft.Telephony.CallTransfer.uischema => CallTransferDialog.uischema} (81%) diff --git a/packages/.vs/Microsoft.Bot.Components/config/applicationhost.config b/packages/.vs/Microsoft.Bot.Components/config/applicationhost.config deleted file mode 100644 index 269dc55dcf..0000000000 --- a/packages/.vs/Microsoft.Bot.Components/config/applicationhost.config +++ /dev/null @@ -1,1021 +0,0 @@ - - - - - - - - -
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
- - -
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs deleted file mode 100644 index 2551644ea9..0000000000 --- a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Bot.Components.Telephony.Actions -{ - using System.Runtime.CompilerServices; - using System.Threading; - using System.Threading.Tasks; - using AdaptiveExpressions.Properties; - using Microsoft.Bot.Builder; - using Microsoft.Bot.Builder.Dialogs; - using Newtonsoft.Json; - - /// - /// Transfers call to given phone number. - /// - public class CallTransfer : Dialog - { - /// - /// Class identifier. - /// - [JsonProperty("$kind")] - public const string Kind = "Microsoft.Telephony.CallTransfer"; - - /// - /// Initializes a new instance of the class. - /// - /// Optional, source file full path. - /// Optional, line number in source file. - [JsonConstructor] - public CallTransfer([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) - : base() - { - // enable instances of this command as debug break point - this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); - } - - /// - /// Gets or sets the phone number to be included when sending the handoff activity. - /// - /// - /// . - /// - [JsonProperty("phoneNumber")] - public StringExpression PhoneNumber { get; set; } - - /// - /// Called when the dialog is started and pushed onto the dialog stack. - /// - /// The for the current turn of conversation. - /// Optional, initial information to pass to the dialog. - /// A cancellation token that can be used by other objects - /// or threads to receive notice of cancellation. - /// A representing the asynchronous operation. - public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) - { - var phoneNumber = this.PhoneNumber?.GetValue(dc.State); - - // Create handoff event, passing the phone number to transfer to as context. - var context = new { TargetPhoneNumber = phoneNumber }; - var handoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, context); - await dc.Context.SendActivityAsync(handoffEvent, cancellationToken).ConfigureAwait(false); - return await dc.EndDialogAsync(result: null, cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs new file mode 100644 index 0000000000..002df0e22f --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using AdaptiveExpressions.Properties; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Dialogs; +using Newtonsoft.Json; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Bot.Components.Telephony.Actions +{ + public class CallTransferDialog : Dialog + { + [JsonConstructor] + public CallTransferDialog([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) + : base() + { + // enable instances of this command as debug break point + this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); + } + + [JsonProperty("$kind")] + public const string Kind = "CallTransferDialog"; + + [JsonProperty("targetPhoneNumber")] + public StringExpression TargetPhoneNumber { get; set; } + + public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) + { + var targetPhoneNumber = TargetPhoneNumber.GetValue(dc.State); + + await dc.Context.SendActivityAsync($"Transferring to \"{targetPhoneNumber}\"..."); + + // Create handoff event, passing the phone number to transfer to as context. + var poContext = new { TargetPhoneNumber = targetPhoneNumber }; + var poHandoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, poContext); + + try + { + await dc.Context.SendActivityAsync(poHandoffEvent, cancellationToken); + await dc.Context.SendActivityAsync($"Call transfer initiation succeeded"); + } + catch + { + await dc.Context.SendActivityAsync($"Call transfer failed"); + } + + return await dc.EndDialogAsync(result: 0, cancellationToken: cancellationToken); + } + } +} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj index b1ee4749a3..2535dc32a3 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj +++ b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj @@ -1,29 +1,34 @@  - Library - netstandard2.0 + $(LocalPackageVersion) + $(PreviewPackageVersion) + $(LocalPackageVersion) + $(PreviewPackageVersion) + Debug;Release + bin\$(Configuration)\netstandard2.0\Microsoft.Bot.Builder.Dialogs.Adaptive.xml + netstandard2.0 Microsoft.Bot.Components.Telephony - 1.0.0-preview - This library implements .NET support for adaptive dialogs with Telephony. - This library implements .NET support for adaptive dialogs with Telephony. - true - ..\..\build\35MSSharedLib1024.snk - true + This library implements .NET support for adaptive dialogs with Telephony + This library implements .NET support for adaptive dialogs with Microsoft Telephony content + msbot-action;msbot-trigger;msbot-component - - + + Full + true + - - all - runtime; build; native; contentfiles; analyzers - - + + + $(NoWarn);CS1591 + 1.0.0-preview + true + @@ -34,10 +39,12 @@ - - - - $(NoWarn),SA0001,SA1649 - - + + + + + + + + \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema similarity index 75% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema rename to packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema index 4666c744e9..2475f68ddd 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema @@ -4,15 +4,12 @@ "title": "Call Transfer", "description": "Phone number to transfer the call to (in E.164 format such as +1425123456)", "type": "object", - "required": [ - "phoneNumber" - ], "additionalProperties": false, "properties": { - "phoneNumber": { + "targetPhoneNumber": { "$ref": "schema:#/definitions/stringExpression", - "title": "Phone Number", - "description": "Phone number to transfer the call to.", + "title": "Target Phone Number", + "description": "Phone number to transfer the call to", "examples": [ "in E.164 format such as +1425123456" ] diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema similarity index 81% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema rename to packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema index ba73979ccc..1e65630305 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema @@ -4,11 +4,11 @@ "label": "Transfer a call", "subtitle": "Call Transfer", "order": [ - "phoneNumber", + "targetPhoneNumber", "*" ], "properties": { - "phoneNumber": { + "targetPhoneNumber": { "intellisenseScopes": [ "variable-scopes" ] @@ -21,6 +21,6 @@ }, "flow": { "widget": "ActionCard", - "body": "=action.phoneNumber" + "body": "=action.targetPhoneNumber" } } \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs index 969ec1be33..18be688bf1 100644 --- a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs +++ b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs @@ -1,24 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.Bot.Components.Telephony.Actions; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Bot.Builder; + namespace Microsoft.Bot.Components.Telephony { - using Microsoft.Bot.Builder; - using Microsoft.Bot.Builder.Dialogs.Declarative; - using Microsoft.Bot.Components.Telephony.Actions; - using Microsoft.Extensions.Configuration; - using Microsoft.Extensions.DependencyInjection; - - /// - /// Telephony actions registration. - /// - public class TelephonyBotComponent : BotComponent + public class TeamsBotComponent : BotComponent { /// public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { // Conditionals - services.AddSingleton(sp => new DeclarativeType(CallTransfer.Kind)); + services.AddSingleton(sp => new DeclarativeType(CallTransferDialog.Kind)); } } } \ No newline at end of file From d9b414b0de410bc756abbb810b1fd652302d8ccc Mon Sep 17 00:00:00 2001 From: Vanshika Sinha Date: Thu, 22 Apr 2021 16:31:16 -0700 Subject: [PATCH 4/6] updates based on comments/stylecop and throwing errors --- .../Actions/CallTransfer.cs | 66 +++++++++++++++++++ .../Actions/CallTransferDialog.cs | 53 --------------- .../Microsoft.Bot.Components.Telephony.csproj | 47 ++++++------- ...> Microsoft.Telephony.CallTransfer.schema} | 9 ++- ...Microsoft.Telephony.CallTransfer.uischema} | 6 +- .../TelephonyBotComponent.cs | 19 +++--- 6 files changed, 106 insertions(+), 94 deletions(-) create mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs delete mode 100644 packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs rename packages/Microsoft.Bot.Components.Telephony/Schemas/{CallTransferDialog.schema => Microsoft.Telephony.CallTransfer.schema} (75%) rename packages/Microsoft.Bot.Components.Telephony/Schemas/{CallTransferDialog.uischema => Microsoft.Telephony.CallTransfer.uischema} (81%) diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs new file mode 100644 index 0000000000..2551644ea9 --- /dev/null +++ b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Bot.Components.Telephony.Actions +{ + using System.Runtime.CompilerServices; + using System.Threading; + using System.Threading.Tasks; + using AdaptiveExpressions.Properties; + using Microsoft.Bot.Builder; + using Microsoft.Bot.Builder.Dialogs; + using Newtonsoft.Json; + + /// + /// Transfers call to given phone number. + /// + public class CallTransfer : Dialog + { + /// + /// Class identifier. + /// + [JsonProperty("$kind")] + public const string Kind = "Microsoft.Telephony.CallTransfer"; + + /// + /// Initializes a new instance of the class. + /// + /// Optional, source file full path. + /// Optional, line number in source file. + [JsonConstructor] + public CallTransfer([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) + : base() + { + // enable instances of this command as debug break point + this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); + } + + /// + /// Gets or sets the phone number to be included when sending the handoff activity. + /// + /// + /// . + /// + [JsonProperty("phoneNumber")] + public StringExpression PhoneNumber { get; set; } + + /// + /// Called when the dialog is started and pushed onto the dialog stack. + /// + /// The for the current turn of conversation. + /// Optional, initial information to pass to the dialog. + /// A cancellation token that can be used by other objects + /// or threads to receive notice of cancellation. + /// A representing the asynchronous operation. + public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) + { + var phoneNumber = this.PhoneNumber?.GetValue(dc.State); + + // Create handoff event, passing the phone number to transfer to as context. + var context = new { TargetPhoneNumber = phoneNumber }; + var handoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, context); + await dc.Context.SendActivityAsync(handoffEvent, cancellationToken).ConfigureAwait(false); + return await dc.EndDialogAsync(result: null, cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs b/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs deleted file mode 100644 index 002df0e22f..0000000000 --- a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransferDialog.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using AdaptiveExpressions.Properties; -using Microsoft.Bot.Builder; -using Microsoft.Bot.Builder.Dialogs; -using Newtonsoft.Json; -using System.Runtime.CompilerServices; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Bot.Components.Telephony.Actions -{ - public class CallTransferDialog : Dialog - { - [JsonConstructor] - public CallTransferDialog([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) - : base() - { - // enable instances of this command as debug break point - this.RegisterSourceLocation(sourceFilePath, sourceLineNumber); - } - - [JsonProperty("$kind")] - public const string Kind = "CallTransferDialog"; - - [JsonProperty("targetPhoneNumber")] - public StringExpression TargetPhoneNumber { get; set; } - - public async override Task BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) - { - var targetPhoneNumber = TargetPhoneNumber.GetValue(dc.State); - - await dc.Context.SendActivityAsync($"Transferring to \"{targetPhoneNumber}\"..."); - - // Create handoff event, passing the phone number to transfer to as context. - var poContext = new { TargetPhoneNumber = targetPhoneNumber }; - var poHandoffEvent = EventFactory.CreateHandoffInitiation(dc.Context, poContext); - - try - { - await dc.Context.SendActivityAsync(poHandoffEvent, cancellationToken); - await dc.Context.SendActivityAsync($"Call transfer initiation succeeded"); - } - catch - { - await dc.Context.SendActivityAsync($"Call transfer failed"); - } - - return await dc.EndDialogAsync(result: 0, cancellationToken: cancellationToken); - } - } -} \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj index 2535dc32a3..8dfa3c2544 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj +++ b/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj @@ -1,34 +1,29 @@  - $(LocalPackageVersion) - $(PreviewPackageVersion) - $(LocalPackageVersion) - $(PreviewPackageVersion) - Debug;Release - bin\$(Configuration)\netstandard2.0\Microsoft.Bot.Builder.Dialogs.Adaptive.xml + Library + netstandard2.0 - netstandard2.0 Microsoft.Bot.Components.Telephony - This library implements .NET support for adaptive dialogs with Telephony - This library implements .NET support for adaptive dialogs with Microsoft Telephony + 1.0.0-preview + This library implements .NET support for adaptive dialogs with Telephony. + This library implements .NET support for adaptive dialogs with Telephony. + true + ..\..\build\35MSSharedLib1024.snk + true content - msbot-action;msbot-trigger;msbot-component - - Full - true - + + - - - $(NoWarn);CS1591 - 1.0.0-preview - true - + + all + runtime; build; native; contentfiles; analyzers + + @@ -39,12 +34,10 @@ - - - - - - - + + + + $(NoWarn),SA0001,SA1649 + \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema similarity index 75% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema rename to packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema index 2475f68ddd..4666c744e9 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.schema +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema @@ -4,12 +4,15 @@ "title": "Call Transfer", "description": "Phone number to transfer the call to (in E.164 format such as +1425123456)", "type": "object", + "required": [ + "phoneNumber" + ], "additionalProperties": false, "properties": { - "targetPhoneNumber": { + "phoneNumber": { "$ref": "schema:#/definitions/stringExpression", - "title": "Target Phone Number", - "description": "Phone number to transfer the call to", + "title": "Phone Number", + "description": "Phone number to transfer the call to.", "examples": [ "in E.164 format such as +1425123456" ] diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema similarity index 81% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema rename to packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema index 1e65630305..ba73979ccc 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Schemas/CallTransferDialog.uischema +++ b/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema @@ -4,11 +4,11 @@ "label": "Transfer a call", "subtitle": "Call Transfer", "order": [ - "targetPhoneNumber", + "phoneNumber", "*" ], "properties": { - "targetPhoneNumber": { + "phoneNumber": { "intellisenseScopes": [ "variable-scopes" ] @@ -21,6 +21,6 @@ }, "flow": { "widget": "ActionCard", - "body": "=action.targetPhoneNumber" + "body": "=action.phoneNumber" } } \ No newline at end of file diff --git a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs index 18be688bf1..969ec1be33 100644 --- a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs +++ b/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs @@ -1,21 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Bot.Components.Telephony.Actions; -using Microsoft.Bot.Builder.Dialogs.Declarative; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Bot.Builder; - namespace Microsoft.Bot.Components.Telephony { - public class TeamsBotComponent : BotComponent + using Microsoft.Bot.Builder; + using Microsoft.Bot.Builder.Dialogs.Declarative; + using Microsoft.Bot.Components.Telephony.Actions; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + + /// + /// Telephony actions registration. + /// + public class TelephonyBotComponent : BotComponent { /// public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { // Conditionals - services.AddSingleton(sp => new DeclarativeType(CallTransferDialog.Kind)); + services.AddSingleton(sp => new DeclarativeType(CallTransfer.Kind)); } } } \ No newline at end of file From 479664ce61061505fad73cfe7cfdcf80ef80c313 Mon Sep 17 00:00:00 2001 From: Vanshika Sinha Date: Fri, 23 Apr 2021 09:55:35 -0700 Subject: [PATCH 5/6] moving to Telephony folder --- .../Actions/CallTransfer.cs | 0 .../Microsoft.Bot.Components.Telephony.csproj | 1 + .../Schemas/Microsoft.Telephony.CallTransfer.schema | 0 .../Schemas/Microsoft.Telephony.CallTransfer.uischema | 0 .../TelephonyBotComponent.cs | 0 5 files changed, 1 insertion(+) rename packages/{Microsoft.Bot.Components.Telephony => Telephony}/Actions/CallTransfer.cs (100%) rename packages/{Microsoft.Bot.Components.Telephony => Telephony}/Microsoft.Bot.Components.Telephony.csproj (96%) rename packages/{Microsoft.Bot.Components.Telephony => Telephony}/Schemas/Microsoft.Telephony.CallTransfer.schema (100%) rename packages/{Microsoft.Bot.Components.Telephony => Telephony}/Schemas/Microsoft.Telephony.CallTransfer.uischema (100%) rename packages/{Microsoft.Bot.Components.Telephony => Telephony}/TelephonyBotComponent.cs (100%) diff --git a/packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs b/packages/Telephony/Actions/CallTransfer.cs similarity index 100% rename from packages/Microsoft.Bot.Components.Telephony/Actions/CallTransfer.cs rename to packages/Telephony/Actions/CallTransfer.cs diff --git a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj b/packages/Telephony/Microsoft.Bot.Components.Telephony.csproj similarity index 96% rename from packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj rename to packages/Telephony/Microsoft.Bot.Components.Telephony.csproj index 8dfa3c2544..6e5f572aaa 100644 --- a/packages/Microsoft.Bot.Components.Telephony/Microsoft.Bot.Components.Telephony.csproj +++ b/packages/Telephony/Microsoft.Bot.Components.Telephony.csproj @@ -14,6 +14,7 @@ ..\..\build\35MSSharedLib1024.snk true content + msbot-component;msbot-action diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema b/packages/Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema similarity index 100% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema rename to packages/Telephony/Schemas/Microsoft.Telephony.CallTransfer.schema diff --git a/packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema b/packages/Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema similarity index 100% rename from packages/Microsoft.Bot.Components.Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema rename to packages/Telephony/Schemas/Microsoft.Telephony.CallTransfer.uischema diff --git a/packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs b/packages/Telephony/TelephonyBotComponent.cs similarity index 100% rename from packages/Microsoft.Bot.Components.Telephony/TelephonyBotComponent.cs rename to packages/Telephony/TelephonyBotComponent.cs From bf6ff1793fe7444f16d4bab4619037acc964a6ed Mon Sep 17 00:00:00 2001 From: Vanshika Sinha Date: Fri, 23 Apr 2021 10:01:40 -0700 Subject: [PATCH 6/6] updating solution too --- packages/Microsoft.Bot.Components.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Microsoft.Bot.Components.sln b/packages/Microsoft.Bot.Components.sln index c1f3d8fcde..25c2572803 100644 --- a/packages/Microsoft.Bot.Components.sln +++ b/packages/Microsoft.Bot.Components.sln @@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Ad EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Teams", "Teams\Microsoft.Bot.Components.Teams.csproj", "{FD29CBA6-C18F-498B-9F00-A3C34C1BEC5F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Components.Telephony", "Microsoft.Bot.Components.Telephony\Microsoft.Bot.Components.Telephony.csproj", "{A854B5EC-3A34-4D1F-8080-F0846DEDF63F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Components.Telephony", "Telephony\Microsoft.Bot.Components.Telephony.csproj", "{A854B5EC-3A34-4D1F-8080-F0846DEDF63F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution