1. 關於acc , 2.2 之前的網上很多就不說了,之後的要兼容,需要就行一下修改
爲acc表增加額外的字段記錄主叫被叫
進入mysql,選取opensips的數據庫
ALTER TABLE acc ADD from_uri VARCHAR(64) DEFAULT '' NOT NULL ;
ALTER TABLE acc ADD to_uri VARCHAR(64) DEFAULT '' NOT NULL ;
因爲參數改變, opensips.cfg 裏面修改如下
modparam("acc", "extra_fields", "db: a->from_uri; b->to_uri")
在腳本掛號中增加 參數獲取
# sequential request within a dialog should
# take the path determined by record-routing
if ( !loose_route() ) {
# we do record-routing for all our traffic, so we should not
# receive any sequential requests without Route hdr.
send_reply("404","Not here");
exit;
}
else {
#zym add acc
if (is_method("BYE"))
{
#do_accounting();
$acc_extra(a) = $fu;
$acc_extra(b) = $tu;
do_accounting("db","cdr");
}
else if (is_method("INVITE"))
{
# even if in most of the cases is useless, do RR for
# re-INVITEs also, as some buggy clients do change route set
# during the dialog.
record_route();
#do_accounting("db", "cdr", "acc");
}
}
2. 關於大的連接數,似乎要增加 loc_size
modparam("usrloc", "hash_size", 14)