Beispiel #1
0
        // Token: 0x06002B6F RID: 11119 RVA: 0x000F3A30 File Offset: 0x000F1C30
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Message = base.Initialize <MessageItem>(new PropertyDefinition[]
            {
                MessageItemSchema.IsRead,
                BodySchema.Codepage,
                BodySchema.InternetCpid,
                MessageItemSchema.MessageAudioNotes,
                MessageItemSchema.SenderTelephoneNumber,
                ItemSchema.FlagStatus,
                ItemSchema.FlagCompleteTime,
                MessageItemSchema.ReplyTime,
                MessageItemSchema.RequireProtectedPlayOnPhone,
                ItemSchema.UtcDueDate,
                ItemSchema.UtcStartDate,
                ItemSchema.ReminderDueBy,
                ItemSchema.ReminderIsSet,
                StoreObjectSchema.EffectiveRights
            });
            this.IrmItemHelper = new IRMItemHelper(this.Message, base.UserContext, base.IsPreviewForm, base.IsEmbeddedItem);
            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                this.isUMEnabled          = umclientCommon.IsUMEnabled();
                this.isPlayOnPhoneEnabled = umclientCommon.IsPlayOnPhoneEnabled();
            }
            this.IrmItemHelper.IrmDecryptIfRestricted();
            bool isSuspectedPhishingItem = false;
            bool isLinkEnabled           = false;
            bool flag = false;

            this.isMacintoshPlatform = (Utilities.GetBrowserPlatform(base.Request.UserAgent) == BrowserPlatform.Macintosh);
            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.Message, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkEmailFolder, out isSuspectedPhishingItem, out isLinkEnabled, out flag);
            this.toolbar             = new ReadMessageToolbar(base.IsInDeleteItems, base.IsEmbeddedItem, this.Message, this.isInJunkEmailFolder, isSuspectedPhishingItem, isLinkEnabled, false, this.IrmItemHelper.IsReplyRestricted, this.IrmItemHelper.IsReplyAllRestricted, this.IrmItemHelper.IsForwardRestricted, this.IrmItemHelper.IsPrintRestricted);
            this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
            this.recipientWell       = new MessageRecipientWell(this.Message);
            if (flag)
            {
                this.bodyMarkup = Markup.PlainText;
            }
            InfobarMessageBuilder.AddImportance(this.infobar, this.Message);
            InfobarMessageBuilder.AddFlag(this.infobar, this.Message, base.UserContext);
            InfobarMessageBuilder.AddSensitivity(this.infobar, this.Message);
            if (base.UserContext.IsIrmEnabled && Utilities.IsIrmRestrictedAndDecrypted(this.Message))
            {
                InfobarMessageBuilder.AddIrmInformation(this.infobar, this.Message, base.IsPreviewForm, false, false, false);
            }
            if (!this.Message.IsRead && !base.IsPreviewForm && !base.IsEmbeddedItem)
            {
                this.Message.MarkAsRead(Utilities.ShouldSuppressReadReceipt(base.UserContext, this.Message), false);
            }
        }
Beispiel #2
0
        public void RecordUnifiedMessagingGreeting()
        {
            ExTraceGlobals.UserOptionsCallTracer.TraceDebug((long)this.GetHashCode(), "OptionsEventHandler.RecordUnifiedMessagingGreeting");
            bool   flag         = (bool)base.GetParameter("vGr");
            string dialString   = (string)base.GetParameter("tpNum");
            string lastUMCallId = base.UserContext.LastUMCallId;

            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                if (!umclientCommon.IsPlayOnPhoneEnabled())
                {
                    throw new OwaEventHandlerException("Failed to record greeting because user doesn't have Play On Phone Enabled", LocalizedStrings.GetNonEncoded(1385527863));
                }
                if (!string.IsNullOrEmpty(lastUMCallId))
                {
                    UMCallState umcallState = UMCallState.Disconnected;
                    try
                    {
                        UMCallInfo callInfo = umclientCommon.GetCallInfo(lastUMCallId);
                        umcallState = callInfo.CallState;
                    }
                    catch (InvalidCallIdException)
                    {
                        ExTraceGlobals.UnifiedMessagingTracer.TraceDebug((long)this.GetHashCode(), "Failed to get call status from Unified Messaging");
                    }
                    catch (Exception exception)
                    {
                        if (!OptionsEventHandler.HandleUMException(exception))
                        {
                            throw;
                        }
                    }
                    if (umcallState != UMCallState.Disconnected)
                    {
                        throw new OwaEventHandlerException(LocalizedStrings.GetNonEncoded(460647110), LocalizedStrings.GetNonEncoded(460647110));
                    }
                    base.UserContext.LastUMCallId = null;
                }
                UMGreetingType greetingType = flag ? UMGreetingType.NormalCustom : UMGreetingType.OofCustom;
                try
                {
                    base.UserContext.LastUMCallId = umclientCommon.PlayOnPhoneGreeting(greetingType, dialString);
                }
                catch (Exception exception2)
                {
                    if (!OptionsEventHandler.HandleUMException(exception2))
                    {
                        throw;
                    }
                }
            }
        }
