[sr-dev] [kamailio/kamailio] acc: generating duplicates (#1674)

Julien Chavanton notifications at github.com
Fri Oct 12 19:25:33 CEST 2018


At this point it is a bit challenging to conclude what is wrong :)

The other modules, `acc_diameter`, `acc_raduis` and `acc_json` are using the `acc_engine` interface and the logic in the acc module is slightly different because it is using functions like `acc_run_engines`
In these modules it was assumed that `acc_flag` and `missed_flag` should be stored bit shifted, because of the fact  `is_eng_acc_on` was expecting already bit shifted values.

However the main acc module is not bit shifting them, so this is one thing not making sense.

(Problem A*) Back to normal ACC module, consider the following combination found in `acc_logic.c` :
 `flags_to_reset |= log_missed_flag;`  +	`reset_acc_flag(req, flags_to_reset);`
`log_missed_flag` is what ? (depending on the module it can be 1 or 2)
1: bit shifted, then `reset_acc_flag` is not compatible 
`#define reset_acc_flag(_rq,_flag)   (resetflag((_rq), (_flag)))`
2: no bit shifted, then we need to use the assignment operator and we can not keep track of multiple flags.
In fact thanks to the review, I just realized this is not good enough for fixing normal ACC module behavior, we need to keep track of multiple flags to reset until the very end of `on_missed` in case the same flag is used  for `db_missed_flag` and `log_missed_flag`, I will revisit my patch.

When I look at `acc_mod.c` and when I debug the running program.
`log_missed_flag` and `db_missed_flag` are not storing bit shifted values, this is why I think we need to align the acc_engine and modules using it with the default behavior.

The main acc module logic will also be fixed at the same time since the code should not always be working well as describer in (A*)

I hope I am not getting confused :)
I will definitely revisit the patch knowing it is not good enough.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1674#issuecomment-429399926
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20181012/a164477e/attachment.html>


More information about the sr-dev mailing list