tags:

views:

46

answers:

3

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.

+11  A: 

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

shrikant.soni
+1  A: 

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.

Michał Niklas
+2  A: 

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.

sipwiz