具体来说,我有一个 Apple USB 调制解调器,它表示支持来电显示,我希望我的应用程序能够知道何时有电话打入以及是谁打来的。将来我可能会添加拨号器功能等,但本末倒置。来电显示一站式服务!
也就是说,我不敢相信这已经被证明是如此难以捉摸,甚至在任何地方都找不到一个例子(我已经用谷歌搜索了这个废话!)但是有人可以告诉我如何在Mac应用程序中进行基本的来电显示检测吗?我更喜欢可可,但如果必须的话我愿意选择碳。
现在,我并不是在寻找完整的电话 API 示例,尽管如果有必要的话,我会走这条路,但我什至找不到它!在 Windows 端到处都可以找到这个东西,但在 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!
That said, 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? I'd prefer 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!
发布评论
评论(4)
正如其他地方提到的,你可以(而且我已经)使用
screen /dev/tty .usbmodem00001
或类似的东西,可以直接从终端访问调制解调器、发送 AT 命令或查看 RING 和 CallerID(一旦通过 AT 或 NCID 启用)。他们还介绍了如上所述的 minicom 用法。
谷歌搜索
/dev/tty mac callerid
揭示了很多想法。至于编写软件,我想 NCID 要么会被证明是有用的(也有一个咆哮插件!),要么可以作为示例代码。请参阅Mac 安装说明,特别是在
使用调制解调器进行测试.这是扩展 NCID 启动的示例方法您自己的带有来电显示信息的程序/脚本。
As mentioned elsewhere you can (and I have) use
screen /dev/tty.usbmodem00001
or some such to access the modem directly from terminal, send AT commands or see RINGs and CallerID (once enabled via AT or NCID).They also walk through minicom usage as mentioned above.
Googling
/dev/tty mac callerid
reveals quite a few ideas.As to writing software, I imagine NCID will either prove useful (there's a growl plugin too!) or can serve as example code. See the Mac install instructions, specifically under
TEST USING A MODEM
. Here's an example way of extending NCID to launch your own program/script with CallerID info.伙计,那已经是老派了。五年来我没有看到任何与模拟调制解调器相关的东西。我知道,在过去,甚至 NextStep 调制解调器的东西也是在 BSD 中并用 C 编写的。我认为从来没有一个 Objective-C API 可以满足这一切。今天,一切都是 volIP。
Asterisks 看起来您可能可以使用。
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.
您可以使用
Hayes
命令与调制解调器通信吗?然后我认为您应该能够启用来电显示功能如果您需要终端程序与调制解调器对话我可以推荐
minicom
。我刚刚为 mac 编译了它,我不确定来电显示将如何显示,但我认为使用终端程序,您应该能够在输出
RING
时看到它来自调制解调器。这都是新的吗?也许这可以是开始
然后回到 Cocoa,如何与调制解调器通话?请参阅此讨论
此页面有一个关于来电显示的讨论,有趣。显然,主叫号码和更多内容是在第一个
RING
之后输出的Are you able to talk to the modem with
Hayes
commands? Then I think you should be able to enable the caller id feature withIf 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 withI'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
这比您想象的要困难得多,因为没有 API 来控制调制解调器。
上面 TechZen 提到的 Asterisk 是一个很好的参考,但是 Asterisk 没有您尝试使用的 USB 调制解调器的驱动程序。 sunrisetel 的人们开始努力为 Apple 的 USB 调制解调器编写驱动程序,但我不确定他们是否在此期间没有放弃它:查看 afelio
引用 Afelio 的页面:
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: