------------------------------------------------------------------------------------------------------------
loadmodule "acc.so"
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
modparam("acc", "detect_direction", 1)
modparam("acc", "db_flag", FLT_ACC)
modparam("acc", "db_missed_flag", FLT_ACCMISSED)
modparam("acc", "db_url", DBURL)
modparam("acc", "cdr_enable", 1)
modparam("acc", "cdr_start_on_confirmed", 1)
modparam("acc", "cdrs_table", "acc_cdrs")
modparam("acc", "cdr_start_id", "start_time")
modparam("acc", "cdr_end_id", "end_time")
modparam("acc", "cdr_duration_id", "duration")
if (is_method("INVITE")) {
setflag(FLT_ACC); # do accounting
}
route[WITHINDLG] {
if (has_totag()) {
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
CREATE TABLE `acc_cdrs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`start_time` varchar(32) NOT NULL DEFAULT '',
`end_time` varchar(32) NOT NULL DEFAULT '',
`duration` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `start_time_idx` (`start_time`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1$$
Thank you.