示例#1
0
 protected override UcwaUserConfiguration InternalExecute()
 {
     return(UcwaConfigurationUtilities.GetUcwaUserConfiguration(this.sipUri, base.CallContext));
 }
        // Token: 0x060019AD RID: 6573 RVA: 0x0005AB7C File Offset: 0x00058D7C
        protected override OnlineMeetingType InternalExecute()
        {
            this.SetDefaultValuesForOptics();
            UserContext userContext = UserContextManager.GetUserContext(base.CallContext.HttpContext, base.CallContext.EffectiveCaller, true);

            if (string.Compare(userContext.SipUri, this.sipUri, StringComparison.OrdinalIgnoreCase) != 0)
            {
                base.CallContext.ProtocolLog.Set(CreateOnlineMeetingMetadata.ManagerSipUri, ExtensibleLogger.FormatPIIValue(this.sipUri));
            }
            if (userContext.ExchangePrincipal.MailboxInfo.OrganizationId != null && userContext.ExchangePrincipal.MailboxInfo.OrganizationId.OrganizationalUnit != null)
            {
                base.CallContext.ProtocolLog.Set(CreateOnlineMeetingMetadata.Organization, userContext.ExchangePrincipal.MailboxInfo.OrganizationId.OrganizationalUnit.Name);
            }
            UcwaUserConfiguration ucwaUserConfiguration = UcwaConfigurationUtilities.GetUcwaUserConfiguration(this.sipUri, base.CallContext);

            if (!ucwaUserConfiguration.IsUcwaSupported)
            {
                base.CallContext.ProtocolLog.Set(CreateOnlineMeetingMetadata.IsUcwaSupported, bool.FalseString);
                string errorString = string.Format("[InternalExecute] Attempted to create an online meeting for a non-UCWA supported user; autodiscover returned UcwaUrl: '{0}', DiagnosticInfo: '{1}'", ucwaUserConfiguration.UcwaUrl, ucwaUserConfiguration.DiagnosticInfo);
                this.LogAndTraceError(errorString);
                return(OnlineMeetingType.CreateFailedOnlineMeetingType("User is not UCWA enabled"));
            }
            if (!this.ShoudlMeetingBeCreated())
            {
                return(OnlineMeetingType.CreateFailedOnlineMeetingType("Item already has an online meeting associated to it."));
            }
            OAuthCredentials oauthCredential;

            try
            {
                oauthCredential = UcwaConfigurationUtilities.GetOAuthCredential(this.sipUri);
                oauthCredential.ClientRequestId = new Guid?(Guid.NewGuid());
                base.CallContext.ProtocolLog.Set(CreateOnlineMeetingMetadata.OAuthCorrelationId, oauthCredential.ClientRequestId.Value.ToString());
            }
            catch (OwaException ex)
            {
                this.LogAndTraceError("An error occurred while obtaining OAuth Credential: " + UcwaConfigurationUtilities.BuildFailureLogString(ex));
                return(OnlineMeetingType.CreateFailedOnlineMeetingType("An error occurred while obtaining OAuth credential"));
            }
            Task <OnlineMeetingResult> task = this.CreateLyncOnlineMeeting(ucwaUserConfiguration.UcwaUrl, oauthCredential, userContext.UserCulture);

            base.CallContext.ProtocolLog.Set(CreateOnlineMeetingMetadata.IsTaskCompleted, task.IsCompleted.ToString());
            if (task.IsFaulted)
            {
                task.Exception.Flatten().Handle(new Func <Exception, bool>(this.HandleCreateOnlineMeetingTaskException));
                return(OnlineMeetingType.CreateFailedOnlineMeetingType("An error occured while calling UCWA to create the meeting"));
            }
            if (task.Result == null)
            {
                this.LogAndTraceError("Result from call to UCWA is null");
                return(OnlineMeetingType.CreateFailedOnlineMeetingType("Unable to create the meeting"));
            }
            if (task.Result.OnlineMeeting.WebUrl == "")
            {
                return(OnlineMeetingType.CreateFailedOnlineMeetingType("Unable to create the meeting"));
            }
            this.UpdateOpticsLog(task.Result);
            OnlineMeetingType result = this.ProcessOnlineMeetingResult(userContext, task.Result);

            this.DiposeObjectsIfNeeded();
            return(result);
        }