Beispiel #3
0
 public void SaveUnifiedMessagingOptions()
 {
     ExTraceGlobals.UserOptionsCallTracer.TraceDebug((long)this.GetHashCode(), "OptionsEventHandler.SaveUnifiedMessagingOptions");
     using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
     {
         if (!umclientCommon.IsUMEnabled())
         {
             throw new OwaEventHandlerException("Failed to reset pin because user is not enabled for Unified Messaging", LocalizedStrings.GetNonEncoded(1301599396));
         }
         if (base.IsParameterSet("tpNum"))
         {
             umclientCommon.SetPlayOnPhoneDialString((string)base.GetParameter("tpNum"));
         }
         if (base.IsParameterSet("vGr"))
         {
             umclientCommon.SetOofStatus(!(bool)base.GetParameter("vGr"));
         }
         if (base.IsParameterSet("vSo"))
         {
             umclientCommon.SetUnReadVoiceMailReadingOrder((bool)base.GetParameter("vSo"));
         }
         if (base.IsParameterSet("mc"))
         {
             umclientCommon.SetMissedCallNotificationEnabled((bool)base.GetParameter("mc"));
         }
         if (base.IsParameterSet("plvm"))
         {
             umclientCommon.SetPinlessAccessToVoicemail((bool)base.GetParameter("plvm"));
         }
         if (base.IsParameterSet("sms"))
         {
             umclientCommon.SetSMSNotificationOption((UMSMSNotificationOptions)base.GetParameter("sms"));
         }
         if (base.IsParameterSet("vmPvRec"))
         {
             umclientCommon.SetReceivedVoiceMailPreview((bool)base.GetParameter("vmPvRec"));
         }
         if (base.IsParameterSet("vmPvSnd"))
         {
             umclientCommon.SetSentVoiceMailPreview((bool)base.GetParameter("vmPvSnd"));
         }
         if (base.IsParameterSet("tpFdr"))
         {
             string telephoneAccessFolderEmail = Utilities.ProviderSpecificIdFromStoreObjectId((string)base.GetParameter("tpFdr"));
             umclientCommon.SetTelephoneAccessFolderEmail(telephoneAccessFolderEmail);
         }
     }
 }
Beispiel #4
0
 public void ResetUnifiedMessagingPassword()
 {
     ExTraceGlobals.UserOptionsCallTracer.TraceDebug((long)this.GetHashCode(), "OptionsEventHandler.ResetUnifiedMessagingPassword");
     using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
     {
         if (!umclientCommon.IsUMEnabled())
         {
             throw new OwaEventHandlerException("Failed to reset pin because user is not enabled for Unified Messaging", LocalizedStrings.GetNonEncoded(1301599396));
         }
         try
         {
             umclientCommon.ResetPIN();
         }
         catch (ResetPINException innerException)
         {
             throw new OwaEventHandlerException("Unable to Reset PIN in Unified Messaging", LocalizedStrings.GetNonEncoded(51129530), innerException);
         }
     }
 }
Beispiel #5
0
        public void GetUMCallStatus()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "ReadVoiceMessageEventHandler.GetUMCallStatus");
            string      lastUMCallId = base.UserContext.LastUMCallId;
            UMCallState umcallState  = UMCallState.Disconnected;

            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                if (!umclientCommon.IsPlayOnPhoneEnabled())
                {
                    throw new OwaEventHandlerException("User is not enabled for Play on Phone", LocalizedStrings.GetNonEncoded(1385527863));
                }
                if (!string.IsNullOrEmpty(lastUMCallId))
                {
                    try
                    {
                        UMCallInfo callInfo = umclientCommon.GetCallInfo(lastUMCallId);
                        umcallState = callInfo.CallState;
                    }
                    catch (InvalidCallIdException)
                    {
                        ExTraceGlobals.UnifiedMessagingTracer.TraceDebug((long)this.GetHashCode(), "Failed to get call status from Unified Messaging");
                    }
                    catch (Exception exception)
                    {
                        if (this.HandleUMException(exception))
                        {
                            return;
                        }
                        throw;
                    }
                    if (umcallState == UMCallState.Disconnected || umcallState == UMCallState.Idle)
                    {
                        base.UserContext.LastUMCallId = null;
                    }
                }
            }
            TextWriter writer = this.Writer;
            int        num    = (int)umcallState;

            writer.Write(num.ToString());
        }
