views:

184

answers:

3
+3  Q: 

Caller ID in Cocoa

I can't believe this has proven sooo ellusive to find even a single example of ANYWHERE (I have googled the CRAP out of this!) but can anyone show me how to do basic Caller ID detection in a Mac app? ...preferrably Cocoa but will be willing to go Carbon if I must? Now I'm not looking for a full-on telephony API example although again, I'll go that route if I have to, but I can't even find that! Found this all over the place on the Windows side of things, but can't find a damn thing on Mac!

Specifically, I have the Apple USB modem that says it supports Caller ID and I want my app to be able to know when a call comes in and whose calling. In the future I may add dialer capabilities, etc., but cart-before-the-horse. Caller ID is stop-one!

HELP!

A: 

Man, that is going old school. I haven't seen anything related to analog modems in five years. I know that back in the day, even the NextStep modem stuff was down in the BSD and written in C. I don't think there ever was Objective-C API for it all. Today, everything is volIP.

Asterisks looks like something you might be able to use.

TechZen
Ya... that's the problem. I've looked into getting caller ID from bluetooth devices from cell phones but to no avail. I've also looked into VOIP stuff but asides from Skype or another app, most VOIP hardware just converts the signals back to POTS lines so you can still use your regular phones, hence you're right back to te beginning.As I said in a reply to the 'modem' comment above, the end-game is I want somehow to get a caller ID notification. Don't really care how or over what method. Just need to get it. You can show me any solution, I'm all for it.
MarqueIV
I think it's going to be hard. People just aren't doing a lot of that kind of work anymore. I suggest you look for some Posix compatible Linux solutions and try to port them over. There's a lot of hardware hacking on the Linux side.
TechZen
+1  A: 

It's much harder than you'd think because there's no API to control the modem.

Asterisk referred by TechZen above is a good reference, but Asterisk has no driver for the USB modem you're trying to use. The folks over at sunrisetel started an effort to write a driver for Apple's USB modem but I'm not sure if they have not abandoned it in the meantime: see afelio

Quoting from Afelio's page:

A media server for the Motorola SM56 modem used by Apple in recent Macs and in the external Apple USB modem is now under development.

diciu
A: 

Are you able to talk to the modem with Hayes commands? Then I think you should be able to enable the caller id feature with

AT#CID=1

If you need a terminal program to talk to the modem with I can recommend minicom. I got it to compile for the mac just now with

LIBS=-liconv ./configure ; make ; sudo make install

I'm not sure how the caller id will be presented but I think using the terminal program you should be able to see it probably when the RING is outputed from the modem.

All new to this? Maybe this can be a start

Then back to Cocoa, how to speak to a modem? See this discussion

This page has a discussion about the caller id, interesting. Apparently the caller id and more is outputted after the first RING

epatel
IF I could get that far that would be great... but I haven't found any wasy way to even get to the COM ports to send the commands down. I'm working through the Apple sample that supposedly enumerates serial ports, but I can't get anything more than a generic response from querying the system what modems/ports are attached and the modem and it fails when I try to open the port anyway. If you know of any Mac code for talking to a USB modem, or even just a COM port, I'd love to see it! Would be a huuuge help!
MarqueIV
@MarqueIV This sample code should get you going http://developer.apple.com/mac/library/samplecode/SerialPortSample/ You should notice the AT commands defined early in the .c file
epatel