microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
210 stars 235 forks source link

AudioVideoSample throws a 500 internal server error on changeRole #95

Open saraswat40 opened 5 years ago

saraswat40 commented 5 years ago

Describe the issue I am trying to use 'changeRole' on the audiovideo bot after the bot has joined and starts playing the video.

Expected behavior This should stop playing the video and I expect the following line to get triggered logging something

Call ID 461f1100-c139-427c-a0ec-33ab2bbc1d49

Logs $>2019-07-05T19:19:26.2905073Z Info: LoggingMessageHandler.cs:167 SendAsync TransactionDirection: Incoming TraceType: HttpResponse ResponseTime: 213 request: POST https://trusthive.com/calls/461f1100-c139-427c-a0ec-33ab2bbc1d49/changeRole response: 500 InternalServerError headers: Content-Type: text/plain; charset=utf-8 $>2019-07-05T19:19:26.0873716Z Info: LoggingMessageHandler.cs:138 SendAsync TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com/calls/461f1100-c139-427c-a0ec-33ab2bbc1d49/changeRole headers: origin: (redacted) postman-token: (redacted) Cache-Control: no-cache Connection: close Accept: / Accept-Encoding: (redacted) Accept-Language: (redacted) Host: trusthive.com User-Agent: Mozilla/5.0,(X11; Linux x86_64),AppleWebKit/537.36,(KHTML, like Gecko),Chrome/74.0.3729.131,Safari/537.36 Content-Length: (redacted) Content-Type: application/json Additional context Add any other context about the problem here.

If I leave the call and rejoin the call, at least the video stops playing. And even though I have video enabled, there is nothing in the logs if I sent the changeRole request again.

ksikorsk commented 5 years ago

You need to use the instance specific URI to change the role. The samples have been recently changed to deploy 2 VM instances, and only one of those hosts your call. We don't currently expose the instance when you do a join call, but I will add that in.

To find which instance has your call try: https://trusthive.com:10100/logs/461f1100-c139-427c-a0ec-33ab2bbc1d49 https://trusthive.com:10101/logs/461f1100-c139-427c-a0ec-33ab2bbc1d49

Then make sure the "changeRole" request goes to the right instance. I see it went to the wrong one.

The samples should also return a 404 instead of a 500.

ksikorsk commented 5 years ago

PS... the samples expose a No-Auth REST API. You'll need to seal that if you're going to use this as a production application. Or at a minimum not publicly share your application URI :)

saraswat40 commented 5 years ago

Thanks for the quick response. I tried that. The video still continue to play. I was expecting this line to get executed (CallHander.OnVideoMediaReceived): this.logger.Info($"[{this.Call.Id}]: Capturing image: [VideoMediaReceivedEventArgs(Data=<{e.Buffer.Data.ToString()}>, Length={e.Buffer.Length}, Timestamp={e.Buffer.Timestamp}, Width={e.Buffer.VideoFormat.Width}, Height={e.Buffer.VideoFormat.Height}, ColorFormat={e.Buffer.VideoFormat.VideoColorFormat}, FrameRate={e.Buffer.VideoFormat.FrameRate})]");

