Example #1
0
        public int CompareTo(object obj)
        {
            sCallExtensionReference cer = (sCallExtensionReference)obj;

            if (cer.Context == Context)
            {
                return(Extension.CompareTo(cer.Extension));
            }
            return(Context.CompareTo(cer.Context));
        }
Example #2
0
 public TransferToCallExtension(sCallExtensionReference destination)
 {
     _destination = destination;
 }
 protected void UpdateVacationRoute(string context, string extension, DateTime originalStartDate, DateTime startDate, DateTime endDate, bool endWithVoicemail, sCallExtensionReference callExtension)
 {
     lock (_lock)
     {
         Hashtable ht = StoredConfiguration;
         ArrayList cont = new ArrayList();
         if (ht.ContainsKey(context))
         {
             cont = (ArrayList)ht[context];
             ht.Remove(context);
         }
         Hashtable vcr;
         for (int x = 0; x < cont.Count; x++)
         {
             vcr = (Hashtable)cont[x];
             if (((string)vcr[_OWNING_EXTENSION_FIELD_ID] == extension)
                 && (((DateTime)vcr[_OWNING_EXTENSION_FIELD_ID]).Ticks == originalStartDate.Ticks))
             {
                 cont.RemoveAt(x);
                 break;
             }
         }
         vcr = new Hashtable();
         vcr.Add(_OWNING_EXTENSION_FIELD_ID, extension);
         vcr.Add(_START_DATE_FIELD_ID, startDate);
         vcr.Add(_END_DATE_FIELD_ID, endDate);
         vcr.Add(_END_WITH_VM_FIELD_ID, endWithVoicemail);
         vcr.Add(_TYPE_FIELD_ID, VacationRouteRedirectTypes.TransferToExtension);
         vcr.Add(_CALL_EXTENSION_FIELD_ID, extension);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }
 public void UpdateTimedRoute(string context, string originalName, string name, string condition, bool performOnFail, sCallTime start, sCallTime? end,
     sCallExtensionReference callExtension)
 {
     lock (_lock)
     {
         Hashtable ht = StoredConfiguration;
         ArrayList cont = new ArrayList();
         if (ht.ContainsKey(context))
         {
             cont = (ArrayList)ht[context];
             ht.Remove(context);
         }
         for (int x = 0; x < cont.Count; x++)
         {
             Hashtable ext = (Hashtable)cont[x];
             if (ext[_NAME_FIELD_ID].ToString() == originalName)
             {
                 cont.RemoveAt(x);
                 break;
             }
         }
         Hashtable pln = new Hashtable();
         pln.Add(_NAME_FIELD_ID, name);
         pln.Add(_CONDITION_FIELD_ID, condition);
         pln.Add(_PERFORM_ON_FAIL_FIElD_ID, performOnFail);
         pln.Add(_START_FIELD_ID, start.ToString());
         if (end.HasValue)
             pln.Add(_END_FIELD_ID, end.Value.ToString());
         pln.Add(_TYPE_FIELD_ID, VacationRouteRedirectTypes.TransferToExtension);
         pln.Add(_CALL_EXTENSION_FIELD_ID, callExtension.ToString());
         cont.Add(pln);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }
 protected void AddVacationRoute(string context, string extension, DateTime startDate, DateTime endDate, bool endWithVoicemail, sCallExtensionReference callExtension)
 {
     lock (_lock)
     {
         Hashtable ht = StoredConfiguration;
         ArrayList cont = new ArrayList();
         if (ht.ContainsKey(context))
         {
             cont = (ArrayList)ht[context];
             ht.Remove(context);
         }
         Hashtable vcr = new Hashtable();
         vcr.Add(_OWNING_EXTENSION_FIELD_ID, extension);
         vcr.Add(_START_DATE_FIELD_ID, startDate);
         vcr.Add(_END_DATE_FIELD_ID, endDate);
         vcr.Add(_END_WITH_VM_FIELD_ID, endWithVoicemail);
         vcr.Add(_TYPE_FIELD_ID, VacationRouteRedirectTypes.TransferToExtension);
         vcr.Add(_CALL_EXTENSION_FIELD_ID, extension);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }