Skip to content

Commit

Permalink
Kasikors/sync (#60)
Browse files Browse the repository at this point in the history
* Docs and binding redirect fixes.
  • Loading branch information
ksikorsk authored May 9, 2019
1 parent aa91682 commit d269f07
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net471</TargetFramework>
Expand Down Expand Up @@ -29,5 +29,5 @@
<ProjectReference Include="..\..\..\Common\Sample.Common\Sample.Common.csproj" />
<Reference Include="System.Net.Http" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4213/",
"applicationUrl": "http://localhost:9442/",
"sslPort": 44308
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "http://localhost:4213/",
"launchUrl": "http://localhost:9442/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IcMBot": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"launchUrl": "http://localhost:9442/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:4214/"
"applicationUrl": "http://localhost:9442/"
}
}
}
4 changes: 2 additions & 2 deletions Samples/Common/Sample.Common/Logging/SampleObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public string GetLogs(int skip = 0, int take = int.MaxValue)
var filteredLogs = this.logs
.Skip(skip)
.Take(take);
return string.Join(string.Empty, filteredLogs);
return string.Join(Environment.NewLine, filteredLogs);
}
}

Expand All @@ -89,7 +89,7 @@ public string GetLogs(string filter, int skip = 0, int take = int.MaxValue)
.Where(log => log.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0)
.Skip(skip)
.Take(take);
return string.Join(string.Empty, filteredLogs);
return string.Join(Environment.NewLine, filteredLogs);
}
}

Expand Down
4 changes: 3 additions & 1 deletion Samples/CommsSamples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RemoteMediaSamples", "Remot
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AudioVideoPlaybackBot", "AudioVideoPlaybackBot", "{540514B8-BFF4-47D6-8F21-B8B824521A1B}"
ProjectSection(SolutionItems) = preProject
V1.0Samples\LocalMediaSamples\configure_cloud.ps1 = V1.0Samples\LocalMediaSamples\configure_cloud.ps1
V1.0Samples\LocalMediaSamples\AudioVideoPlaybackBot\README.md = V1.0Samples\LocalMediaSamples\AudioVideoPlaybackBot\README.md
EndProjectSection
EndProject
Expand All @@ -39,6 +38,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Common", "Common\Sample.Common\Sample.Common.csproj", "{3268E59C-90DC-4D7B-97EA-A1DBB2716DF3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HueBot", "HueBot", "{2092372D-EEE2-4F2C-963D-2A0F9ECAF82C}"
ProjectSection(SolutionItems) = preProject
V1.0Samples\LocalMediaSamples\HueBot\README.md = V1.0Samples\LocalMediaSamples\HueBot\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HueBot", "V1.0Samples\LocalMediaSamples\HueBot\HueBot\HueBot.csproj", "{64538D87-16CD-4A13-ADA9-63EBA7C80BBE}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void ConfigureSettings(IAppBuilder app, IGraphLogger logger)
{
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.MapHttpAttributeRoutes();
httpConfig.MessageHandlers.Add(new LoggingMessageHandler(isIncomingMessageHandler: true, logger: logger));
httpConfig.MessageHandlers.Add(new LoggingMessageHandler(isIncomingMessageHandler: true, logger: logger, urlIgnorers: new[] { "/logs" }));

httpConfig.Services.Add(typeof(IExceptionLogger), new Common.Logging.ExceptionLogger(logger));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ public interface IConfiguration : IDisposable
/// </summary>
Uri PlaceCallEndpointUrl { get; }

/// <summary>
/// Gets the Base URL for this particular azure instance.
/// </summary>
Uri AzureInstanceBaseUrl { get; }

/// <summary>
/// Gets the AadAppId generated at the time of registration of the bot.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<Setting name="APPINSIGHTS_INSTRUMENTATIONKEY" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="DefaultEndpoint" protocol="tcp" port="443" localPort="9440" />
<InputEndpoint name="DefaultEndpoint" protocol="tcp" port="443" localPort="9443" />
<InstanceInputEndpoint name="InstanceCallControlEndpoint" protocol="tcp" localPort="10100">
<AllocatePublicPortFrom>
<FixedPortRange max="10199" min="10100" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ internal class AzureConfiguration : IConfiguration
private const string InstanceIdToken = "in_";

/// <summary>
/// localPort specified in <InputEndpoint name="DefaultCallControlEndpoint" protocol="tcp" port="443" localPort="9440" />
/// localPort specified in <InputEndpoint name="DefaultCallControlEndpoint" protocol="tcp" port="443" localPort="9443" />
/// in .csdef. This is needed for running in emulator. Currently only messaging can be debugged in the emulator.
/// Media debugging in emulator will be supported in future releases.
/// </summary>
private const int DefaultPort = 9440;
private const int DefaultPort = 9443;

/// <summary>
/// Graph logger.
Expand Down Expand Up @@ -159,9 +159,6 @@ public AzureConfiguration(IGraphLogger logger)
/// <inheritdoc/>
public Uri PlaceCallEndpointUrl { get; private set; }

/// <inheritdoc/>
public Uri AzureInstanceBaseUrl { get; private set; }

/// <inheritdoc/>
public MediaPlatformSettings MediaPlatformSettings { get; private set; }

Expand Down Expand Up @@ -233,7 +230,7 @@ public void Initialize()

int instanceCallControlPublicPort = RoleEnvironment.IsEmulated ? DefaultPort : instanceCallControlEndpoint.PublicIPEndpoint.Port;
int mediaInstanceInternalPort = RoleEnvironment.IsEmulated ? 8445 : mediaControlEndpoint.IPEndpoint.Port;
int mediaInstancePublicPort = RoleEnvironment.IsEmulated ? 20100 : mediaControlEndpoint.PublicIPEndpoint.Port;
int mediaInstancePublicPort = RoleEnvironment.IsEmulated ? 13016 : mediaControlEndpoint.PublicIPEndpoint.Port;

string instanceCallControlIpEndpoint = string.Format("{0}:{1}", instanceCallControlInternalIpAddress, instanceCallControlInternalPort);

Expand Down Expand Up @@ -280,31 +277,32 @@ public void Initialize()

this.AudioVideoFileLengthInSec = avFileLengthInSec;

// Create structured config objects for service.
this.CallControlBaseUrl = new Uri(string.Format(
"https://{0}:{1}/{2}",
this.ServiceCname,
instanceCallControlPublicPort,
HttpRouteConstants.CallSignalingRoutePrefix));

this.AzureInstanceBaseUrl = new Uri(string.Format(
"https://{0}:{1}/",
this.ServiceCname,
instanceCallControlPublicPort));

this.TraceConfigValue("CallControlCallbackUri", this.CallControlBaseUrl);
List<Uri> controlListenUris = new List<Uri>();

if (RoleEnvironment.IsEmulated)
{
// Create structured config objects for service.
this.CallControlBaseUrl = new Uri(string.Format(
"https://{0}/{1}",
this.ServiceCname,
HttpRouteConstants.CallSignalingRoutePrefix));

controlListenUris.Add(new Uri("https://" + defaultEndpoint.IPEndpoint.Address + ":" + DefaultPort + "/"));
controlListenUris.Add(new Uri("http://" + defaultEndpoint.IPEndpoint.Address + ":" + (DefaultPort - 1) + "/"));
}
else
{
// Create structured config objects for service.
this.CallControlBaseUrl = new Uri(string.Format(
"https://{0}:{1}/{2}",
this.ServiceCname,
instanceCallControlPublicPort,
HttpRouteConstants.CallSignalingRoutePrefix));

controlListenUris.Add(new Uri("https://" + instanceCallControlIpEndpoint + "/"));
controlListenUris.Add(new Uri("https://" + defaultEndpoint.IPEndpoint + "/"));
}

this.TraceConfigValue("CallControlCallbackUri", this.CallControlBaseUrl);
this.CallControlListeningUrls = controlListenUris;

foreach (Uri uri in this.CallControlListeningUrls)
Expand All @@ -313,7 +311,7 @@ public void Initialize()
}

IPAddress publicInstanceIpAddress = RoleEnvironment.IsEmulated
? IPAddress.Loopback
? IPAddress.Any
: this.GetInstancePublicIpAddress(this.ServiceDnsName);

this.MediaPlatformSettings = new MediaPlatformSettings()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
Expand Down Expand Up @@ -42,14 +42,6 @@

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
Expand All @@ -62,10 +54,22 @@
<assemblyIdentity name="System.Threading.Tasks.Dataflow" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.6.3.0" newVersion="4.6.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Graph.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.15.0.0" newVersion="1.15.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Skype.Bots.Media" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.12.1.6" newVersion="1.12.1.6" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
{
"name": "MediaNatPool",
"properties": {
"backendPort": "8000",
"backendPort": "8445",
"frontendIPConfiguration": {
"id": "[variables('lbIPConfig0')]"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<!-- Instance input port for Media; traffic to this is enabled by the NAT pool in Load Balancer settings. -->
<!-- If you update the port here, update the argument to Startup.cmd above. -->
<Endpoint Name="MediaPort" Type="Input" Protocol="tcp" Port="8000" />
<Endpoint Name="MediaPort" Type="Input" Protocol="tcp" Port="8445" />

<!-- This http endpoint is used during local debugging with ngrok.
During Azure deployment, access to this port is blocked by the Load Balancer. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ For running locally, we need to use a tunneling mechanism to route traffic to yo
addr: 9442
proto: http
media:
addr: 8000
addr: 8445
proto: tcp
```
Expand All @@ -72,7 +72,7 @@ For running locally, we need to use a tunneling mechanism to route traffic to yo
* `%AppId%` and `%AppSecret%` that you obtained during application registration.
* Replace all `huebotsxxxxx.xxxx.cloudapp.azure.com` with your full cluster name.
* Replace all certificate thumbprint `ABC0000000000000000000000000000000000CBA` with your certificate.
* in HueBot/PackageRoot/ServiceManifest.xml file, for Startup.cmd, add `8000 your certificate thumbprint` for \<Arguments\>. For example \<Arguments\>`8000 ABC0000000000000000000000000000000000CBA`\</Arguments\>
* in HueBot/PackageRoot/ServiceManifest.xml file, for Startup.cmd, add `8445 your certificate thumbprint` for \<Arguments\>. For example \<Arguments\>`8445 ABC0000000000000000000000000000000000CBA`\</Arguments\>
### Deploy

#### [Azure] deployment
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/calls/appHostedMediaCalls.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h1 id="application-hosted-media-calls">Application Hosted Media Calls</h1>
<h2 id="building-a-communicationsclient-with-media-platform-settings">Building a CommunicationsClient with Media Platform Settings</h2>
<ol>
<li>Create the an instance of the <a class="xref" href="../../client/Microsoft.Graph.Communications.Client.ICommunicationsClientBuilder.html">ICommunicationsClientBuilder</a>.</li>
<li>Create an instance of MediaPlatformSettings and use <a class="xref" href="../../calls_media/Microsoft.Graph.Communications.Calls.Media.MediaCommunicationsClientBuilderExtensions.html#Microsoft_Graph_Communications_Calls_Media_MediaCommunicationsClientBuilderExtensions_SetMediaPlatformSettings_Microsoft_Graph_Communications_Client_ICommunicationsClientBuilder_Microsoft_Skype_Bots_Media_MediaPlatformSettings_">MediaCommunicationsClientBuilderExtensions.SetMediaPlatformSettings</a> method to pass the MediaPlatformSettings to build the <a class="xref" href="../../client/Microsoft.Graph.Communications.Client.ICommunicationsClient.html">ICommunicationsClient</a></li>
<li>Create an instance of <a class="xref" href="../../bot_media/Microsoft.Skype.Bots.Media.MediaPlatformSettings.html">MediaPlatformSettings</a> and use <a class="xref" href="../../calls_media/Microsoft.Graph.Communications.Calls.Media.MediaCommunicationsClientBuilderExtensions.html#Microsoft_Graph_Communications_Calls_Media_MediaCommunicationsClientBuilderExtensions_SetMediaPlatformSettings_Microsoft_Graph_Communications_Client_ICommunicationsClientBuilder_Microsoft_Skype_Bots_Media_MediaPlatformSettings_">MediaCommunicationsClientBuilderExtensions.SetMediaPlatformSettings</a> method to pass the <a class="xref" href="../../bot_media/Microsoft.Skype.Bots.Media.MediaPlatformSettings.html">MediaPlatformSettings</a> to build the <a class="xref" href="../../client/Microsoft.Graph.Communications.Client.ICommunicationsClient.html">ICommunicationsClient</a></li>
<li>Once the builder builds the <a class="xref" href="../../client/Microsoft.Graph.Communications.Client.ICommunicationsClient.html">ICommunicationsClient</a>, a media session can be created using either <a class="xref" href="../../calls_media/Microsoft.Graph.Communications.Calls.Media.MediaCommunicationsClientExtensions.html#Microsoft_Graph_Communications_Calls_Media_MediaCommunicationsClientExtensions_CreateMediaSession_Microsoft_Graph_Communications_Client_ICommunicationsClient_Microsoft_Skype_Bots_Media_AudioSocketSettings_Microsoft_Skype_Bots_Media_VideoSocketSettings_Microsoft_Skype_Bots_Media_VideoSocketSettings_Microsoft_Skype_Bots_Media_DataSocketSettings_System_Guid_">MediaCommunicationsClientExtension.CreateMediaSession</a> or <a class="xref" href="../../calls_media/Microsoft.Graph.Communications.Calls.Media.MediaCommunicationsClientExtensions.html#Microsoft_Graph_Communications_Calls_Media_MediaCommunicationsClientExtensions_CreateMediaSession_Microsoft_Graph_Communications_Client_ICommunicationsClient_Microsoft_Skype_Bots_Media_AudioSocketSettings_System_Collections_Generic_IEnumerable_Microsoft_Skype_Bots_Media_VideoSocketSettings__Microsoft_Skype_Bots_Media_VideoSocketSettings_Microsoft_Skype_Bots_Media_DataSocketSettings_System_Guid_">MediaCommunicationsClientExtension.CreateMediaSession</a> depending on how many video sockets are required.</li>
<li>When creating an object of the <a class="xref" href="../../core_calls/Microsoft.Graph.Call.html">Call</a> resource, <a class="xref" href="../../core_calls/Microsoft.Graph.MediaConfig.html">MediaConfig</a> needs to be set to <a class="xref" href="../../core_calls/Microsoft.Graph.AppHostedMediaConfig.html">AppHostedMediaConfig</a>.</li>
</ol>
Expand Down
Loading

0 comments on commit d269f07

Please sign in to comment.