Пример #1
0
        // Token: 0x06000ABB RID: 2747 RVA: 0x00046114 File Offset: 0x00044314
        private void ProcessMailboxForSMS(MailboxInfo mailbox, MailboxSession session, StoreObject item, ADUser user, UMDialPlan dialPlan)
        {
            if (mailbox.MapiEvent == null || session == null || item == null)
            {
                ExTraceGlobals.MWITracer.TraceDebug((long)this.GetHashCode(), "MwiAssistant.ProcessMailboxForSMS: Skipping for {0} (event={1}, session={2}, item={3})", new object[]
                {
                    mailbox,
                    mailbox.MapiEvent,
                    session,
                    item
                });
                return;
            }
            UMMailbox ummailbox = new UMMailbox(user);

            if (ummailbox.UMSMSNotificationOption == UMSMSNotificationOptions.None)
            {
                ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo>((long)this.GetHashCode(), "MwiAssistant.ProcessMailboxForSMS: Skipping {0}. UMSMSNotificationOptions=None", mailbox);
                return;
            }
            if (MwiAssistant.IsMissedCallMessageEvent(mailbox.MapiEvent) && ummailbox.UMSMSNotificationOption != UMSMSNotificationOptions.VoiceMailAndMissedCalls)
            {
                ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo, string>((long)this.GetHashCode(), "MwiAssistant.ProcessMailboxForSMS: Skipping {0}. UMSMSNotificationOptions={1}", mailbox, ummailbox.UMSMSNotificationOption.ToString());
                return;
            }
            this.SendSMSMessage(mailbox, session, item, user, dialPlan);
        }
Пример #2
0
        // Token: 0x06000ABE RID: 2750 RVA: 0x00046574 File Offset: 0x00044774
        private void SendSMSMessage(MailboxInfo mailbox, MailboxSession session, StoreObject item, ADUser user, UMDialPlan dialPlan)
        {
            ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo, MailboxSession, StoreObject>((long)this.GetHashCode(), "MwiAssistant.SendSMSMessage: Mailbox:{0} Session={1} Item={2}", mailbox, session, item);
            string      text;
            CultureInfo preferredCulture;

            if (MwiAssistant.TryGetNotificationPhoneNumber(mailbox, session, user, out text, out preferredCulture))
            {
                StoreObjectId storeObjectId = session.GetDefaultFolderId(DefaultFolderType.Drafts) ?? session.GetDefaultFolderId(DefaultFolderType.Outbox);
                using (Folder.Bind(session, storeObjectId))
                {
                    using (MessageItem messageItem = MessageItem.Create(session, storeObjectId))
                    {
                        messageItem.ClassName = "IPM.Note.Mobile.SMS.Alert.Voicemail";
                        if (MwiAssistant.IsVoiceMessageEvent(mailbox.MapiEvent))
                        {
                            SmsVoicemailNotification smsVoicemailNotification = new SmsVoicemailNotification(session, preferredCulture, item, dialPlan);
                            smsVoicemailNotification.PrepareSmsMessage(messageItem);
                        }
                        else
                        {
                            if (!MwiAssistant.IsMissedCallMessageEvent(mailbox.MapiEvent))
                            {
                                throw new ArgumentException("MapiEvent.ObjectClass");
                            }
                            SmsMissedCallNotification smsMissedCallNotification = new SmsMissedCallNotification(session, preferredCulture, item, dialPlan);
                            smsMissedCallNotification.PrepareSmsMessage(messageItem);
                        }
                        Participant participant = new Participant(null, text, "MOBILE");
                        messageItem.Recipients.Add(participant, RecipientItemType.To);
                        string subject = messageItem.Subject;
                        string text2   = string.Format("{0}:{1}", participant.RoutingType, participant.EmailAddress);
                        ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo, string, string>((long)this.GetHashCode(), "MwiAssistant.SendSMSMessage: Mailbox:{0} Recipient:{1} Subject={2}. Sending...", mailbox, text2, subject);
                        messageItem.Send();
                        UmGlobals.ExEvent.LogEvent(UMEventLogConstants.Tuple_MwiTextMessageSent, null, new object[]
                        {
                            subject,
                            mailbox,
                            text,
                            text2
                        });
                    }
                }
            }
        }
Пример #3
0
 // Token: 0x06000AAB RID: 2731 RVA: 0x000459C4 File Offset: 0x00043BC4
 public bool IsEventInteresting(MapiEvent mapiEvent)
 {
     return((MwiAssistant.IsVoicemailSearchFolderEvent(mapiEvent) && mapiEvent.CreateTime >= (DateTime)this.assistantUtcStartTime && (mapiEvent.ItemCount != -1L || mapiEvent.UnreadItemCount != -1L)) || (mapiEvent.ItemType == ObjectType.MAPI_MESSAGE && mapiEvent.EventMask == MapiEventTypeFlags.NewMail && (MwiAssistant.IsMissedCallMessageEvent(mapiEvent) || MwiAssistant.IsVoiceMessageEvent(mapiEvent))));
 }