System information

After the alteration to your database and dialplan, you can place a call and then look
at your CDRs. You should see something like the following:
+--------------+----------+---------+------------+
| src | duration | billsec | route_rate |
+--------------+----------+---------+------------+
| 0000FFFF0008 | 37 | 30 | 0.01 |
+--------------+----------+---------+------------+
You now have enough information to calculate how much the call should have cost
you, which enables you to either bill customers or check your records against what the
phone company is sending you, so you can do monthly auditing of your phone bills.
Additional Configuration Options for cdr_adaptive_odbc.conf
Some extra configuration options exist in the cdr_adaptive_odbc.conf file that may be
useful. The first is that you can define multiple databases or tables to store information
into, so if you have multiple databases that need the same information, you can simply
define them in res_odbc.conf, create tables in the databases, and then refer to them in
separate sections of the configuration:
[mysql_connection]
connection=asterisk_mysql
table=cdr
[mssql_connection]
connection=production_mssql
table=call_records
If you specify multiple sections using the same connection and table,
you will get duplicate records.
Beyond just configuring multiple connections and tables (which of course may or may
not contain the same information; the CDR module we’re using is adaptive to situations
like that), we can define aliases for the built-in variables, such as accountcode, src, dst,
billsec, etc.
If we were to add aliases for column names for our MS SQL connection, we might alter
our connection definition like so:
[mssql_connection]
connection=production_mssql
table=call_records
alias src => Source
alias dst => Destination
alias accountcode => AccountCode
alias billsec => BillableTime
Storing Call Detail Records (CDRs) | 377