Hello. When i tested acc_radius module , i realize module doesn't send ACK/ALIVE packets. So i digged the code i found acc module sends INVITE request instead of ACK. I fixed these on my local so you can check it and fix it ? First of all in acc_logic.c at acc_onack function - acc_run_engines(req, 0, NULL); +acc_run_engines(ack, 0, NULL);
Second in acc.c at acc_run_engines - if((type==0) && ((e->acc_flag))) { +if((type==0) && (msg->flags&(e->acc_flag))) {
Thanks
http://sip-router.1086192.n5.nabble.com/About-Acc-radius-rad-sttaus-Function...
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266
If you changed the sources to fix it, send the patch here -- you can take it with 'git diff' if you got sources via git or 'diff -u oldfile new file'.
Having the patch helps to understand what you fixed and apply it to the main repository.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125109338
Hello Daniel
diff --git a/modules/acc/acc.c b/modules/acc/acc.c index 7bf7dd7..7874c38 100644 --- a/modules/acc/acc.c +++ b/modules/acc/acc.c @@ -992,7 +992,7 @@ int acc_run_engines(struct sip_msg *msg, int type, int *reset) inf.leg_info = leg_info; while(e) { if(e->flags & 1) { - if((type==0) && (msg->flags&(e->acc_flag))) { + if((type==0) && ((e->acc_flag))) { LM_DBG("acc event for engine: %s\n", e->name); e->acc_req(msg, &inf); if(reset) *reset |= e->acc_flag; diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c index bd3f1cc..16a97e5 100644 --- a/modules/acc/acc_logic.c +++ b/modules/acc/acc_logic.c @@ -615,7 +615,7 @@ static inline void acc_onack( struct cell* t, struct sip_msg *req, #endif
/* run extra acc engines */ - acc_run_engines(req, 0, NULL); + acc_run_engines(ack, 0, NULL);
}
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125115087
I pushed the change to acc_logic.c, but I don't understand the reason for the one in acc.c, respectively the change:
``` - if((type==0) && (msg->flags&(e->acc_flag))) { + if((type==0) && ((e->acc_flag))) { ```
That is checking if the message has the flag set for accounting, you changed just to test if accounting engine has a flag to be used for accounting. Can you detail more of what you think it is solving?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125177336
As you know , there is a 3 type packet for accounting. INVITE(START) for request, ACK(ALIVE) for request accepted that means callers talking , accounting started and BYE(STOP) accounting stop. When i tested to acc_radius , it sends INVITE packet instead of ACK packet is that described RD_STATUS_ALIVE in acc_radius.
in acc.c , msg->flags always is 32 and e->acc_flags=1 and return false. So ACK parameters never was sent to acc_radius module. When INVITE , msg->flags always 134217774 and always true. it is only difference DB module is working but not acc_radius. I am not sure it effects IMS_Charging , it should be checked.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125183924
Do you have acc mod param report_ack set?
What flag did you configure to be used for accounting?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125191412
i added my sample. repor_ack is setted in acc. i set flags for each INVITE packet.
#!define FLT_ACC 1 #!define FLT_ACCMISSED 2 #!define FLT_ACCFAILED 3
#!ifdef WITH_ACCDB modparam("acc", "cdr_enable", 1) modparam("acc", "early_media", 0) modparam("acc", "report_ack", 1) modparam("acc", "report_cancels", 1) modparam("acc", "detect_direction", 0) modparam("acc", "db_url", DBURLCDR) modparam("acc", "log_flag", FLT_ACC) modparam("acc", "db_missed_flag", FLT_ACCMISSED) modparam("acc", "db_table_missed_calls", "missed_calls") modparam("acc", "db_flag", 1) modparam("acc", "db_missed_flag", 3) modparam("acc", "acc_time_column", "calldatetime") modparam("acc", "time_mode", 2) modparam("acc", "time_exten", "micorsecs") modparam("acc", "time_attr", "seconds") modparam("acc", "db_extra","src_user=$fU;src_domain=$fd;src_ip=$si;dst_user=$rU;dst_domain=$rd;src_ousername=$avp(poparty);networkdatetime=$avp(networkdatetime);dst_ouser=$avp(ptparty);provider=$avp(pprovider);m_id=$avp(maliyet_id);tibtip=$avp(tibtip);src_userid=$avp(userid);dst_userid=$avp(dst_userid);flags=$avp(ucrflag);op_kodu=$avp(op_kodu);lifetime=$avp(i:77);uniqueid=$avp(unique_id)") #!endif
#!ifdef WITH_RAD modparam("acc_radius", "radius_config","/etc/radiusclient-ng/radiusclient.conf") modparam("acc_radius", "radius_flag", FLT_ACC) modparam("acc_radius", "radius_missed_flag", FLT_ACCMISSED) modparam("acc_radius", "service_type", 15) modparam("acc_radius", "radius_extra", "src_ip=$si;Sip-Uri-User=$fu;provider=$avp(pprovider);uniqueid=$avp(unique_id);src_user=$fU;dst_user=$rU;dst_domain=$rd;src_ousername=$avp(poparty);networkdatetime=$avp(networkdatetime);dst_ouser=$avp(ptparty);m_id=$avp(maliyet_id);tibtip=$avp(tibtip);src_userid=$avp(userid);dst_userid=$avp(dst_userid);flags=$avp(ucrflag);op_kodu=$avp(op_kodu);lifetime=$avp(i:77)")
modparam("misc_radius", "radius_config", "/etc/radiusclient-ng/radiusclient.conf") modparam("misc_radius", "group_service_type", 12) modparam("misc_radius", "uri_service_type", 10) modparam("misc_radius", "caller_service_type", 30) modparam("misc_radius", "callee_service_type", 31) #Arayan modparam("misc_radius", "caller_extra", "Calling-Station-Id=$ci;Acct-Status-Type=$avp(ucrflag);Acct-Multi-Session-Id=$rU;Acct-Session-Id=$avp(servis)") #Aranan modparam("misc_radius", "callee_extra", "Called-Station-Id=$ci;Acct-Status-Type=$avp(ucrflag);Acct-Multi-Session-Id=$rU;Acct-Session-Id=$avp(servis)")
modparam("misc_radius", "uri_extra", "Called-Station-Id=$tu") modparam("misc_radius", "common_response", 0)
#!endif
# Handle requests within SIP dialogs route[WITHINDLG] { if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { route(DLGURI); if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails } else if ( is_method("ACK") ) { # ACK is forwarded statelessy route(NATMANAGE); } else if ( is_method("NOTIFY") ) { # Add Record-Route for in-dialog NOTIFY as per RFC 6665. record_route(); } route(RELAY); ...
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125192524
Try to set the FLT_ACC flag also for ACK, it is set only for BYE after the INVITE is answered -- report here if it changes something.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125193961
Hey; When i set ACC flag in Withindlg , msg_flags gives 42 so working with ```` msg->flags ```` . Succesful Thanks
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125224782
Closed #266.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#event-366277328
Added a note in acc readme for report_ack that the acc flag still needs to be set for each ACK.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/266#issuecomment-125266689