how to read cdr records from freepbx installation by

Posted on 2011-05-03
Last Modified: 2012-05-11
Hi, i want to read cdr records from a freepbx installation. Ho to connect with the mysql database on the freepbx box
which connection string ...
which table to i need to use

what fields are on that table?


Question by:aatjan
    LVL 25

    Accepted Solution

    First you need to install the MySQL client on your the machine you will run your code from.

    The connection string is similar to a mssql connection string...

    Dim asteriskserveripaddress As String = ""
        Dim asteriskservermysqllogin As String = "root"
        Dim asteriskservermysqlsecret As String = "secret"
        Dim asteriskserverdbname As String = "asteriskcdr"
    Public mysqlconnStr As String = "Database=asterisk;" & _
                            "Data Source=" & asteriskserveripaddress & ";" & _
                            "User Id=" & asteriskservermysqllogin & ";Password=" & asteriskservermysqlsecret

    1.accountcode: What account number to use: Asterisk billing account, (string, 20 characters)
    2.src: Caller*ID number (string, 80 characters)
    3.dst: Destination extension (string, 80 characters)
    4.dcontext: Destination context (string, 80 characters)
    5.clid: Caller*ID with text (80 characters) Channel used (80 characters)
    7.dstchannel: Destination channel if appropriate (80 characters)
    8.lastapp: Last application if appropriate (80 characters)
    9.lastdata: Last application data (arguments) (80 characters)
    10.start: Start of call (date/time)
    11.answer: Answer of call (date/time)
    12.end: End of call (date/time)
    13.duration: Total time in system, in seconds (integer), from dial to hangup
    14.billsec: Total time call is up, in seconds (integer), from answer to hangup
    15.disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY, FAILED (on some CDR backends, e.g. ODBC, these may be integers; note that more detailed info can be found in the dialplan variable $HANGUPCAUSE)
    16.amaflags: What flags to use: see amaflags: DOCUMENTATION, BILLING, IGNORE etc, specified on a per channel basis like accountcode.
    17.user field: A user-defined field, maximum 255 characters

    In some cases, uniqueid is appended:

    •uniqueid: Unique Channel Identifier (32 characters)
    LVL 25

    Expert Comment

    by:Ron M
    Imports MySql.Data.MySqlClient

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now