public static void SendSystemTextMessage(MailboxSession mailboxSession, E164Number recipient, string content, bool alert)
 {
     if (mailboxSession == null)
     {
         throw new ArgumentNullException("mailboxSession");
     }
     if (recipient == null)
     {
         throw new ArgumentNullException("recipient");
     }
     if (string.IsNullOrEmpty(content))
     {
         throw new ArgumentNullException("content");
     }
     TextMessagingHelper.SendMessageItemWithoutSave(mailboxSession, alert ? "IPM.Note.Mobile.SMS.Alert.Info" : "IPM.Note.Mobile.SMS.Undercurrent", new Participant(mailboxSession.MailboxOwner), new Participant(recipient.Number, recipient.Number, "MOBILE"), null, content, false, Importance.Normal);
 }
 public static void UpdateAndSaveTextMessgaingStateOnAdUser(TextMessagingAccount account, ADRecipient adRecipient, IRecipientSession adSession)
 {
     if (account == null)
     {
         throw new ArgumentNullException("account");
     }
     if (adRecipient == null)
     {
         throw new ArgumentNullException("adRecipient");
     }
     if (adSession == null)
     {
         throw new ArgumentNullException("adSession");
     }
     if (TextMessagingHelper.UpdateTextMessagingState(adRecipient.TextMessagingState, account.TextMessagingSettings.DeliveryPoints))
     {
         adSession.Save(adRecipient);
     }
 }
        public static void SaveTextMessagingAccount(TextMessagingAccount account, VersionedXmlDataProvider storeDataProvider, ADRecipient adRecipient, IRecipientSession adSession)
        {
            if (account == null)
            {
                throw new ArgumentNullException("account");
            }
            if (storeDataProvider == null)
            {
                throw new ArgumentNullException("storeDataProvider");
            }
            if (adRecipient == null)
            {
                throw new ArgumentNullException("adRecipient");
            }
            if (adSession == null)
            {
                throw new ArgumentNullException("adSession");
            }
            bool notificationPhoneNumberVerified = account.NotificationPhoneNumberVerified;
            bool dupIdentitiesExist = false;

            account.TextMessagingSettings.DeliveryPoints.Sort(delegate(DeliveryPoint x, DeliveryPoint y)
            {
                if (x.Identity == y.Identity)
                {
                    dupIdentitiesExist = true;
                }
                return(x.Identity.CompareTo(y.Identity));
            });
            if (dupIdentitiesExist)
            {
                int num = 0;
                while (account.TextMessagingSettings.DeliveryPoints.Count > num)
                {
                    account.TextMessagingSettings.DeliveryPoints[num].Identity = (byte)num;
                    num++;
                }
            }
            TextMessagingHelper.UpdateTextMessagingState(adRecipient.TextMessagingState, account.TextMessagingSettings.DeliveryPoints);
            storeDataProvider.Save(account);
            adSession.Save(adRecipient);
        }
        private static Uri GetEcpServiceUrl(ExchangePrincipal principal, ClientAccessType type)
        {
            bool enabled = VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled;

            if (principal.MailboxInfo.Location.ServerVersion >= Server.E15MinVersion && enabled)
            {
                return(TextMessagingHelper.GetE15MultitenancyEcpServiceUrl(principal, type));
            }
            ServiceTopology serviceTopology = enabled ? ServiceTopology.GetCurrentLegacyServiceTopology("f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\sms\\TextMessagingHelper.cs", "GetEcpServiceUrl", 371) : ServiceTopology.GetCurrentServiceTopology("f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\sms\\TextMessagingHelper.cs", "GetEcpServiceUrl", 371);

            if (serviceTopology != null)
            {
                IList <EcpService> list = serviceTopology.FindAll <EcpService>(principal, type, "f:\\15.00.1497\\sources\\dev\\data\\src\\ApplicationLogic\\sms\\TextMessagingHelper.cs", "GetEcpServiceUrl", 374);
                if (list != null && 0 < list.Count)
                {
                    return(list[0].Url);
                }
            }
            return(null);
        }
 public static Uri GetEcpUrl(ExchangePrincipal principal)
 {
     return(TextMessagingHelper.GetEcpServiceUrl(principal, ClientAccessType.External) ?? TextMessagingHelper.GetEcpServiceUrl(principal, ClientAccessType.Internal));
 }