Before you go and say.. "but the caller-ID is not new", well that is true, CallerID has been around and used in almost many countries, however, the problem is, although there are few caller-id system in existence, there seems to be no global standard for it, it seems that the implementation of caller-id is based on what the telephone company wants to deploy i.e. some telephone company uses the american caller-id system but with a little modification to it and some uses DTMF. apparently, there are many implementation of caller-id, the DTMF/FSK, the bellcore, and some other system I am not aware of. This topic will only cover the caller-id based on DTMF, I will not cover the in-depth technology of it, rather I will just simply talk about why majority of modems with caller-id capability being sold in some countries won't work even if you have your caller-id service activated.
It seems to me that most modem with CID being sold in the market nowadays are based on american caller-id system, basically, the american caller-id is a FSK , the caller's information is passed to the CID unit between the first and second ring using a Bell202 baud modulation (similar to a 1200 baud modem), there are 2 types of caller-id data, the SDMF (Single Data Message Format) which only contains the number of the caller and the extended format MDMF (Multiple Data Message Format) which contains an additional details such as the Name, Address, Date, etc. these information is passed to you by the telco and not the caller, hence; the need of CID subscription.
If the modem can understand the CID format, it will be decoded and display it on your screen/unit, If the modem cannot understand the format you get nothing at all, so, even if you own a cid capable modem and subscribed to a caller-id service with your telco, there is no guarantee that the caller-id will appear on your computer or your modem can understand it.
first of all, you must understand that in able to use your modem's CID, you must make sure your telco is using the same format of caller-id with your modem. case in point, I once lived in saudi arabia and they have a caller-id service which is based on DTMF, the main problem is, majority of modems with CID capability being sold there are all based on american CID, these two can't play together, and that is one of the main reason why callerid modems are useless there, another country that I know of, is the Philippines, the telephone company in the Philippines uses the DTMF system, However, the modems that are being sold there are all based on "american caller-id", so again, callerid in the philippines is useless for computer use.
I've also seen a modem that can detect a DTMF callerid (forgot the brand), however, this modem cannot work here due to the signaling of the callerid here, it cannot be understood by the modem, you see, even with a DTMF modem, there's still a big chance of, it may or may not work, however a standalone DTMF caller-id unit can work here 100%, it seems to me that the real issue is with the modem being sold here.
I really wanted my asterisk to support the caller-id function and with what I have here in terms of hardware and component availability, i.e. a modem that can only understand american caller-id system and telephone company that only supports DTMF, I almost give-up of not using it.
Anyways, with my desperation of having the CID for my asterisk, I ended up studying how the DTMF works here, the signaling, "when" and "how" the CID is transmitted and all other crap associated with it, it took me long hours just for that, I called the telephone company here to inquire about their caller-id and they offer no help as their "Technical People" doesn't seem to know anything about it, not only that, they took my inquiries with suspicions so I decided not to press with it.
With the help of a small circuit that I built and attached it to my PC's sound card, I manage to "listen" and "capture" the activity of my phone line when it receives a call, I managed to record the actual "Tone" that is being sent to my stand-alone caller-id and even the signaling, also, I cannibalize a stand-alone caller-id unit and study its circuity so i can have a better understanding of it.
I thought there are something special about the local telephone company's DTMF caller-id system here, as it turned out, it is a lot easier to understand it, but of course i would not be able to know that until I actually listen to the "Tone"
With all I have done. I came up with this.. remember the components I used here are based on what is "available" in the country, so don't cry foul about this project, don't tell me that I can use a mcu/mpu or any similar device as it is not widely available here, heck! even a logic gates ic's are very hard to find here, most of my project components are all came from a discarded boards.
The 3.579545 Mhz oscillator is very easy to find, as a matter of fact you can probably asks your local TV repair shop for it for free, this oscillator is normally used for T.V. mainly for NTSC sub-color
I use the HD14020BP 14-stage ripple counter to divide the 3.579545 mhz to provide me a clock rate of 56.6khz for my serial communication, I can, of course, use a 1.8432 MHz or 3.6864 MHz oscillator for it, but finding an oscillator that can generate a 1200,9600 baud rate is hard to find here, again, *this is what I can get here*, by using a ripple counter, you can easily get a 56.6khz from the 3.579545 Mhz that can at least match the 57600 baud rate, o.k. don't tell me bullshit about precision timing in here, I cannot stress enough that this is all I can get in here! so don't leave a comment telling me that "I should do this or that", as long as the whole things work and my PC can communicate with it I don't need a precise timing.
Actual photo of the 3.579545 MHz
I also use the 74LS165N Shift Register Parallel-In/Serial-out to convert the KT3170 output into its ASCII value, (you could also use 74LS166) I could easily done this with a PIC but due to lack of availability of PIC here, I must do the conversion with a logic ic, it took me a while to figure out the right binary format of the 74LS165 to generate the right ASCII value.
The transformer and the capacitor also came from an old modem and it is there to isolate the circuit from the phone line for added protection.
Now, you would ask why do I need the caller-ID for? well, there is so much you can do with it especially if you are into developing a customer service software, and I think because of different caller-id system used in different countries and the available modem that are being sold in those countries that can actually work with the telcos's callerid service, there's a huge mismatch between the modem and caller-id service, therefore there are very few software that deals with caller-id system.
On my next project, I will be building a DTMF to FSK circuit for a regular modem, I am in the process of collecting all the component and other relevant information for it. basically the circuit is connected in-line with the phone line going to the modem's telephone port, the circuit will listen to the DTMF signal and converts it into FSK that the modem can understand, that includes the format of the data SDMF and MDMF, reverse polarity for signaling start and the modulation, I might use a different approach with this project, perhaps the use of mcu's for conversion purpose.
anyways, my first prototype caller-id is now attached to my asterisk and is now capable of caller-id, all I needed to do is play with the asterisk scripting/programming and I should be on my way having a better asterisk telephony experience.