Asterisk x A2Billing x CDR tables


#1

Hi all.

My A2Billing version is 1.6.0 (Hickory).

My Asterisk version is 1.4.26.2.

I have Asterisk logging CDR records correctly im my database into a table with the following structure:

±------------±-------------±-----±----±--------------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------------------±---------------+
| id | int(5) | NO | PRI | NULL | auto_increment |
| calldate | datetime | NO | | 0000-00-00 00:00:00 | |
| clid | varchar(80) | NO | | | |
| src | varchar(80) | NO | | | |
| dst | varchar(80) | NO | | | |
| dcontext | varchar(80) | NO | | | |
| channel | varchar(80) | NO | | | |
| dstchannel | varchar(80) | NO | | | |
| lastapp | varchar(80) | NO | | | |
| lastdata | varchar(80) | NO | | | |
| duration | int(11) | NO | | 0 | |
| billsec | int(11) | NO | | 0 | |
| disposition | varchar(45) | NO | | | |
| amaflags | int(11) | NO | | 0 | |
| accountcode | varchar(20) | NO | | | |
| uniqueid | varchar(32) | NO | | | |
| userfield | varchar(255) | NO | | | |
±------------±-------------±-----±----±--------------------±---------------+
17 rows in set (0.01 sec)

My problem is when I try to get a CDR report in A2Billing (Call Reports -> CDRs) because A2Billing looks for information into cc_call table and it gets nothing because this table is empty. The cc_call table’s structure is the following:

±----------------------±--------------±-----±----±--------------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±----------------------±--------------±-----±----±--------------------±---------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| sessionid | varchar(40) | NO | | NULL | |
| uniqueid | varchar(30) | NO | | NULL | |
| card_id | bigint(20) | NO | | NULL | |
| nasipaddress | varchar(30) | NO | | NULL | |
| starttime | timestamp | NO | MUL | CURRENT_TIMESTAMP | |
| stoptime | timestamp | NO | | 0000-00-00 00:00:00 | |
| sessiontime | int(11) | YES | | NULL | |
| calledstation | varchar(30) | NO | MUL | NULL | |
| sessionbill | float | YES | | NULL | |
| id_tariffgroup | int(11) | YES | | NULL | |
| id_tariffplan | int(11) | YES | | NULL | |
| id_ratecard | int(11) | YES | | NULL | |
| id_trunk | int(11) | YES | | NULL | |
| sipiax | int(11) | YES | | 0 | |
| src | varchar(40) | NO | | NULL | |
| id_did | int(11) | YES | | NULL | |
| buycost | decimal(15,5) | YES | | 0.00000 | |
| id_card_package_offer | int(11) | YES | | 0 | |
| real_sessiontime | int(11) | YES | | NULL | |
| dnid | varchar(40) | NO | | NULL | |
| terminatecauseid | int(1) | YES | MUL | 1 | |
| destination | int(11) | YES | | 0 | |
±----------------------±--------------±-----±----±--------------------±---------------+
23 rows in set (0.01 sec)

So, Asterisk puts CDR information in one table (cdr table) and A2Billing looks for information in another table (cc_call table) with different structures.

How can I solve this problem?

Thanks.
Giancarlo.


#2

Hi.

Do you guys have any idea to solve this problem?

How to make A2Billing understand the CDR table in Asterisk?

Thank you.


#3

Hi,

A2Billing uses his own CDR tables, we don’t reuse the Asterisk CDR tables.
if you want your calls to be billed into your A2Billing system you need to redirect those calls to the AGI, see the installation instruction.

Yours,
/Areski
Founder at Star2Billing (http://www.star2billing.com)