/// <summary>Sends a start streaming command.</summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="targetAddress">Addressee information.</param>
        /// <param name="url">The streaming URL to be used.</param>
        /// <returns>Response <see cref="LiveVideoControlElementListResult"/>.</returns>
        private static LiveVideoControlResult SendStartStreamingCommand(
            Guid sessionId,
            TargetAddressType targetAddress,
            string url)
        {
            LiveVideoControlResult result = new LiveVideoControlResult();

            result.RequestId  = Guid.Empty;
            result.ResultCode = LiveVideoControlErrorEnum.InternalError;
            Guid   requestId = Guid.Empty;
            string error;

            if (sessionId != Guid.Empty)
            {
                error = _sessionManager.GenerateRequestID(sessionId, out requestId);
            }
            else
            {
                error = _sessionManager.GenerateRequestID(out requestId);
            }

            if (requestId != Guid.Empty)
            {
                ElementList <AvailableElementData> elements;
                T2GManagerErrorEnum rqstResult = _t2gManager.GetAvailableElementDataByTargetAddress(targetAddress, out elements);

                switch (rqstResult)
                {
                case T2GManagerErrorEnum.eSuccess:
                    Guid notificationRequestId        = requestId;
                    List <RequestContext> newRequests = new List <RequestContext>();
                    foreach (AvailableElementData element in elements)
                    {
                        if (_dicVideoHistorySentService.ContainsKey(targetAddress))
                        {
                            ServiceInfo availableService;
                            if (_t2gManager.GetAvailableServiceData(element.ElementNumber, (int)eServiceID.eSrvSIF_LiveVideoControlServer, out availableService) == T2GManagerErrorEnum.eSuccess)
                            {
                                _dicVideoHistorySentService[targetAddress] = availableService;
                            }
                        }

                        LiveVideoControlService.SendNotificationToGroundApp(requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum.LiveVideoControlDistributionProcessing, element.ElementNumber);
                        ProcessStartVideoStreamingCommandRequestContext request = new ProcessStartVideoStreamingCommandRequestContext(
                            element.ElementNumber,
                            requestId,
                            sessionId,
                            url);

                        newRequests.Add(request);
                    }

                    _requestProcessor.AddRequestRange(newRequests);
                    result.RequestId  = requestId;
                    result.ResultCode = LiveVideoControlErrorEnum.RequestAccepted;
                    break;

                case T2GManagerErrorEnum.eT2GServerOffline:
                    LogManager.WriteLog(TraceType.ERROR, "T2G Offline", "PIS.Ground.LiveVideoControl.LiveVideoControlService.SendStartStreamingCommand", null, EventIdEnum.LiveVideoControl);
                    result.ResultCode = LiveVideoControlErrorEnum.T2GServerOffline;
                    break;

                case T2GManagerErrorEnum.eElementNotFound:
                    LogManager.WriteLog(TraceType.ERROR, "Element not found", "PIS.Ground.LiveVideoControl.LiveVideoControlService.SendStartStreamingCommand", null, EventIdEnum.LiveVideoControl);
                    result.ResultCode = LiveVideoControlService.GetInvalidTargetAddressResponse(targetAddress);
                    break;

                default:
                    LogManager.WriteLog(TraceType.ERROR, "Problem looking for an element. T2GClient returned: " + rqstResult.ToString(),
                                        "PIS.Ground.LiveVideoControl.LiveVideoControlService.SendStartStreamingCommand", null, EventIdEnum.LiveVideoControl);
                    result.ResultCode = LiveVideoControlErrorEnum.InternalError;
                    break;
                }
            }
            else
            {
                LogManager.WriteLog(TraceType.ERROR, error, "PIS.Ground.LiveVideoControl.LiveVideoControlService.SendStartStreamingCommand", null, EventIdEnum.LiveVideoControl);
                result.ResultCode = LiveVideoControlErrorEnum.InvalidRequestID;
            }

            return(result);
        }