microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
207 stars 225 forks source link

Guidance on using Media Platform from a console app #216

Closed paulnearney closed 4 years ago

paulnearney commented 4 years ago

For testing/prototyping purposes, I'm looking to be able to create a lightweight application-hosted media app that doesn't have a dependency on cloud service or service fabric. So far, I'm unable to get the media platform to initialize.

On calling SetMediaPlatformSettings, I get a series of TaskCanceled, Socket and ObjectDisposed exceptions (see full program output below). I also see this warning a few times:

(AVMP,WriteThreadHeartBeat:workitemqueue.cs(126)) [MP] ThreadPool: Received invalid thread id 0

I do seem to receive audio from Teams, but get an error along the lines of Socket Closed when I try to send audio.

I'm running this as a .NET Framework 4.6.2 Console application. Source code is below. Referencing:

I'm reusing an ngrok tunnel, Azure AD app, certificate, DNS records etc from an environment that works with the HueBot sample, so I don't think there are any issues with those parts of the setup.

Is this possible? Can I reach my goal of being able to spin up lightweight test apps without the dependency on Service Fabric or Cloud Service?

Source code

static void Main(string[] args)
        {
            var location = Assembly.GetExecutingAssembly().Location;
            Directory.SetCurrentDirectory(Path.GetDirectoryName(location));

            System.Diagnostics.Process.Start("cmd.exe", "/c startup.cmd 8445 **cert thumbprint**");

            var authProvider = new AuthenticationProvider(
                "****",
                "****",
                null);

            var rootUri = new Uri("https://****/");
            var builder = new CommunicationsClientBuilder("AV Bot", "**appid**", null);
            builder.SetAuthenticationProvider(authProvider);
            builder.SetNotificationUrl(new Uri("https://****/api/calling"));

            var httpClientHandler = new HttpClientHandler
            {
                Proxy = new WebProxy("http://127.0.0.1:8888"),
                UseDefaultCredentials = true
            };
            builder.SetHttpClient(new HttpClient(httpClientHandler));

            var publicMediaUrl = new Uri("net.tcp://****:14678");

            var instanceAddresses = Dns.GetHostEntry(publicMediaUrl.Host).AddressList;
            if (instanceAddresses.Length == 0)
            {
                throw new InvalidOperationException("Could not resolve the PIP hostname. Please make sure that PIP is properly configured for the service");
            }

            var mps = new MediaPlatformSettings()
            {
                ApplicationId = "****",
                MediaPlatformInstanceSettings = new MediaPlatformInstanceSettings()
                {
                    CertificateThumbprint = "****",
                    InstanceInternalPort = 8445,
                    InstancePublicIPAddress = instanceAddresses[0],
                    InstancePublicPort = publicMediaUrl.Port,
                    ServiceFqdn = publicMediaUrl.Host
                }
            };

            builder.SetMediaPlatformSettings(mps);

            builder.SetServiceBaseUrl(new Uri("https://graph.microsoft.com/beta"));

            var client = builder.Build();
        }

Program output

'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Graph.Communications.Client.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Skype.Bots.Media.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Graph.Communications.Common.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Graph.Communications.Calls.Media.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Newtonsoft.Json.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Graph.Core.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\MPServiceImp.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\MPAzAppHost.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Management.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Rtc.Internal.Media.MediaApi.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Rtc.Internal.Media.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Skype.ECS.Client.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Skype.ECS.Core.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Skype.Seatbelt.Core.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Skype.Seatbelt.Core.ClientHelpers.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Skype.Seatbelt.Core.Common.dll'. Symbol loading disabled by Include/Exclude setting.
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
A task was canceled.

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.IO.IOException' in System.dll
Unable to read data from the transport connection: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'..

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.ObjectDisposedException' in System.dll
Cannot access a disposed object.

Exception thrown: 'System.Net.WebException' in System.dll
The request was aborted: The request was canceled.

Exception thrown: 'System.Net.WebException' in System.dll
The request was aborted: The request was canceled.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
A task was canceled.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Net.Http.dll
A task was canceled.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
A task was canceled.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in Microsoft.Skype.Seatbelt.Core.dll
A task was canceled.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
A task was canceled.

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
A task was canceled.

