// 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);
            }
        }
Ejemplo n.º 2
0
        // 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());
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 // Token: 0x06000C4C RID: 3148 RVA: 0x0004F914 File Offset: 0x0004DB14
 protected override void InternalDoWork()
 {
     if (base.User.UMEnabled)
     {
         IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(base.User.OrganizationId);
         UMDialPlan dialPlanFromId = iadsystemConfigurationLookup.GetDialPlanFromId(base.User.UMRecipientDialPlanId);
         string[]   accessNumbers  = ProvisioningAssistant.PostMigrationUMProvisioningRequest.GetAccessNumbers(dialPlanFromId);
         string     extension      = this.GetExtension(dialPlanFromId);
         Utils.SendWelcomeMail(base.User, accessNumbers, extension, Strings.UnchangedPIN, base.User.PrimarySmtpAddress.ToString(), base.MailboxSession);
         return;
     }
     Utils.ResetUMMailbox(base.User, true, base.MailboxSession);
 }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
0
        // Token: 0x060010E9 RID: 4329 RVA: 0x00062FD0 File Offset: 0x000611D0
        private static Guid GetTenantGuid(OrganizationId orgId)
        {
            IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(orgId);

            return(iadsystemConfigurationLookup.GetExternalDirectoryOrganizationId());
        }
Ejemplo n.º 7
0
        // Token: 0x06001169 RID: 4457 RVA: 0x00065FBC File Offset: 0x000641BC
        public List <DirectoryGrammar> GetGrammarList()
        {
            this.Logger.TraceDebug(this, "Entering UserGrammarGenerator.GetGrammarList", new object[0]);
            List <DirectoryGrammar> list             = new List <DirectoryGrammar>();
            HashSet <Guid>          addressListGuids = new HashSet <Guid>();

            this.Logger.TraceDebug(this, "Adding GAL grammar", new object[0]);
            list.Add(new GalUserGrammar());
            Exception ex = Utilities.RunSafeADOperation(ExTraceGlobals.UMGrammarGeneratorTracer, delegate
            {
                IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(this.OrgId);
                iadsystemConfigurationLookup.GetGlobalAddressLists(addressListGuids);
            }, "UserGrammarGenerator.GetGrammarList - Getting gals");

            if (ex != null)
            {
                this.Logger.TraceError(this, "Couldn't get list of gals. Error='{0}'", new object[]
                {
                    ex
                });
            }
            IEnumerable <Guid> dialPlanGuids = null;

            ex = Utilities.RunSafeADOperation(ExTraceGlobals.UMGrammarGeneratorTracer, delegate
            {
                IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(this.OrgId);
                dialPlanGuids = iadsystemConfigurationLookup.GetAutoAttendantDialPlans();
            }, "UserGrammarGenerator.GetGrammarList - Getting dial plan of all auto attendants");
            if (ex == null)
            {
                using (IEnumerator <Guid> enumerator = dialPlanGuids.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Guid guid = enumerator.Current;
                        this.Logger.TraceDebug(this, "Adding dial plan grammar for '{0}'", new object[]
                        {
                            guid
                        });
                        list.Add(new DialPlanGrammar(guid));
                    }
                    goto IL_147;
                }
            }
            this.Logger.TraceError(this, "Couldn't get list of auto attendant dial plans. Error='{0}'", new object[]
            {
                ex
            });
IL_147:
            if (VariantConfiguration.InvariantNoFlightingSnapshot.UM.AddressListGrammars.Enabled)
            {
                ex = Utilities.RunSafeADOperation(ExTraceGlobals.UMGrammarGeneratorTracer, delegate
                {
                    IADSystemConfigurationLookup iadsystemConfigurationLookup = ADSystemConfigurationLookupFactory.CreateFromOrganizationId(this.OrgId);
                    iadsystemConfigurationLookup.GetAutoAttendantAddressLists(addressListGuids);
                }, "UserGrammarGenerator.GetGrammarList - Getting address lists of all auto attendants");
                if (ex != null)
                {
                    this.Logger.TraceError(this, "Couldn't get list of auto attendant address lists. Error='{0}'", new object[]
                    {
                        ex
                    });
                }
            }
            foreach (Guid guid2 in addressListGuids)
            {
                this.Logger.TraceDebug(this, "Adding grammar for address list '{0}'", new object[]
                {
                    guid2
                });
                list.Add(new AddressListGrammar(guid2));
            }
            this.ValidateGrammarFiles(list);
            return(list);
        }