Here are the logs: $>2019-07-05T22:29:22.7237330Z Info: LoggingMessageHandler.cs:167 SendAsync TransactionDirection: Incoming TraceType: HttpResponse ResponseTime: 163 request: POST https://trusthive.com:10101/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/changeRole response: 200 OK $>2019-07-05T22:29:22.7237330Z Info: GraphAuthClient.cs:144 SendHttpRequestAsync ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot CallId: 441f1100-ccbf-4b11-8469-7ccb5b03d033 TenantId: cd2c5a75-c821-42a8-8c41-775b48d8d206 TransactionDirection: Outgoing TraceType: HttpResponse ResponseTime: 161 request: POST https://graph.microsoft.com/beta/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/microsoft.graph.changeScreenSharingRole response: 202 Accepted headers: Transfer-Encoding: chunked request-id: 0a3b23c8-b25b-43f4-bdb7-3263ea9f77d9 client-request-id: 2c84d6c7-757b-4e9a-8dd2-c8aa6c593c5d x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US 2","Slice":"SliceC","Ring":"5","ScaleUnit":"002","RoleInstance":"AGSFE_IN_1","ADSiteName":"WUS2"}} scenario-id: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 Duration: 144.9651 Strict-Transport-Security: max-age=31536000 Cache-Control: private Date: Fri, 05 Jul 2019 22:29:22 GMT Content-Type: text/plain $>2019-07-05T22:29:22.5619932Z Info: GraphAuthClient.cs:101 SendHttpRequestAsync ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot CallId: 441f1100-ccbf-4b11-8469-7ccb5b03d033 TenantId: cd2c5a75-c821-42a8-8c41-775b48d8d206 TransactionDirection: Outgoing TraceType: HttpRequest request: POST https://graph.microsoft.com/beta/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/microsoft.graph.changeScreenSharingRole headers: scenario-id: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 client-request-id: 2c84d6c7-757b-4e9a-8dd2-c8aa6c593c5d User-Agent: GraphCommunicationsClient-AudioVideoPlaybackBot/1.1.0.581 Authorization: (redacted) Content-Type: application/json; charset=utf-8 { "role": "viewer" } $>2019-07-05T22:29:22.5609923Z Info: LoggingMessageHandler.cs:138 SendAsync TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/changeRole headers: origin: (redacted) postman-token: (redacted) Cache-Control: no-cache Connection: close Accept: / Accept-Encoding: (redacted) Accept-Language: (redacted) Host: trusthive.com:10101 User-Agent: Mozilla/5.0,(X11; Linux x86_64),AppleWebKit/537.36,(KHTML, like Gecko),Chrome/74.0.3729.131,Safari/537.36 Content-Length: (redacted) Content-Type: application/json $>2019-07-05T22:29:12.4935522Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 387a3ff2-6eda-4363-9b6f-968adb418300 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: 6c5f3aea-3215-42b4-97a9-cfaf8d84cbcb Connection: Keep-Alive Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/participants", "resourceData": [ { "@odata.type": "#microsoft.graph.participant", "info": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "application": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: 1PfJFy55)", "id": "b22ad71e-224e-48b2-a1e0-15d2a20dadcf" } } }, "mediaStreams": [ { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "audio", "sourceId": "35", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "video", "sourceId": "36", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "videoBasedScreenSharing", "sourceId": "40", "direction": "receiveOnly", "serverMuted": false } ], "isMuted": false, "isInLobby": false, "id": "644b031d-bc1e-4b0b-b95d-3cbd22cef036" }, { "@odata.type": "#microsoft.graph.participant", "info": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: D2mL5nTw)", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf" } }, "languageId": "en" }, "mediaStreams": [ { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "audio", "sourceId": "20", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "video", "sourceId": "21", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "videoBasedScreenSharing", "sourceId": "31", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "data", "sourceId": "32", "direction": "sendReceive", "serverMuted": false } ], "isMuted": false, "isInLobby": false, "id": "8780581e-a720-42c1-8c24-369662e6c535" } ] } ] } $>2019-07-05T22:24:52.6412557Z Info: LoggingMessageHandler.cs:167 SendAsync TransactionDirection: Incoming TraceType: HttpResponse ResponseTime: 176 request: POST https://trusthive.com:10101/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/changeRole response: 200 OK $>2019-07-05T22:24:52.6402540Z Info: GraphAuthClient.cs:144 SendHttpRequestAsync ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot CallId: 441f1100-ccbf-4b11-8469-7ccb5b03d033 TenantId: cd2c5a75-c821-42a8-8c41-775b48d8d206 TransactionDirection: Outgoing TraceType: HttpResponse ResponseTime: 153 request: POST https://graph.microsoft.com/beta/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/microsoft.graph.changeScreenSharingRole response: 202 Accepted headers: Transfer-Encoding: chunked request-id: a3f69513-5cab-4b01-ae38-e60b933b4096 client-request-id: 7c97db83-7c63-4fa8-a8ec-0420b5daef00 x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US 2","Slice":"SliceC","Ring":"4","ScaleUnit":"000","RoleInstance":"AGSFE_IN_1","ADSiteName":"WUS2"}} scenario-id: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 Duration: 143.3525 Strict-Transport-Security: max-age=31536000 Cache-Control: private Date: Fri, 05 Jul 2019 22:24:51 GMT Content-Type: text/plain $>2019-07-05T22:24:52.4856847Z Info: GraphAuthClient.cs:101 SendHttpRequestAsync ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot CallId: 441f1100-ccbf-4b11-8469-7ccb5b03d033 TenantId: cd2c5a75-c821-42a8-8c41-775b48d8d206 TransactionDirection: Outgoing TraceType: HttpRequest request: POST https://graph.microsoft.com/beta/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/microsoft.graph.changeScreenSharingRole headers: scenario-id: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 client-request-id: 7c97db83-7c63-4fa8-a8ec-0420b5daef00 User-Agent: GraphCommunicationsClient-AudioVideoPlaybackBot/1.1.0.581 Authorization: (redacted) Content-Type: application/json; charset=utf-8 { "role": "viewer" } $>2019-07-05T22:24:52.4646839Z Info: LoggingMessageHandler.cs:138 SendAsync TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/changeRole headers: origin: (redacted) postman-token: (redacted) Cache-Control: no-cache Connection: close Accept: / Accept-Encoding: (redacted) Accept-Language: (redacted) Host: trusthive.com:10101 User-Agent: Mozilla/5.0,(X11; Linux x86_64),AppleWebKit/537.36,(KHTML, like Gecko),Chrome/74.0.3729.131,Safari/537.36 Content-Length: (redacted) Content-Type: application/json $>2019-07-05T22:23:19.5248641Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 387a3ff2-6eda-4363-9b6f-968adb418300 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: 4e2f2b04-dd9b-4bbe-9901-7f2ce031d817 Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/participants", "resourceData": [ { "@odata.type": "#microsoft.graph.participant", "info": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "application": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: 1PfJFy55)", "id": "b22ad71e-224e-48b2-a1e0-15d2a20dadcf" } } }, "mediaStreams": [ { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "audio", "sourceId": "35", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "video", "sourceId": "36", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "videoBasedScreenSharing", "sourceId": "40", "direction": "receiveOnly", "serverMuted": false } ], "isMuted": false, "isInLobby": false, "id": "644b031d-bc1e-4b0b-b95d-3cbd22cef036" }, { "@odata.type": "#microsoft.graph.participant", "info": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: D2mL5nTw)", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf" } }, "languageId": "en" }, "mediaStreams": [ { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "audio", "sourceId": "20", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "video", "sourceId": "21", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "videoBasedScreenSharing", "sourceId": "31", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "data", "sourceId": "32", "direction": "sendReceive", "serverMuted": false } ], "isMuted": false, "isInLobby": false, "id": "8780581e-a720-42c1-8c24-369662e6c535" } ] } ] } $>2019-07-05T22:23:19.4450271Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 387a3ff2-6eda-4363-9b6f-968adb418300 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: 9a25cd2a-70df-43db-8777-721fe4a855bb Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/participants", "resourceData": [ { "@odata.type": "#microsoft.graph.participant", "info": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: D2mL5nTw)", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf" } }, "languageId": "en" }, "mediaStreams": [ { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "audio", "sourceId": "20", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "video", "sourceId": "21", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "videoBasedScreenSharing", "sourceId": "31", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "data", "sourceId": "32", "direction": "sendReceive", "serverMuted": false } ], "isMuted": false, "isInLobby": false, "id": "8780581e-a720-42c1-8c24-369662e6c535" } ] } ] } $>2019-07-05T22:23:16.3011313Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 81ffdc5d-75e5-483f-9dc9-6f7a95a02546 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: e0cd9c7c-4953-4a85-8c7b-8bd6deb7c243 Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033/participants", "resourceData": [ { "@odata.type": "#microsoft.graph.participant", "info": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: D2mL5nTw)", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf" } }, "languageId": "en" }, "mediaStreams": [ { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "audio", "sourceId": "20", "direction": "sendReceive", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "video", "sourceId": "21", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "videoBasedScreenSharing", "sourceId": "31", "direction": "receiveOnly", "serverMuted": false }, { "@odata.type": "#microsoft.graph.mediaStream", "mediaType": "data", "sourceId": "32", "direction": "sendReceive", "serverMuted": false } ], "isMuted": false, "isInLobby": false, "id": "8780581e-a720-42c1-8c24-369662e6c535" } ] } ] } $>2019-07-05T22:23:16.1171233Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 387a3ff2-6eda-4363-9b6f-968adb418300 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: 6637ecfe-3357-4e23-b57d-11c4885d5694 Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033", "resourceData": { "@odata.type": "#microsoft.graph.call", "state": "established", "direction": "outgoing", "meetingInfo": { "@odata.type": "#microsoft.graph.organizerMeetingInfo", "organizer": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf", "tenantId": "(Generic: E5hq0Qsx)" } } }, "tenantId": "cd2c5a75-c821-42a8-8c41-775b48d8d206", "id": "441f1100-ccbf-4b11-8469-7ccb5b03d033" } } ] } $>2019-07-05T22:23:15.2081453Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 387a3ff2-6eda-4363-9b6f-968adb418300 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: 5c8e055e-4e8c-4100-b783-7c62ef3a73b9 Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033", "resourceData": { "@odata.type": "#microsoft.graph.call", "state": "establishing", "chatInfo": { "@odata.type": "#microsoft.graph.chatInfo", "threadId": "19:meeting_NDM3MjEwNTMtODg2Ni00MTc4LWE2ZTAtMDQ4YWFlOWE2Y2Iw@thread.v2", "messageId": "0" }, "meetingInfo": { "@odata.type": "#microsoft.graph.organizerMeetingInfo", "organizer": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf", "tenantId": "(Generic: E5hq0Qsx)" } } }, "meetingCapability": { "@odata.type": "#microsoft.graph.meetingCapability", "allowAnonymousUsersToDialOut": false, "autoAdmittedUsers": "everyoneInCompany", "allowAnonymousUsersToStartMeeting": false }, "tenantId": "cd2c5a75-c821-42a8-8c41-775b48d8d206", "id": "441f1100-ccbf-4b11-8469-7ccb5b03d033" } } ] } $>2019-07-05T22:23:11.4594519Z Info: CommunicationsClientExtensions.cs:220 LogRequestAndCreateResponse ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Incoming TraceType: HttpRequest request: POST https://trusthive.com:10101/api/calling headers: X-Microsoft-Skype-Chain-ID: 81ffdc5d-75e5-483f-9dc9-6f7a95a02546 Scenario-ID: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 X-Microsoft-Skype-Message-ID: cb01a310-2f25-4bf8-8dee-e8a65e9186c2 Connection: Keep-Alive Accept: application/json Authorization: (redacted) Host: trusthive.com:10101 User-Agent: Microsoft-Skype/3.0,(Calling/1.0) Content-Length: (redacted) Content-Type: application/json; charset=utf-8 { "@odata.type": "#microsoft.graph.commsNotifications", "value": [ { "@odata.type": "#microsoft.graph.commsNotification", "changeType": "updated", "resource": "/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033", "resourceData": { "@odata.type": "#microsoft.graph.call", "state": "establishing", "chatInfo": { "@odata.type": "#microsoft.graph.chatInfo", "threadId": "19:meeting_NDM3MjEwNTMtODg2Ni00MTc4LWE2ZTAtMDQ4YWFlOWE2Y2Iw@thread.v2", "messageId": "0" }, "meetingInfo": { "@odata.type": "#microsoft.graph.organizerMeetingInfo", "organizer": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf", "tenantId": "(Generic: E5hq0Qsx)" } } }, "id": "441f1100-ccbf-4b11-8469-7ccb5b03d033" } } ] } $>2019-07-05T22:23:11.4594519Z Warning: NotificationDispatcher.cs:171 ProcessNotification ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot No queue or registered callbacks for Updated: /app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033 $>2019-07-05T22:23:10.5531705Z Info: GraphAuthClient.cs:144 SendHttpRequestAsync ScenarioId: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 AppId: b22ad71e-224e-48b2-a1e0-15d2a20dadcf AppName: AudioVideoPlaybackBot TransactionDirection: Outgoing TraceType: HttpResponse ResponseTime: 534 request: POST https://graph.microsoft.com/beta/app/calls response: 201 Created headers: Transfer-Encoding: chunked request-id: df939bf8-ae01-4bcc-a240-d90396f617cb client-request-id: 3d68a2d7-022e-4d43-8f3b-c42fc4451725 x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US 2","Slice":"SliceC","Ring":"4","ScaleUnit":"000","RoleInstance":"AGSFE_IN_0","ADSiteName":"WUS2"}} scenario-id: 3f50bd85-c0f9-4bd9-99a3-3029f188a245 OData-Version: 4.0 Duration: 457.0781 Strict-Transport-Security: max-age=31536000 Cache-Control: private Date: Fri, 05 Jul 2019 22:23:10 GMT Location: https://graph.microsoft.com/beta/app/calls/441f1100-ccbf-4b11-8469-7ccb5b03d033 Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8 { "@odata.type": "#microsoft.graph.call", "state": "establishing", "direction": "outgoing", "callbackUri": "https://trusthive.com:10101/api/calling", "callRoutes": [], "source": { "@odata.type": "#microsoft.graph.participantInfo", "identity": { "@odata.type": "#microsoft.graph.identitySet", "application": { "@odata.type": "#microsoft.graph.identity", "displayName": "(Identity: 1PfJFy55)", "id": "b22ad71e-224e-48b2-a1e0-15d2a20dadcf" }, "user": null, "device": null, "phone": null }, "region": null, "languageId": null }, "targets": [], "requestedModalities": [ "audio", "video", "videoBasedScreenSharing" ], "activeModalities": [], "mediaConfig": { "@odata.type": "#microsoft.graph.appHostedMediaConfig", "blob": "{\"mpUri\":\"net.tcp://trusthive.com:20101/MediaProcessor\",\"audioRenderContexts\":[\"5aa0b87c-01c7-4b94-8b1e-ad2dcea811c0\"],\"videoRenderContexts\":[\"ca7c7467-0c02-42bf-86ca-885bf4459f8c\",\"a6568799-ccb8-404c-809b-609758b81a14\",\"b3222385-fd7c-4e1e-abc2-3affa9cc2fd5\",\"9a83b9de-4f3f-4980-9253-990093d4cd97\"],\"vbssRenderContexts\":[\"735adc72-2fda-402b-983a-7ac7e8fd85e3\"],\"audioSourceContexts\":[\"b4583458-b650-48ee-b19d-c2963b4bf10e\"],\"videoSourceContexts\":[\"6e414e14-699c-4545-b1f1-ab87cc1f2634\"],\"vbssSourceContexts\":[\"f979c336-f704-4c12-9a1d-2f68cad49bf2\"],\"dataRenderContexts\":null,\"dataSourceContexts\":null,\"supportedAudioFormat\":\"Pcm16K\",\"videoSinkEncodingFormats\":[\"H264\",\"H264\",\"H264\",\"H264\"],\"vbssSinkEncodingFormats\":[\"H264\"],\"initialScreenSharingRole\":\"Viewer\",\"mpMediaSessionId\":\"bb793ab0-56d9-48ed-a1f6-4206e9073df8\",\"regionAffinity\":null,\"skypeMediaBotsVersion\":\"1.12.1.0006\",\"mediaStackVersion\":\"2019.13.1.17\",\"mpVersion\":\"7.2.0.4597\",\"callId\":\"8d7c9059-67db-4bf1-93a7-df3c4deb6546\"}", "removeFromDefaultAudioGroup": false }, "chatInfo": { "@odata.type": "#microsoft.graph.chatInfo", "threadId": "19:meeting_NDM3MjEwNTMtODg2Ni00MTc4LWE2ZTAtMDQ4YWFlOWE2Y2Iw@thread.v2", "messageId": "0", "replyChainMessageId": null }, "meetingInfo": { "@odata.type": "#microsoft.graph.organizerMeetingInfo", "organizer": { "@odata.type": "#microsoft.graph.identitySet", "user": { "@odata.type": "#microsoft.graph.identity", "id": "3cbceccb-6bbe-4dc0-b4cb-b171df0161cf", "displayName": null, "tenantId": "(Generic: E5hq0Qsx)" }, "application": null, "device": null, "phone": null }, "allowConversationWithoutHost": null, "lobbyBypass": null }, "routingPolicies": [], "tenantId": "cd2c5a75-c821-42a8-8c41-775b48d8d206", "myParticipantId": "644b031d-bc1e-4b0b-b95d-3cbd22cef036", "id": "441f1100-ccbf-4b11-8469-7ccb5b03d033", "@odata.context": "https://graph.microsoft.com/beta/$metadata#app/calls/$entity", "transferState": null, "terminationReason": null, "ringingTimeoutInSeconds": null, "subject": null, "mediaState": null, "resultInfo": null, "answeredBy": null, "meetingCapability": null, "toneInfo": null }

