Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Caller ID in C#?

I want to use 56K modem for getting telephone number of who calls the home phone. Is there a way to achieve this with C# ?

like image 240
zer0w1dthspace Avatar asked Jul 29 '09 15:07

zer0w1dthspace


2 Answers

Not all modems support caller ID. And for those that do, the implementation varies between manufacturers.

There caller ID is passed through the serial data so you will have to use the TAPI library (or Windows' HyperTerminal to test it). The caller ID number typically appears between the first and the second ring.

You will need to issue a command to the modem to activate caller ID. Typically:

AT#CID=1 (or AT+VCID=1)

OK

Check the documentation for your modem.

When a call comes in, the modem will receive the a call string. Typically:

RING

Then the caller ID text will come in. If I am remembering correctly, it will be in the form:

NMBR=XXXXXXXXXX

[I am looking for a reference. I will post a link when I can find it]

UPDATE: Ah, found one. Check out this page for the commands and connection strings for for various modems:

How to Test a Modem for Caller ID Support

like image 126
Robert Cartaino Avatar answered Sep 17 '22 16:09

Robert Cartaino


It is possible, but there are some things about it you should note:

  • You still have to have caller ID supported by your carrier/provider. A basic POTS line won't include this information unless the carrier has done some extra work to add it. So you can't do this to avoid paying an extra caller ID fee.
  • It's not built into .Net. You'll have to call into the basic TAPI library. I've never worked with this library myself, so that's as much as I can tell you.
like image 38
Joel Coehoorn Avatar answered Sep 17 '22 16:09

Joel Coehoorn