Extract phone number from callers programatically

Started by Magnum, December 06, 2010, 10:35:22 PM

Previous topic - Next topic

Magnum

I appreciate all the help over the years and the patience you have shown.

I was doing some thinking.

If I receive a fax, the number that sent the fax is available.

Is there a way to extract that number?

I don't have caller I.D., so it would be "cool beaners" to programatically do that.





Have a great day,
                         Andy

clive

I think the number is whatever is programmed into the fax machine, which could be pretty much anything the user wants to put in there. Typically it will be the in-bound fax machine, which in many circumstances is not the same number from practical reasons (PBX, mail-to-fax, corporate fax modem bank, fax modem in PC, networked copier/fax, etc).

From the modem's stand-point you could use the AT command set to talk to it, or have it respond as the connection is made. Not sure if there is a Windows API access to it, as I'm usually talking to the modems. But there probably is a method, and your access to it might depend if you have fax receiving software running, and whether you have to reimplement that, or if it will provide this to you, or put it in a log file, etc.

http://en.wikipedia.org/wiki/Hayes_command_set

http://www.activexperts.com/activcomport/at/hayes/#ATSETPART2

AT+FLID=" Set Local ID String
'm' is 20 characters numeric string, set by user, to be used in TSI or CSI frame.

+FCSI:'m' Report the called station ID response
Modem issues this after receiving the remote ID string.
It could be a random act of randomness. Those happen a lot as well.

Gunner

you probably have to intercept the fax call before the fax machine/software...  i think the info you want gets exchanged during the handshake
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

Magnum

Thanks for the info.

I think there is a way.

I once had a program where you could enter people's phone number and when
they called you, it would show their name on the screen.

I will investigate that and the modem commands.

Last time I messed with those commands was when the BBSes were going strong.

Have a great day,
                         Andy

redskull

If you have caller-id service on your line, you can get the number of any incoming call, before the handshake.  If you don't, then you can only get numbers of the fax callers, sent as part of the fax data after the handshake.  The former is sent by the phone company, the latter by the sending fax machine (and not always gaurenteed to be correct, just whatever the sender has programmed in).  CID can be got by AT commands.  I have no idea how modems send fax data, but i would guess it would be just raw data you would have to manually decode

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

Magnum

So far it looks like I would need caller I.D. phone service at a minimum. ($10/month)

I also may need a caller I.D. capable modem as well.

Have a great day,
                         Andy


clive

Quote from: Magnum on December 07, 2010, 05:56:16 PM
Last time I messed with those commands was when the BBSes were going strong.

That's when I first messed with AT commands, using an Intel 9600EX. These days I'm using them to send SMS or TCP data across the wireless-cellular networks. That and XMODEM and YMODEM for embedded firmware.

@Red, I'm pretty sure the modem just implements the fax handshaking, and chunks out the scan line data either directly or encapulated, to the waiting "WinFax" type application. The modulation techniques being used just map back-and-forth to the modem standards of the day for the data transport layer. Doing TCP over wireless modems can either be done in data mode (what you send to/from the serial port), or command mode (encapsulated with AT command/responses).

Now I strongly suspect that Windows has an API for receiving state/status messages/notifications from a modem/fax, just not sure it would "share" nicely with other applications. I also suspect you could sniff the serial port data too, but that's not a class of filter driver I've tinkered with. There are some free applications that do, most of the time I'm using that, RealTerm, or an oscilloscope to check the data and bit timing.
It could be a random act of randomness. Those happen a lot as well.

clive

Quote from: Magnum on December 07, 2010, 06:46:18 PM
So far it looks like I would need caller I.D. phone service at a minimum. ($10/month)

I also may need a caller I.D. capable modem as well.

I'm not even sure of the current cost/bundling of Caller ID. If you dump the land-line and move to cellular it's pretty much a given. In-bounding on Skype also shows the numbers. I certainly like to be able to tell who's calling and if I want to answer, although the do-not-call list, and un-identified call blocking, has drastically curbed the amount of unwanted calls I get.

There used to be kits and magazine articles dealing with just making a caller id type box, which would pull the 2400 baud/hz signal off between the ring signal and pipe it to a serial connection. The device collecting the Caller ID, doesn't have to be the device answering the phone, it can just sit passively on the cable/line.

I'd think most current modems could do this too, as Silicon Labs has chip level solutions for doing this and connecting to the phone system, DTMF tones, etc.
It could be a random act of randomness. Those happen a lot as well.

redskull

Quote from: clive on December 07, 2010, 07:33:55 PM
I certainly like to be able to tell who's calling ...

I agree.  That way I can tell which girls are ignoring me without even answering the phone...  :'(

I haven't even seen any win32 specific modem stuff, let alone fax-modem stuff, just your basic COM port stuff.  A MASM program to print faxes would be an interesting side project, if all the modem specs could be scrounged up...

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

Magnum

Quote from: dedndave on December 07, 2010, 07:09:23 PM
this may be of interest

http://www.ms-news.net/f3612/how-do-i-get-caller-number-2046651.html

Thanks Dave.

lineGetCallInfo has been around quite a while too.

I could not find any assembly source code, but translating is good too.  :U

It looks doable.

It's on my list.

Have a great day,
                         Andy

Magnum

Quote from: redskull on December 07, 2010, 07:45:42 PM
Quote from: clive on December 07, 2010, 07:33:55 PM
I certainly like to be able to tell who's calling ...

I agree.  That way I can tell which girls are ignoring me without even answering the phone...  :'(

I haven't even seen any win32 specific modem stuff, let alone fax-modem stuff, just your basic COM port stuff.  A MASM program to print faxes would be an interesting side project, if all the modem specs could be scrounged up...

-r

Tapi is what I am exploring.

It's somewhat like the Hayes modem commands.

Plenty of power, but needs to be harnessed to achieve your goal.

Have a great day,
                         Andy

Magnum

Have a great day,
                         Andy