ksikorsk commented 5 years ago

Couple items:

ksikorsk commented 5 years ago

Hi @saraswat40 did the above help you resolve your issues? Do you need further clarification?

saraswat40 commented 5 years ago

@ksikorsk I didn't understand. You said "This means when you change it to sharer the bot starts streaming video to the screen sharing modality. And when you set it as viewer it stops." This is what I expected, but this is not what is actually happening.

My assumption is that the video will stream only if the bot is in screen sharing mode. I am also assuming that when the bot joins the call, it is in screen sharing mode which is why it starts streaming the video immediately. However, if I switch the role to viewer, the streaming doesn't stop. I have the organizer window open and the video keeps playing.

How is a dominant speaker event identified? I have tried speaking into the mic and I am the only speaker who can speak into the mic. I will try to change the log settings, please give me till the end of the day.

ksikorsk commented 5 years ago

@saraswat40 Keep in mind that the bot is ALWAYS streams video to the video modality... when you change the role to "sharer" it then starts streaming video to the VBSS modality in addition to the video modality.

The bot starts in viewer mode. It does not start sharing until you change the bot to sharer mode. What you're doing is a no-op, given that you are changing it to the mode it is already in.

Dominant speaker is identified as someone that has audio and is actively speaking. You need to be speaking AND streaming video from your camera to be picked up as dominant speaker in the sample.

