Example #1
0
 public void AddTimedRoute(string context, 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);
         }
         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;
     }
 }
Example #2
0
 public void UpdateTimedRoute(string context, string originalName, string name, string condition, bool performOnFail, sCallTime start, sCallTime?end,
                              sDomainExtensionPair extensionNumber)
 {
     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.PhoneExtension);
         pln.Add(_EXTENSION_FIELD_ID, extensionNumber.ToString());
         cont.Add(pln);
         ht.Add(context, cont);
         StoredConfiguration = ht;
     }
 }
Example #3
0
 public void AddTimedRoute(string context, 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);
         }
         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;
     }
 }