'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Applications.Telemetry.Server.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Applications.Telemetry.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll'. Symbol loading disabled by Include/Exclude setting.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : Starting TelemetryManager constructor
BareBonesApplicationHostedMediaConsole.exe Information: 0 : TelemetryManagerImpl creation started
BareBonesApplicationHostedMediaConsole.exe Information: 0 : Performance counters are disabled. Skipping creation of counters category.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Bond.Interfaces.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Bond.dll'. Symbol loading disabled by Include/Exclude setting.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : RecordBatcherTask with ID 13 started.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : DataPackageSender with UserAgent name: AST-Server-C#, version: 1.1.259.0, [Ast_Trace_Source]
BareBonesApplicationHostedMediaConsole.exe Information: 0 : SendTask with ID 14 started
BareBonesApplicationHostedMediaConsole.exe Information: 0 : DataPackageSender with UserAgent name: AST-Server-C#, version: 1.1.259.0, [Ast_Trace_Source]
BareBonesApplicationHostedMediaConsole.exe Information: 0 : SendTask with ID 15 started
BareBonesApplicationHostedMediaConsole.exe Information: 0 : TelemetryManagerImpl creation finished
BareBonesApplicationHostedMediaConsole.exe Information: 0 : Ending TelemetryManager constructor
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Created a new Aria trace listener with token 60d5a17c7f9d4fc3a788f76306c56932-17828cc4-fc68-4361-984a-9c6c88fee139-7032
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Setting MediaAgents platform log level to Information
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Setting MediaApiLogLevel to Warning
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Setting AvMP log level to Warning
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Attempting to apply the UnifiedLogging configuration: UnifiedLoggingConfiguration: [ IsEnabled: False ScenarioStrings:  ]
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Setting UnifiedLogging Info: [isEnabled: False] [ScenarioStrings: ]
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Logger initialized for application ID 39f7b865-c1c3-44a9-a35f-79c5501dedf6. Logging configuration: LoggingConfiguration: [ MediaAgentsPlatformLogLevel: Information; MediaApiLogLevel: Warning; MediaProcessorLogLevel: Warning; AriaLoggingConfiguration: AriaLoggingConfiguration: [ AriaTenantToken: 60d5a17c7f9d4fc3a788f76306c56932-17828cc4-fc68-4361-984a-9c6c88fee139-7032; AriaTraceEventName: SkypeMediaBotsTraces; SplitAriaTracesByLevel: True; DisableAriaTracing:  ]; UnifiedLoggingConfiguration: UnifiedLoggingConfiguration: [ IsEnabled: False ScenarioStrings:  ] ]
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] New telemetry configuration: TelemetryConfiguration: [ AriaTenantToken: 60d5a17c7f9d4fc3a788f76306c56932-17828cc4-fc68-4361-984a-9c6c88fee139-7032 MonitorUnhandledExceptions: True MonitorSocketMetrics: True ]
BareBonesApplicationHostedMediaConsole.exe Information: 0 : Starting TelemetryManager constructor
BareBonesApplicationHostedMediaConsole.exe Information: 0 : TelemetryManagerImpl creation started
BareBonesApplicationHostedMediaConsole.exe Information: 0 : Performance counters are disabled. Skipping creation of counters category.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : RecordBatcherTask with ID 3 started.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : DataPackageSender with UserAgent name: AST-Server-C#, version: 1.1.259.0, [Ast_Default_Source]
BareBonesApplicationHostedMediaConsole.exe Information: 0 : SendTask with ID 16 started
BareBonesApplicationHostedMediaConsole.exe Information: 0 : DataPackageSender with UserAgent name: AST-Server-C#, version: 1.1.259.0, [Ast_Default_Source]
BareBonesApplicationHostedMediaConsole.exe Information: 0 : SendTask with ID 17 started
BareBonesApplicationHostedMediaConsole.exe Information: 0 : TelemetryManagerImpl creation finished
BareBonesApplicationHostedMediaConsole.exe Information: 0 : Ending TelemetryManager constructor
BareBonesApplicationHostedMediaConsole.exe Information: 0 : RecordBatcher configuration maximalRecordBatchSizeInBytes: 2935624, MaxRecordsInBatchNum: 10000, MaxBatchingWaitingThreshold: 00:00:20, SingleWaitingOnDequeueDurationWhenBatching: 00:00:00.0500000
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Whitelist config value changed: cipnoam.api.mpaas.trafficmanager.net,intnoam.api.mpaas.trafficmanager.net,dognoam.api.mpaas.trafficmanager.net,prdnoam.api.mpaas.trafficmanager.net,prdapac.api.mpaas.trafficmanager.net,prdemea.api.mpaas.trafficmanager.net,prd00apac.mpaas.trafficmanager.net,prd00noam.mpaas.trafficmanager.net,prd00emea.mpaas.trafficmanager.net,mediapaas-api-test-01-wus.cloudapp.net,ucapnoam.api.mpaas.trafficmanager.net,mediapaas-api-apac.pub.ngcmtls.com,mediapaas-api-aus.pub.ngcmtls.com,mediapaas-api-dog.pub.ngcmtls.com,mediapaas-api-emea.pub.ngcmtls.com,mediapaas-api-int.pub.ngcmtls.com,mediapaas-api-noam.pub.ngcmtls.com,mediapaas-api-test.pub.ngcmtls.com,mediapaas-api-prod.gov.ngcmtls.us,mediapaas-api-prod.dod.ngcmtls.us
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Minimum supported version config changed: 1.8.0.2
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Comparing bots version 1.17.0.0039 and minimum supported version 1.8.0.2
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TelemetryWriter is not null, not creating a new one
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Platform has 4 cores
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Initializing MP with Service FQDN: ****, Instance public port: 14678, Instance internal port: 8445
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] UseMPAzureAppHostPerfCounterProvider is false. Discarding MP perf counters
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Valid MediaPerf registration detected
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] UseMPAzureAppHostPerfCounterProvider is false. Not checking for perf counter registration
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\MP.WebAPI.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\MPServiceHostLib.dll'. Symbol loading disabled by Include/Exclude setting.
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] MP Service Event: ReportEvent_MPSVC_I_SERVICE_STARTING
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll'. Symbol loading disabled by Include/Exclude setting.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : TL_INFO(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.533.00000001 (MPSERVICEHOSTLIB,.ctor:MPInstanceDescriptor.cs(158)) [MPBindingConfig] SecurityKeys are Issuer: CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US  CertSN: 03D41403EC7A34CDBDAAFC4E028FBD6B2501
BareBonesApplicationHostedMediaConsole.exe Warning: 0 : TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.535.00000002 (MPSERVICEHOSTLIB,.ctor:MPInstanceDescriptor.cs(161)) [MPBindingConfig] PrincipalName (localhost) is irrelevant in MTLS scenarios and will be ignored. Using certificate with SN: 03D41403EC7A34CDBDAAFC4E028FBD6B2501,  Issuer: CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Internals.dll'. Symbol loading disabled by Include/Exclude setting.
BareBonesApplicationHostedMediaConsole.exe Information: 0 : TL_INFO(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.563.00000001 (AVMP,.cctor:MediaProcessor.cs(375)) [MP] MediaProcessor Service is created.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll'. Symbol loading disabled by Include/Exclude setting.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Diagnostics.ServiceModelSink\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll'. Symbol loading disabled by Include/Exclude setting.
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.628.00000004 (AVMP,InitializeHostMonitor:MediaProcessor.cs(1376)) [MP] InitializeHostMonitor: Set supportunencryptedaudioportrange to false!
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.631.00000005 (AVMP,InitializeHostMonitor:MediaProcessor.cs(1376)) [MP] InitializeHostMonitor: Set UseBundledPortRangeForConsumer to false!
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.631.00000006 (AVMP,InitializeHostMonitor:MediaProcessor.cs(1376)) [MP] InitializeHostMonitor: Set UseBundledPortRangeForBusiness to false!
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.632.00000007 (AVMP,InitializeHostMonitor:MediaProcessor.cs(1392)) [MP] InitializeHostMonitor: Set bundledminportrange to false!
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:32.633.00000008 (AVMP,InitializeHostMonitor:MediaProcessor.cs(1392)) [MP] InitializeHostMonitor: Set bundledmaxportrange to false!
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.47::04/28/2020-09:07:32.672.00000045 (AVMP,WriteThreadHeartBeat:workitemqueue.cs(126)) [MP] ThreadPool: Received invalid thread id 0
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.49::04/28/2020-09:07:32.681.00000049 (AVMP,WriteThreadHeartBeat:workitemqueue.cs(126)) [MP] ThreadPool: Received invalid thread id 0
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.69::04/28/2020-09:07:32.722.00000071 (AVMP,WriteThreadHeartBeat:workitemqueue.cs(126)) [MP] ThreadPool: Received invalid thread id 0
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.71::04/28/2020-09:07:32.728.00000075 (AVMP,WriteThreadHeartBeat:workitemqueue.cs(126)) [MP] ThreadPool: Received invalid thread id 0
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.75::04/28/2020-09:07:32.738.0000007D (AVMP,WriteThreadHeartBeat:workitemqueue.cs(126)) [MP] ThreadPool: Received invalid thread id 0
TraceSource Warning: 0 : [AvMP][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] TL_WARN(TF_COMPONENT) [DESKTOP-JF26560]9616.1::04/28/2020-09:07:33.294.00000007 (MPSERVICEHOSTLIB,EndInitialize:MPHostImpl.cs(777)) [MPServiceHost] EndInitialize - Blocking
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] MP Service Event: ReportEvent_MPSVC_I_SERVICE_STARTED
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Initialized MP With Uri: [net.tcp://****:14678/MediaProcessor]
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Set PIP on MP: [3.19.114.185]
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] MP workload configuration set to [(500,500)]
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Initialized MediaApi Platform
TraceSource Information: 0 : [SkypeBotsMediaPlatform][AppId:39f7b865-c1c3-44a9-a35f-79c5501dedf6] Initialized MediaPlatform. ApplicationId : 39f7b865-c1c3-44a9-a35f-79c5501dedf6, MPUri: net.tcp://****:14678/MediaProcessor, IsTest: False.
'BareBonesApplicationHostedMediaConsole.exe' (CLR v4.0.30319: BareBonesApplicationHostedMediaConsole.exe): Loaded 'C:\Development\Repositories\Internal\Testing\BareBonesApplicationHostedMedia\BareBonesApplicationHostedMediaConsole\bin\x64\Debug\Microsoft.Graph.dll'. Symbol loading disabled by Include/Exclude setting.
ssulzer commented 4 years ago

@paulnearney A bot application should be able to run as a simple console application on a VM, as long as it self-hosts a WebAPI/HTTP endpoint (in order to receive calls from the platform services). From the traces provided, it looks like the MediaPlatform started successfully - the internal exceptions you see in the traces can be ignored. What application scenario problem are you encountering? The bot can receive audio but not send it? Thanks.

paulnearney commented 4 years ago

Thanks Steven. I got so caught up on the exceptions from the platform, that I missed that I had an error in my send logic. All good now

angieleba commented 1 year ago

@paulnearney Hi Paul, we are trying to achieve the same thing locally. However we have the following error: InvalidOperationException: MediaPlatform needs a system with at least 2 cores for creation. We created a media tunnel with ngrok. We have a certificate pointing to the *.ngrok.io domain. We try to start the app from VS but receive the above exception. Only the Azure Bot instance is in azure.

ssulzer commented 1 year ago

@angieleba What kind or type of Azure Virtual Machine are you deploying on? Please try a VM with 4 virtual CPUs (vCPUs). Thanks.

angieleba commented 1 year ago

@ssulzer Yes, we did exactly that. Changing to 4vCPU solved the error. However, when calling, it still goes to voicemail. I see logs in the ngrok terminal but it does not reach the signaling API. This is my ngrok tunnel configuration:

  signaling:
    addr: "https://localhost:9441"
    proto: http
    subdomain: **angieDomain**
    host_header: "localhost:9441"
  media: 
    addr: 8445
    proto: tcp
    remote_addr: 1.tcp.......ngrok.io:ngrokPost

I have a domain in ngrok called angieDomain. From Bot Service I call the ngrok for signaling and I expect to sent me to the OnIncomingRequestAsync but its not happening. Testing the localhost:9441 says connection failed. I have installed in my localComputer a pfx certificate for *.ngrok.io and I have set the ServiceFqdn to the tcp ngrokAddress. The only error I have is "PlaceCallEndpointUrl" from ServiceRuntime: FAIL. but reading online, maybe locally this should happen? Also, I read I should create a CNAME in my pc that will map a domain with the tcp address. Is this necessary? Any insight would be very helpful!

ssulzer commented 1 year ago

Please review these instructions for setting up a bot running locally behind ngrok: https://microsoftgraph.github.io/microsoft-graph-comms-samples/docs/articles/Testing.html

angieleba commented 1 year ago

@ssulzer I followed the steps and we receive the calls from Teams. However, the request cant reach the bot. We try to access the port 9441 and its not reachable at all. Even if we create our custom controller. With reachable I mean that its not entering in debug, it is not reaching the api/signaling endpoint.