Beispiel #6
0
 private UMSettingsData ReadAggregatedUMSettingsData(UserConfigurationManager.IAggregationContext ctx, ExchangePrincipal exchangePrincipal)
 {
     return(UserContextUtilities.ReadAggregatedType <UMSettingsData>(ctx, "OWA.UMSettings", delegate
     {
         UMSettingsData umsettingsData = new UMSettingsData();
         try
         {
             using (UMClientCommon umclientCommon = new UMClientCommon(exchangePrincipal))
             {
                 umsettingsData.PlayOnPhoneDialString = umclientCommon.GetPlayOnPhoneDialString();
                 umsettingsData.IsRequireProtectedPlayOnPhone = umclientCommon.IsRequireProtectedPlayOnPhone();
                 umsettingsData.IsUMEnabled = umclientCommon.IsUMEnabled();
             }
         }
         catch (LocalizedException arg)
         {
             ExTraceGlobals.CoreTracer.TraceWarning <LocalizedException>((long)this.GetHashCode(), "Failed to initialize UM settings due to exception: {0}", arg);
         }
         return umsettingsData;
     }));
 }
Beispiel #7
0
        public void HangupUMPhoneCall()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "ReadVoiceMessageEventHandler.HangupUMPhoneCall");
            string lastUMCallId = base.UserContext.LastUMCallId;

            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                if (!umclientCommon.IsPlayOnPhoneEnabled())
                {
                    throw new OwaEventHandlerException("User is not enabled for Play on Phone", LocalizedStrings.GetNonEncoded(1385527863));
                }
                if (!string.IsNullOrEmpty(lastUMCallId))
                {
                    try
                    {
                        UMCallInfo  callInfo  = umclientCommon.GetCallInfo(lastUMCallId);
                        UMCallState callState = callInfo.CallState;
                        if (callInfo.CallState != UMCallState.Disconnected)
                        {
                            umclientCommon.Disconnect(lastUMCallId);
                            base.UserContext.LastUMCallId = null;
                        }
                    }
                    catch (InvalidCallIdException)
                    {
                        ExTraceGlobals.UnifiedMessagingTracer.TraceDebug((long)this.GetHashCode(), "Failed to get call status from Unified Messaging");
                    }
                    catch (Exception exception)
                    {
                        if (this.HandleUMException(exception))
                        {
                            return;
                        }
                        throw;
                    }
                }
                base.UserContext.LastUMCallId      = null;
                base.UserContext.LastUMPhoneNumber = null;
            }
        }
