microsoft / BotBuilder-RealTimeMediaCalling

BotBuilder-RealTimeMediaCalling extends the BotBuilder to enable bots to engage in Skype audio-video calling. It provides real-time, programmable access to the voice, video, and screen sharing streams of a Skype call. The bot is a direct participant in a Skype 1:1 call.
MIT License
76 stars 36 forks source link

HueBot -- OnAnswerAppHostedMediaCompleted --> MediaSession.Dispose() ALWAYS #20

Closed mrpullen closed 7 years ago

mrpullen commented 7 years ago

So the bot receives the call, and can receive messages on the text channel.. but when the call comes in and the callback OnAnswerAppHostedMediaCompleted I am winding up here.

AnswerAppHostedMediaOutcome answerAppHostedMediaOutcome = answerAppHostedMediaOutcomeEvent.AnswerAppHostedMediaOutcome;
                if (answerAppHostedMediaOutcome.Outcome == Outcome.Failure)
                {
                    Log.Info(new CallerInfo(), LogContext.FrontEnd, $"[{CallId}] AnswerAppHostedMedia failed with reason: {answerAppHostedMediaOutcome.FailureReason}");
                    //cleanup internal resources
                    MediaSession.Dispose();
                }

So my MediaSession is immediately disposed. Failure Reason in the logs is

EventName="MessageEvent" Message="RealTimeMediaCallingConversation: System.ArgumentException: Empty Actions List not allowed
   at Microsoft.Bot.Builder.Calling.ObjectModel.Misc.Utils.AssertArgument(Boolean condition, String format, Object[] args)
   at Microsoft.Bot.Builder.RealTimeMediaCalling.ObjectModel.Contracts.RealTimeMediaValidActions.Validate(IEnumerable`1 actions)
   at Microsoft.Bot.Builder.RealTimeMediaCalling.ObjectModel.Contracts.RealTimeMediaWorkflow.Validate(Boolean expectEmptyActions)
   at Microsoft.Bot.Builder.RealTimeMediaCalling.RealTimeMediaCallService.<ProcessConversationResult>d__38.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Bot.Builder.RealTimeMediaCalling.RealTimeCallProcessor.<ProcessCallbackAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Bot.Builder.RealTimeMediaCalling.RealTimeMediaCalling.<SendAsync>d__3.MoveNext()" TraceSource="WaWorkerHost.exe"    WorkerRole_IN_0 d40934041d6e4715a67e03035b092799    6/28/2017 12:19 AM

I haven't changed any the OnIncomingCallReceived method where an ActionBase Array is loaded with a single AnswerAppHostedMedia action is added.

Any help appreciated. !!

mrpullen commented 7 years ago

Looks like a similar issue from #2 when there was some variance in CName versus Service Name.. just not sure how to fix it..

Here is my configuration

Let's summarize the full stack configuration to define what is inconsistent:

SubjectName of our certificate: 'bot.holovisor.net' DNS name of our cloud service is 'holovisor.cloudapp.net'; We created CNAME DNS record www.bot.holovisor.net -> holovisor.cloudapp.net. Public IP address Holovisor cloud service at Azure dashboard: 13.82.217.186 nslookup skypebot.dataart.com

At the bot's dashboard we have following configuration:

Messaging endpoint: https://www.bot.holovisor.net/api/messages Webhook (For calling): https://www.bot.holovisor.net/api/calling/call Enable calling, Real Time Media, Video (Audio always enabled), Screen sharing In the configuration of the service we have

DefaultCallControlEndpoint -> Internal=https://10.72.213.246:9440, PublicPort=443 InstanceMediaControlEndpoint -> Internal=https://10.72.213.246:8445, PublicPort=20100 CallControlCallbackUri -> https://www.bot.holovisor.net:10100/api/calling/callback/ NotificationCallbackUrl -> https://www.bot.holovisor.net:10100/api/calling/notification/ Call control listening Uri -> https://10.72.213.246:10100/ Call control listening Uri -> https://10.72.213.246:9440/

ServiceDnsName -> holovisor.cloudapp.net ServiceDnsAlias --> www.bot.holovisor.net Cloud Service Public IPAddress -> 13.82.217.186 Media Platform Instance Internal Port -> 8445 Media Platform Instance Public Port -> 20100 Media Platform Instance Public IPAddress -> 13.82.217.186 Service FQDN -> www.bot.holovisor.net

MicrosoftAppId -> 353ac489-cd05-4624-93e4-fd0b54a205ad mpUri -> net.tcp://www.bot.holovisor.net:20100/MediaProcessor

MalarGit commented 7 years ago

@mrpullen could you try with bot.holovisor.net as your CNAME in the service config and change the CNAME to bot.holovisor.net.

Also could you check if the last entry in the SAN of the certificate is bot.holovisor.net?

mrpullen commented 7 years ago

Looks like that's it.. I got that cert reissued like 5 times, each time www.bot was the last SAN.. now it's bot.holovisor.net.

Thanks, looks like this is the solution.