private string GetCallForwardingPilotNumber()
        {
            string        result = string.Empty;
            TelephonyInfo telephonyInfo;

            if (AirSyncUtils.GetTelephonyInfo(base.UMDialPlan, base.UMMailbox.SIPResourceIdentifier, out telephonyInfo))
            {
                result = telephonyInfo.VoicemailNumber.Number;
            }
            return(result);
        }
Ejemplo n.º 2
0
        private void SetAirSyncNumber(ADUser user)
        {
            UMMailboxPolicy ummailboxPolicy = this.ReadPolicyObject(user);
            UMDialPlan      dialPlan        = ummailboxPolicy.GetDialPlan();
            MultiValuedProperty <string> extensionsFromCollection = UMMailbox.GetExtensionsFromCollection(user.UMAddresses, ProxyAddressPrefix.ASUM, dialPlan.PhoneContext);
            Hashtable     hashtable = new Hashtable();
            List <string> list      = new List <string>();

            foreach (string key in extensionsFromCollection)
            {
                hashtable.Add(key, false);
            }
            foreach (string text in this.AirSyncNumbers)
            {
                if (hashtable.ContainsKey(text))
                {
                    hashtable[text] = true;
                }
                else
                {
                    list.Add(text);
                }
            }
            foreach (object obj in hashtable)
            {
                DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
                if (!(bool)dictionaryEntry.Value)
                {
                    TelephoneNumberProcessStatus status;
                    AirSyncUtils.RemoveAirSyncPhoneNumber(user, (string)dictionaryEntry.Key, out status);
                    ArgumentException ex = this.HandleResult(status, (string)dictionaryEntry.Key);
                    if (ex != null)
                    {
                        base.WriteError(ex, (ErrorCategory)1001, null);
                    }
                }
            }
            foreach (string text2 in list)
            {
                TelephoneNumberProcessStatus status2;
                AirSyncUtils.AddAirSyncPhoneNumber(user, text2, out status2);
                ArgumentException ex2 = this.HandleResult(status2, text2);
                if (ex2 != null)
                {
                    base.WriteError(ex2, (ErrorCategory)1001, null);
                }
            }
        }