Ejemplo n.º 1
0
        protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject)
        {
            if (dataObject == null)
            {
                return(null);
            }
            ADUser aduser = (ADUser)dataObject;

            if (null != aduser.MasterAccountSid)
            {
                aduser.LinkedMasterAccount = SecurityPrincipalIdParameter.GetFriendlyUserName(aduser.MasterAccountSid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
                aduser.ResetChangeTracking();
            }
            UMMailbox ummailbox = UMMailbox.FromDataObject(aduser);

            if (ummailbox.UMDialPlan != null)
            {
                UMDialPlan dialPlan = ummailbox.GetDialPlan();
                if (dialPlan != null && (dialPlan.URIType == UMUriType.E164 || dialPlan.URIType == UMUriType.SipName))
                {
                    ummailbox.SIPResourceIdentifier = UMMailbox.GetPrimaryExtension(ummailbox.EmailAddresses, ProxyAddressPrefix.UM);
                }
                if (dialPlan != null)
                {
                    ummailbox.PhoneNumber = ummailbox.GetEUMPhoneNumber(dialPlan);
                }
                ummailbox.AccessTelephoneNumbers       = dialPlan.AccessTelephoneNumbers;
                ummailbox.CallAnsweringRulesExtensions = new MultiValuedProperty <string>(Utils.GetExtensionsInDialPlanValidForPAA(dialPlan, aduser));
            }
            return(ummailbox);
        }
Ejemplo n.º 2
0
 public SetUMMailboxConfiguration(UMMailbox umMailbox) : base(umMailbox)
 {
     this.dialPlan            = base.UMMailbox.GetDialPlan();
     this.primaryExtension    = UMMailbox.GetPrimaryExtension(base.UMMailbox.EmailAddresses, ProxyAddressPrefix.UM);
     this.secondaryExtensions = new List <UMExtension>();
     foreach (ProxyAddress proxyAddress in base.UMMailbox.EmailAddresses)
     {
         string extension;
         string phoneContext;
         string dpName;
         if (!proxyAddress.IsPrimaryAddress && proxyAddress.Prefix == ProxyAddressPrefix.UM && UMMailbox.ExtractExtensionInformation(proxyAddress, out extension, out phoneContext, out dpName))
         {
             this.secondaryExtensions.Add(new UMExtension(extension, phoneContext, dpName));
         }
     }
 }