saraswat40 commented 5 years ago

ok, I tried this again. Here is what happened from the organizer perspective: Bot joined the call and plays the video ( I believe this is the no-op scenario you mentioned) I changed bot's role to sharer, the video continues to play Now I changed bot's role to viewer. The video still continues to play.

Let me know if you want the logs or if I again missed something.

ssulzer commented 5 years ago

The changeScreenSharingRole applies only to the VideoSocket created for the VBSS modality. I looked at the logs for the call on 2019-07-05 made at 22:23 UTC with CallId 8d7c9059-67db-4bf1-93a7-df3c4deb6546. The bot did not do anything with its VBSS VideoSocket and the changeScreenSharingRole calls all specified the Viewer role which is the default setting and so those calls would have no effect. The changeScreenSharingRole API allows the bot to change its VBSS VideoSocket from the Viewer (receive-only) role to Sharer (send-only) role; the Sharer role allows the bot to become the screen sharer. The video that the bot was playing was sourced from VideoSocket #0 of its "main-video" socket set; the changeScreenSharingRole API does not apply to those main-video VideoSockets.

The main-video VideoSockets allow the bot to play its equivalent of a "web camera" video source and also view the web camera video sources of other meeting participants. Separate from the main-video modality, the bot can also engage in the video-based screen sharing (VBSS) modality to either view or source screen sharing content.

