Skip to content

Commit

Permalink
kamusers: store missed calls and responseCode
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzccl committed Nov 24, 2023
1 parent d872469 commit c52a20f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions kamailio/users/config/kamailio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,11 @@ modparam("acc", "cdr_enable", 1)
modparam("acc", "cdr_skip", "nocdr")
modparam("acc", "cdr_extra_nullable", 1)
modparam("acc", "cdr_log_enable", 1)
modparam("acc", "cdr_on_failed", 0)
modparam("acc", "cdr_on_failed", 1)
modparam("acc", "cdr_expired_dlg_enable", 1)
modparam("acc", "cdr_start_on_confirmed", 1)
modparam("acc", "cdr_facility", "LOG_LOCAL3")
modparam("acc", "cdr_extra", "brandId=$dlg_var(brandId);companyId=$dlg_var(companyId);caller=$dlg_var(caller);callee=$dlg_var(callee);callid=$dlg_var(callid);callidHash=$dlg_var(cidhash);xcallid=$dlg_var(xcallid);diversion=$dlg_var(diversion);referrer=$dlg_var(referrer);referee=$dlg_var(referee);direction=$dlg_var(direction);userId=$dlg_var(userId);friendId=$dlg_var(friendId)")
modparam("acc", "cdr_extra", "brandId=$dlg_var(brandId);companyId=$dlg_var(companyId);caller=$dlg_var(caller);callee=$dlg_var(callee);callid=$dlg_var(callid);callidHash=$dlg_var(cidhash);xcallid=$dlg_var(xcallid);diversion=$dlg_var(diversion);referrer=$dlg_var(referrer);referee=$dlg_var(referee);direction=$dlg_var(direction);userId=$dlg_var(userId);friendId=$dlg_var(friendId);responseCode=$dlg_var(responseCode)")

# DIALOG
modparam("dialog", "dlg_flag", DLG_FLAG)
Expand Down Expand Up @@ -438,6 +438,9 @@ request_route {
if (t_check_trans()) {
setflag(FLT_ACC); # do accounting
setflag(FLT_ACCFAILED); # even if the transaction fails
if (is_present_hf("Reason") && $hdr(Reason) == 'SIP;cause=200;text="Call completed elsewhere"') {
$dlg_var(nocdr) = "1";
}
route(RTPENGINE);
route(RELAY);
}
Expand Down Expand Up @@ -2778,6 +2781,8 @@ branch_route[MANAGE_BRANCH] {

# Executed when dialog is confirmed with 2XX response code
event_route[dialog:start] {
$dlg_var(responseCode) = '200';

if(isbflagset(FLB_WEBSOCKETS)) {
xnotice("[$dlg_var(cidhash)] Dialog involving WSS started\n");
$dlg_var(ws) = 'yes';
Expand Down Expand Up @@ -2830,6 +2835,8 @@ event_route[dialog:end] {

# Executed when dialog is not established
event_route[dialog:failed] {
$dlg_var(responseCode) = $rs;

sht_rm_name_re("dialogs=>$ci::.*");

#!ifdef WITH_REALTIME
Expand Down

0 comments on commit c52a20f

Please sign in to comment.