Browse Source

manual merge and backport of pull #20 adding an accounting role

3.12
karl anderson 11 years ago
parent
commit
798082b6dd
2 changed files with 46 additions and 0 deletions
  1. +22
    -0
      kamailio/accounting-role.cfg
  2. +24
    -0
      kamailio/default.cfg

+ 22
- 0
kamailio/accounting-role.cfg View File

@ -0,0 +1,22 @@
####### Flags #######
flags
FLAG_ACC: 7,
FLAG_ACCMISSED: 8,
FLAG_ACCFAILED: 9;
######## Accounting module ########
loadmodule "acc.so"
######## Accounting params ########
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 0)
modparam("acc", "log_flag", 7)
modparam("acc", "log_level", 2)
modparam("acc", "log_missed_flag", 8)
modparam("acc", "failed_transaction_flag", 9)
modparam("acc", "log_extra",
"src_user=$fU;src_domain=$fd;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
modparam("acc", "log_facility", "LOG_LOCAL6")

+ 24
- 0
kamailio/default.cfg View File

@ -170,6 +170,9 @@ include_file "websockets-role.cfg"
#!ifdef TLS-ROLE
include_file "tls-role.cfg"
#!endif
#!ifdef ACCOUNTING-ROLE
include_file "accounting-role.cfg"
#!endif
####### Permissions module ##########
loadmodule "permissions.so"
@ -323,6 +326,13 @@ route[HANDLE_IN_DIALOG_REQUESTS]
record_route();
}
if (loose_route()) {
#!ifdef ACCOUNTING-ROLE
if (is_method("BYE")) {
setflag(FLAG_ACC);
setflag(FLAG_ACCFAILED);
}
#!endif
#!ifdef WEBSOCKETS-ROLE
if ($du == $null) {
handle_ruri_alias();
@ -406,6 +416,13 @@ route[RELAY]
route[INTERNAL_TO_EXTERNAL_RELAY]
{
#!ifdef ACCOUNTING-ROLE
if (is_method("INVITE")) {
setflag(FLAG_ACC);
setflag(FLAG_ACCFAILED);
}
#!endif
remove_hf_re("X-.*");
t_on_reply("EXTERNAL_REPLY");
@ -417,6 +434,13 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
route[EXTERNAL_TO_INTERNAL_RELAY]
{
#!ifdef ACCOUNTING-ROLE
if (is_method("INVITE") && is_present_hf("Proxy-Authorization")) {
setflag(FLAG_ACC);
setflag(FLAG_ACCFAILED);
}
#!endif
#!ifdef NAT-TRAVERSAL-ROLE
if (!isflagset(FLAG_INTERNALLY_SOURCED)) {
route(NAT_TEST_AND_CORRECT);


Loading…
Cancel
Save