Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:20:35+00:00 2026-06-05T01:20:35+00:00

I have a program that gets the incoming number, date and time. I want

  • 0

I have a program that gets the incoming number, date and time. I want to check however if the person who is ringing me has put the phone down, how can I do this?

Below is the code which I currently have:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;

namespace CallerID
{
    public partial class CallerID : Form
    {
        int timesTicked = 0;
        Point defaultLocation = new Point();
        Point newLocation = new Point();
        public CallerID()
        {
            InitializeComponent();
            port.Open();
            SetModem(); // SetModem(); originally went after WatchModem();
            WatchModem();
            //SetModem();
            telephoneTimer.Interval = 16;
            telephoneTimer.Tick += new EventHandler(telephoneTimer_Tick);
            defaultLocation = pictureBox1.Location;
            newLocation = pictureBox1.Location;

        }

        void telephoneTimer_Tick(object sender, EventArgs e)
        {
            if (timesTicked <= 2)
                newLocation.X++;
            if (timesTicked >= 4)
                newLocation.X--;
            if (timesTicked == 6)
            {
                timesTicked = 0;
                pictureBox1.Location = defaultLocation;
                newLocation = defaultLocation;
            }
            pictureBox1.Location = newLocation;
            timesTicked++;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            WatchModem();
        }

        private SerialPort port = new SerialPort("COM3");
        string CallName;
        string CallNumber;
        string ReadData;

        private void SetModem()
        {
            port.WriteLine("AT+VCID=1\n");
            //port.WriteLine("AT+VCID=1");
            port.RtsEnable = true;
        }

        private void WatchModem()
        {
            port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
        }

        public delegate void SetCallerIdText();

        private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            ReadData = port.ReadExisting();
            //Add code to split up/decode the incoming data
            //if (lblCallerIDTitle.InvokeRequired)
            if (ReadData.Contains("NMBR"))
            {
                lblData.Invoke(new SetCallerIdText(() => lblData.Text = ReadData));
            }
            //else
            //    lblCallerIDTitle.Text = ReadData;
        }

        private void lblData_TextChanged(object sender, EventArgs e)
        {
            telephoneTimer.Start();
            button1.Visible = true;
        }
    }
}

Please ignore the Timer Code as that is just for animation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:20:37+00:00Added an answer on June 5, 2026 at 1:20 am

    Have you tried the PinChanged event? Normally Carrier Detect will go low when the remote end disconnects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of
I have to write program that gets a number n from the user, and
I have a program that gets a string from a method. I want to
I have made a program that gets some strings in input from the user
I have a Java program that is supplied a directory name, gets a list
I have program that I want to test on clean Windows installation. For now
I have a program that accepts a number that represents an array index and
I have an program that gets installed via an msi. The msi was built
I have a batch-file program that gets called from another batch-file so I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.