Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6eb4d73
Adding Telephony preview package, this includes Call Transfer Activit…
vanshu86 Apr 23, 2021
e73c96c
Telephony: First draft of CommandDialog (#983)
carlosscastro Apr 23, 2021
908ada4
Telephony: create build pipeline (#984)
carlosscastro Apr 23, 2021
baeceac
Update telephony.yml for Azure Pipelines
carlosscastro Apr 23, 2021
888fcbd
Telephony: Add recording actions to component
carlosscastro Apr 23, 2021
f4a723e
Add Schema files and some comments
Apr 23, 2021
e7fe083
Fix OnSuccess flow for commands
Apr 23, 2021
d65ac34
Update telephony version to 0.0.1
carlosscastro Apr 23, 2021
d70ac7f
Update Microsoft.Bot.Components.Telephony.csproj
carlosscastro Apr 23, 2021
d3e3587
Add support for pause and resume
Apr 23, 2021
e8722bc
Merge branch 'feature/telephony' of https://github.com/microsoft/botf…
Apr 23, 2021
12734be
Add support for pause and resume
Apr 23, 2021
902fd4d
Update Microsoft.Bot.Components.Telephony.csproj
carlosscastro Apr 24, 2021
15639d5
Update nuget-versioning-steps.yml
carlosscastro Apr 24, 2021
0b86b24
Merge main -> feature/telephony
carlosscastro May 3, 2021
77b7a65
Telephony: adopt stylecop / fxcop and leave things at zero warnings /…
carlosscastro May 3, 2021
531a6a8
chore: [Internal dev branch PR] Telephony: integration tests and Comm…
carlosscastro May 28, 2021
13c8aae
Telephony: Base call transfer tests
carlosscastro Jun 16, 2021
9f1beba
Telephony uischemas: Change action tree location for telephony compon…
carlosscastro Jun 16, 2021
b6ef2f4
Add tests for pause and resume recording (#1165)
p-nagpal Jun 25, 2021
a2d3fac
Update recording labels per UX feedback (#1166)
p-nagpal Jun 28, 2021
7b94687
Update subtitle for recording operations (#1176)
p-nagpal Jun 30, 2021
4cc89b0
chore:Add mini-spec for Telephony actions (#1190)
p-nagpal Jul 9, 2021
9a9f732
Add more requirements to the call recording mini-spec (#1211)
p-nagpal Jul 10, 2021
dfedd60
chore: Merge main to feature/telephony (#1209)
p-nagpal Jul 12, 2021
15febcd
chore: Merge latest main into feature/telephony (#1217)
p-nagpal Jul 14, 2021
01d0bfe
chore: Updating tests and adding documentation for error handling in …
vanshu86 Jul 19, 2021
b30f43d
chore:Merge main to Telephony to remove new conflicts (#1224)
p-nagpal Jul 19, 2021
fe1e6d2
Merge branch 'main' into feature/telephony
Jul 20, 2021
dc3de8a
refactor: remove unused imported functional tests code (#1222)
ryanisgrig Jul 19, 2021
e706979
Address feedback for merging feature/telephony to main
Jul 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ experimental/generator-dotnet-yeoman/node_modules

# Allow the root-level /packages/ directory or it gets confused with NuGet directories
!/[Pp]ackages/*
!/tests/[Pp]ackages/*

# Allow the packages directory under tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple duplicates of the same directory, maybe can just use !/tests/**/[Pp]ackages/*?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed duplicates. There is one instance of !/tests/unit/[Pp]ackages/*. Did you want to remove all references to tests/unit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we should keep the one!

Are there any instances of !/tests/[Pp]ackages/* or can that be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Telephony tests are there. I will move them out after this merge and once a few PRs in flight settle down. Too many conflicts otherwise :(

Will make sure to remove this line with that change.

!/tests/unit/[Pp]ackages/*
Expand Down
2 changes: 0 additions & 2 deletions build/yaml/pipelines/telephony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ pool:

extends:
template: ../templates/component-template.yml
parameters:
PublishPackageArtifacts: # parameter is set in ADO

variables:
BuildConfiguration: 'Release'
Expand Down
4 changes: 2 additions & 2 deletions build/yaml/templates/nuget-versioning-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ steps:

# Configure version suffix based on deployment ring
if ($deploymentRing.ToLowerInvariant() -ne "stable") {
$nugetVersionSuffix = $deploymentRing + $vs;
$nugetVersionSuffix = $deploymentRing;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll need to check what to do with this one, but I can take care of that separately.

"Version Suffix = $nugetVersionSuffix";
$packageVersion += "-" + $nugetVersionSuffix;
}
Expand All @@ -73,4 +73,4 @@ steps:
NugetPackageVersion: $(NugetPackageVersion)
continueOnError: true

- template: debug-workspace-steps.yml
- template: debug-workspace-steps.yml
6 changes: 6 additions & 0 deletions packages/Microsoft.Bot.Components.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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\dotnet\Microsoft.Bot.Components.Teams.csproj", "{FD29CBA6-C18F-498B-9F00-A3C34C1BEC5F}"
EndProject
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
Debug|Any CPU = Debug|Any CPU
Expand All @@ -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
Expand Down
71 changes: 71 additions & 0 deletions packages/Telephony/Actions/CallTransfer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using AdaptiveExpressions.Properties;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Adaptive.Actions;
using Microsoft.Bot.Connector;
using Newtonsoft.Json;

namespace Microsoft.Bot.Components.Telephony.Actions
{
/// <summary>
/// Transfers call to given phone number.
/// </summary>
public class CallTransfer : SendHandoffActivity
{
/// <summary>
/// Class identifier.
/// </summary>
[JsonProperty("$kind")]
public new const string Kind = "Microsoft.Telephony.CallTransfer";

/// <summary>
/// Initializes a new instance of the <see cref="CallTransfer"/> class.
/// </summary>
/// <param name="sourceFilePath">Optional, source file full path.</param>
/// <param name="sourceLineNumber">Optional, line number in source file.</param>
[JsonConstructor]
public CallTransfer([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
: base()
{
// enable instances of this command as debug break point
this.RegisterSourceLocation(sourceFilePath, sourceLineNumber);
}

/// <summary>
/// Gets or sets the phone number to be included when sending the handoff activity.
/// </summary>
/// <value>
/// <see cref="StringExpression"/>.
/// </value>
[JsonProperty("phoneNumber")]
public StringExpression PhoneNumber { get; set; }

/// <summary>
/// Called when the dialog is started and pushed onto the dialog stack.
/// </summary>
/// <param name="dc">The <see cref="DialogContext"/> for the current turn of conversation.</param>
/// <param name="options">Optional, initial information to pass to the dialog.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects
/// or threads to receive notice of cancellation.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
public async override Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
var phoneNumber = this.PhoneNumber?.GetValue(dc.State);

// Create handoff event, passing the phone number to transfer to as context.
HandoffContext = new { TargetPhoneNumber = phoneNumber };

return await base.BeginDialogAsync(dc, options, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
63 changes: 63 additions & 0 deletions packages/Telephony/Actions/PauseRecording.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Components.Telephony.Common;
using Microsoft.Bot.Connector;
using Newtonsoft.Json;

namespace Microsoft.Bot.Components.Telephony.Actions
{
/// <summary>
/// Pauses recording the current conversation.
/// </summary>
public class PauseRecording : CommandDialog
{
/// <summary>
/// Class identifier.
/// </summary>
[JsonProperty("$kind")]
public const string Kind = "Microsoft.Telephony.PauseRecording";

private const string RecordingPause = "channel/vnd.microsoft.telephony.recording.pause";

/// <summary>
/// Initializes a new instance of the <see cref="PauseRecording"/> class.
/// </summary>
/// <param name="sourceFilePath">Optional, source file full path.</param>
/// <param name="sourceLineNumber">Optional, line number in source file.</param>
[JsonConstructor]
public PauseRecording([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
: base()
{
// enable instances of this command as debug break point
this.RegisterSourceLocation(sourceFilePath, sourceLineNumber);

this.CommandName = RecordingPause;
}

public async override Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default)
{
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
return await base.BeginDialogAsync(dc, options, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}

public override async Task<DialogTurnResult> ContinueDialogAsync(DialogContext dc, CancellationToken cancellationToken = default)
{
// TODO: Carlos try to delete
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
return await base.ContinueDialogAsync(dc, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
63 changes: 63 additions & 0 deletions packages/Telephony/Actions/ResumeRecording.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Components.Telephony.Common;
using Microsoft.Bot.Connector;
using Newtonsoft.Json;

namespace Microsoft.Bot.Components.Telephony.Actions
{
/// <summary>
/// Resume recording the current conversation.
/// </summary>
public class ResumeRecording : CommandDialog
{
public const string RecordingResume = "channel/vnd.microsoft.telephony.recording.resume";

/// <summary>
/// Class identifier.
/// </summary>
[JsonProperty("$kind")]
public const string Kind = "Microsoft.Telephony.ResumeRecording";

/// <summary>
/// Initializes a new instance of the <see cref="ResumeRecording"/> class.
/// </summary>
/// <param name="sourceFilePath">Optional, source file full path.</param>
/// <param name="sourceLineNumber">Optional, line number in source file.</param>
[JsonConstructor]
public ResumeRecording([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
: base()
{
// enable instances of this command as debug break point
this.RegisterSourceLocation(sourceFilePath, sourceLineNumber);

this.CommandName = RecordingResume;
}

public async override Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default)
{
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
return await base.BeginDialogAsync(dc, options, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}

public override async Task<DialogTurnResult> ContinueDialogAsync(DialogContext dc, CancellationToken cancellationToken = default)
{
// TODO: Carlos try to delete
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
return await base.ContinueDialogAsync(dc, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
65 changes: 65 additions & 0 deletions packages/Telephony/Actions/StartRecording.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Components.Telephony.Common;
using Microsoft.Bot.Connector;
using Newtonsoft.Json;

namespace Microsoft.Bot.Components.Telephony.Actions
{
/// <summary>
/// Starts recording the current conversation.
/// </summary>
public class StartRecording : CommandDialog
{
/// <summary>
/// Class identifier.
/// </summary>
[JsonProperty("$kind")]
public const string Kind = "Microsoft.Telephony.StartRecording";

private const string RecordingStart = "channel/vnd.microsoft.telephony.recording.start";

/// <summary>
/// Initializes a new instance of the <see cref="StartRecording"/> class.
/// </summary>
/// <param name="sourceFilePath">Optional, source file full path.</param>
/// <param name="sourceLineNumber">Optional, line number in source file.</param>
[JsonConstructor]
public StartRecording([CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
: base()
{
// enable instances of this command as debug break point
this.RegisterSourceLocation(sourceFilePath, sourceLineNumber);

this.CommandName = RecordingStart;
}

/// <inheritdoc/>
public async override Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default)
{
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
return await base.BeginDialogAsync(dc, options, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <inheritdoc/>
public override async Task<DialogTurnResult> ContinueDialogAsync(DialogContext dc, CancellationToken cancellationToken = default)
{
// TODO: Carlos try to delete
if (dc.Context.Activity.ChannelId == Channels.Telephony)
{
return await base.ContinueDialogAsync(dc, cancellationToken).ConfigureAwait(false);
}

return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
12 changes: 12 additions & 0 deletions packages/Telephony/Common/CommandDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Bot.Components.Telephony.Common
{
/// <summary>
/// Generic dialog to orchestrate issuing command activities and releasing control once a command result is received.
/// </summary>
public class CommandDialog : CommandDialog<object>
{
}
}
Loading