|
If you are importing CDRs from a source other than Asterisk, the information below will give you an analysis of AgileVoice's table structure, so that you may map third-party structures to AgileVoice. Any field that is marked as being assigned during call rating, does not need to be populated. It will be populated during the call rating process.
+-----------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| id | mediumint(9) | | | 0 | |
| site_id | mediumint(9) | YES | MUL | NULL | |
| date_orig | bigint(20) | YES | MUL | NULL | |
| account_id | mediumint(9) | YES | MUL | NULL | |
| voip_rate_id | mediumint(9) | YES | MUL | NULL | |
| clid | varchar(128) | YES | | NULL | |
| src | varchar(128) | YES | | NULL | |
| dst | varchar(128) | YES | MUL | NULL | |
| dcontext | varchar(128) | YES | | NULL | |
| channel | varchar(128) | YES | | NULL | |
| dstchannel | varchar(128) | YES | | NULL | |
| lastapp | varchar(128) | YES | | NULL | |
| lastdata | varchar(16) | YES | | NULL | |
| duration | mediumint(9) | YES | | NULL | |
| billsec | mediumint(9) | YES | | NULL | |
| disposition | varchar(45) | YES | | NULL | |
| amaflags | mediumint(9) | YES | | NULL | |
| accountcode | varchar(128) | YES | MUL | NULL | |
| uniqueid | varchar(128) | YES | | NULL | |
| amount | double | YES | | NULL | |
| calltype | tinyint(4) | YES | | NULL | |
| rated | tinyint(4) | YES | MUL | NULL | |
| adjbillinterval | decimal(10,0) | YES | | NULL | |
+-----------------+---------------+------+-----+---------+-------+
id - Unique identifier for the record. Generated via a database independent method. See General Database Notes.
site_id - This is typically 1, unless you have a multi-site license. See General Database Notes.
date_orig - UNIX timestamp of the call. A simple hack is to use MySQL's UNIX_TIMESTAMP() function.
account_id - The unique identifier from the account table. This is assigned during CDR rating.
voip_rate_id - The unique identifier from the voip_rate table. This is assigned during CDR rating.
clid - The caller ID string in Asterisk's native format.
src - The calling number
dst - The called number
dcontext - The called numbers context. Not presently used for rating calls.
channel - The channel used to bridge the call between Asterisk and the calling party. Not presently used for rating calls.
dstchannel - The channel used to bridge the call between Asterisk and the called party. Not presently used for rating calls.
lastapp - The last application used in the call. If importing third-party CDRs this should be either Dial or Hangup.
lastdata - The arguments used by the last application. Not presently used for rating calls.
duration - The complete duration, in seconds, of the call. This includes call setup and teardown seconds.
billsec - The billable duration, in seconds. This is the field used by the rating engine to determine call length.
disposition - The end result of the call.
amaflags - Automated Message Accounting flags. These are not presently used by the rating engine, but will be in the future.
| • | default - Uses the rating engine's default setting, which is to rate and bill the call. |
| • | omit - Do not rate or bill the call. |
| • | billing - Rate and bill the call. |
| • | documentation - Rate the call for documentation only, do not actually charge the customer the rated amount. |
accountcode - Account number to use. This is used internally for prepaid accounts, etc.
amount - The rated cost of the call. This is assigned during CDR rating.
calltype - The type of call placed. This is assigned during CDR rating.
| • | 1 - Intrastate call if the NPA of the number matches any NPAs configured in the VoIP -> Configuration area. |
| • | 2 - Interstate call if the NPA of the number does not match any NPAs configured. |
| • | 3 - If the call is to a toll-free number |
| • | 4 - If the call was in-bound |
rated - A boolean indicator specifying wether the record has been rated.
adjbillinterval - The actual billed minutes of the call, after applying the rating engine logic. This field is assigned during CDR rating, and is used to calculate combined rating.
|