Skip to content

Commit

Permalink
Updating to latest sample. (microsoftgraph#127)
Browse files Browse the repository at this point in the history
* Updating to latest sample.

* Updating to latest
  • Loading branch information
ksikorsk authored Nov 22, 2019
1 parent 15b8070 commit a3943ba
Show file tree
Hide file tree
Showing 125 changed files with 3,113 additions and 3,290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,17 @@ private void OnRecordingStatusFlip(object source, ElapsedEventArgs e)
_ = Task.Run(async () =>
{
var recordingStatus = new[] { RecordingStatus.Recording, RecordingStatus.NotRecording, RecordingStatus.Failed };
var recordingIndex = (this.recordingStatusIndex + 1) % recordingStatus.Length;
var recordingIndex = this.recordingStatusIndex + 1;
if (recordingIndex >= recordingStatus.Length)
{
var recordedParticipantId = this.Call.Resource.IncomingContext.ObservedParticipantId;

this.logger.Warn($"We've rolled through all the status'... removing participant {recordedParticipantId}");
var recordedParticipant = this.Call.Participants[recordedParticipantId];
await recordedParticipant.DeleteAsync().ConfigureAwait(false);
return;
}

var newStatus = recordingStatus[recordingIndex];

this.logger.Info($"Flipping recording status to {newStatus}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="5.2.7" />
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.1.0-prerelease.2237" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="4.0.1" />
<PackageReference Include="Microsoft.Skype.Bots.Media" Version="1.13.1.324-alpha" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected override async Task<HttpResponseMessage> SendAsync(
}

this.logger.LogHttpMessage(
TraceLevel.Info,
TraceLevel.Verbose,
direction,
HttpTraceType.HttpRequest,
request.RequestUri.ToString(),
Expand Down Expand Up @@ -165,7 +165,7 @@ protected override async Task<HttpResponseMessage> SendAsync(
}

this.logger.LogHttpMessage(
TraceLevel.Info,
TraceLevel.Verbose,
direction,
HttpTraceType.HttpResponse,
request.RequestUri.ToString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,42 @@ The Compliance Recording bot sample guides you through building, deploying and t

This section walks you through the process of deploying and testing the sample bot.

### Bot Registration

1. Follow the steps in [Register Calling Bot](https://microsoftgraph.github.io/microsoft-graph-comms-samples/docs/articles/calls/register-calling-bot.html). Save the bot name, bot app id and bot secret for configuration.

1. Add the following Application Permissions to the bot:

* Calls.AccessMedia.All
* Calls.JoinGroupCall.All

1. The permission needs to be consented by tenant admin. Go to "https://login.microsoftonline.com/common/adminconsent?client_id=<app_id>&state=<any_number>&redirect_uri=<any_callback_url>" using tenant admin to sign-in, then consent for the whole tenant.

### Create an Application Instance

Open powershell (in admin mode) and run the following commands. When prompted for authentication, login with the tenant admin.
* `> Import-Module SkypeOnlineConnector`
* `> $userCredential = Get-Credential`
* `> $sfbSession = New-CsOnlineSession -Credential $userCredential -Verbose`
* `> Import-PSSession $sfbSession`
* `> New-CsOnlineApplicationInstance -UserPrincipalName <[email protected]> -DisplayName <displayName> -ApplicationId <your_botappId>`
* `> Sync-CsOnlineApplicationInstance -ObjectId <objectId>`

### Create a Compliance Recording Policy
Requires the application instance ID created above. Continue your powershell session and run the following commands.
* `> New-CsTeamsComplianceRecordingPolicy -Tenant <tenantId> -Enabled $true -Description "Test policy created by <yourName>" <policyIdentity>`
* ```> Set-CsTeamsComplianceRecordingPolicy -Tenant <tenantId> -Identity <policyIdentity> -ComplianceRecordingApplications ` @(New-CsTeamsComplianceRecordingApplication -Tenant <tenantId> -Parent <policyIdentity> -Id <objectId>)```

After 30-60 seconds, the policy should show up. To verify your policy was created correctly:
* `> Get-CsTeamsComplianceRecordingPolicy <policyIdentity>`

### Assign the Compliance Recording Policy
Requries the policy identity created above. Contine your powershell session and run the following commands.
* `> Grant-CsTeamsComplianceRecordingPolicy -Identity <[email protected]> -PolicyName <policyIdentity> -Tenant <tenantId>`

To verify your policy was assigned correctly:
* `> Get-CsOnlineUser <[email protected]> | ft sipaddress, tenantid, TeamsComplianceRecordingPolicy`

### Prerequisites

* Install the prerequisites:
Expand All @@ -24,29 +60,29 @@ This section walks you through the process of deploying and testing the sample b
3. Copy the thumbprint for later.

1. Set up cloud service configuration
1. Open powershell, go to the folder that contains file `configure_cloud.ps1`. The file is in the same directory as `AudioVideoPlaybackBot.sln`
2. Run the powershell script with parameters `.\configure_cloud.ps1 -p .\AudioVideoPlaybackBot\ -dns {your DNS name} -cn {your CN name, should be the same as your DNS name} -thumb {your certificate thumbprint} -bid {your bot name} -aid {your bot app id} -as {your bot secret}`, for example `.\configure_cloud.ps1 -p .\AudioVideoPlaybackBot\ -dns bot.contoso.com -cn bot.contoso.com -thumb ABC0000000000000000000000000000000000CBA -bid bot -aid 3853f935-2c6f-43d7-859d-6e8f83b519ae -as 123456!@#$%^`
1. Open powershell, go to the folder that contains file `configure_cloud.ps1`. The file is in the `Samples` directory.
2. Run the powershell script with parameters:
* `> .\configure_cloud.ps1 -p .\BetaSamples\LocalMediaSamples\ComplianceRecordingBot\ -dns {your DNS name} -cn {your CN name, should be the same as your DNS name} -thumb {your certificate thumbprint} -bid {your bot name} -aid {your bot app id} -as {your bot secret}`, for example `.\configure_cloud.ps1 -p .\BetaSamples\LocalMediaSamples\ComplianceRecordingBot\ -dns bot.contoso.com -cn bot.contoso.com -thumb ABC0000000000000000000000000000000000CBA -bid bot -aid 3853f935-2c6f-43d7-859d-6e8f83b519ae -as 123456!@#$%^`

1. Publish the bot from VS:
1. Right click ComplianceRecordingBot, then click `Publish...`. Publish it to the cloud service you created earlier.

### Test

1. Set up the test meeting and test clients:
1. Sign in to Teams client with a non-recorded test tenant user, and schedule a Teams meeting with the recorded user.
![Test Meeting1](Images/TestMeeting1.png)
1. Sign in to Teams client with a non-recorded test tenant user.
1. Use another Teams client to sign in with the recorded user. (You could use an private browser window at https://teams.microsoft.com)

1. Join the meeting from the Teams client with the non-recorded user.
1. Place a call from the Teams client with the non-recorded user to the recorded user.

1. Invite the recorded user to the meeting. Your bot should now receive an incoming call, and join the call. (See next step for retrieving logs) Use the recorded user's Teams client to accept the call.
1. Your bot should now receive an incoming call, and join the call (See next step for retrieving logs). Use the recorded user's Teams client to accept the call.

1. Interact with your service, _adjusting the service URL appropriately_.
1. Get diagnostics data from the bot. Open the links in a browser for auto-refresh. Replace the call id 311a0a00-53d9-4a42-aa78-c10a9ae95213 below with your call id from the first response.
* Active calls: https://bot.contoso.com/calls
* Service logs: https://bot.contoso.com/logs

1. Terminate the call through `DELETE`, as needed for testing. Replace the call id `311a0a00-53d9-4a42-aa78-c10a9ae95213` below with your call id from the first response.
1. By default, the call will be terminated when the recording status has failed. You can terminate the call through `DELETE`, as needed for testing. Replace the call id `311a0a00-53d9-4a42-aa78-c10a9ae95213` below with your call id from the first response.

##### Request
```json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<PackageReference Include="Microsoft.Skype.Bots.Media" Version="1.13.1.324-alpha" />
<PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" Version="3.2.3" />
<PackageReference Include="Microsoft.WindowsAzure.SDK" Version="2.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="WindowsAzure.Storage">
<Version>8.0.1</Version>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="2.1.1" />
<PackageReference Include="Microsoft.Graph.Communications.Calls" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Calls" Version="1.1.0-prerelease.2237" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
<ProjectReference Include="..\..\..\Common\Sample.Common\Sample.Common.csproj" />
<Reference Include="System.Net.Http" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\..\Graph.props" />

<ItemGroup>
<PackageReference Include="Microsoft.Graph.Communications.Client" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Core.Calls" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Client" Version="1.1.0-prerelease.2237" />
<PackageReference Include="Microsoft.Graph.Communications.Core.Calls" Version="1.1.0-prerelease.2237" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/Common/Sample.Common/Sample.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\Graph.props" />

<ItemGroup>
<PackageReference Include="Microsoft.Graph.Communications.Client" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Core.Calls" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Client" Version="1.1.0-prerelease.2237" />
<PackageReference Include="Microsoft.Graph.Communications.Core.Calls" Version="1.1.0-prerelease.2237" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.2.3" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="5.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="5.2.7" />
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.1.0-prerelease.2237" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="4.0.1" />
<PackageReference Include="Microsoft.Skype.Bots.Media" Version="1.13.1.324-alpha" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<Reference Include="System.Data.Entity" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="Microsoft.Skype.Bots.Media" Version="1.13.1.324-alpha" />
<PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" Version="3.2.3" />
<PackageReference Include="Microsoft.WindowsAzure.SDK" Version="2.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<Reference Include="MonAgentListener, Version=33.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Configuration" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- Although Bots.Media is implicitly imported by Calls.Media, this library requires an explicit reference for
some scripts included within the nuget package. -->
<PackageReference Include="Microsoft.Skype.Bots.Media" Version="1.13.1.324-alpha" />
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.1.0-prerelease.2027" />
<PackageReference Include="Microsoft.Graph.Communications.Calls.Media" Version="1.1.0-prerelease.2237" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This changelog covers what's changed in Microsoft Graph Communications SDK and i

## Nov 2019

- Updated Communications libraries 1.1.0-prerelease.2237
- Exposed delete participant API

- Updated Communications libraries 1.1.0-prerelease.2027
- Exposed recording APIs

Expand Down
Loading

0 comments on commit a3943ba

Please sign in to comment.