Hello Kama ML,
today I stumbled on function "update_sl_stats()" inside sl_stats.c and noticed that some response codes are treated differently.
For example here:
https://github.com/kamailio/kamailio/blob/a9ef78b7f43616f2ceaa26df97eff68eb5...
since we have a "break;" statement, when a 500 code is received, the 5XX counter is not incremented even if a 500 code belongs to the 5XX family.
We have the same behaviour for other response codes and it really seems that it's not a bug and the author really wanted it.
The docs are not so helpful and they don't explain much in detail how counters are built.
I just want to have confirmation this is how it must work and I wonder if it's the case to write something about it into the docs.
Thanks
Alessio
Hello,
I agree that this stats handling is a bit non-intuitive.
Basically, the reasoning behind the implementation was, to count certain, well-known return codes with individual counters and have a generic NXX counter for the rest.
Taking the 5xx codes as example, the 500 counter just gives you this value, and the 5XX counter the rest. If you want to get all 5xx codes counts, you need to take the sum of 500 and 5XX counter. Similar logic also applies to the other counters in this module.
Hope this makes it clear. Extensions to the docs are of course always welcome, just open a pull-request.
Cheers,
Henning