By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,405 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,405 IT Pros & Developers. It's quick & easy.

getting caller id info

P: n/a
Hi, I am developing an application where I need to read the caller id
from an incoming call. The only info (for now) I need is the caller id
info, so that I can display the propper caller info on screen if so
desired.
I was thinking on using asterisk (asterisk.org) for this with
appropriate 2FXO/2FXS card but I do not know if this is just overkill
(asterisk for this). Do you know of any other solution/way of getting
the caller id and passing it to PHP?.

tks.

Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
>Hi, I am developing an application where I need to read the caller id
from an incoming call. The only info (for now) I need is the caller id
info, so that I can display the propper caller info on screen if so
desired.
You need to give more information. What is the incoming call
supposed to be connected to? A modem? Voice? A voice-response
system? A quick click and hang-up?

You can, for instance, get caller-id from a modem connected to
a phone line through the serial port, then answer the call
and hang up. Somehow I don't think the last part is what you
intended.
I was thinking on using asterisk (asterisk.org) for this with
appropriate 2FXO/2FXS card but I do not know if this is just overkill
(asterisk for this). Do you know of any other solution/way of getting
the caller id and passing it to PHP?.


A 2FXO/2FXS card is likely much more expensive than 2 dirt-cheap
modems with caller-ID capability. And the modems don't HAVE to
answer the call to get the caller ID. On the other hand, if you
really wanted to use the caller ID to route the call, asterisk is
quite capable of doing this in a way you're unlikely to get with a
cheap modem. asterisk might even leave the info around for your
app to get hold of it (e.g. the guy currently called into Extension
203 has caller ID XXX XXX-XXXX).

Gordon L. Burditt
Jul 17 '05 #2

P: n/a

Gordon Burditt wrote:
Hi, I am developing an application where I need to read the caller idfrom an incoming call. The only info (for now) I need is the caller idinfo, so that I can display the propper caller info on screen if so
desired.
You need to give more information. What is the incoming call
supposed to be connected to? A modem? Voice? A voice-response
system? A quick click and hang-up?

Is a small restaurant order system with 2/3 incoming lines. Currently
everything is handled manually. The idea is to have a php app in the
intranet where orders will recorded. The operator would still use
normal telephone lines, but they would like as a plus to grab the
caller id info and pull customer info (using the caller id info from a
previous order.. if any) from the system. For this I would need
X-HARDWARE (this is what I want to figure out). Then X-HARDWARE would
pass the caller id-info to the php server (I need to fiture this out
too depending on what X-HARDWARE is). X-HARDWARE doesn't even have to
answer or do anything with the call just grab the caller id info and
pass it appropiately.
A 2FXO/2FXS card is likely much more expensive than 2 dirt-cheap
modems with caller-ID capability. And the modems don't HAVE to
answer the call to get the caller ID. On the other hand, if you
really wanted to use the caller ID to route the call, asterisk is
quite capable of doing this in a way you're unlikely to get with a
cheap modem. asterisk might even leave the info around for your
app to get hold of it (e.g. the guy currently called into Extension
203 has caller ID XXX XXX-XXXX).

Gordon L. Burditt


I know as a fact that asterisk can do this and more, but i was
wondering if there was an easier solution and cheaper hardware to
accomplish it.

tks again.

Jul 17 '05 #3

P: n/a
>> You need to give more information. What is the incoming call
supposed to be connected to? A modem? Voice? A voice-response
system? A quick click and hang-up?

Is a small restaurant order system with 2/3 incoming lines. Currently
everything is handled manually. The idea is to have a php app in the
intranet where orders will recorded. The operator would still use
normal telephone lines, but they would like as a plus to grab the
caller id info and pull customer info (using the caller id info from a
previous order.. if any) from the system. For this I would need
X-HARDWARE (this is what I want to figure out). Then X-HARDWARE would
pass the caller id-info to the php server (I need to fiture this out
too depending on what X-HARDWARE is). X-HARDWARE doesn't even have to
answer or do anything with the call just grab the caller id info and
pass it appropiately.
A 2FXO/2FXS card is likely much more expensive than 2 dirt-cheap
modems with caller-ID capability. And the modems don't HAVE to
answer the call to get the caller ID. On the other hand, if you
really wanted to use the caller ID to route the call, asterisk is
quite capable of doing this in a way you're unlikely to get with a
cheap modem. asterisk might even leave the info around for your
app to get hold of it (e.g. the guy currently called into Extension
203 has caller ID XXX XXX-XXXX).

Gordon L. Burditt


I know as a fact that asterisk can do this and more, but i was
wondering if there was an easier solution and cheaper hardware to
accomplish it.


A cheap standalone modem connected to each phone line and serial
ports can act as a caller-ID device. Have some task monitor the
serial line from each modem and record the caller ID somewhere (PHP
is not a good candidate for this since you want to monitor all the
time, and PHP has things like run time limits, although it's possible
to do this with standalone PHP). You want the caller ID captured
BEFORE the operator opens up the order web page. Sticking the
caller ID and a timestamp in a prearranged file location is one
approach.

PHP looks at that file (when someone opens the web page) and picks
up the caller ID, then does its thing with it.

You don't care about the speed of the modem at all, as the intent
is never to answer the phone. It does need to do caller-ID, but
not necessarily 56K. You might be able to pick up modems like
this on Ebay for $10 each plus shipping.

Gordon L. Burditt
Jul 17 '05 #4

P: n/a
tks for your quick reply!!
I am quite new to telephony stuff.... will the modem automatically
write the caller id info to the serial port??
If that's the case, then I just have to have a program to stand there
and look at the port.....

tks again,
ivan

Jul 17 '05 #5

P: n/a
>I am quite new to telephony stuff.... will the modem automatically
write the caller id info to the serial port??
It typically comes as part of the RING (spontaneous) response
generated when the phone rings. You may get the same caller-ID
data multiple times (one on each ring) if the phone isn't answered
immediately.
If that's the case, then I just have to have a program to stand there
and look at the port.....


It's almost that simple.

You may need to have the program set up the modem first, to tell
it you WANT "RING" responses, and ones with caller-ID in them, to
set up the serial port speed on the PC side, turn off auto-answer,
and such. This is a couple of AT commands once you set the speed.
(Sorry, I can't give you specific commands, and they are modem-dependent,
although there are probably only a few variations at most.) Then
just listen for info coming back.

You probably want your program to check that the modem is taking
the commands (you get an OK back) before assuming that it is working.

Gordon L. Burditt
Jul 17 '05 #6

P: n/a
Might just look into a modem with caller-id and the free software
called YAC
http://sunflowerhead.com/software/yac/
it's open source.. at the very least, it keeps a log file of incoming
calls that you could read.

Jul 17 '05 #7

P: n/a

BKDotCom wrote:
Might just look into a modem with caller-id and the free software
called YAC
http://sunflowerhead.com/software/yac/
it's open source.. at the very least, it keeps a log file of incoming
calls that you could read.


this looks very promising....I am going to try it.... TKS!!!

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.