public int CompareTo(object obj) { sDomainExtensionPair dep = (sDomainExtensionPair)obj; if (dep.Domain == Domain) { return(Extension.CompareTo(dep.Extension)); } return(Domain.CompareTo(dep.Domain)); }
public ScheduleTransfer(int seconds, sDomainExtensionPair extension, string dialPlan, string context) { _seconds = seconds; _extension = extension; _dialPlan = dialPlan; _context=context; }
public Deflect(sDomainExtensionPair extension, bool waitUntilDone) { _extension = extension; _waitUntilDone = waitUntilDone; }
public ConferenceSetAutoOutCall(sDomainExtensionPair extension) { _extension = extension; }
public Voicemail(string context, sDomainExtensionPair extension) { _context=context; _extension = extension; }
public BridgeToMultipleExtensions(sDomainExtensionPair[] extension,bool sequential, bool waitUntilDone) { _extension = extension; _sequential = sequential; _waitUntilDone = waitUntilDone; }
protected void UpdateVacationRoute(string context, string extension,DateTime originalStartDate, DateTime startDate, DateTime endDate, bool endWithVoicemail, sDomainExtensionPair bridgeExtension) { 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.PhoneExtension); vcr.Add(_BRIDGE_EXTENSION_FIELD_ID, extension); ht.Add(context, cont); StoredConfiguration = ht; } }
public AttendedTransfer(sDomainExtensionPair extension, bool waitUntilDone) { _extension = extension; _waitUntilDone = waitUntilDone; }
protected void UpdateIntercom(string context, string intercomExtension,string newIntercomExtension, bool oneWay, sDomainExtensionPair[] extensions) { lock (_lock) { Hashtable ht = StoredConfiguration; ArrayList tmp = new ArrayList(); if (ht.ContainsKey(context)) tmp = (ArrayList)ht[context]; int index = tmp.Count; Hashtable icom; for(int x=0;x<tmp.Count;x++) { icom = (Hashtable)tmp[x]; if ((string)icom[_EXTENSION_FIELD_NAME] == intercomExtension) { index = x; tmp.RemoveAt(x); break; } } icom = new Hashtable(); icom.Add(_EXTENSION_FIELD_NAME, newIntercomExtension); icom.Add(_ONE_WAY_FIELD_NAME, oneWay); ArrayList map = new ArrayList(); foreach (sDomainExtensionPair dep in extensions) map.Add(dep.Extension + "@" + dep.Domain); icom.Add(_MAPS_FIELD_NAME, map); tmp.Insert(index, icom); ht.Remove(context); if (tmp.Count > 0) ht.Add(context, tmp); StoredConfiguration = ht; } }
public new bool Update() { bool ret = true; try { base.Update(); sDomainExtensionPair[] extensions = new sDomainExtensionPair[Extensions.Length]; for (int x = 0; x < Extensions.Length; x++) extensions[x] = new sDomainExtensionPair(Extensions[x].Number, Extensions[x].Domain.Name); ConfigurationController.RegisterChangeCall( typeof(IntercomPlan), new ADialPlan.sUpdateConfigurationsCall( "UpdateIntercom", new NameValuePair[]{ new NameValuePair("context",Context.Name), new NameValuePair("intercomExtension",OriginalNumber), new NameValuePair("newIntercomExtension",Number), new NameValuePair("oneWay",OneWay), new NameValuePair("extensions",extensions) } ), new IEvent[]{ new GenericEvent("IntercomUpdated",new NameValuePair[]{ new NameValuePair("Number",Number), new NameValuePair("DomainName",Domain.Current.Name) })} ); } catch (Exception e) { Log.Error(e); EventController.TriggerEvent(new ErrorOccuredEvent(e)); ret = false; } return ret; }
protected void AddIntercom(string context, string intercomExtension, bool oneWay, sDomainExtensionPair[] extensions) { lock (_lock) { Hashtable ht = StoredConfiguration; ArrayList tmp = new ArrayList(); if (ht.ContainsKey(context)) tmp = (ArrayList)ht[context]; bool add = true; foreach (Hashtable icom in tmp) { if ((string)icom[_EXTENSION_FIELD_NAME] == intercomExtension) { add = false; break; } } if (add) { Hashtable icom = new Hashtable(); icom.Add(_EXTENSION_FIELD_NAME, intercomExtension); icom.Add(_ONE_WAY_FIELD_NAME, oneWay); ArrayList map = new ArrayList(); foreach (sDomainExtensionPair dep in extensions) map.Add(dep.Extension + "@" + dep.Domain); icom.Add(_MAPS_FIELD_NAME, map); tmp.Add(icom); } ht.Remove(context); if (tmp.Count > 0) ht.Add(context, tmp); StoredConfiguration = ht; } }
protected void UpdateHuntGroup(string context, string extension,string newExtension, bool sequential, sDomainExtensionPair[] extensions) { lock (_lock) { Hashtable ht = StoredConfiguration; ArrayList cont = new ArrayList(); if (ht.ContainsKey(context)) cont = (ArrayList)ht[context]; bool add = true; int index = cont.Count; for(int x=0;x<cont.Count;x++) { Hashtable hgroup = (Hashtable)cont[x]; if (hgroup[_EXTENSION_FIELD_ID].ToString() == extension) { cont.RemoveAt(x); index = x; break; } } if (!add) throw new Exception("Unable to add Hunt Group, 1 already exists in the context[" + context + "] for the number[" + extension + "]"); Hashtable hgrp = new Hashtable(); hgrp.Add(_EXTENSION_FIELD_ID, newExtension); hgrp.Add(_SEQUENTIAL_FIELD_ID, sequential); ArrayList exts = new ArrayList(); foreach (sDomainExtensionPair ext in extensions) exts.Add(ext.Extension + "@" + ext.Domain); hgrp.Add(_EXTENSIONS_FIELD_ID, exts); cont.Insert(index, hgrp); ht.Remove(context); ht.Add(context, cont); StoredConfiguration = ht; } }
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; } }
public Presence(bool set,sDomainExtensionPair extension,string presenceName,string message,bool waitUntilDone){ _set = set; _extension = extension; _presenceName = presenceName; _message = message; _waitUntilDone = waitUntilDone; }
public SetUser(sDomainExtensionPair extension, string prefix, bool waitUntilDone) { _extension = extension; _prefix = prefix; _waitUntilDone = waitUntilDone; }
public Redirect(sDomainExtensionPair[] extension, bool waitUntilDone) { _extension = extension; _waitUntilDone = waitUntilDone; }
public BridgeToExtension(sDomainExtensionPair extension, bool waitUntilDone) { _extension = extension; _waitUntilDone = waitUntilDone; }
public new bool Save() { bool ret = true; try { base.Save(); sDomainExtensionPair[] extensions = new sDomainExtensionPair[Extensions.Length]; for (int x = 0; x < Extensions.Length; x++) extensions[x] = new sDomainExtensionPair(Extensions[x].Number, Extensions[x].Domain.Name); ConfigurationController.RegisterChangeCall( typeof(HuntGroupPlan), new ADialPlan.sUpdateConfigurationsCall( "AddHuntGroup", new NameValuePair[]{ new NameValuePair("context",Context.Current.Name), new NameValuePair("extension",Number), new NameValuePair("sequential",RingSequential), new NameValuePair("extensions",extensions) } ), new IEvent[]{ new GenericEvent("HuntGroupCreated", new NameValuePair[]{ new NameValuePair("Context",Context.Name), new NameValuePair("Number",Number) }) } ); } catch (Exception e) { Log.Error(e); EventController.TriggerEvent(new ErrorOccuredEvent(e)); ret = false; } return ret; }
protected void AddVacationRoute(string context, string extension, DateTime startDate, DateTime endDate, bool endWithVoicemail, sDomainExtensionPair bridgeExtension) { 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.PhoneExtension); vcr.Add(_BRIDGE_EXTENSION_FIELD_ID, extension); ht.Add(context, cont); StoredConfiguration = ht; } }