CDR to MYSql Database

Discussion in '3CX Phone System - General' started by Yennick, Mar 6, 2018.

  1. Yennick

    Feb 15, 2018
    Likes Received:
    is it possible to add cdr call logs to a mysql database .
    i need to show these call logs on my webpage.But we cant put it in a local textfile since the company we do a project for can't do it that way or doesn't want it that way
  2. Saqqara

    Saqqara Active Member

    Mar 12, 2014
    Likes Received:
    Not by default - cdr option will only output to a text file.

    You would have to create a application to read the text file and import into mysql
  3. mariosM_3CX

    mariosM_3CX Support Team
    Staff Member 3CX Support

    Nov 1, 2017
    Likes Received:
    Hello @Yennick

    As per this , yes this is possible but not directly from the PBX.
    PBX will merely output the CDRs to a socket (or a file). Then it's up to you how will you read these and import them in the Database.

    I would go with creating a small passive server application, listening for connections from the PBX. (so PBX will act as a client - active CDR mode) Every time a call is done, PBX will connect to this application and write the CDR. All this server application will do is wait for connections from the PBX. Once a connection is established, read the CDR and insert into the Database.
    Now from your webpage read the DB and refresh as needed.

    Let me know if you need any clarification.