Example #1
0
        private void SetToxBoxInformation(State state)
        {
            var videoRoom = _videoRoomService.GetVideoRoom(VideoRoomNames.Everyone);

            state.TokBoxSessionId = videoRoom.TokBoxSessionId;
            if (!String.IsNullOrWhiteSpace(state.TokBoxTicketId) && DateTime.Now.AddHours(-22) < state.LastOnline)
            {
                return;
            }
            var connectionMetadata = new Dictionary <string, object> {
                { "Name", state.Name }, { "Guid", state.ProfileGuid }, { "PhotoGuid", state.PhotoGuid }, { "Gender", state.Gender }, { "Country", state.CountryCode }, { "Age", DateTime.Now.Year - state.BirthYear }
            };

            state.TokBoxTicketId = _tokBox.GenerateToken(state.TokBoxSessionId, connectionMetadata);
        }