Asterisk CDR database?  schema?

Posted on 2009-02-09
Last Modified: 2013-12-21
Anyone know what database Asterisk uses for their CDR database?  Anyone know what the schema is?  Fields, etc.?
Question by:ttitus
    LVL 25

    Accepted Solution

    Usually you would find it going to a CSV file or MySQL database.  Here is the field list for the CSV,

    And there is an example of the table creating with a SQL command here,

    In general has tons of useful Asterisk info and is often a good place to start.

    Author Comment

    Excellent site!  Thanks!  One quick questions before I awared you the points:

    It looks like there is no SourceIP or DestinationIP for the phone IP that was used in the call -- is this true, or is this in a different table?

    From how the table is formatted, it looks like it only records external to internal calls -- not internal to internal calls, true?
    LVL 36

    Expert Comment

    There is no IP information recorded and there is also no separate table.
    All attempted calls are logged regardless of the source or destination.

    Author Comment

    So there's no ability to track which phone's IP address connected to which gateway for a call?
    LVL 36

    Assisted Solution

    If its an unauthenticated incoming call then the IP address will normally be recorded in the channel name which is in the call records.
    If its authenticated then only the authenticated user name is mentioned.  You will have to look up the ${CHANNEL} variable to find the username and then query the built in asterisk database unser SIP/Registry/username to pull out the IP address and put that into the custom accountcode or user field.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    There are no good configuration guides for HP-H3C router to LYNC on the web. :( Big statement, but we havent been able to find one yet. We did find the following document useful, but the information was not enough to use H3C router for use as a L…
    As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    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…

    754 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