将 CDR 集成到基于 Asterisk 的应用程序的最佳架构是什么

发布于 2024-09-29 00:39:39 字数 1433 浏览 10 评论 0原文

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

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

发布评论

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

评论(3

甜柠檬 2024-10-06 00:39:39

最好的架构是使用分布式节点(服务器),即 PBX、Web 服务器和服务器。不同节点的数据库服务器。每次通话后,PBX 都会填充您的 CDR 表(必须位于数据库服务器中),您可以从您的 Web 服务器获取这些记录以进行报告和报告。计费目的。

不建议使用 Cron 同步数据库表,因为它会消耗系统资源和数据。带宽也是如此(因为这个 cron 每次都会运行,耗尽系统资源并且与 Db 同步将导致带宽使用)
因此,使用上面定义的架构,您可以节省运行 cron 时使用的系统资源

其次,如果您将 CDR 放置在与 PBX 相同的节点中,它将由于 cron 而节省系统资源,但用于报告和报告。计费你必须从这个节点获取数据,所以你不能节省带宽,这个模式有一个主要缺点,因为目前你正在谈论 100 个并发调用,如果你有 1000 个或更多呢?

在这种情况下,您必须使用 PBX 集群,在这种情况下,您将需要一个由 PBX 集群同步的集中式数据库服务器。

因此,在所有方面,我建议的架构都将完全满足您的需求。
正如问题中所述,您只需要 100 个并发调用,您可以使用单个节点进行数据库和存储。 Web 服务器,而 PBx 在其他节点

The best architecture would be to use distributed nodes(Server) i.e. PBX,web server & DB server in different nodes. PBX will populate your CDR table(this must be in a DB server) after every call, you can fetch these records from your web server for your reporting & billing purpose.

Using Cron to Sync DB table is not recommended as it will eat up the system resources & Bandwidth too (as this cron will run each time eating up the system resource & syncing with Db will cause bandwidth usage)
So using above defined architecture you can save system resources that will be used in running cron

Secondly if you place CDR in same node as PBX it will save system resource due to cron but for reporting & billing you have to fetch data from this node so you cant save Bandwidth, this schema has a major drawback, as currently you are talking about 100 calls concurrently what about if you had 1000 or more ??

In this case you have to definitely use PBX clustering in that case you will need a centralized DB server that will be synced by your PBX clusters.

So in all aspects my suggested architecture would perfectly suite your need.
As it is stated in the question that you need only 100s of concurrent calls you can use a single node for DB & Web server while PBx in other node

硪扪都還晓 2024-10-06 00:39:39

使用单独的数据库服务器来存储 CDR 是正确的选择,除了爱好 Asterisk 实现之外。 Asterisk 可以轻松为您的 CDR 选择目标数据库,并具有多种不同的数据库选项:MySQL、Postgresql。 MSSQL 等。Asterisk CDR 实现仅使用单个表,因此它实际上是它与数据库服务器之间的非常简单的集成。

需要非常注意的一件事是,如果您的数据库服务器或它与 Asterisk 服务器之间的连接出现问题,它将影响您的呼叫处理。如果出现问题,Asterisk 将在不断尝试连接到数据库以写入 CDR 时阻塞。在执行此操作时,它不会处理任何其他调用。可以说,这是理想的行为,因为 CDR 对于计费至关重要,而无法记录它们意味着任何呼叫最终都可能是免费的。作为备份,您还可以将 CDR 记录设置为 Asterisk 服务器上的 .csv 文件,作为一种安全带和大括号的方法。

Using a separate database server to store your CDR's is the correct option for anything but a hobby Asterisk implementation. Asterisk makes it easy to select a destination database for your CDR's and has a myriad of different database options: MySQL, Postgresql. MSSQL etc. The Asterisk CDR implementation only uses a single table so it's actually a very simple integration between it and your database server.

One thing to be VERY aware of is that if your database server or the connection between it and your Asterisk server has problems it WILL impact your call processing. If there's a problem Asterisk will block while it keeps trying to connect to the database to write the CDR's. While it's doing that it won't process any other calls. Arguably this is desired behaviour as CDR's are critical for billing and not being able to log them means any calls would potentially end up being free. As a backup you can also set up CDR logging to a .csv file on the Asterisk server as a belt and braces approach.

稀香 2024-10-06 00:39:39

我认为如果你可以直接从 Asterisk 连接到数据库,那么你应该使用它。我在一些 Asterisk 安装(包括一个相当大的呼叫中心)上看到过它,而且效果很好。

我使用的另一个选项是,Asterisk 到数据库没有直接连接,但有到其他服务的 HTTPS 连接,或者计费表结构与 Asterisk 表不兼容,可以使用 CSV CDR 文件。此类文件每隔几分钟发送到 CRM 系统。我使用 cron 和小 Python 脚本。这样我就可以轻松适应 CRM 计费系统使用的 CSV 格式。

I think that if you can connect directly from Asterisk to database than you should use it. I have seen it on some Asterisk installations (including one quite big call center) and it worked well.

The other option I use where there is no direct connection from Asterisk to database, but there is HTTPS connection to other service, or where billing table structure is not compatible to Asterisk tables it to use CSV CDR files. Such file is send every few minutes to CRM system. I use cron and little Python script. This way I can easily adapt to CSV format used by CRM billing system.

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