// Token: 0x06000B0B RID: 2827 RVA: 0x00047C18 File Offset: 0x00045E18
        private void ProcessEvent(ADUser user, MailboxSession mailboxSession, StoreObject item)
        {
            Exception     ex            = null;
            StringBuilder stringBuilder = new StringBuilder();

            UMPartnerMessageAssistant.UMPartnerMessageRpcTargetPicker instance = UMPartnerMessageAssistant.UMPartnerMessageRpcTargetPicker.Instance;
            IADSystemConfigurationLookup iadsystemConfigurationLookup          = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(user.OrganizationId);
            ProcessPartnerMessageRequest processPartnerMessageRequest          = new ProcessPartnerMessageRequest();

            processPartnerMessageRequest.MailboxGuid = mailboxSession.MailboxGuid;
            processPartnerMessageRequest.TenantGuid  = iadsystemConfigurationLookup.GetExternalDirectoryOrganizationId();
            processPartnerMessageRequest.ItemId      = item.Id.ToBase64String();
            LocalizedString partnerMessageDescription = UMPartnerMessageAssistant.GetPartnerMessageDescription(item);
            int             num  = 0;
            int             num2 = 0;

            for (;;)
            {
                IVersionedRpcTarget versionedRpcTarget = instance.PickNextServer(user.UMRecipientDialPlanId.ObjectGuid, out num);
                if (versionedRpcTarget == null)
                {
                    break;
                }
                try
                {
                    ex = null;
                    versionedRpcTarget.ExecuteRequest(processPartnerMessageRequest);
                    UMPartnerMessageAssistant.LogMessageProcessingSuccessEvent(partnerMessageDescription, user, versionedRpcTarget);
                    UMPartnerMessageAssistant.SafeDeleteItem(mailboxSession, item.Id);
                    goto IL_151;
                }
                catch (RpcException ex2)
                {
                    ex = ex2;
                    UMPartnerMessageAssistant.Tracer.TraceWarning <string, RpcException>(0L, "UMPMA.ProcessEvent({0}): {1}", versionedRpcTarget.Name, ex2);
                    stringBuilder.AppendLine(Strings.UMRpcError(versionedRpcTarget.Name, ex2.ErrorCode, ex2.Message));
                    if (UMErrorCode.IsPermanent(ex2.ErrorCode))
                    {
                        throw new SkipException(Strings.descUMServerFailure(versionedRpcTarget.Name, partnerMessageDescription, user.DistinguishedName), ex2);
                    }
                    if (UMErrorCode.IsNetworkError(ex2.ErrorCode))
                    {
                        instance.ServerUnavailable(versionedRpcTarget);
                    }
                }
                if (++num2 >= num)
                {
                    goto IL_151;
                }
            }
            UMPartnerMessageAssistant.LogNoServersAvailableEvent(partnerMessageDescription, user);
            throw new TransientMailboxException(Strings.descUMServerNotAvailable(partnerMessageDescription, user.DistinguishedName), null, UMPartnerMessageAssistant.RetrySchedule);
IL_151:
            if (ex != null)
            {
                UMPartnerMessageAssistant.LogMessageProcessingFailedEvent(partnerMessageDescription, user, stringBuilder.ToString());
                throw new TransientMailboxException(Strings.descUMAllServersFailed(partnerMessageDescription, user.DistinguishedName), ex, UMPartnerMessageAssistant.RetrySchedule);
            }
        }
        // Token: 0x06000A60 RID: 2656 RVA: 0x00044328 File Offset: 0x00042528
        internal static Guid GetExternalDirectoryOrganizationId(MailboxSession session)
        {
            if (session.MailboxOwner.MailboxInfo.OrganizationId == null || OrganizationId.ForestWideOrgId.Equals(session.MailboxOwner.MailboxInfo.OrganizationId))
            {
                return(Guid.Empty);
            }
            IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(session.MailboxOwner.MailboxInfo.OrganizationId);

            return(iadsystemConfigurationLookup.GetExternalDirectoryOrganizationId());
        }
Exemple #3
0
        // Token: 0x06001D5A RID: 7514 RVA: 0x000750BC File Offset: 0x000732BC
        private static void GetUserIdentity(HttpContext httpContext, out Guid userObjectGuid, out Guid tenantGuid, out OrganizationId orgId, out UserContext userContext)
        {
            ExTraceGlobals.SpeechRecognitionTracer.TraceDebug(0L, "Entering SpeechRecognitionProcessor.GetUserIdentity");
            userContext    = UserContextManager.GetUserContext(httpContext);
            userObjectGuid = userContext.ExchangePrincipal.ObjectId.ObjectGuid;
            orgId          = userContext.ExchangePrincipal.MailboxInfo.OrganizationId;
            IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(orgId);

            tenantGuid = iadsystemConfigurationLookup.GetExternalDirectoryOrganizationId();
            ExTraceGlobals.SpeechRecognitionTracer.TraceDebug <Guid, Guid, OrganizationId>(0L, "SpeechRecognitionProcessor.GetUserIdentity - userObjectGuid='{0}', tenantGuid='{1}', orgId='{2}'", userObjectGuid, tenantGuid, orgId);
        }
Exemple #4
0
        // Token: 0x06000ABD RID: 2749 RVA: 0x00046480 File Offset: 0x00044680
        private void SendMwiMessage(MailboxInfo mailbox, MailboxSession itemStore)
        {
            StoreObjectId umsearchFolderId = MwiAssistant.GetUMSearchFolderId(itemStore);

            if (umsearchFolderId == null)
            {
                ExTraceGlobals.MWITracer.TraceWarning <MailboxInfo>((long)this.GetHashCode(), "MwiAssistant.SendMwiMessage(): Skipping event. Could not get Voice Mail search folder for {0}.", mailbox);
                return;
            }
            using (SearchFolder searchFolder = SearchFolder.Bind(itemStore, umsearchFolderId, new PropertyDefinition[]
            {
                FolderSchema.ItemCount,
                FolderSchema.UnreadCount
            }))
            {
                int itemCount = searchFolder.ItemCount;
                int num       = (int)searchFolder[FolderSchema.UnreadCount];
                ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo, int, int>((long)this.GetHashCode(), "MwiAssistant.SendMwiMessage(): Sending MWI for user {0}, itemCount={1}, unreadCount={2}", mailbox, itemCount, num);
                IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(mailbox.OrganizationId);
                Guid       externalDirectoryOrganizationId = iadsystemConfigurationLookup.GetExternalDirectoryOrganizationId();
                MwiMessage message = new MwiMessage(mailbox.Guid, mailbox.DialPlanGuid, mailbox.DisplayName, mailbox.UMExtension, num, itemCount, MwiAssistant.MessageExpirationTime, mailbox.EventTimeUtc, externalDirectoryOrganizationId);
                this.loadBalancer.SendMessage(message);
            }
        }
Exemple #5
0
        // Token: 0x060010E9 RID: 4329 RVA: 0x00062FD0 File Offset: 0x000611D0
        private static Guid GetTenantGuid(OrganizationId orgId)
        {
            IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(orgId);

            return(iadsystemConfigurationLookup.GetExternalDirectoryOrganizationId());
        }