与 *nix 的电话系统接口

发布于 2024-07-04 09:36:45 字数 291 浏览 8 评论 0原文

有谁知道 *nix 中的 C/C++ 应用程序与电话系统(例如 Cisco CCM)交互的“标准”方式? 我过去曾使用过 MS TAPI,但这仅限于 Windows,并且不想走 jTAPI (Java) 路线,从表面上看,这似乎是唯一的选择。

我想监控电话系统以进行记录(这样我就知道用户何时拨打电话、接听电话等)。 TAPI 擅长这类事情,但我不能成为第一个在没有 Windows 服务器的情况下想做类似事情的人。

请注意,我需要与现有的 PABX 系统集成 - 特别是 Cisco CCM 和 Nortel BCM。

Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it.

I want to monitor the phone system for logging purposes (so I know when users have made calls, received calls, etc.). TAPI is good at this sort of thing but I can't be the first person who wants to do something similar without having a Windows server.

Note that I need to integrate with existing PABX systems - notably Cisco CCM and Nortel BCM.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鹿港巷口少年归 2024-07-11 09:36:45

这是对 SMDR 的另一次投票。 我见过的电话系统都提供通过电话盒上的串行端口进行 SMDR 记录的选项。 只需从串行端口捕获文本并根据需要对其进行解析即可。

我编写了一个服务器进程,用于捕获 SMDR 输出、解析它并将结果保存在数据库中,我们的其他应用程序可以使用该数据库来查看每个电话呼叫的分机号、电话号码、时间和长度。

Here's another vote for SMDR. The telephony systems I've seen all offer the option of SMDR logging through a serial port on the phone box. Just capture the text from the serial port and parse it as needed.

I wrote a server process that captures the SMDR output, parses it and saves the result in a database that our other applications can use to see the extension, phone number, time and length of each phone call.

不打扰别人 2024-07-11 09:36:45

这是一个老问题,但仍然出现在搜索结果中,所以我想我应该在这里发布我的解决方案:

我创建了一个小的 bash 脚本,通过 telnet 连接到 Panasonic KX PBX,安排它使用 crontab 运行code>,并编写了我的应用程序代码来获取日志文件并解析它们。

这是我的 bash 脚本:

#!/bin/sh

HOST="192.168.0.200"
PORT="2300"
USER="SMDR"
PASS="PCCSMDR"

FILE=/var/smdr/smdr-`date +%F`.log
TS=`date +"%F %T"`

echo "### ${TS}" >> $FILE

(
  echo open $HOST $PORT
  sleep 2
  echo $USER
  sleep 2
  echo $PASS
  sleep 150
  echo "quit"
) | telnet | tee -a $FILE

This is an old question but still shows up in search results so I figured I'd post my solution here:

I created a small bash script that connects to the Panasonic KX PBX via telnet, scheduled it to run with crontab, and wrote my application code to grab the log files and parse them.

Here's my bash script:

#!/bin/sh

HOST="192.168.0.200"
PORT="2300"
USER="SMDR"
PASS="PCCSMDR"

FILE=/var/smdr/smdr-`date +%F`.log
TS=`date +"%F %T"`

echo "### ${TS}" >> $FILE

(
  echo open $HOST $PORT
  sleep 2
  echo $USER
  sleep 2
  echo $PASS
  sleep 150
  echo "quit"
) | telnet | tee -a $FILE
<逆流佳人身旁 2024-07-11 09:36:45

我有使用两种电话标准 TAPI 和 CSTA 的经验,据我所知,供应商(例如 Cisco、Nortel、NEC)之间没有关于标准 API 的此类协议。

我建议您查看您所使用的 PBX 平台上的 SMDR(电台消息详细记录)的可用性假设不需要呼叫/设备控制。 这将允许您以文本流的形式访问 PBX 活动,并且您可以解析数据以进行进一步操作以满足您的目的。

PBX 供应商之间的格式很可能会有所不同,但希望可以将其抽象化,以便核心应用程序功能可以重用。

这可能是一个更便携的选项,同样假设不需要呼叫/设备控制,因为您不依赖于供应商在您选择的平台上提供 CTI 连接。

I have experience with two telephony standards TAPI, and CSTA, as far as I know there is no such agreement between vendors (e.g. Cisco, Nortel, NEC) regarding THE standard API.

I would recommend looking at the availability of SMDR (Station Messaging Detail Recording) on the PBX platforms you are targeting, assuming that no call/device control is required. This will allow you to access the PBX activity as a text stream and you can parse the data for further manipulations to suit your purpose.

Most likely the format between the PBX vendors will be different but hopefully this could be abstracted away so that the core application functionality is re-usable.

This is likely to be a more portable option, again assuming no call/device control is required, as you are not relying on the vendor providing CTI connectivity on your platform of choice.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文