Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is it possible to read bytes directly from modem or phone line without losing any info? If use SerialPort after ringing nothing happens on ReceiveData event.

I want to read caller id info directly from the line. My modem doesn't support Caller Id.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
320 views
Welcome To Ask or Share your Answers For Others

1 Answer

The correct way to detect the caller ID is to use the TAPI API.

You can find a C# TAPI library (called ITAPI3) here. http://www.julmar.com/tapi/

Check the April 04, 2006 blog entry for some notes on building programs linked against it on 64-bit Windows.

And here's sample code:

TTAPI tapi = new TTAPI();

tapi.TE_CALLINFOCHANGE += (sender, e) =>
{
    if (e.Cause == CALLINFOCHANGE_CAUSE.CIC_CALLERID)
    {
        Console.WriteLine(e.Call.get_CallInfo(CALLINFO_STRING.CIS_CALLERIDNUMBER));
        Console.WriteLine(e.Call.get_CallInfo(CALLINFO_STRING.CIS_CALLERIDNAME));
    }
}

tapi.Initialize();

// ...
// Keep the TAPI object in memory so it can listen for events
// ...

tapi.ShutDown();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...