Example #1
0
 public bool SetLineControl(LineControl lc)
 {
     object[] results = this.Invoke("SetLineControl", new object[] {
         lc
     });
     return((bool)(results[0]));
 }
Example #2
0
 /// <remarks/>
 public void SetLineControlAsync(LineControl lc, object userState)
 {
     if ((this.SetLineControlOperationCompleted == null))
     {
         this.SetLineControlOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLineControlOperationCompleted);
     }
     this.InvokeAsync("SetLineControl", new object[] {
         lc
     }, this.SetLineControlOperationCompleted, userState);
 }
Example #3
0
 /// <remarks/>
 public void SetLineControlAsync(LineControl lc)
 {
     this.SetLineControlAsync(lc, null);
 }
Example #4
0
 /// <remarks/>
 public System.IAsyncResult BeginSetLineControl(LineControl lc, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("SetLineControl", new object[] {
         lc
     }, callback, asyncState));
 }
Example #5
0
 private static bool FindLineControl(LineControl lc)
 {
     if (lc.directoryNumber == dnToFind)
     {
         return true;
     }
     {
         return false;
     }
 }
Example #6
0
 private LineControl GetLineControl(TapiAddress address)
 {
     LineControl lc = new LineControl();
     lc.directoryNumber = address.Address;
     lc.doNotDisturb = false;
     lc.forward = GetForward(address);
     lc.mwiOn = false;
     lc.monitored = "";
     if (address.Calls.Length > 0)
     {
         List<LineControlConnection> lcs = new List<LineControlConnection>();
         foreach (TapiCall tc in address.Calls)
         {
             if (tc.CallState != CallState.Idle && tc.CallState != CallState.Unknown)
             {
                 LineControlConnection lcc = new LineControlConnection();
                 lcc.callid = tc.Id.ToString();
                 if (tc.CallOrigin == CallOrigins.Outbound)
                 {
                     lcc.contact = tc.CalledId;
                 }
                 else
                 {
                     lcc.contact = tc.CallerId;
                 }
                 SetLineControlConnection(lcc, tc.CallState);
                 lcs.Add(lcc);
             }
         }
         lc.lineControlConnection = lcs.ToArray();
         if (address.Calls.Length > 1)
         {
             lc.status = Status.busy;
         }
         else
         {
             switch (address.Calls[0].CallState)
             {
                 case CallState.Dialing:
                     lc.status = Status.dialing;
                     break;
                 case CallState.Offering:
                     lc.status = Status.ringing;
                     break;
                 case CallState.Idle:
                     lc.status = Status.available;
                     break;
                 case CallState.Disconnected:
                     lc.status = Status.available;
                     break;
                 case CallState.None:
                     lc.status = Status.available;
                     break;
                 case CallState.Unknown:
                     lc.status = Status.available;
                     break;
                 case CallState.Accepted:
                     lc.status = Status.busy;
                     break;
                 case CallState.Busy:
                     lc.status = Status.busy;
                     break;
                 default:
                     lc.status = Status.busy;
                     break;
             }
         }
     }
     else
     {
         lc.status = Status.available;
     }
     return lc;
 }
Example #7
0
 private LineControl getLineControlFromPeerEntry(PeerEntryEvent pee)
 {
     log.Debug("Peer entry channel: " + pee.Channel + ", status:" + pee.Status);
     LineControl lc = null;
     lc = new LineControl();
     //lc.directoryNumber = pee.ChannelType + "/" + pee.ObjectName;
     lc.directoryNumber = pee.ObjectName;
     lc.doNotDisturb = false;
     lc.forward = "";
     lc.mwiOn = getMWI(pee.ObjectName);
     lc.lineControlConnection = null;
     switch (pee.Status)
     {
         case "UNKNOWN":
             lc.status = Status.inactive;
             break;
         default:
             //OK
             lc.status = Status.available;
             break;
     }
     linecontrols.Add(lc);
     getDND(lc.directoryNumber);
     getForward(lc.directoryNumber);
     return lc;
 }
Example #8
0
 private LineControl getLineControl(string dn)
 {
     LineControl lc = null;
     dnToFind = dn;
     log.Debug("Looking for LineControl: " + dn);
     lc = linecontrols.Find(FindLineControl);
     if (lc == null)
     {
         log.Debug("LineControl: " + dn + " not exists");
         lc = new LineControl();
         lc.directoryNumber = dn;
         lc.doNotDisturb = false;
         lc.forward = "";
         lc.mwiOn = false;
         lc.lineControlConnection = null;
     }
     return lc;
 }
Example #9
0
 void manager_LineRemoved(object sender, LineRemovedEventArgs e)
 {
     foreach (TapiAddress ad in e.Line.Addresses)
     {
         LineControl lc = new LineControl();
         lc.directoryNumber = ad.Address;
         lc.doNotDisturb = false;
         lc.forward = GetForward(ad);
         lc.mwiOn = false;
         lc.monitored = "";
         lc.status = Status.inactive;
         lc.lineControlConnection = null;
         ss.SetLineControl(lc);
     }
     
     log.Debug("Manager line removed: " + e.Line.ToString());
 }
Example #10
0
 /// <remarks/>
 public void SetLineControlAsync(LineControl lc, object userState) {
     if ((this.SetLineControlOperationCompleted == null)) {
         this.SetLineControlOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLineControlOperationCompleted);
     }
     this.InvokeAsync("SetLineControl", new object[] {
                 lc}, this.SetLineControlOperationCompleted, userState);
 }
Example #11
0
 /// <remarks/>
 public void SetLineControlAsync(LineControl lc) {
     this.SetLineControlAsync(lc, null);
 }
Example #12
0
 /// <remarks/>
 public System.IAsyncResult BeginSetLineControl(LineControl lc, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("SetLineControl", new object[] {
                 lc}, callback, asyncState);
 }
Example #13
0
 public bool SetLineControl(LineControl lc) {
     object[] results = this.Invoke("SetLineControl", new object[] {
                 lc});
     return ((bool)(results[0]));
 }