Esempio n. 1
0
 private void OnNewCall(object sender, TapiCallNotificationEventArgs e)
 {
     if (e.Call.Privilege == CALL_PRIVILEGE.CP_OWNER)
     {
         lbCalls.Items.Add(e.Call);
     }
 }
Esempio n. 2
0
        private void OnNewCall(object sender, TapiCallNotificationEventArgs e)
        {
            TCall thisCall = e.Call;

            if (thisCall.Privilege == CALL_PRIVILEGE.CP_OWNER)
            {
                if (activeCall != null)
                {
                    thisCall.Disconnect(DISCONNECT_CODE.DC_REJECTED);
                }
                else
                {
                    activeCall = thisCall;
                }
            }
        }
Esempio n. 3
0
File: mf2040.cs Progetto: uvigii/cls
        private void OnNewCall(object sender, TapiCallNotificationEventArgs e)
        {
            if (e.Call.Privilege == CALL_PRIVILEGE.CP_OWNER)
            {
                //lbCalls.Items.Add(e.Call);
                lbRing.Text = e.Call.get_CallInfo(CALLINFO_STRING.CIS_CALLERIDNUMBER);
            }
            lbRing.BackColor = Color.FromArgb(0, 255, 0);
            this.BackColor   = Color.FromArgb(0, 255, 0);
            this.LogWrite(sURL + lbRing.Text);
            if (lbRing.Text != "")
            {
                try
                {
                    // Create a new 'HttpWebRequest' Object to the mentioned URL.
                    System.Net.HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(sURL + lbRing.Text);
                    myHttpWebRequest.Timeout          = 10000;
                    myHttpWebRequest.ReadWriteTimeout = 10000;
                    myHttpWebRequest.KeepAlive        = false;
                    myHttpWebRequest.ProtocolVersion  = HttpVersion.Version11;
                    myHttpWebRequest.Method           = "GET";
                    System.Net.HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
                    myHttpWebResponse.Close();

                    myHttpWebResponse = null;
                    myHttpWebRequest  = null;
                    //System.Net.WebRequest req = System.Net.WebRequest.Create(sURL + lbRing.Text);
                    //System.Net.WebResponse resp = req.GetResponse();
                }
                catch (Exception err)
                {
                    lbRing.BackColor = Color.FromArgb(255, 0, 0);
                    this.BackColor   = Color.FromArgb(255, 0, 0);
                    tbLog.Text       = err.ToString();
                    this.LogWrite(err.ToString());
                }
            }
            else
            {
                this.LogWrite("No number ?!");
            }
        }
Esempio n. 4
0
        private void OnNewCall(object sender, TapiCallNotificationEventArgs e)
        {
            TCall newCall = e.Call;

            // If we are the owner of the call..
            if (newCall.Privilege == CALL_PRIVILEGE.CP_OWNER)
            {
                if (currCall != newCall)
                {
                    try
                    {
                        newCall.Disconnect(DISCONNECT_CODE.DC_REJECTED);
                    }
                    catch (TapiException ex)
                    {
                        toolStripStatusLabel1.Text = ex.Message;
                    }
                }
                else
                {
                    toolStripStatusLabel1.Text = "Call " + newCall.ToString();
                }
            }
        }