Esempio n. 1
0
        public int CompareTo(object obj)
        {
            sGatewayNumberPair gnp = (sGatewayNumberPair)obj;

            if (gnp.GatewayName == GatewayName)
            {
                return(Number.CompareTo(gnp.Number));
            }
            return(GatewayName.CompareTo(gnp.GatewayName));
        }
Esempio n. 2
0
 public BridgeOutGateway(sGatewayNumberPair gateway, bool waitUntilDone)
     : this(gateway.GatewayName, gateway.Number, waitUntilDone) { }
 protected void UpdateVacationRoute(string context, string extension, DateTime originalStartDate, DateTime startDate, DateTime endDate, bool endWithVoicemail, sGatewayNumberPair outGateway)
 {
     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.OutGateway);
         vcr.Add(_GATEWAY_NUMBER_FIELD_ID, outGateway);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }
 public void UpdateTimedRoute(string context,string originalName, string name, string condition, bool performOnFail, sCallTime start, sCallTime? end,
     sGatewayNumberPair gateway)
 {
     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.OutGateway);
         pln.Add(_GATEWAY_NUMBER_FIELD_ID, gateway.ToString());
         cont.Add(pln);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }
 protected void AddVacationRoute(string context, string extension, DateTime startDate, DateTime endDate, bool endWithVoicemail, sGatewayNumberPair outGateway)
 {
     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.OutGateway);
         vcr.Add(_GATEWAY_NUMBER_FIELD_ID,outGateway);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }