Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the best architecture for CDR integration to a Asterisk based Application

Tags:

cdr

voip

asterisk

Iam developing a VOIP platform which would allow users to make 100s of calls concurrently using my service.

Asterisk stores all call detail records in the CDR table. I would like to know where is best place to keep this table for the best possible architecture of my system.

Should I keep it on the Asterisk Box and run a cron to sync it with the database server OR should I directly call the DB server by the Asterisk Box and log all data directly on the database remotely though Asterisk.

All feel that both the architectures have their own pros and cons. I would like the help of experts to suggest me which would be best possible path for long term scalability and sustainability.

like image 868
Sumit Ghosh Avatar asked Oct 26 '10 18:10

Sumit Ghosh


People also ask

What is Asterisk PBX used for?

You can use Asterisk to build communications applications, things like business phone systems (also known as IP PBXs), call distributors, VoIP gateways and conference bridges. Asterisk includes both low and high-level components that significantly simplify the process of building these complex applications.

Is Asterisk a SIP server?

The Asterisk PBX utilizes SIP Trunking allowing you to have a fully customized communication application. If you need a communication platform that can accommodate a changing system, Asterisk will fulfill you requirements. Implementing Asterisk is easier than ever.

What is Asterisk Call Manager?

The Asterisk Manager Interface (AMI) is a monitoring and management interface over TCP. With the manager interface, you can control the UCx to: originate calls, check mailbox status, monitor channels, queues and also execute commands.

Can I install Asterisk on Windows?

Just download and install the player from this link to get started. You'll need a Windows PC with at least a 500 MHz processor with 256MB of RAM and about 2 gigs of disk space for this project.


2 Answers

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

like image 60
Shrikant Soni Avatar answered Sep 28 '22 02:09

Shrikant Soni


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.

like image 38
sipsorcery Avatar answered Sep 28 '22 01:09

sipsorcery