Hi all
I'm trying to make kamailio not to insert a row in missed_calls table when reply code is 407. But even if I set the "failed_filter" modparam the 407 row is inserted.
The acc mmodparams are:
modparam("acc", "db_table_acc", "kam_acc") modparam("acc", "db_flag", FLT_ACC) modparam("acc", "db_missed_flag", FLT_ACC_MISS) modparam("acc", "db_url",DBURL) modparam("acc", "db_insert_mode", 1) modparam("acc", "time_mode", 2) modparam("acc", "time_attr", "time_hires") modparam("acc", "failed_filter", "401,407") modparam("acc", "db_extra", "whatever"
db is mysql. Kamailio version is 5.7.4
When I send a call that receives a 407 and after auth a 480 y get both rows in missed_calls table.
Log:
DEBUG: acc [acc_mod.c:404]: mod_init(): acc db table initialized to: kam_acc
DEBUG: acc [acc_mod.c:362]: parse_failed_filter(): failed_filter 0 = 401
DEBUG: acc [acc_mod.c:362]: parse_failed_filter(): failed_filter 1 = 407
DEBUG: acc [acc_logic.c:721]: tmcb_func(): acc callback called for t(0x7f7cec807480) event type 512, reply code 407
DEBUG: acc [acc_logic.c:443]: should_acc_reply(): probing acc state - code: 407 flags: 0x220
DEBUG: acc [acc_logic.c:449]: should_acc_reply(): failed acc is off
DEBUG: acc [acc_logic.c:721]: tmcb_func(): acc callback called for t(0x7f7cebf59bc0) event type 512, reply code 486
DEBUG: acc [acc_logic.c:443]: should_acc_reply(): probing acc state - code: 486 flags: 0x220
DEBUG: acc [acc_logic.c:449]: should_acc_reply(): failed acc is off
am I configuring this wrong?
cheers,
Jon
El Thu, 6 Jun 2024 15:40:19 +0200 "Jon Bonilla (Manwe) via sr-users" sr-users@lists.kamailio.org escribió:
DEBUG: acc [acc_logic.c:721]: tmcb_func(): acc callback called for t(0x7f7cec807480) event type 512, reply code 407
DEBUG: acc [acc_logic.c:443]: should_acc_reply(): probing acc state - code: 407 flags: 0x220
DEBUG: acc [acc_logic.c:449]: should_acc_reply(): failed acc is off
Checking the acc_logic.c I see that filter is not checked because this:
if(!is_failed_acc_on(req)) {
and
#define is_failed_acc_on(_rq) is_acc_flag_set(_rq, failed_transaction_flag)
So seems like filter needs modparam failed_transaction_flag to work. (this is me trying to understand C code. Forgive me if I mess it up)
So I added just to check
modparam("acc", "db_missed_flag", FLT_ACC_MISS) modparam("acc", "failed_transaction_flag", FLT_ACC_MISS)
that way when I set the flag I also set for that modparam. But I get the same result and the same log
acc [acc_logic.c:721]: tmcb_func(): acc callback called for t(0x7fcbd3e47920) event type 512, reply code 407
acc [acc_logic.c:443]: should_acc_reply(): probing acc state - code: 407 flags: 0x220
acc [acc_logic.c:449]: should_acc_reply(): failed acc is off
Any ideas over there?
thanks
Hello,
just to double check, you are also setting this two flags then in processing the INVITE, right?
Cheers,
Henning
El Thu, 6 Jun 2024 17:48:43 +0000 Henning Westerholt hw@gilawa.com escribió:
Hello,
just to double check, you are also setting this two flags then in processing the INVITE, right?
Yes. I get the failed rows in the database tables "missed_calls" I just want in a invite-407-invite-486 call to have a single entry with the 486 and do not have the 407 one.
route[TO_PSTN] { xlog("L_NOTICE", "Call from PBX. Sending to PSTN - R=$ru\n"); $fsn="main"; if (is_method("INVITE")){ $avp(acc_company)=$hdr(P-PEKE-SRCCOMPANY); $avp(acc_exten)=$hdr(P-PEKE-SRCEXTEN); $avp(acc_direction)="out"; setflag(FLT_ACC); setflag(FLT_ACC_MISS); }