saraswat40 commented 5 years ago

I have enabled extra logging as suggested by @ksikorsk in an earlier reply. The more details logs from yesterday are available here: https://trusthive.com:10100/logs/431f1100-5ff2-47bf-ad72-10ec5a983909

I am simply following the steps mentioned in the readme to get the bot to stop playing the video, switch to a viewer role and start capturing the vbss video shared by the dominant speaker. So far I have failed to do so. Can you provide steps for how I can achieve this?

ksikorsk commented 5 years ago

@saraswat40 you cannot turn off the main video. The bot never stops playing video through it's video ("webcam") socket... it has not been built for this. It has also not been built to capture vbss ("screen sharing") video, it only supports streaming a video to the vbss socket. The capabilities exist, but the sample does not showcase them. In the logs I don't see you changing the screen sharing role to sharer, which would enable sharing via the vbss socket. Like I said earlier, the default is viewer.

You can find a little more documentation regarding these concepts here: https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/calls-and-meetings/real-time-media-concepts

saraswat40 commented 5 years ago

@ksikorsk Is there a series of steps I can follow to trigger this in CallHandler.cs> OnVideoMediaReceived: this.logger.Info($"[{this.Call.Id}]: Capturing image: [VideoMediaReceivedEventArgs(Data=<{e.Buffer.Data.ToString()}>, Length={e.Buffer.Length}, Timestamp={e.Buffer.Timestamp}, Width={e.Buffer.VideoFormat.Width}, Height={e.Buffer.VideoFormat.Height}, ColorFormat={e.Buffer.VideoFormat.VideoColorFormat}, FrameRate={e.Buffer.VideoFormat.FrameRate})]");

I have already made this change in SampleObserver.cs: if (logEvent.EventType != LogEventType.HttpTrace) { // Unless we have an error/warning to log. if (logEvent.Level != TraceLevel.Error && logEvent.Level != TraceLevel.Warning && logEvent.Level != TraceLevel.Info) { return; } }

aarushi-mittal commented 4 years ago

Hello,

were you able to resolve this issue ?

-aarushi