We help IT Professionals succeed at work.

Asterisk CDR database?  schema?

Tim Titus
Tim Titus asked
on
Medium Priority
2,638 Views
Last Modified: 2013-12-21
Anyone know what database Asterisk uses for their CDR database?  Anyone know what the schema is?  Fields, etc.?
Comment
Watch Question

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

http://www.voip-info.org/wiki/view/Asterisk+cdr+csv

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

http://www.voip-info.org/wiki-Asterisk+cdr+mysql

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
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?
CERTIFIED EXPERT

Commented:
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

Commented:
So there's no ability to track which phone's IP address connected to which gateway for a call?
CERTIFIED EXPERT
Commented:
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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.