Search code examples
voipasteriskcdr

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


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.


Solution

  • 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