Beispiel #8
0
        private void PlayOnPhone(bool isPAA)
        {
            string text         = (string)base.GetParameter("phNum");
            string lastUMCallId = base.UserContext.LastUMCallId;

            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                if (!umclientCommon.IsPlayOnPhoneEnabled())
                {
                    throw new OwaEventHandlerException("User is not enabled for Play on Phone", LocalizedStrings.GetNonEncoded(1385527863));
                }
                if (!string.IsNullOrEmpty(lastUMCallId))
                {
                    UMCallState umcallState = UMCallState.Disconnected;
                    try
                    {
                        UMCallInfo callInfo = umclientCommon.GetCallInfo(lastUMCallId);
                        umcallState = callInfo.CallState;
                    }
                    catch (InvalidCallIdException)
                    {
                        ExTraceGlobals.UnifiedMessagingTracer.TraceDebug((long)this.GetHashCode(), "Failed to get call status from Unified Messaging");
                    }
                    catch (Exception exception)
                    {
                        if (this.HandleUMException(exception))
                        {
                            return;
                        }
                        throw;
                    }
                    if (umcallState != UMCallState.Disconnected)
                    {
                        base.RenderPartialFailure(460647110, new Strings.IDs?(-937065163), ButtonDialogIcon.Warning);
                        return;
                    }
                    base.UserContext.LastUMCallId = null;
                }
                try
                {
                    if (isPAA)
                    {
                        string s           = (string)base.GetParameter("paaID");
                        Guid   paaIdentity = new Guid(Convert.FromBase64String(s));
                        base.UserContext.LastUMCallId = umclientCommon.PlayOnPhonePAAGreeting(paaIdentity, text);
                    }
                    else
                    {
                        OwaStoreObjectId  owaStoreObjectId             = (OwaStoreObjectId)base.GetParameter("msgID");
                        ExchangePrincipal playOnPhoneExchangePrincipal = this.GetPlayOnPhoneExchangePrincipal(owaStoreObjectId);
                        using (UMClientCommon umclientCommon2 = new UMClientCommon(playOnPhoneExchangePrincipal))
                        {
                            string base64ObjectId = Utilities.ProviderSpecificIdFromStoreObjectId(owaStoreObjectId.StoreObjectId.ToBase64String());
                            base.UserContext.LastUMCallId = umclientCommon2.PlayOnPhone(base64ObjectId, text);
                        }
                    }
                    base.UserContext.LastUMPhoneNumber = text;
                    if (string.Compare(umclientCommon.GetUMProperties().PlayOnPhoneDialString, text, StringComparison.InvariantCultureIgnoreCase) != 0)
                    {
                        umclientCommon.SetPlayOnPhoneDialString(text);
                    }
                }
                catch (Exception exception2)
                {
                    if (this.HandleUMException(exception2))
                    {
                        return;
                    }
                    throw;
                }
                this.Writer.Write(base.UserContext.LastUMCallId);
            }
        }
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     this.infobar = new Infobar();
     using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
     {
         if (!umclientCommon.IsUMEnabled())
         {
             throw new OwaInvalidRequestException("User is not UM enabled");
         }
         this.isPlayOnPhoneEnabled             = umclientCommon.IsPlayOnPhoneEnabled();
         this.enabledForPinlessVoicemail       = umclientCommon.UMPolicy.AllowPinlessVoiceMailAccess;
         this.enabledForSMSNotification        = umclientCommon.IsSmsNotificationsEnabled();
         this.enabledForVoicemailPreview       = umclientCommon.UMPolicy.AllowVoiceMailPreview;
         this.enabledForMissedCallNotification = umclientCommon.UMPolicy.AllowMissedCallNotifications;
         this.isDialPlanEnterprise             = (umclientCommon.DialPlan.SubscriberType == UMSubscriberType.Enterprise);
         UMPropertiesEx umproperties = umclientCommon.GetUMProperties();
         this.isOutOfOffice             = umproperties.OofStatus;
         this.isFIFOOrder               = umproperties.ReadUnreadVoicemailInFIFOOrder;
         this.isMissedCallNotification  = umproperties.MissedCallNotificationEnabled;
         this.dialOnPhoneNumber         = umproperties.PlayOnPhoneDialString;
         this.telephoneAccessNumbers    = umproperties.TelephoneAccessNumbers;
         this.isPinlessVoicemail        = umproperties.PinlessAccessToVoicemail;
         this.smsNotificationValue      = umproperties.SMSNotificationOption;
         this.isVoicemailPreviewReceive = umproperties.ReceivedVoiceMailPreviewEnabled;
         this.isVoicemailPreviewSend    = umproperties.SentVoiceMailPreviewEnabled;
         try
         {
             this.telephoneFolderId = StoreObjectId.FromProviderSpecificId(Convert.FromBase64String(umproperties.TelephoneAccessFolderEmail));
         }
         catch (CorruptDataException arg)
         {
             ExTraceGlobals.CoreCallTracer.TraceDebug <string, CorruptDataException>(0L, "Invalid format for Folder ID string: {0}. Exception: {1}", umproperties.TelephoneAccessFolderEmail, arg);
         }
         catch (FormatException arg2)
         {
             ExTraceGlobals.CoreCallTracer.TraceDebug <string, FormatException>(0L, "Invalid format for Folder ID string: {0}. Exception: {1}", umproperties.TelephoneAccessFolderEmail, arg2);
         }
     }
     if (this.telephoneFolderId == null)
     {
         this.telephoneFolderId = base.UserContext.InboxFolderId;
     }
     try
     {
         using (Folder folder = Folder.Bind(base.UserContext.MailboxSession, this.telephoneFolderId, new PropertyDefinition[]
         {
             FolderSchema.DisplayName
         }))
         {
             this.TelephoneFolderName = folder.DisplayName;
         }
     }
     catch (ObjectNotFoundException)
     {
         ExTraceGlobals.CoreCallTracer.TraceDebug <StoreObjectId>(0L, "The folder doesn't exist. Folder Id: {0}", this.telephoneFolderId);
         this.telephoneFolderId = base.UserContext.InboxFolderId;
         using (Folder folder2 = Folder.Bind(base.UserContext.MailboxSession, this.telephoneFolderId, new PropertyDefinition[]
         {
             FolderSchema.DisplayName
         }))
         {
             this.TelephoneFolderName = folder2.DisplayName;
         }
     }
     using (IPAAStore ipaastore = PAAStore.Create(base.UserContext.ExchangePrincipal))
     {
         ipaastore.GetUserPermissions(out this.enabledForPersonalAutoAttendant, out this.enabledForOutdialing);
         if (this.enabledForPersonalAutoAttendant)
         {
             this.personalAutoAttendantToolbar = new PersonalAutoAttendantListToolbar();
         }
     }
 }