sortof working cdrs through local files
This commit is contained in:
36
kamailio.cfg
36
kamailio.cfg
@@ -18,7 +18,7 @@ loadmodule "siputils"
|
||||
loadmodule "sanity"
|
||||
loadmodule "acc.so"
|
||||
loadmodule "dialog.so"
|
||||
|
||||
loadmodule "db_flatstore.so"
|
||||
|
||||
# Lines to configure:
|
||||
# uac reg_contact_addr
|
||||
@@ -52,20 +52,27 @@ modparam("uac","auth_realm_avp","$avp(arealm)")
|
||||
# TM settings
|
||||
modparam("tm", "auto_inv_100_reason", "Trying")
|
||||
# CDR STUFF
|
||||
modparam("dialog", "default_timeout", 43200 )
|
||||
modparam("dialog", "db_mode", 0 ) # no database writes
|
||||
modparam("dialog", "dlg_flag", 3 )
|
||||
modparam("dialog", "hash_size", 4096 )
|
||||
#!define FLD_DLG 4
|
||||
#!define FLT_ACC 5
|
||||
#!define FLT_ACCMISSED 6
|
||||
#!define FLT_ACCFAILED 7
|
||||
#!define FLT_ACCDB 7
|
||||
modparam("dialog", "dlg_flag", FLD_DLG)
|
||||
|
||||
modparam("acc", "log_flag", 2)
|
||||
modparam("acc", "db_url", "flatstore:/var/log/cdrs")
|
||||
modparam("acc", "early_media", 0)
|
||||
modparam("acc", "report_ack", 0)
|
||||
modparam("acc", "report_cancels", 0)
|
||||
modparam("acc", "detect_direction", 0)
|
||||
modparam("acc", "db_flag", FLT_ACCDB)
|
||||
modparam("acc", "log_flag", FLT_ACC)
|
||||
modparam("acc", "log_missed_flag", FLT_ACCMISSED)
|
||||
modparam("acc","cdr_extra","src_user=$fU;src_domain=$fd;src_ip=$si;dst_user=$rU;dst_ouser=$tU;dst_domain=$rd;sip_code=$rs;sip_reason=$rr;callid=$dlg(callid);dst_ip=$Ri")
|
||||
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
|
||||
modparam("acc", "cdr_enable", 1)
|
||||
modparam("acc", "cdr_log_enable", 0)
|
||||
modparam("acc", "cdr_start_on_confirmed", 1)
|
||||
modparam("acc", "cdr_facility", "LOG_DAEMON")
|
||||
#modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)")
|
||||
modparam("acc", "cdr_extra","src_user=$fU;src_domain=$fd;src_ip=$si;""dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
|
||||
modparam("acc", "cdr_start_id", "st")
|
||||
modparam("acc", "cdr_end_id", "et")
|
||||
modparam("acc", "cdr_duration_id", "duration")
|
||||
modparam("acc", "cdr_facility", "LOG_LOCAL0")
|
||||
|
||||
/* Main SIP request routing logic
|
||||
* - processing of any incoming SIP request starts with this route
|
||||
@@ -134,7 +141,10 @@ route[RELAY] {
|
||||
if (is_method("INVITE")) {
|
||||
rtpengine_manage("replace-origin replace-session-connection force-relay");
|
||||
}
|
||||
|
||||
# Start writing CDRs
|
||||
setflag(FLD_DLG);
|
||||
setflag(FLT_ACC);
|
||||
setflag(FLT_ACCDB);
|
||||
# update $du to set the destination address for proxying based on caller IP
|
||||
if ($siz==$avp(sip1) || $siz==$avp(sip2)) {
|
||||
xlog("Incomming call from SIP provider");
|
||||
|
||||
Reference in New Issue
Block a user